mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* e * https://github.com/tgstation/tgstation/pull/55157 * manual * Replace alert usage with tgui_alert (#58419) Pretty much every alert() call is replaced with tgui_alert, except one I replaced with tgalert as a fallback. If tgui_alert exists, why not use it? * e * e Co-authored-by: Celotajs <81999976+celotajstg@users.noreply.github.com>
131 lines
3.9 KiB
Plaintext
131 lines
3.9 KiB
Plaintext
//DO NOT ADD MORE TO THIS FILE.
|
|
//Use vv_do_topic() for datums!
|
|
/client/proc/view_var_Topic(href, href_list, hsrc)
|
|
if( (usr.client != src) || !src.holder || !holder.CheckAdminHref(href, href_list))
|
|
return
|
|
var/target = GET_VV_TARGET
|
|
vv_do_basic(target, href_list, href)
|
|
if(istype(target, /datum))
|
|
var/datum/D = target
|
|
D.vv_do_topic(href_list)
|
|
else if(islist(target))
|
|
vv_do_list(target, href_list)
|
|
if(href_list["Vars"])
|
|
debug_variables(locate(href_list["Vars"]))
|
|
|
|
//Stuff below aren't in dropdowns/etc.
|
|
|
|
//~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records).
|
|
if(href_list["rename"])
|
|
if(!check_rights(R_ADMIN))
|
|
return
|
|
|
|
var/mob/M = locate(href_list["rename"]) in GLOB.mob_list
|
|
if(!istype(M))
|
|
to_chat(usr, "This can only be used on instances of type /mob", confidential = TRUE)
|
|
return
|
|
|
|
var/new_name = stripped_input(usr,"What would you like to name this mob?","Input a name",M.real_name,MAX_NAME_LEN)
|
|
|
|
if( !new_name || !M )
|
|
return
|
|
|
|
message_admins("Admin [key_name_admin(usr)] renamed [key_name_admin(M)] to [new_name].")
|
|
M.fully_replace_character_name(M.real_name,new_name)
|
|
vv_update_display(M, "name", new_name)
|
|
vv_update_display(M, "real_name", M.real_name || "No real name")
|
|
|
|
else if(check_rights(R_VAREDIT))
|
|
if(href_list["rotatedatum"])
|
|
if(!check_rights(NONE))
|
|
return
|
|
|
|
var/atom/A = locate(href_list["rotatedatum"])
|
|
if(!istype(A))
|
|
to_chat(usr, "This can only be done to instances of type /atom", confidential = TRUE)
|
|
return
|
|
|
|
switch(href_list["rotatedir"])
|
|
if("right")
|
|
A.setDir(turn(A.dir, -45))
|
|
if("left")
|
|
A.setDir(turn(A.dir, 45))
|
|
vv_update_display(A, "dir", dir2text(A.dir))
|
|
|
|
|
|
else if(href_list["makehuman"])
|
|
if(!check_rights(R_SPAWN))
|
|
return
|
|
|
|
var/mob/living/carbon/human/Mo = locate(href_list["makehuman"]) in GLOB.mob_list
|
|
if(!ismonkey(Mo))
|
|
to_chat(usr, "This can only be done to monkeys", confidential = TRUE)
|
|
return
|
|
|
|
if(tgui_alert(usr,"Confirm mob type change?",,list("Transform","Cancel")) != "Transform")
|
|
return
|
|
if(!Mo)
|
|
to_chat(usr, "Mob doesn't exist anymore", confidential = TRUE)
|
|
return
|
|
holder.Topic(href, list("humanone"=href_list["makehuman"]))
|
|
|
|
else if(href_list["adjustDamage"] && href_list["mobToDamage"])
|
|
if(!check_rights(NONE))
|
|
return
|
|
|
|
var/mob/living/L = locate(href_list["mobToDamage"]) in GLOB.mob_list
|
|
if(!istype(L))
|
|
return
|
|
|
|
var/Text = href_list["adjustDamage"]
|
|
|
|
var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num|null
|
|
|
|
if (isnull(amount))
|
|
return
|
|
|
|
if(!L)
|
|
to_chat(usr, "Mob doesn't exist anymore", confidential = TRUE)
|
|
return
|
|
|
|
var/newamt
|
|
switch(Text)
|
|
if(BRUTE)
|
|
L.adjustBruteLoss(amount, TRUE, TRUE)
|
|
newamt = L.getBruteLoss()
|
|
if(BURN)
|
|
L.adjustFireLoss(amount, TRUE, TRUE)
|
|
newamt = L.getFireLoss()
|
|
if(TOX)
|
|
L.adjustToxLoss(amount)
|
|
newamt = L.getToxLoss()
|
|
if(OXY)
|
|
L.adjustOxyLoss(amount)
|
|
newamt = L.getOxyLoss()
|
|
if(BRAIN)
|
|
L.adjustOrganLoss(ORGAN_SLOT_BRAIN, amount)
|
|
newamt = L.getOrganLoss(ORGAN_SLOT_BRAIN)
|
|
if(CLONE)
|
|
L.adjustCloneLoss(amount)
|
|
newamt = L.getCloneLoss()
|
|
if(STAMINA)
|
|
L.adjustStaminaLoss(amount)
|
|
newamt = L.getStaminaLoss()
|
|
else
|
|
to_chat(usr, "You caused an error. DEBUG: Text:[Text] Mob:[L]", confidential = TRUE)
|
|
return
|
|
|
|
if(amount != 0)
|
|
var/log_msg = "[key_name(usr)] dealt [amount] amount of [Text] damage to [key_name(L)]"
|
|
message_admins("[key_name(usr)] dealt [amount] amount of [Text] damage to [ADMIN_LOOKUPFLW(L)]")
|
|
log_admin(log_msg)
|
|
admin_ticket_log(L, "<font color='blue'>[log_msg]</font>")
|
|
vv_update_display(L, Text, "[newamt]")
|
|
|
|
|
|
//Finally, refresh if something modified the list.
|
|
if(href_list["datumrefresh"])
|
|
var/datum/DAT = locate(href_list["datumrefresh"])
|
|
if(istype(DAT, /datum) || istype(DAT, /client) || islist(DAT))
|
|
debug_variables(DAT)
|