diff --git a/code/datums/outfit.dm b/code/datums/outfit.dm index 784e7a1b06f..38a67b1baa2 100644 --- a/code/datums/outfit.dm +++ b/code/datums/outfit.dm @@ -532,5 +532,11 @@ /datum/outfit/vv_do_topic(list/href_list) . = ..() + + if(!.) + return + if(href_list[VV_HK_TO_OUTFIT_EDITOR]) + if(!check_rights(NONE)) + return usr.client.open_outfit_editor(src) diff --git a/code/datums/weakrefs.dm b/code/datums/weakrefs.dm index dedc0d8eff9..eaeea94b3c3 100644 --- a/code/datums/weakrefs.dm +++ b/code/datums/weakrefs.dm @@ -100,6 +100,10 @@ /datum/weakref/vv_do_topic(list/href_list) . = ..() + + if(!.) + return + if(href_list[VV_HK_WEAKREF_RESOLVE]) if(!check_rights(NONE)) return diff --git a/code/game/atom/atom_vv.dm b/code/game/atom/atom_vv.dm index 8393ecabcfd..b5a572749a6 100644 --- a/code/game/atom/atom_vv.dm +++ b/code/game/atom/atom_vv.dm @@ -27,12 +27,17 @@ /atom/vv_do_topic(list/href_list) . = ..() - if(href_list[VV_HK_ADD_REAGENT] && check_rights(R_VAREDIT)) + + if(!.) + return + + if(href_list[VV_HK_ADD_REAGENT]) + if(!check_rights(R_VAREDIT)) + return if(!reagents) var/amount = input(usr, "Specify the reagent size of [src]", "Set Reagent Size", 50) as num|null if(amount) create_reagents(amount) - if(reagents) var/chosen_id switch(tgui_alert(usr, "Choose a method.", "Add Reagents", list("Search", "Choose from a list", "I'm feeling lucky"))) @@ -61,27 +66,32 @@ log_admin("[key_name(usr)] has added [amount] units of [chosen_id] to [src]") message_admins(span_notice("[key_name(usr)] has added [amount] units of [chosen_id] to [src]")) - if(href_list[VV_HK_TRIGGER_EXPLOSION] && check_rights(R_FUN)) + if(href_list[VV_HK_TRIGGER_EXPLOSION]) + if(!check_rights(R_FUN)) + return usr.client.cmd_admin_explosion(src) - if(href_list[VV_HK_TRIGGER_EMP] && check_rights(R_FUN)) + if(href_list[VV_HK_TRIGGER_EMP]) + if(!check_rights(R_FUN)) + return usr.client.cmd_admin_emp(src) - if(href_list[VV_HK_SHOW_HIDDENPRINTS] && check_rights(R_ADMIN)) + if(href_list[VV_HK_SHOW_HIDDENPRINTS]) + if(!check_rights(R_ADMIN)) + return usr.client.cmd_show_hiddenprints(src) if(href_list[VV_HK_ARMOR_MOD]) + if(!check_rights(NONE)) + return var/list/pickerlist = list() var/list/armorlist = get_armor().get_rating_list() - for (var/i in armorlist) pickerlist += list(list("value" = armorlist[i], "name" = i)) - var/list/result = presentpicker(usr, "Modify armor", "Modify armor: [src]", Button1="Save", Button2 = "Cancel", Timeout=FALSE, inputtype = "text", values = pickerlist) var/list/armor_all = ARMOR_LIST_ALL() - - if (islist(result)) - if (result["button"] != 2) // If the user pressed the cancel button + if(islist(result)) + if(result["button"] != 2) // If the user pressed the cancel button // text2num conveniently returns a null on invalid values var/list/converted = list() for(var/armor_key in armor_all) @@ -102,7 +112,9 @@ return ai_controller = new result(src) - if(href_list[VV_HK_MODIFY_TRANSFORM] && check_rights(R_VAREDIT)) + if(href_list[VV_HK_MODIFY_TRANSFORM]) + if(!check_rights(R_VAREDIT)) + return var/result = input(usr, "Choose the transformation to apply","Transform Mod") as null|anything in list("Scale","Translate","Rotate","Shear") var/matrix/M = transform if(!result) @@ -131,10 +143,11 @@ if(isnull(angle)) return transform = M.Turn(angle) - SEND_SIGNAL(src, COMSIG_ATOM_VV_MODIFY_TRANSFORM) - if(href_list[VV_HK_SPIN_ANIMATION] && check_rights(R_VAREDIT)) + if(href_list[VV_HK_SPIN_ANIMATION]) + if(!check_rights(R_VAREDIT)) + return var/num_spins = input(usr, "Do you want infinite spins?", "Spin Animation") in list("Yes", "No") if(num_spins == "No") num_spins = input(usr, "How many spins?", "Spin Animation") as null|num @@ -155,25 +168,35 @@ return SpinAnimation(spin_speed, num_spins, direction) - if(href_list[VV_HK_STOP_ALL_ANIMATIONS] && check_rights(R_VAREDIT)) + if(href_list[VV_HK_STOP_ALL_ANIMATIONS]) + if(!check_rights(R_VAREDIT)) + return var/result = input(usr, "Are you sure?", "Stop Animating") in list("Yes", "No") if(result == "Yes") animate(src, transform = null, flags = ANIMATION_END_NOW) // Literally just fucking stop animating entirely because admin said so return - if(href_list[VV_HK_AUTO_RENAME] && check_rights(R_VAREDIT)) + if(href_list[VV_HK_AUTO_RENAME]) + if(!check_rights(R_VAREDIT)) + return var/newname = input(usr, "What do you want to rename this to?", "Automatic Rename") as null|text // Check the new name against the chat filter. If it triggers the IC chat filter, give an option to confirm. if(newname && !(is_ic_filtered(newname) || is_soft_ic_filtered(newname) && tgui_alert(usr, "Your selected name contains words restricted by IC chat filters. Confirm this new name?", "IC Chat Filter Conflict", list("Confirm", "Cancel")) != "Confirm")) vv_auto_rename(newname) - if(href_list[VV_HK_EDIT_FILTERS] && check_rights(R_VAREDIT)) + if(href_list[VV_HK_EDIT_FILTERS]) + if(!check_rights(R_VAREDIT)) + return usr.client?.open_filter_editor(src) - if(href_list[VV_HK_EDIT_COLOR_MATRIX] && check_rights(R_VAREDIT)) + if(href_list[VV_HK_EDIT_COLOR_MATRIX]) + if(!check_rights(R_VAREDIT)) + return usr.client?.open_color_matrix_editor(src) - if(href_list[VV_HK_TEST_MATRIXES] && check_rights(R_VAREDIT)) + if(href_list[VV_HK_TEST_MATRIXES]) + if(!check_rights(R_VAREDIT)) + return usr.client?.open_matrix_tester(src) /atom/vv_get_header() diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b200e688caa..11d01fb827e 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -1645,7 +1645,6 @@ if(href_list[VV_HK_GET_MOVABLE]) if(!check_rights(R_ADMIN)) return - if(QDELETED(src)) return forceMove(get_turf(usr)) @@ -1657,16 +1656,13 @@ if(href_list[VV_HK_DEADCHAT_PLAYS] && check_rights(R_FUN)) if(tgui_alert(usr, "Allow deadchat to control [src] via chat commands?", "Deadchat Plays [src]", list("Allow", "Cancel")) != "Allow") return - // Alert is async, so quick sanity check to make sure we should still be doing this. if(QDELETED(src)) return - // This should never happen, but if it does it should not be silent. if(deadchat_plays() == COMPONENT_INCOMPATIBLE) to_chat(usr, span_warning("Deadchat control not compatible with [src].")) CRASH("deadchat_control component incompatible with object of type: [type]") - to_chat(usr, span_notice("Deadchat now control [src].")) log_admin("[key_name(usr)] has added deadchat control to [src]") message_admins(span_notice("[key_name(usr)] has added deadchat control to [src]")) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 55cdf19f960..39f56619253 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -493,8 +493,9 @@ if(!.) return - if(href_list[VV_HK_ADD_FANTASY_AFFIX] && check_rights(R_FUN)) - + if(href_list[VV_HK_ADD_FANTASY_AFFIX]) + if(!check_rights(R_FUN)) + return //gathering all affixes that make sense for this item var/list/prefixes = list() var/list/suffixes = list() @@ -507,13 +508,11 @@ prefixes[affix_choice.name] = affix_choice else suffixes[affix_choice.name] = affix_choice - //making it more presentable here var/list/affixes = list("---PREFIXES---") affixes.Add(prefixes) affixes.Add("---SUFFIXES---") affixes.Add(suffixes) - //admin picks, cleanup the ones we didn't do and handle chosen var/picked_affix_name = tgui_input_list(usr, "Affix to add to [src]", "Enchant [src]", affixes) if(isnull(picked_affix_name)) @@ -527,7 +526,6 @@ fantasy_quality++ else fantasy_quality-- - //name gets changed by the component so i want to store it for feedback later var/before_name = name //naming these vars that i'm putting into the fantasy component to make it more readable @@ -537,7 +535,6 @@ if(AddComponent(/datum/component/fantasy, fantasy_quality, list(affix), canFail, announce) == COMPONENT_INCOMPATIBLE) to_chat(usr, span_warning("Fantasy component not compatible with [src].")) CRASH("fantasy component incompatible with object of type: [type]") - to_chat(usr, span_notice("[before_name] now has [picked_affix_name]!")) log_admin("[key_name(usr)] has added [picked_affix_name] fantasy affix to [before_name]") message_admins(span_notice("[key_name(usr)] has added [picked_affix_name] fantasy affix to [before_name]")) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index a7263520ad8..6cfb940bb71 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -227,50 +227,52 @@ GLOBAL_LIST_EMPTY(objects_by_id_tag) VV_DROPDOWN_OPTION(VV_HK_OSAY, "Object Say") /obj/vv_do_topic(list/href_list) - if(!(. = ..())) + . = ..() + + if(!.) return + if(href_list[VV_HK_OSAY]) - if(check_rights(R_FUN, FALSE)) - usr.client.object_say(src) + if(!check_rights(R_FUN, FALSE)) + return + usr.client.object_say(src) if(href_list[VV_HK_MASS_DEL_TYPE]) - if(check_rights(R_DEBUG|R_SERVER)) - var/action_type = tgui_alert(usr, "Strict type ([type]) or type and all subtypes?",,list("Strict type","Type and subtypes","Cancel")) - if(action_type == "Cancel" || !action_type) - return - - if(tgui_alert(usr, "Are you really sure you want to delete all objects of type [type]?",,list("Yes","No")) != "Yes") - return - - if(tgui_alert(usr, "Second confirmation required. Delete?",,list("Yes","No")) != "Yes") - return - - var/O_type = type - switch(action_type) - if("Strict type") - var/i = 0 - for(var/obj/Obj in world) - if(Obj.type == O_type) - i++ - qdel(Obj) - CHECK_TICK - if(!i) - to_chat(usr, "No objects of this type exist") - return - log_admin("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ") - message_admins(span_notice("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ")) - if("Type and subtypes") - var/i = 0 - for(var/obj/Obj in world) - if(istype(Obj,O_type)) - i++ - qdel(Obj) - CHECK_TICK - if(!i) - to_chat(usr, "No objects of this type exist") - return - log_admin("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") - message_admins(span_notice("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ")) + if(!check_rights(R_DEBUG|R_SERVER)) + return + var/action_type = tgui_alert(usr, "Strict type ([type]) or type and all subtypes?",,list("Strict type","Type and subtypes","Cancel")) + if(action_type == "Cancel" || !action_type) + return + if(tgui_alert(usr, "Are you really sure you want to delete all objects of type [type]?",,list("Yes","No")) != "Yes") + return + if(tgui_alert(usr, "Second confirmation required. Delete?",,list("Yes","No")) != "Yes") + return + var/O_type = type + switch(action_type) + if("Strict type") + var/i = 0 + for(var/obj/Obj in world) + if(Obj.type == O_type) + i++ + qdel(Obj) + CHECK_TICK + if(!i) + to_chat(usr, "No objects of this type exist") + return + log_admin("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ") + message_admins(span_notice("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ")) + if("Type and subtypes") + var/i = 0 + for(var/obj/Obj in world) + if(istype(Obj,O_type)) + i++ + qdel(Obj) + CHECK_TICK + if(!i) + to_chat(usr, "No objects of this type exist") + return + log_admin("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") + message_admins(span_notice("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ")) /obj/examine(mob/user) . = ..() diff --git a/code/modules/events/space_vines/vine_controller.dm b/code/modules/events/space_vines/vine_controller.dm index e32edcb0902..bd330668ba6 100644 --- a/code/modules/events/space_vines/vine_controller.dm +++ b/code/modules/events/space_vines/vine_controller.dm @@ -50,7 +50,13 @@ GLOBAL_LIST_INIT(vine_mutations_list, init_vine_mutation_list()) /datum/spacevine_controller/vv_do_topic(href_list) . = ..() + + if(!.) + return + if(href_list[VV_HK_SPACEVINE_PURGE]) + if(!check_rights(NONE)) + return if(tgui_alert(usr, "Are you sure you want to delete this spacevine cluster?", "Delete Vines", list("Yes", "No")) == "Yes") DeleteVines() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 5d8d6dd425c..30d6e545782 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1071,6 +1071,10 @@ /mob/living/carbon/vv_do_topic(list/href_list) . = ..() + + if(!.) + return + if(href_list[VV_HK_MODIFY_BODYPART]) if(!check_rights(R_SPAWN)) return @@ -1112,7 +1116,6 @@ if("replace") var/limb2add = input(usr, "Select a bodypart type to add", "Add/Replace Bodypart") as null|anything in sort_list(limbtypes) var/obj/item/bodypart/new_bp = new limb2add() - if(new_bp.replace_limb(src, special = TRUE)) admin_ticket_log("key_name_admin(usr)] has replaced [src]'s [BP.type] with [new_bp.type]") qdel(BP) @@ -1124,6 +1127,7 @@ if(!check_rights(NONE)) return usr.client.manipulate_organs(src) + if(href_list[VV_HK_MARTIAL_ART]) if(!check_rights(NONE)) return @@ -1144,6 +1148,7 @@ MA.teach(src) log_admin("[key_name(usr)] has taught [MA] to [key_name(src)].") message_admins(span_notice("[key_name_admin(usr)] has taught [MA] to [key_name_admin(src)].")) + if(href_list[VV_HK_GIVE_TRAUMA]) if(!check_rights(NONE)) return @@ -1160,6 +1165,7 @@ if(BT) log_admin("[key_name(usr)] has traumatized [key_name(src)] with [BT.name]") message_admins(span_notice("[key_name_admin(usr)] has traumatized [key_name_admin(src)] with [BT.name].")) + if(href_list[VV_HK_CURE_TRAUMA]) if(!check_rights(NONE)) return diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index be84d857ed6..e1bf1f533d2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -788,20 +788,23 @@ /mob/living/carbon/human/vv_do_topic(list/href_list) . = ..() + + if(!.) + return + if(href_list[VV_HK_COPY_OUTFIT]) if(!check_rights(R_SPAWN)) return copy_outfit() + if(href_list[VV_HK_MOD_MUTATIONS]) if(!check_rights(R_SPAWN)) return - var/list/options = list("Clear"="Clear") for(var/x in subtypesof(/datum/mutation/human)) var/datum/mutation/human/mut = x var/name = initial(mut.name) options[dna.check_mutation(mut) ? "[name] (Remove)" : "[name] (Add)"] = mut - var/result = input(usr, "Choose mutation to add/remove","Mutation Mod") as null|anything in sort_list(options) if(result) if(result == "Clear") @@ -812,25 +815,21 @@ dna.remove_mutation(mut) else dna.add_mutation(mut) + if(href_list[VV_HK_MOD_QUIRKS]) if(!check_rights(R_SPAWN)) return - var/list/options = list("Clear"="Clear") for(var/type in subtypesof(/datum/quirk)) var/datum/quirk/quirk_type = type - if(initial(quirk_type.abstract_parent_type) == type) continue - // SKYRAT EDIT ADDITION START if(initial(quirk_type.erp_quirk) && CONFIG_GET(flag/disable_erp_preferences)) continue // SKYRAT EDIT ADDITION END - var/qname = initial(quirk_type.name) options[has_quirk(quirk_type) ? "[qname] (Remove)" : "[qname] (Add)"] = quirk_type - var/result = input(usr, "Choose quirk to add/remove","Quirk Mod") as null|anything in sort_list(options) if(result) if(result == "Clear") @@ -842,6 +841,7 @@ remove_quirk(T) else add_quirk(T) + if(href_list[VV_HK_SET_SPECIES]) if(!check_rights(R_SPAWN)) return @@ -850,6 +850,7 @@ var/newtype = GLOB.species_list[result] admin_ticket_log("[key_name_admin(usr)] has modified the bodyparts of [src] to [result]") set_species(newtype) + if(href_list[VV_HK_PURRBATION]) if(!check_rights(R_SPAWN)) return @@ -863,13 +864,13 @@ var/msg = span_notice("[key_name_admin(usr)] has put [key_name(src)] on purrbation.") message_admins(msg) admin_ticket_log(src, msg) - else to_chat(usr, "Removed [src] from purrbation.") log_admin("[key_name(usr)] has removed [key_name(src)] from purrbation.") var/msg = span_notice("[key_name_admin(usr)] has removed [key_name(src)] from purrbation.") message_admins(msg) admin_ticket_log(src, msg) + if(href_list[VV_HK_APPLY_DNA_INFUSION]) if(!check_rights(R_SPAWN)) return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 823155dec3d..fed6ce4e62f 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1960,13 +1960,22 @@ GLOBAL_LIST_EMPTY(fire_appearances) /mob/living/vv_do_topic(list/href_list) . = ..() + if(!.) + return + if(href_list[VV_HK_GIVE_SPEECH_IMPEDIMENT]) if(!check_rights(NONE)) return admin_give_speech_impediment(usr) - if (href_list[VV_HK_ADD_MOOD]) + + if(href_list[VV_HK_ADD_MOOD]) + if(!check_rights(NONE)) + return admin_add_mood_event(usr) - if (href_list[VV_HK_REMOVE_MOOD]) + + if(href_list[VV_HK_REMOVE_MOOD]) + if(!check_rights(NONE)) + return admin_remove_mood_event(usr) if(href_list[VV_HK_GIVE_HALLUCINATION]) @@ -1978,6 +1987,7 @@ GLOBAL_LIST_EMPTY(fire_appearances) if(!check_rights(NONE)) return admin_give_delusion(usr) + if(href_list[VV_HK_GIVE_GUARDIAN_SPIRIT]) if(!check_rights(NONE)) return diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ec8f0f629f1..81ca3fc0b53 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1452,62 +1452,80 @@ /mob/vv_do_topic(list/href_list) . = ..() + + if(!.) + return + if(href_list[VV_HK_REGEN_ICONS]) if(!check_rights(NONE)) return regenerate_icons() + if(href_list[VV_HK_PLAYER_PANEL]) if(!check_rights(NONE)) return usr.client.holder.show_player_panel(src) + if(href_list[VV_HK_GODMODE]) if(!check_rights(R_ADMIN)) return usr.client.cmd_admin_godmode(src) + if(href_list[VV_HK_GIVE_MOB_ACTION]) if(!check_rights(NONE)) return usr.client.give_mob_action(src) + if(href_list[VV_HK_REMOVE_MOB_ACTION]) if(!check_rights(NONE)) return usr.client.remove_mob_action(src) + if(href_list[VV_HK_GIVE_SPELL]) if(!check_rights(NONE)) return usr.client.give_spell(src) + if(href_list[VV_HK_REMOVE_SPELL]) if(!check_rights(NONE)) return usr.client.remove_spell(src) + if(href_list[VV_HK_GIVE_DISEASE]) if(!check_rights(NONE)) return usr.client.give_disease(src) + if(href_list[VV_HK_GIB]) if(!check_rights(R_FUN)) return usr.client.cmd_admin_gib(src) + if(href_list[VV_HK_BUILDMODE]) if(!check_rights(R_BUILD)) return togglebuildmode(src) + if(href_list[VV_HK_DROP_ALL]) if(!check_rights(NONE)) return usr.client.cmd_admin_drop_everything(src) + if(href_list[VV_HK_DIRECT_CONTROL]) if(!check_rights(NONE)) return usr.client.cmd_assume_direct_control(src) + if(href_list[VV_HK_GIVE_DIRECT_CONTROL]) if(!check_rights(NONE)) return usr.client.cmd_give_direct_control(src) + if(href_list[VV_HK_OFFER_GHOSTS]) if(!check_rights(NONE)) return offer_control(src) + if(href_list[VV_HK_VIEW_PLANES]) if(!check_rights(R_DEBUG)) return