mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-15 04:01:41 +00:00
* Cleans up unnecessary transformation options in admin player panel (#62832) I got tired of having to walk new admin candidates through the admin buttons and telling them about all of the antiquated buttons they'd never use, so I'm doing my part and removing a bunch of the transformation bloat from the player panel. Below is the current menu The only button admins I know ever actually use is the human rudimentary transformation one, and literally nothing else. Judging by how the options are a random choice of some of the station pets, these options probably haven't been updated since like 2012. In addition, the non-rudimentary transformations only work if you're a human, so not sure why they show up for non human player panels. Here's the new pared down selection, I figured these would be the only useful ones from the bunch. They work no matter what mob the target was previously, whether it be another living mob or a ghost. In addition, I also cut out the transformation equivalents from the VV dropdown, because lord knows that menu keeps getting longer and longer. Lastly, I refactored stuff where possible without getting too trapped in cursed pre-MSO era admincode. * Cleans up unnecessary transformation options in admin player panel Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
123 lines
3.8 KiB
Plaintext
123 lines
3.8 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.
|
|
|
|
if(check_rights(R_VAREDIT))
|
|
|
|
//~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records).
|
|
|
|
if(href_list["rename"])
|
|
if(!check_rights(NONE))
|
|
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 the new name is something that would be restricted by IC chat filters,
|
|
// give the admin a warning but allow them to do it anyway if they want.
|
|
if(is_ic_filtered(new_name) || is_soft_ic_filtered(new_name) && tgui_alert(usr, "Your selected name contains words restricted by IC chat filters. Confirm this new name?", "IC Chat Filter Conflict", list("Confirm", "Cancel")) == "Cancel")
|
|
return
|
|
|
|
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(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["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)
|
|
newamt = L.getBruteLoss()
|
|
if("fire")
|
|
L.adjustFireLoss(amount)
|
|
newamt = L.getFireLoss()
|
|
if("toxin")
|
|
L.adjustToxLoss(amount)
|
|
newamt = L.getToxLoss()
|
|
if("oxygen")
|
|
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)
|
|
|