From 9f42148ab1ac050904ca29f360b2b23ecdfeb46a Mon Sep 17 00:00:00 2001 From: CHOMPStation2 <58959929+CHOMPStation2@users.noreply.github.com> Date: Sun, 1 Sep 2024 15:28:35 -0700 Subject: [PATCH] [MIRROR] default tgui alert input handling (#8891) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: Kashargul --- code/controllers/subsystems/media_tracks.dm | 4 +- code/game/antagonist/antagonist_factions.dm | 2 +- .../gamemodes/changeling/powers/fake_death.dm | 2 +- code/game/gamemodes/cult/ritual.dm | 2 +- code/game/machinery/computer/robot.dm | 2 +- code/game/machinery/computer/supply.dm | 4 +- .../machinery/virtual_reality/ar_console.dm | 4 +- .../machinery/virtual_reality/vr_console.dm | 4 +- code/game/mecha/combat/phazon.dm | 2 + code/game/mecha/mecha_actions.dm | 2 + code/game/objects/items/blueprints_vr.dm | 4 +- .../items/devices/communicator/phone.dm | 2 +- code/game/objects/items/devices/e_beacon.dm | 2 +- code/game/objects/items/devices/multitool.dm | 6 +- code/game/objects/items/devices/paicard.dm | 2 +- code/game/objects/items/mail_ch.dm | 2 + .../weapons/circuitboards/computer/supply.dm | 4 +- .../items/weapons/id cards/syndicate_ids.dm | 4 +- code/game/objects/micro_event.dm | 4 +- code/game/objects/structures/artstuff.dm | 6 +- .../objects/structures/ghost_pods/event_vr.dm | 2 +- .../structures/ghost_pods/ghost_pods.dm | 2 +- .../objects/structures/props/beam_prism.dm | 6 +- code/game/response_team.dm | 5 +- code/game/trader_visit.dm | 5 +- code/modules/admin/DB ban/functions.dm | 2 +- code/modules/admin/admin.dm | 9 +- code/modules/admin/admin_verbs.dm | 4 +- code/modules/admin/callproc/callproc.dm | 2 + code/modules/admin/map_capture.dm | 2 +- .../secrets/admin_secrets/jump_shuttle.dm | 4 +- .../secrets/admin_secrets/move_shuttle.dm | 2 +- code/modules/admin/topic.dm | 10 +- code/modules/admin/verbs/adminhelp.dm | 5 +- code/modules/admin/verbs/adminhelp_vr.dm | 2 +- code/modules/admin/verbs/atmosdebug.dm | 2 +- code/modules/admin/verbs/buildmode.dm | 5 +- code/modules/admin/verbs/change_appearance.dm | 5 +- code/modules/admin/verbs/cinematic.dm | 5 +- code/modules/admin/verbs/debug.dm | 2 +- code/modules/admin/verbs/entity_narrate.dm | 10 +- code/modules/admin/verbs/event_triggers.dm | 10 +- code/modules/admin/verbs/lightning_strike.dm | 2 +- .../admin/verbs/map_template_loadverb.dm | 4 +- code/modules/admin/verbs/playsound.dm | 4 +- code/modules/admin/verbs/randomverbs.dm | 35 +- code/modules/admin/verbs/randomverbs_vr.dm | 4 +- code/modules/admin/verbs/smite.dm | 2 +- code/modules/admin/verbs/striketeam.dm | 2 +- .../view_variables/mass_edit_variables.dm | 4 +- .../admin/view_variables/modify_variables.dm | 4 +- code/modules/casino/casino.dm | 2 + .../preference_setup/general/03_body.dm | 2 +- .../client/preference_setup/vore/02_size.dm | 2 + .../client/preference_setup/vore/07_traits.dm | 2 +- .../clothing/spacesuits/rig/modules/ninja.dm | 2 +- .../rig/modules/specific/self_destruct.dm | 2 +- code/modules/emotes/emote_mob.dm | 2 +- .../eventkit/generic_objects/generic_item.dm | 8 +- .../generic_objects/generic_structure.dm | 16 +- .../gm_interfaces/fake_pda_conversations.dm | 7 +- code/modules/food/food/snacks.dm | 2 +- code/modules/instruments/songs/editor.dm | 2 +- code/modules/mentor/mentor.dm | 2 + code/modules/mentor/mentorhelp.dm | 7 +- code/modules/mob/dead/observer/observer.dm | 6 +- code/modules/mob/dead/observer/observer_vr.dm | 2 +- code/modules/mob/living/carbon/give.dm | 2 +- .../human/species/lleill/lleill_abilities.dm | 4 +- .../human/species/lleill/lleill_items.dm | 6 +- .../station/protean_vr/protean_powers.dm | 407 ++++++++++++++++++ .../station/station_special_abilities_vr.dm | 7 + .../station/traits_vr/traits_tutorial.dm | 2 +- code/modules/mob/living/living.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 6 + code/modules/mob/living/silicon/pai/pai.dm | 2 +- .../silicon/robot/dogborg/dog_modules_vr.dm | 2 + .../modules/mob/living/silicon/robot/robot.dm | 2 +- code/modules/mob/mob.dm | 2 +- .../programs/generic/file_browser.dm | 2 +- code/modules/multiz/ladders.dm | 2 +- code/modules/multiz/movement_vr.dm | 8 +- code/modules/paperwork/adminpaper.dm | 2 + code/modules/paperwork/faxmachine.dm | 2 +- code/modules/power/fusion/_setup.dm | 4 +- code/modules/random_map/drop/droppod.dm | 7 +- code/modules/random_map/drop/supply.dm | 6 +- .../reagents/machinery/injector_maker.dm | 2 +- code/modules/research/rdconsole_tgui.dm | 2 +- code/modules/resleeving/autoresleever.dm | 2 +- code/modules/resleeving/computers.dm | 2 +- code/modules/shuttles/shuttles_web.dm | 4 +- code/modules/virus2/admin.dm | 2 +- code/modules/vore/eating/living_vr.dm | 2 + code/modules/vore/eating/vorepanel_vr.dm | 2 +- code/modules/vore/resizing/crackers.dm | 6 +- .../tools/artifact_harvester.dm | 2 +- .../tools/geosample_scanner.dm | 4 + interface/interface.dm | 12 +- .../machinery/virtual_reality/vr_console.dm | 4 +- .../game/objects/items/devices/flipper.dm | 2 +- .../game/objects/items/devices/mind_binder.dm | 4 +- modular_chomp/code/modules/tickets/procs.dm | 12 +- .../code/modules/tickets/tickets_ui.dm | 5 +- .../code/modules/vore/eating/soulcatcher.dm | 11 +- modular_chomp/game/machinery/buttons.dm | 4 +- 106 files changed, 675 insertions(+), 178 deletions(-) create mode 100644 code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm diff --git a/code/controllers/subsystems/media_tracks.dm b/code/controllers/subsystems/media_tracks.dm index 295f536e07..7026d9388d 100644 --- a/code/controllers/subsystems/media_tracks.dm +++ b/code/controllers/subsystems/media_tracks.dm @@ -145,7 +145,7 @@ SUBSYSTEM_DEF(media_tracks) return var/secret = tgui_alert(C, "Optional: Mark track as secret?", "Track Secret", list("Yes", "Cancel", "No")) - if(secret == "Cancel") + if(!secret || secret == "Cancel") return else if(secret == "Yes") secret = TRUE @@ -153,7 +153,7 @@ SUBSYSTEM_DEF(media_tracks) secret = FALSE var/lobby = tgui_alert(C, "Optional: Mark track as lobby music?", "Track Lobby", list("Yes", "Cancel", "No")) - if(lobby == "Cancel") + if(!lobby || lobby == "Cancel") return else if(secret == "Yes") secret = TRUE diff --git a/code/game/antagonist/antagonist_factions.dm b/code/game/antagonist/antagonist_factions.dm index 5bdefaa4b6..c2b98c2639 100644 --- a/code/game/antagonist/antagonist_factions.dm +++ b/code/game/antagonist/antagonist_factions.dm @@ -38,7 +38,7 @@ if(choice == "Yes!" && faction.add_antagonist_mind(player, 0, faction.faction_role_text, faction.faction_welcome)) to_chat(src, "\The [player.current] joins the [faction.faction_descriptor]!") return - if(choice == "No!") + if(!choice || choice == "No!") to_chat(player, "You reject this traitorous cause!") to_chat(src, "\The [player.current] does not support the [faction.faction_descriptor]!") diff --git a/code/game/gamemodes/changeling/powers/fake_death.dm b/code/game/gamemodes/changeling/powers/fake_death.dm index 02cf51f013..a29ed4cad7 100644 --- a/code/game/gamemodes/changeling/powers/fake_death.dm +++ b/code/game/gamemodes/changeling/powers/fake_death.dm @@ -22,7 +22,7 @@ to_chat(src, "We have no genomes, not even our own, and cannot regenerate.") return 0 - if(!C.stat && tgui_alert(src, "Are we sure we wish to regenerate? We will appear to be dead while doing so.","Revival",list("Yes","No")) == "No") + if(!C.stat && tgui_alert(src, "Are we sure we wish to regenerate? We will appear to be dead while doing so.","Revival",list("Yes","No")) != "Yes") return to_chat(C, "We will attempt to regenerate our form.") diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 610f1a2480..d1059dd4af 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -334,7 +334,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," return else switch(tgui_alert(user, "You open the tome", "Tome", list("Read it","Scribe a rune","Cancel"))) - if("Cancel") + if("Cancel", null) return if("Read it") if(usr.get_active_hand() != src) diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 6d9db65e94..d023ac552e 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -222,7 +222,7 @@ if(!can_hack(usr, R)) return var/choice = tgui_alert(usr, "Really hack [R.name]? This cannot be undone.", "Hack?", list("Yes", "No")) - if(choice == "No") + if(choice != "Yes") return log_game("[key_name(usr)] emagged [key_name(R)] using robotic console!") message_admins("[key_name_admin(usr)] emagged [key_name_admin(R)] using robotic console!") diff --git a/code/game/machinery/computer/supply.dm b/code/game/machinery/computer/supply.dm index ce345e429e..005626956c 100644 --- a/code/game/machinery/computer/supply.dm +++ b/code/game/machinery/computer/supply.dm @@ -160,7 +160,7 @@ /obj/machinery/computer/supplycomp/tgui_static_data(mob/user) var/list/data = ..() - + var/list/pack_list = list() for(var/pack_name in SSsupply.supply_pack) var/datum/supply_pack/P = SSsupply.supply_pack[pack_name] @@ -395,6 +395,8 @@ return FALSE var/list/L = E.contents[params["index"]] var/field = tgui_alert(usr, "Select which field to edit", "Field Choice", list("Name", "Quantity", "Value")) + if(!field) + return FALSE var/new_val = sanitize(tgui_input_text(usr, field, "Enter the new value for this field:", L[lowertext(field)])) if(!new_val) diff --git a/code/game/machinery/virtual_reality/ar_console.dm b/code/game/machinery/virtual_reality/ar_console.dm index 904c439596..4731b4cb8d 100644 --- a/code/game/machinery/virtual_reality/ar_console.dm +++ b/code/game/machinery/virtual_reality/ar_console.dm @@ -57,7 +57,7 @@ if(!occupant) return - if(!forced && avatar && avatar.stat != DEAD && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) == "No") + if(!forced && avatar && avatar.stat != DEAD && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) != "Yes") return avatar.exit_vr() @@ -89,7 +89,7 @@ if(avatar && !occupant.stat) to_chat(occupant,"\The [src] begins to [pick("whir","hum","pulse")] as a screen appears in front of you.") - if(tgui_alert(occupant, "This pod is already linked. Are you certain you wish to engage?", "Commmit?", list("Yes", "No")) == "No") + if(tgui_alert(occupant, "This pod is already linked. Are you certain you wish to engage?", "Commmit?", list("Yes", "No")) != "Yes") visible_message("\The [src] pulses!") to_chat(occupant,"Your mind blurs as information bombards you.") diff --git a/code/game/machinery/virtual_reality/vr_console.dm b/code/game/machinery/virtual_reality/vr_console.dm index 2e2c610cfc..e966a39519 100644 --- a/code/game/machinery/virtual_reality/vr_console.dm +++ b/code/game/machinery/virtual_reality/vr_console.dm @@ -191,7 +191,7 @@ if(!occupant) return - if(!forced && avatar && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) == "No") + if(!forced && avatar && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) != "Yes") return if(avatar) @@ -228,7 +228,7 @@ avatar = occupant.vr_link // If they've already enterred VR, and are reconnecting, prompt if they want a new body - if(avatar && tgui_alert(occupant, "You already have a [avatar.stat == DEAD ? "" : "deceased "]Virtual Reality avatar. Would you like to use it?", "New avatar", list("Yes", "No")) == "No") + if(avatar && tgui_alert(occupant, "You already have a [avatar.stat == DEAD ? "" : "deceased "]Virtual Reality avatar. Would you like to use it?", "New avatar", list("Yes", "No")) != "Yes") // Delink the mob occupant.vr_link = null avatar = null diff --git a/code/game/mecha/combat/phazon.dm b/code/game/mecha/combat/phazon.dm index 0e238fec46..83ad592c85 100644 --- a/code/game/mecha/combat/phazon.dm +++ b/code/game/mecha/combat/phazon.dm @@ -145,6 +145,8 @@ /obj/mecha/combat/phazon/janus/query_damtype() var/new_damtype = tgui_alert(src.occupant,"Gauntlet Phase Emitter Mode","Damage Type",list("Force","Energy","Stun")) + if(!new_damtype) + return switch(new_damtype) if("Force") damtype = "brute" diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index cee2768dac..3370bcdd0e 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -406,6 +406,8 @@ if(usr!=src.occupant) return var/new_damtype = tgui_alert(src.occupant,"Melee Damage Type","Damage Type",list("Brute","Fire","Toxic")) + if(!new_damtype) + return switch(new_damtype) if("Brute") damtype = "brute" diff --git a/code/game/objects/items/blueprints_vr.dm b/code/game/objects/items/blueprints_vr.dm index 6533ebc896..81981190ad 100644 --- a/code/game/objects/items/blueprints_vr.dm +++ b/code/game/objects/items/blueprints_vr.dm @@ -617,7 +617,7 @@ return var/confirm = tgui_alert(creator, "Are you sure you want to change [oldA.name] into a new area named [str]?", "READ CAREFULLY", list("No", "Yes")) - if(confirm == "No") + if(confirm != "Yes") to_chat(creator, "No changes made.") return @@ -626,7 +626,7 @@ newA.has_gravity = oldA.has_gravity else var/confirm = tgui_alert(creator, "Are you sure you want to change [oldA.name] into [area_choice]?", "READ CAREFULLY", list("No", "Yes")) - if(confirm == "No") + if(confirm != "Yes") to_chat(creator, "No changes made.") return newA = area_choice //They selected to turn the area they're standing on into the selected area. diff --git a/code/game/objects/items/devices/communicator/phone.dm b/code/game/objects/items/devices/communicator/phone.dm index b29fd735ec..196b914198 100644 --- a/code/game/objects/items/devices/communicator/phone.dm +++ b/code/game/objects/items/devices/communicator/phone.dm @@ -287,7 +287,7 @@ return //something is terribly wrong var/confirm = tgui_alert(src, "Would you like to talk as [src.client.prefs.real_name], over a communicator? This will reset your respawn timer, if someone answers.", "Join as Voice?", list("Yes","No")) - if(confirm == "No") + if(confirm != "Yes") return if(CONFIG_GET(flag/antag_hud_restricted) && has_enabled_antagHUD == 1) // CHOMPEdit diff --git a/code/game/objects/items/devices/e_beacon.dm b/code/game/objects/items/devices/e_beacon.dm index 656835f376..1d1896f0db 100644 --- a/code/game/objects/items/devices/e_beacon.dm +++ b/code/game/objects/items/devices/e_beacon.dm @@ -24,7 +24,7 @@ return else var/answer = tgui_alert(user, "Would you like to activate this personal emergency beacon?","\The [src]", list("Yes", "No")) - if(answer == "No") + if(answer != "Yes") return else if(do_after(user, (3 SECONDS))) //short delay, so they can still abort if they want to user.visible_message("[user] activates \the [src]!","You activate \the [src], spiking it into the ground!") diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index a320c6b490..bebea10008 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -34,9 +34,6 @@ /obj/item/device/multitool/attack_self(mob/living/user) var/choice = tgui_alert(usr, "What do you want to do with \the [src]?", "Multitool Menu", list("Switch Mode", "Clear Buffers", "Cancel")) switch(choice) - if("Cancel") - to_chat(user,"You lower \the [src].") - return if("Clear Buffers") to_chat(user,"You clear \the [src]'s memory.") buffer = null @@ -48,6 +45,9 @@ accepting_refs = 1 if("Switch Mode") mode_switch(user) + else + to_chat(user,"You lower \the [src].") + return update_icon() diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 80bb88a2e3..fd452c3ced 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -79,7 +79,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard) return var/choice = tgui_alert(user, "You sure you want to inhabit this PAI, or submit yourself to being recruited?", "Confirmation", list("Inhabit", "Recruit", "Cancel")) - if(choice == "Cancel") + if(!choice || choice == "Cancel") return ..() if(choice == "Recruit") paiController.recruitWindow(user) diff --git a/code/game/objects/items/mail_ch.dm b/code/game/objects/items/mail_ch.dm index ed9652ed1b..9573ccefa8 100644 --- a/code/game/objects/items/mail_ch.dm +++ b/code/game/objects/items/mail_ch.dm @@ -282,6 +282,8 @@ new chosen(new_mail) var/shuttle_spawn = tgui_alert(usr, "Spawn mail at location or in the shuttle?", "Spawn mail", list("Location", "Shuttle")) + if(!shuttle_spawn) + return if(shuttle_spawn == "Shuttle") SSmail.admin_mail += new_mail log_and_message_admins("spawned [chosen] inside an envelope at the shuttle") diff --git a/code/game/objects/items/weapons/circuitboards/computer/supply.dm b/code/game/objects/items/weapons/circuitboards/computer/supply.dm index 49fdd14ee7..a120db809a 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/supply.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/supply.dm @@ -32,11 +32,11 @@ opposite_catastasis = "BROAD" catastasis = "STANDARD" - switch( tgui_alert(usr, "Current receiver spectrum is set to: [catastasis]","Multitool-Circuitboard interface",list("Switch to [opposite_catastasis]","Cancel")) ) + switch(tgui_alert(usr, "Current receiver spectrum is set to: [catastasis]","Multitool-Circuitboard interface",list("Switch to [opposite_catastasis]","Cancel"))) if("Switch to STANDARD","Switch to BROAD") src.contraband_enabled = !src.contraband_enabled - if("Cancel") + if("Cancel", null) return else to_chat(user, "DERP! BUG! Report this (And what you were doing to cause it) to Agouri") diff --git a/code/game/objects/items/weapons/id cards/syndicate_ids.dm b/code/game/objects/items/weapons/id cards/syndicate_ids.dm index b89868ca19..aaf21fafb3 100644 --- a/code/game/objects/items/weapons/id cards/syndicate_ids.dm +++ b/code/game/objects/items/weapons/id cards/syndicate_ids.dm @@ -38,7 +38,9 @@ if(!registered_user && register_user(user)) to_chat(user, "The microscanner marks you as its owner, preventing others from accessing its internals.") if(registered_user == user) - switch(tgui_alert(usr, "Would you like edit the ID, or show it?","Show or Edit?", list("Edit","Show"))) + switch(tgui_alert(usr, "Would you like to edit the ID, or show it?","Show or Edit?", list("Edit","Show"))) + if(null) + return if("Edit") agentcard_module.tgui_interact(user) if("Show") diff --git a/code/game/objects/micro_event.dm b/code/game/objects/micro_event.dm index 36fcb152e7..3ad5a0efae 100644 --- a/code/game/objects/micro_event.dm +++ b/code/game/objects/micro_event.dm @@ -13,9 +13,11 @@ if(tgui_alert(user, "Should this portal shrink people who are over the limit, or grow people who are under the limit?", "Change portal size settings", list("Shrink","Grow")) == "Shrink") shrinking = TRUE our_message = "What should the size limit be? Anyone over this limit will be shrunk to this size. (1 = 100%, etc)" - else + else if (our_message == "Grow") shrinking = FALSE our_message = "What should the size limit be? Anyone under this limit will be grown to this size. (1 = 100%, etc)" + else + return ..() size_limit = tgui_input_number(user, our_message, "Pick a Size", 1, round_value=FALSE) diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index 92ed709db4..c1b4110f73 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -103,7 +103,7 @@ /obj/item/canvas/attackby(obj/item/I, mob/living/user, params) if(istype(I, /obj/item/paint_palette)) var/choice = tgui_alert(user, "Adjusting the base color of this canvas will replace ALL pixels with the selected color. Are you sure?", "Confirm Color Fill", list("Yes", "No")) - if(choice == "No") + if(choice != "Yes") return var/basecolor = input(user, "Select a base color for the canvas:", "Base Color", canvas_color) as null|color if(basecolor && Adjacent(user) && user.get_active_hand() == I) @@ -551,7 +551,7 @@ Author's Name: [author_name]. \n \ Author's CKey: [author_ckey]")) if(tgui_alert(usr, "Check your chat log (if filtering for notices, check where you don't) for painting details.", - "Is this the painting you want?", list("Yes", "No")) == "No") + "Is this the painting you want?", list("Yes", "No")) != "Yes") return 0 if(!fexists("data/persistent/paintings/[persistence_id]/[painting["md5"]].png")) to_chat(usr, span_warning("Chosen painting could not be loaded! Incident was logged, but no action taken at this time")) @@ -590,7 +590,7 @@ if(tgui_alert(usr, "No painting list ID was given. You may obtain such by debugging SSPersistence and checking the all_paintings entry. \ If you do not wish to do that, you may request a list to be generated of painting titles. This might be resource intensive. \ - Proceed? It will likely have over 500 entries", "Generate list?", list("Proceed!", "Cancel")) == "Cancel") + Proceed? It will likely have over 500 entries", "Generate list?", list("Proceed!", "Cancel")) != "Proceed!") return log_debug("[usr] generated list of paintings from SSPersistence") diff --git a/code/game/objects/structures/ghost_pods/event_vr.dm b/code/game/objects/structures/ghost_pods/event_vr.dm index 2b26664c60..eaf29c8193 100644 --- a/code/game/objects/structures/ghost_pods/event_vr.dm +++ b/code/game/objects/structures/ghost_pods/event_vr.dm @@ -101,7 +101,7 @@ if (not_has_ooc_text(M)) return - while(finalized == "No" && M.client) + while(finalized != "Yes" && M.client) choice = tgui_input_list(M, "What type of predator do you want to play as?", "Maintpred Choice", possible_mobs) if(!choice) //We probably pushed the cancel button on the mob selection. Let's just put the ghost pod back in the list. to_chat(M, "No mob selected, cancelling.") diff --git a/code/game/objects/structures/ghost_pods/ghost_pods.dm b/code/game/objects/structures/ghost_pods/ghost_pods.dm index 82845de15f..c505027b13 100644 --- a/code/game/objects/structures/ghost_pods/ghost_pods.dm +++ b/code/game/objects/structures/ghost_pods/ghost_pods.dm @@ -53,7 +53,7 @@ /obj/structure/ghost_pod/manual/attack_hand(var/mob/living/user) if(!used) if(confirm_before_open) - if(tgui_alert(user, "Are you sure you want to touch \the [src]?", "Confirm", list("No", "Yes")) == "No") + if(tgui_alert(user, "Are you sure you want to touch \the [src]?", "Confirm", list("No", "Yes")) != "Yes") return trigger() // VOREStation Addition Start diff --git a/code/game/objects/structures/props/beam_prism.dm b/code/game/objects/structures/props/beam_prism.dm index 59ab3f619a..7b62ea6c60 100644 --- a/code/game/objects/structures/props/beam_prism.dm +++ b/code/game/objects/structures/props/beam_prism.dm @@ -51,7 +51,7 @@ return var/confirm = tgui_alert(usr, "Do you want to try to rotate \the [src]?", "[name]", list("Yes", "No")) - if(confirm == "No") + if(confirm != "Yes") visible_message(\ "[user.name] decides not to try turning \the [src].",\ "You decide not to try turning \the [src].") @@ -157,7 +157,7 @@ ..() var/confirm = tgui_alert(usr, "Do you want to try to rotate \the [src]?", "[name]", list("Yes", "No")) - if(confirm == "No") + if(confirm != "Yes") visible_message(\ "[user.name] decides not to try turning \the [src].",\ "You decide not to try turning \the [src].") @@ -186,7 +186,7 @@ new_bearing = round(compass_directions[choice]) confirm = tgui_alert(usr, "Are you certain you want to rotate \the [src]?", "[name]", list("Yes", "No")) - if(confirm == "No") + if(confirm != "Yes") visible_message(\ "[user.name] decides not to try turning \the [src].",\ "You decide not to try turning \the [src].") diff --git a/code/game/response_team.dm b/code/game/response_team.dm index 49cb9d423f..84b3da2457 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -29,9 +29,8 @@ var/silent_ert = 0 if(tgui_alert(usr, "Do you want this Response Team to be announced?","ERT",list("Yes","No")) != "Yes") silent_ert = 1 if(get_security_level() != "red") // Allow admins to reconsider if the alert level isn't Red - switch(tgui_alert(usr, "The station is not in red alert. Do you still want to dispatch a response team?","ERT",list("Yes","No"))) - if("No") - return + if(tgui_alert(usr, "The station is not in red alert. Do you still want to dispatch a response team?","ERT",list("Yes","No")) != "Yes") + return if(send_emergency_team) to_chat(usr, "Looks like somebody beat you to it!") return diff --git a/code/game/trader_visit.dm b/code/game/trader_visit.dm index e3c7663aaa..ab78f1ba07 100644 --- a/code/game/trader_visit.dm +++ b/code/game/trader_visit.dm @@ -23,9 +23,8 @@ var/can_call_traders = 1 if(tgui_alert(usr, "Do you want to dispatch the Beruang trade ship?","Trade Ship",list("Yes","No")) != "Yes") return if(get_security_level() == "red") // Allow admins to reconsider if the alert level is Red - switch(tgui_alert(usr, "The station is in red alert. Do you still want to send traders?","Trade Ship",list("Yes","No"))) - if("No") - return + if(tgui_alert(usr, "The station is in red alert. Do you still want to send traders?","Trade Ship",list("Yes","No")) != "Yes") + return if(send_beruang) to_chat(usr, "Looks like somebody beat you to it!") return diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index 817dbd4cdc..1bb0a2cd38 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -53,7 +53,7 @@ if(!validckey) if(!banned_mob || (banned_mob && !IsGuestKey(banned_mob.key))) //VOREStation Edit Start. var/confirm = tgui_alert(usr, "This ckey hasn't been seen, are you sure?", "Confirm Badmin", list("Yes", "No")) - if(confirm == "No") + if(confirm != "Yes") return //VOREStation Edit End var/a_ckey diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index fb25f9fc02..409968a57c 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -600,7 +600,7 @@ var/global/floorIsLava = 0 if (!usr.client.holder) return var/confirm = alert(usr, "Restart the game world?", "Restart", "Yes", "Cancel") // Not tgui_alert for safety - if(confirm == "Cancel") + if(!confirm || confirm == "Cancel") return if(confirm == "Yes") to_world("Restarting world! Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!") @@ -995,7 +995,7 @@ var/datum/announcement/minor/admin_min_announcer = new set desc="Reboots the server post haste" set name="Immediate Reboot" if(!usr.client.holder) return - if(alert(usr, "Reboot server?","Reboot!","Yes","No") == "No") // Not tgui_alert for safety + if(alert(usr, "Reboot server?","Reboot!","Yes","No") != "Yes") // Not tgui_alert for safety return to_world("[span_red("Rebooting world!")] [span_blue("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!")]") log_admin("[key_name(usr)] initiated an immediate reboot.") @@ -1532,9 +1532,8 @@ var/datum/announcement/minor/admin_min_announcer = new var/shouldStamp = 1 if(!P.sender) // admin initiated - switch(tgui_alert(usr, "Would you like the fax stamped?","Stamped?", list("Yes", "No"))) - if("No") - shouldStamp = 0 + if(tgui_alert(usr, "Would you like the fax stamped?","Stamped?", list("Yes", "No")) != "Yes") + shouldStamp = 0 if(shouldStamp) P.stamps += "
This paper has been stamped by the [P.origin] Quantum Relay." diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 90c02df5f4..d14b4e5593 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -530,7 +530,7 @@ set desc = "Tells mob to man up and deal with it." set popup_menu = FALSE //VOREStation Edit - Declutter. - if(tgui_alert(usr, "Are you sure you want to tell them to man up?","Confirmation",list("Deal with it","No"))=="No") return + if(tgui_alert(usr, "Are you sure you want to tell them to man up?","Confirmation",list("Deal with it","No")) != "Deal with it") return to_chat(T, "Man up and deal with it.") to_chat(T, "Move along.") @@ -543,7 +543,7 @@ set name = "Man Up Global" set desc = "Tells everyone to man up and deal with it." - if(tgui_alert(usr, "Are you sure you want to tell the whole server up?","Confirmation",list("Deal with it","No"))=="No") return + if(tgui_alert(usr, "Are you sure you want to tell the whole server up?","Confirmation",list("Deal with it","No")) != "Deal with it") return for (var/mob/T as mob in mob_list) to_chat(T, "
Man up.
Deal with it.

Move along.

") diff --git a/code/modules/admin/callproc/callproc.dm b/code/modules/admin/callproc/callproc.dm index 57b3b73eee..963367f7b8 100644 --- a/code/modules/admin/callproc/callproc.dm +++ b/code/modules/admin/callproc/callproc.dm @@ -11,6 +11,8 @@ var/returnval = null switch(tgui_alert(usr, "Proc owned by something?","Call Proc",list("Yes","No"))) + if(null) + return if("Yes") targetselected = 1 var/list/value = vv_get_value(default_class = VV_ATOM_REFERENCE, classes = list(VV_ATOM_REFERENCE, VV_DATUM_REFERENCE, VV_MOB_REFERENCE, VV_CLIENT)) diff --git a/code/modules/admin/map_capture.dm b/code/modules/admin/map_capture.dm index 69a1d3ecfc..ec385d44b9 100644 --- a/code/modules/admin/map_capture.dm +++ b/code/modules/admin/map_capture.dm @@ -28,7 +28,7 @@ if(!hasasked) var/answer = tgui_alert(usr, "Capture includes non existant turf, Continue capture?","Continue capture?", list("No", "Yes")) hasasked = 1 - if(answer == "No") + if(answer != "Yes") return var/list/atoms = list() diff --git a/code/modules/admin/secrets/admin_secrets/jump_shuttle.dm b/code/modules/admin/secrets/admin_secrets/jump_shuttle.dm index 07c5096ee7..5a2550ae38 100644 --- a/code/modules/admin/secrets/admin_secrets/jump_shuttle.dm +++ b/code/modules/admin/secrets/admin_secrets/jump_shuttle.dm @@ -13,7 +13,7 @@ if (!shuttle_tag) return var/datum/shuttle/S = SSshuttles.shuttles[shuttle_tag] - + var/list/area_choices = return_areas() var/origin_area = tgui_input_list(user, "Which area is the shuttle at now? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)", "Area Choice", area_choices) if (!origin_area) return @@ -22,6 +22,8 @@ if (!destination_area) return var/long_jump = tgui_alert(user, "Is there a transition area for this jump?","Transition?", list("Yes","No")) + if(!long_jump) + return if (long_jump == "Yes") var/transition_area = tgui_input_list(user, "Which area is the transition area? (MAKE SURE THIS IS CORRECT OR THINGS WILL BREAK)", "Area Choice", area_choices) if (!transition_area) return diff --git a/code/modules/admin/secrets/admin_secrets/move_shuttle.dm b/code/modules/admin/secrets/admin_secrets/move_shuttle.dm index 768101434a..6417c519b8 100644 --- a/code/modules/admin/secrets/admin_secrets/move_shuttle.dm +++ b/code/modules/admin/secrets/admin_secrets/move_shuttle.dm @@ -10,7 +10,7 @@ if(!.) return var/confirm = tgui_alert(user, "This command directly moves a shuttle from one area to another. DO NOT USE THIS UNLESS YOU ARE DEBUGGING A SHUTTLE AND YOU KNOW WHAT YOU ARE DOING.", "Are you sure?", list("Ok", "Cancel")) - if (confirm == "Cancel") + if (confirm != "Ok") return var/shuttle_tag = tgui_input_list(user, "Which shuttle do you want to jump?", "Shuttle Choice", SSshuttles.shuttles) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index a302572859..7b6bd42ffe 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -295,7 +295,7 @@ var/delmob = 0 switch(tgui_alert(usr, "Delete old mob?","Message",list("Yes","No","Cancel"))) - if("Cancel") return + if("Cancel", null) return if("Yes") delmob = 1 log_admin("[key_name(usr)] has used rudimentary transformation on [key_name(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]") @@ -359,6 +359,8 @@ var/duration switch(tgui_alert(usr, "Temporary Ban?","Temporary Ban",list("Yes","No"))) + if(null) + return if("Yes") temp = 1 var/mins = 0 @@ -777,6 +779,8 @@ //Banning comes first if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban. switch(tgui_alert(usr, "Temporary Ban?","Temporary Ban", list("Yes","No","Cancel"))) + if(null) + return if("Yes") if(!check_rights(R_MOD,0) && !check_rights(R_BAN, 0)) to_chat(usr, " You cannot issue temporary job-bans!") @@ -913,6 +917,8 @@ if(M.client && M.client.holder) return //admins cannot be banned. Even if they could, the ban doesn't affect them anyway switch(tgui_alert(usr, "Temporary Ban?","Temporary Ban",list("Yes","No","Cancel"))) + if(null) + return if("Yes") var/mins = tgui_input_number(usr,"How long (in minutes)?","Ban time",1440) if(!mins) @@ -951,7 +957,7 @@ if(!reason) return switch(tgui_alert(usr,"IP ban?","IP Ban",list("Yes","No","Cancel"))) - if("Cancel") return + if("Cancel", null) return if("Yes") AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP) if("No") diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 16b2258602..1f62a98dc3 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -660,7 +660,10 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) feedback_add_details("admin_verb","Adminhelp") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! if(current_ticket) - if(tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) != "No") + var/input = tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) + if(!input) + return + if(input == "Yes") if(current_ticket) current_ticket.MessageNoRecipient(msg) to_chat(usr, "PM to-Admins: [msg]") diff --git a/code/modules/admin/verbs/adminhelp_vr.dm b/code/modules/admin/verbs/adminhelp_vr.dm index cd448ca123..752af75cf8 100644 --- a/code/modules/admin/verbs/adminhelp_vr.dm +++ b/code/modules/admin/verbs/adminhelp_vr.dm @@ -32,7 +32,7 @@ Reason: Replaced with "Tickets System" to_chat(usr, "Error: You cannot request spice (muted from adminhelps).") return - if(tgui_alert(usr, "Are you sure you want to request the admins spice things up for you? You accept the consequences if you do.","Spicy!",list("Yes","No")) != "No") + if(tgui_alert(usr, "Are you sure you want to request the admins spice things up for you? You accept the consequences if you do.","Spicy!",list("Yes","No")) == "Yes") message_admins("[ADMIN_FULLMONTY(usr)] has requested the round be spiced up a little.") to_chat(usr, "You have requested some more spice in your round.") else diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 64c33419d0..93218b38b4 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -7,7 +7,7 @@ feedback_add_details("admin_verb","CP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - if(tgui_alert(usr, "WARNING: This command should not be run on a live server. Do you want to continue?", "Check Piping", list("No", "Yes")) == "No") + if(tgui_alert(usr, "WARNING: This command should not be run on a live server. Do you want to continue?", "Check Piping", list("No", "Yes")) != "Yes") return to_chat(usr, "Checking for disconnected pipes...") diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm index 7ede1d8546..02758fd93f 100644 --- a/code/modules/admin/verbs/buildmode.dm +++ b/code/modules/admin/verbs/buildmode.dm @@ -292,8 +292,9 @@ master.buildmode.valueholder = tgui_input_list(usr,"Enter variable value:", "Value", world) if(BUILDMODE_ROOM) - var/area_choice = tgui_alert(usr, "Would you like to generate a new area as well?","Room Builder", list("No", "Yes")) - switch(area_choice) + switch(tgui_alert(usr, "Would you like to generate a new area as well?","Room Builder", list("No", "Yes"))) + if(null) + return if("No") area_enabled = 0 if("Yes") diff --git a/code/modules/admin/verbs/change_appearance.dm b/code/modules/admin/verbs/change_appearance.dm index 1da3989629..efa4887f86 100644 --- a/code/modules/admin/verbs/change_appearance.dm +++ b/code/modules/admin/verbs/change_appearance.dm @@ -46,9 +46,8 @@ if(!istype(M, /mob/living/carbon/human)) to_chat(usr, "You can only do this to humans!") return - switch(tgui_alert(usr, "Are you sure you wish to edit this mob's appearance? Skrell, Unathi, Tajaran can result in unintended consequences.","Danger!",list("Yes","No"))) - if("No") - return + if(tgui_alert(usr, "Are you sure you wish to edit this mob's appearance? Skrell, Unathi, Tajaran can result in unintended consequences.","Danger!",list("Yes","No")) != "Yes") + return var/new_facial = input(usr, "Please select facial hair color.", "Character Generation") as color if(new_facial) M.r_facial = hex2num(copytext(new_facial, 2, 4)) diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm index c5a90d5203..3cd5d8c5b3 100644 --- a/code/modules/admin/verbs/cinematic.dm +++ b/code/modules/admin/verbs/cinematic.dm @@ -6,11 +6,12 @@ if(!check_rights(R_FUN)) return - if(tgui_alert(usr, "Are you sure you want to run [cinematic]?","Confirmation",list("Yes","No"))=="No") return + if(tgui_alert(usr, "Are you sure you want to run [cinematic]?","Confirmation",list("Yes","No")) != "Yes") return if(!ticker) return switch(cinematic) if("explosion") - if(tgui_alert(usr, "The game will be over. Are you really sure?", "Confirmation", list("Continue","Cancel")) == "Cancel") + var/input = tgui_alert(usr, "The game will be over. Are you really sure?", "Confirmation", list("Continue","Cancel")) + if(!input || input == "Cancel") return var/parameter = tgui_input_number(src,"station_missed = ?","Enter Parameter",0,1,0) var/override diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index fcf6c6dc04..cd700b6489 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -506,7 +506,7 @@ var/response = tgui_alert(usr, "Are you sure? This will start up the engine. Should only be used during debug!","Setup Supermatter",list("Setup Completely","Setup except coolant","No")) - if(response == "No") + if(!response || response == "No") return var/found_the_pump = 0 diff --git a/code/modules/admin/verbs/entity_narrate.dm b/code/modules/admin/verbs/entity_narrate.dm index 0ee663a899..675a5c20f1 100644 --- a/code/modules/admin/verbs/entity_narrate.dm +++ b/code/modules/admin/verbs/entity_narrate.dm @@ -92,10 +92,10 @@ var/options = holder.entity_names + "Clear All" var/removekey = tgui_input_list(usr, "Choose which entity to remove", "remove reference", options, null) if(removekey == "Clear All") - var/confirm = tgui_alert(usr, "Do you really want to clear your entity list?", "confirm", list("Yes", "No"), "No") - if(confirm == "Yes") - holder.entity_names = list() - holder.entity_refs = list() + if(tgui_alert(usr, "Do you really want to clear your entity list?", "confirm", list("Yes", "No")) != "Yes") + return + holder.entity_names = list() + holder.entity_refs = list() else if(removekey) holder.entity_refs -= removekey holder.entity_names -= removekey @@ -128,7 +128,7 @@ holder.tgui_interact(usr) else var/mode = tgui_alert(usr, "Speak or emote?", "mode", list("Speak", "Emote", "Cancel")) - if(mode == "Cancel") return + if(!mode || mode == "Cancel") return var/message = tgui_input_text(usr, "Input what you want [which_entity] to [mode]", "narrate", null, multiline = TRUE, prevent_enter = TRUE) if(message) diff --git a/code/modules/admin/verbs/event_triggers.dm b/code/modules/admin/verbs/event_triggers.dm index 5a2b1fb1fc..611c36b0b8 100644 --- a/code/modules/admin/verbs/event_triggers.dm +++ b/code/modules/admin/verbs/event_triggers.dm @@ -44,7 +44,7 @@ Eventkit verb to be used to spawn the obj/effect/landmarks defined under code\ga return if(choice == "Delete All") var/confirm = tgui_alert(src, "ARE YOU SURE? THERE IS NO GOING BACK", "CONFIRM", list("Go Back", "Delete all my event triggers"), autofocus = FALSE) - if(confirm == "Go Back") + if(!confirm || confirm == "Go Back") return for(var/obj/effect/landmark/event_trigger/ET in personal_list) ET.delete_me = TRUE @@ -62,7 +62,7 @@ Eventkit verb to be used to spawn the obj/effect/landmarks defined under code\ga M.forceMove(get_turf(ET)) if(decision == "Delete") var/confirm = tgui_alert(src, "ARE YOU SURE? THERE IS NO GOING BACK FROM DELETING [ET.name]", "CONFIRM", list("Go Back", "Delete it!"), autofocus = FALSE) - if(confirm == "Go Back") + if(!confirm || confirm == "Go Back") return ET.delete_me = TRUE qdel(ET) @@ -91,7 +91,7 @@ Eventkit verb to be used to spawn the obj/effect/landmarks defined under code\ga log_and_message_admins("[src.ckey] deleted all of [other_ckey]'s event triggers while [other_ckey] was active") return var/confirm = tgui_alert(src, "ARE YOU SURE? THERE IS NO GOING BACK", "CONFIRM", list("Go Back", "Delete all my event triggers"), autofocus = FALSE) - if(confirm == "Go Back") + if(!confirm || confirm == "Go Back") return for(var/obj/effect/landmark/event_trigger/ET in others_list) ET.delete_me = TRUE @@ -105,7 +105,7 @@ Eventkit verb to be used to spawn the obj/effect/landmarks defined under code\ga if(isobserver(M)) var/confirm_teleport = tgui_alert(src, "You're not a ghost! Admin-ghost?", "You're not a ghost", \ list("Cancel", "Teleport me with my character")) - if(confirm_teleport == "Cancel") + if(!confirm_teleport || confirm_teleport == "Cancel") return M.forceMove(get_turf(ET)) if(decision == "Delete") @@ -121,7 +121,7 @@ Eventkit verb to be used to spawn the obj/effect/landmarks defined under code\ga log_and_message_admins("[src.ckey] tried to delete event trigger [ET.name] while [other_ckey] is active.") return var/confirm = tgui_alert(src, "ARE YOU SURE? THERE IS NO GOING BACK FROM DELETING [ET.name]", "CONFIRM", list("Go Back", "Delete it!"), autofocus = FALSE) - if(confirm == "Go Back") + if(!confirm || confirm == "Go Back") return ET.delete_me = TRUE qdel(ET) diff --git a/code/modules/admin/verbs/lightning_strike.dm b/code/modules/admin/verbs/lightning_strike.dm index bdc2127c23..a7eb744d72 100644 --- a/code/modules/admin/verbs/lightning_strike.dm +++ b/code/modules/admin/verbs/lightning_strike.dm @@ -8,7 +8,7 @@ var/result = tgui_alert(src, "Really strike your tile with lightning?", "Confirm Badmin" , list("No", "Yes (Cosmetic)", "Yes (Real)")) - if(result == "No") + if(!result || result == "No") return var/fake_lightning = result == "Yes (Cosmetic)" diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm index d7efaeb301..0180e5ebdf 100644 --- a/code/modules/admin/verbs/map_template_loadverb.dm +++ b/code/modules/admin/verbs/map_template_loadverb.dm @@ -27,7 +27,7 @@ preview += image('icons/misc/debug_group.dmi',S ,"red") usr.client.images += preview if(tgui_alert(usr,"Confirm location.", "Template Confirm",list("No","Yes")) == "Yes") - if(template.annihilate && tgui_alert(usr,"This template is set to annihilate everything in the red square. EVERYTHING IN THE RED SQUARE WILL BE DELETED, ARE YOU ABSOLUTELY SURE?", "Template Confirm", list("No","Yes")) == "No") + if(template.annihilate && tgui_alert(usr,"This template is set to annihilate everything in the red square. EVERYTHING IN THE RED SQUARE WILL BE DELETED, ARE YOU ABSOLUTELY SURE?", "Template Confirm", list("No","Yes")) != "Yes") usr.client.images -= preview return @@ -57,7 +57,7 @@ orientation = dir2angle(orientation) if((!(orientation%180) && template.width > world.maxx || template.height > world.maxy) || (orientation%180 && template.width > world.maxy || template.height > world.maxx)) - if(tgui_alert(usr,"This template is larger than the existing z-levels. It will EXPAND ALL Z-LEVELS to match the size of the template. This may cause chaos. Are you sure you want to do this?","DANGER!!!",list("Cancel","Yes")) == "Cancel") + if(tgui_alert(usr,"This template is larger than the existing z-levels. It will EXPAND ALL Z-LEVELS to match the size of the template. This may cause chaos. Are you sure you want to do this?","DANGER!!!",list("Cancel","Yes")) != "Yes") to_chat(usr,"Template placement aborted.") return diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 7f80ca3177..b824aa38b5 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -30,6 +30,8 @@ var/list/sounds_cache = list() sounds_cache += S var/res = tgui_alert(usr, "Show the title of this song ([S]) to the players?\nOptions 'Yes' and 'No' will play the sound.",, list("Yes", "No", "Cancel")) + if(!res) + return switch(res) if("Yes") to_chat(world, "An admin played: [S]", confidential = TRUE) @@ -83,7 +85,7 @@ var/list/sounds_cache = list() sounds_cache += S - if(tgui_alert(usr, "Do you ready?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request", list("Play","Cancel")) == "Cancel") + if(tgui_alert(usr, "Do you ready?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request", list("Play","Cancel")) != "Play") return log_admin("[key_name(src)] played sound [S] on Z[target_z]") diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 6768210055..1e661a354f 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -52,7 +52,8 @@ return var/age = tgui_alert(src, "Age check", "Show accounts yonger then _____ days", list("7","30","All")) - + if(!age) + return if(age == "All") age = 9999999 else @@ -236,6 +237,8 @@ message_admins("[key_name_admin(src)] has added a random AI law.", 1) var/show_log = tgui_alert(src, "Show ion message?", "Message", list("Yes", "No")) + if(!show_log) + return if(show_log == "Yes") command_announcement.Announce("Ion storm detected near \the [station_name()]. Please check all AI-controlled equipment for errors.", "Anomaly Alert", new_sound = 'sound/AI/ionstorm.ogg') @@ -286,7 +289,7 @@ Ccomp's first proc. if(GLOB.respawn_timers[target] == -1) // Their respawn timer is set to -1, which is 'not allowed to respawn' var/response = tgui_alert(src, "Are you sure you wish to allow this individual to respawn? They would normally not be able to.","Allow impossible respawn?",list("No","Yes")) - if(response == "No") + if(response != "Yes") return GLOB.respawn_timers -= target @@ -401,7 +404,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/announce = tgui_alert(src,"Announce as if they had just arrived?", "Announce", list("No", "Yes", "Cancel")) - if(announce == "Cancel") + if(!announce || announce == "Cancel") return else if(announce == "Yes") //Too bad buttons can't just have 1/0 values and different display strings announce = 1 @@ -409,7 +412,7 @@ Traitors and the like can also be revived with the previous role mostly intact. announce = 0 var/inhabit = tgui_alert(src,"Put the person into the spawned mob?", "Inhabit", list("Yes", "No", "Cancel")) - if(inhabit == "Cancel") + if(!inhabit || inhabit == "Cancel") return else if(inhabit == "Yes") inhabit = 1 @@ -425,13 +428,15 @@ Traitors and the like can also be revived with the previous role mostly intact. //Found their record, they were spawned previously if(record_found) var/samejob = tgui_alert(src,"Found [picked_client.prefs.real_name] in data core. They were [record_found.fields["real_rank"]] this round. Assign same job? They will not be re-added to the manifest/records, either way.","Previously spawned",list("Yes","Assistant","No")) + if(!samejob) + return if(samejob == "Yes") charjob = record_found.fields["real_rank"] else if(samejob == USELESS_JOB) //VOREStation Edit - Visitor not Assistant charjob = USELESS_JOB //VOREStation Edit - Visitor not Assistant else records = tgui_alert(src,"No data core entry detected. Would you like add them to the manifest, and sec/med/HR records?","Records",list("No", "Yes", "Cancel")) - if(records == "Cancel") + if(!records || records == "Cancel") return if(records == "Yes") records = 1 @@ -450,7 +455,7 @@ Traitors and the like can also be revived with the previous role mostly intact. var/equipment if(charjob) equipment = tgui_alert(src,"Spawn them with equipment?", "Equipment", list("Yes", "No", "Cancel")) - if(equipment == "Cancel") + if(!equipment || equipment == "Cancel") return else if(equipment == "Yes") equipment = 1 @@ -478,7 +483,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return if(showy == "Drop Pod") showy = tgui_alert(src,"Destructive drop pods cause damage in a 3x3 and may break turfs. Polite drop pods lightly damage the turfs but won't break through.", "Drop Pod", list("Polite", "Destructive", "Cancel")) // reusing var - if(showy == "Cancel") + if(!showy || showy == "Cancel") return if("Arrivals") //Spawn them at a latejoin spawnpoint @@ -706,7 +711,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if ((devastation != -1) || (heavy != -1) || (light != -1) || (flash != -1)) if ((devastation > 20) || (heavy > 20) || (light > 20)) - if (tgui_alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", list("Yes", "No")) == "No") + if (tgui_alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", list("Yes", "No")) != "Yes") return explosion(O, devastation, heavy, light, flash) @@ -772,6 +777,8 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/confirm = tgui_alert(src, "You sure?", "Confirm", list("Yes", "No")) + if(!confirm) + return if(confirm == "Yes") if (istype(mob, /mob/observer/dead)) // so they don't spam gibs everywhere return @@ -1000,7 +1007,7 @@ Traitors and the like can also be revived with the previous role mostly intact. var/notifyplayers = tgui_alert(src, "Do you want to notify the players?", "Options", list("Yes", "No", "Cancel")) - if(notifyplayers == "Cancel") + if(!notifyplayers || notifyplayers == "Cancel") return log_admin("Admin [key_name(src)] has forced the players to have random appearances.") @@ -1045,7 +1052,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/confirm = tgui_alert(usr, "Are you sure you want to cryo [M]?","Confirmation",list("No","Yes")) - if(confirm == "No") + if(confirm != "Yes") return var/list/human_cryopods = list() @@ -1121,10 +1128,10 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/podtype = tgui_alert(src,"Destructive drop pods cause damage in a 3x3 and may break turfs. Polite drop pods lightly damage the turfs but won't break through.", "Drop Pod", list("Polite", "Destructive", "Cancel")) - if(podtype == "Cancel") + if(!podtype || podtype == "Cancel") return var/autoopen = tgui_alert(src,"Should the pod open automatically?", "Drop Pod", list("Yes", "No", "Cancel")) - if(autoopen == "Cancel") + if(!autoopen || autoopen == "Cancel") return switch(podtype) if("Destructive") @@ -1149,10 +1156,10 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/podtype = tgui_alert(src,"Destructive drop pods cause damage in a 3x3 and may break turfs. Polite drop pods lightly damage the turfs but won't break through.", "Drop Pod", list("Polite", "Destructive", "Cancel")) - if(podtype == "Cancel") + if(!podtype || podtype == "Cancel") return var/autoopen = tgui_alert(src,"Should the pod open automatically?", "Drop Pod", list("Yes", "No", "Cancel")) - if(autoopen == "Cancel") + if(!autoopen || autoopen == "Cancel") return if(!L || QDELETED(L)) return diff --git a/code/modules/admin/verbs/randomverbs_vr.dm b/code/modules/admin/verbs/randomverbs_vr.dm index 5609c366f7..5236172355 100644 --- a/code/modules/admin/verbs/randomverbs_vr.dm +++ b/code/modules/admin/verbs/randomverbs_vr.dm @@ -29,13 +29,13 @@ var/char_name = tgui_alert(src, "Spawn mob with their character name?", "Mob name", list("Yes", "No", "Cancel")) var/name = 0 - if(char_name == "Cancel") + if(!char_name || char_name == "Cancel") return if(char_name == "Yes") name = 1 var/vorgans = tgui_alert(src, "Spawn mob with their character's vore organs and prefs?", "Vore organs", list("Yes", "No", "Cancel")) var/organs - if(vorgans == "Cancel") + if(!vorgans || vorgans == "Cancel") return if(vorgans == "Yes") organs = 1 diff --git a/code/modules/admin/verbs/smite.dm b/code/modules/admin/verbs/smite.dm index f2de5cac4d..d3086c9bb4 100644 --- a/code/modules/admin/verbs/smite.dm +++ b/code/modules/admin/verbs/smite.dm @@ -105,7 +105,7 @@ kin_type = kin_types[kin_type] var/myself = tgui_alert(usr, "Control the shadekin yourself or delete pred and prey after?","Control Shadekin?",list("Control","Cancel","Delete")) - if(myself == "Cancel" || !target) + if(!myself || myself == "Cancel" || !target) return var/turf/Tt = get_turf(target) diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index b483c9c7b1..fb23a42fe6 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -45,7 +45,7 @@ var/const/commandos_possible = 6 //if more Commandos are needed in the future while(!choice) choice = sanitize(tgui_input_text(src, "Please specify which mission the strike team shall undertake.", "Specify Mission", "")) if(!choice) - if(tgui_alert(usr, "Error, no mission set. Do you want to exit the setup process?","Strike Team",list("Yes","No"))=="Yes") + if(tgui_alert(usr, "Error, no mission set. Do you want to exit the setup process?","Strike Team",list("Yes","No"))!="No") return consider_ert_load() //VOREStation Add diff --git a/code/modules/admin/view_variables/mass_edit_variables.dm b/code/modules/admin/view_variables/mass_edit_variables.dm index adec98ef66..43782c1202 100644 --- a/code/modules/admin/view_variables/mass_edit_variables.dm +++ b/code/modules/admin/view_variables/mass_edit_variables.dm @@ -116,6 +116,8 @@ var/unique if (varsvars && varsvars.len) unique = tgui_alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", list("Unique", "Same")) + if(!unique) + return if(unique == "Unique") unique = TRUE else @@ -143,7 +145,7 @@ if (VV_NEW_TYPE) var/many = tgui_alert(src, "Create only one [value["type"]] and assign each or a new one for each thing", "How Many", list("One", "Many", "Cancel")) - if (many == "Cancel") + if (!many || many == "Cancel") return if (many == "Many") many = TRUE diff --git a/code/modules/admin/view_variables/modify_variables.dm b/code/modules/admin/view_variables/modify_variables.dm index 8863e76533..eb840d7ea5 100644 --- a/code/modules/admin/view_variables/modify_variables.dm +++ b/code/modules/admin/view_variables/modify_variables.dm @@ -181,7 +181,7 @@ GLOBAL_PROTECT(VVpixelmovement) var/assoc = 0 if(IS_VALID_ASSOC_KEY(L[index])) var/prompt = tgui_alert(src, "Do you want to edit the key or its assigned value?", "Associated List", list("Key", "Assigned Value", "Cancel")) - if (prompt == "Cancel") + if (!prompt || prompt == "Cancel") return if (prompt == "Assigned Value") assoc = 1 @@ -194,7 +194,7 @@ GLOBAL_PROTECT(VVpixelmovement) else variable = L[index] //EXPERIMENTAL - Keep old associated value while modifying key, if any - if(IS_VALID_ASSOC_KEY(variable)) + if(IS_VALID_ASSOC_KEY(variable)) var/found = L[variable] if(!isnull(found)) old_assoc_value = found diff --git a/code/modules/casino/casino.dm b/code/modules/casino/casino.dm index f029155a1e..393b18a49e 100644 --- a/code/modules/casino/casino.dm +++ b/code/modules/casino/casino.dm @@ -615,6 +615,8 @@ if(confirm == "Yes") to_chat(user, "You are now a prize!") //CHOMPAdd Start + if(!confirm) + return if(confirm == "No") to_chat(user, "The SPASM beeps in a sad manner at your impolite decline..") return diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 355a49f190..a0da720fde 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -983,7 +983,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O else if(href_list["marking_color"]) var/M = href_list["marking_color"] if (isnull(pref.body_markings[M]["color"])) - if (tgui_alert(user, "You currently have customized marking colors. This will reset each bodypart's color. Are you sure you want to continue?","Reset Bodypart Colors",list("Yes","No")) == "No") + if (tgui_alert(user, "You currently have customized marking colors. This will reset each bodypart's color. Are you sure you want to continue?","Reset Bodypart Colors",list("Yes","No")) != "Yes") return TOPIC_NOACTION var/mark_color = input(user, "Choose the [M] color: ", "Character Preference", pref.body_markings[M]["color"]) as color|null if(mark_color && CanUseTopic(user)) diff --git a/code/modules/client/preference_setup/vore/02_size.dm b/code/modules/client/preference_setup/vore/02_size.dm index 6d9be14744..8d835b263e 100644 --- a/code/modules/client/preference_setup/vore/02_size.dm +++ b/code/modules/client/preference_setup/vore/02_size.dm @@ -176,6 +176,8 @@ ([WEIGHT_MIN]-[WEIGHT_MAX])", "Character Preference", null, WEIGHT_MAX, WEIGHT_MIN, round_value=FALSE) if(new_weight) var/unit_of_measurement = tgui_alert(user, "Is that number in pounds (lb) or kilograms (kg)?", "Confirmation", list("Pounds", "Kilograms")) + if(!unit_of_measurement) + return TOPIC_NOACTION if(unit_of_measurement == "Pounds") new_weight = round(text2num(new_weight),4) if(unit_of_measurement == "Kilograms") diff --git a/code/modules/client/preference_setup/vore/07_traits.dm b/code/modules/client/preference_setup/vore/07_traits.dm index 39ef6a6c3a..eabb0b52b1 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -590,7 +590,7 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s if(trait_choice in nicelist) var/datum/trait/path = nicelist[trait_choice] var/choice = tgui_alert(user, "\[Cost:[initial(path.cost)]\] [initial(path.desc)]",initial(path.name), list("Take Trait","Go Back")) //ChompEDIT - usr removal - if(choice != "Go Back") + if(choice == "Take Trait") done = TRUE if(!trait_choice) diff --git a/code/modules/clothing/spacesuits/rig/modules/ninja.dm b/code/modules/clothing/spacesuits/rig/modules/ninja.dm index 8980213480..35b14616df 100644 --- a/code/modules/clothing/spacesuits/rig/modules/ninja.dm +++ b/code/modules/clothing/spacesuits/rig/modules/ninja.dm @@ -209,7 +209,7 @@ engage(1) /obj/item/rig_module/self_destruct/engage(var/skip_check) - if(!skip_check && usr && tgui_alert(usr, "Are you sure you want to push that button?", "Self-destruct", list("No", "Yes")) == "No") + if(!skip_check && usr && tgui_alert(usr, "Are you sure you want to push that button?", "Self-destruct", list("No", "Yes")) != "Yes") return if(holder && holder.wearer) smoke.set_up(10, 0, holder.loc) diff --git a/code/modules/clothing/spacesuits/rig/modules/specific/self_destruct.dm b/code/modules/clothing/spacesuits/rig/modules/specific/self_destruct.dm index 861d6528d9..e2295f3102 100644 --- a/code/modules/clothing/spacesuits/rig/modules/specific/self_destruct.dm +++ b/code/modules/clothing/spacesuits/rig/modules/specific/self_destruct.dm @@ -41,7 +41,7 @@ engage(1) /obj/item/rig_module/self_destruct/engage(var/skip_check) - if(!skip_check && usr && tgui_alert(usr, "Are you sure you want to push that button?", "Self-destruct", list("No", "Yes")) == "No") + if(!skip_check && usr && tgui_alert(usr, "Are you sure you want to push that button?", "Self-destruct", list("No", "Yes")) != "Yes") return if(holder && holder.wearer) smoke.set_up(10, 0, holder.loc) diff --git a/code/modules/emotes/emote_mob.dm b/code/modules/emotes/emote_mob.dm index 8120b7cc3b..c8e18b217e 100644 --- a/code/modules/emotes/emote_mob.dm +++ b/code/modules/emotes/emote_mob.dm @@ -61,7 +61,7 @@ if(!message) return if (!m_type) - if(tgui_alert(src, "Is this an audible emote?", "Emote", list("Yes", "No")) == "No") + if(tgui_alert(src, "Is this an audible emote?", "Emote", list("Yes", "No")) != "Yes") m_type = VISIBLE_MESSAGE else m_type = AUDIBLE_MESSAGE diff --git a/code/modules/eventkit/generic_objects/generic_item.dm b/code/modules/eventkit/generic_objects/generic_item.dm index 041f809b4c..0805539952 100644 --- a/code/modules/eventkit/generic_objects/generic_item.dm +++ b/code/modules/eventkit/generic_objects/generic_item.dm @@ -180,7 +180,7 @@ if(s_icon_state_off == "Upload Own Sprite") s_icon = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file var/check_activatable = tgui_alert(src, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel")) - if(check_activatable == "Cancel") + if(!check_activatable || check_activatable == "Cancel") return if(check_activatable == "No") s_activatable = 0 @@ -188,7 +188,7 @@ s_activatable = 1 s_text_activated = tgui_input_text(src, "Activation text:", "Activation Text") check_togglable = tgui_alert(src, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel")) - if(check_togglable == "Cancel") + if(!check_togglable || check_togglable == "Cancel") return if(check_togglable == "No") s_togglable = 0 @@ -200,7 +200,7 @@ s_icon2 = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file s_delay = tgui_input_number(src, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay") var/check_effect = tgui_alert(src, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Cancel")) - if(check_effect == "Cancel") + if(!check_effect || check_effect == "Cancel") return if(check_effect == "No") s_effect = 0 @@ -214,7 +214,7 @@ s_effect = 4 s_object = get_path_from_partial_text() var/check_sound = tgui_alert(src, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel")) - if(check_sound == "Cancel") + if(!check_sound || check_sound == "Cancel") return if(check_sound == "Yes") s_sound = tgui_input_list(src, "Choose a sound to play on activation:", "Sound", sound_options) diff --git a/code/modules/eventkit/generic_objects/generic_structure.dm b/code/modules/eventkit/generic_objects/generic_structure.dm index f87e605082..cc84ecb019 100644 --- a/code/modules/eventkit/generic_objects/generic_structure.dm +++ b/code/modules/eventkit/generic_objects/generic_structure.dm @@ -225,21 +225,21 @@ var/s_name = tgui_input_text(src, "Structure Name:", "Name") var/s_desc = tgui_input_text(src, "Structure Description:", "Description") var/check_anchored = tgui_alert(src, "Start anchored?", "anchored", list("Yes", "No", "Cancel")) - if(check_anchored == "Cancel") + if(!check_anchored || check_anchored == "Cancel") return if(check_anchored == "No") s_anchored = 0 if(check_anchored == "Yes") s_anchored = 1 var/check_density = tgui_alert(src, "Start dense?", "density", list("Yes", "No", "Cancel")) - if(check_density == "Cancel") + if(!check_density || check_density == "Cancel") return if(check_density == "No") s_density = 0 if(check_density == "Yes") s_density = 1 var/check_wrenchable = tgui_alert(src, "Allow it to be fastened and unfastened with a wrench?", "wrenchable", list("Yes", "No", "Cancel")) - if(check_wrenchable == "Cancel") + if(!check_wrenchable || check_wrenchable == "Cancel") return if(check_wrenchable == "No") s_wrenchable = 0 @@ -249,7 +249,7 @@ if(s_icon_state_off == "Upload Own Sprite") s_icon = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file var/check_activatable = tgui_alert(src, "Allow it to be turned on?", "activatable", list("Yes", "No", "Cancel")) - if(check_activatable == "Cancel") + if(!check_activatable || check_activatable == "Cancel") return if(check_activatable == "No") s_activatable = 0 @@ -257,7 +257,7 @@ s_activatable = 1 s_text_activated = tgui_input_text(src, "Activation text:", "Activation Text") check_togglable = tgui_alert(src, "Allow it to be turned back off again?", "togglable", list("Yes", "No", "Cancel")) - if(check_togglable == "Cancel") + if(!check_togglable || check_togglable == "Cancel") return if(check_togglable == "No") s_togglable = 0 @@ -269,7 +269,7 @@ s_icon2 = input(usr, "Choose an image file to upload. Images that are not 32x32 will need to have their positions offset.","Upload Icon") as null|file s_delay = tgui_input_number(src, "Do you want it to take time to put turn on? Choose a number of deciseconds to activate, or 0 for instant.", "Delay") var/check_effect = tgui_alert(src, "Produce an effect on activation?", "Effect?", list("No", "Spark", "Flicker Lights", "Flash", "Spawn Item", "Cancel")) - if(check_effect == "Cancel") + if(!check_effect || check_effect == "Cancel") return if(check_effect == "No") s_effect = 0 @@ -283,7 +283,7 @@ s_effect = 4 s_object = get_path_from_partial_text() var/check_sound = tgui_alert(src, "Play a sound when turning on?", "Sound", list("Yes", "No", "Cancel")) - if(check_sound == "Cancel") + if(!check_sound || check_sound == "Cancel") return if(check_sound == "Yes") s_sound = tgui_input_list(src, "Choose a sound to play on activation:", "Sound", sound_options) @@ -335,4 +335,4 @@ result = matches[1] else result = tgui_input_list(usr, "Select an atom type", "Spawn Atom", matches, strict_modern = TRUE) - return result \ No newline at end of file + return result diff --git a/code/modules/eventkit/gm_interfaces/fake_pda_conversations.dm b/code/modules/eventkit/gm_interfaces/fake_pda_conversations.dm index 5d74fc89f2..63ca4458de 100644 --- a/code/modules/eventkit/gm_interfaces/fake_pda_conversations.dm +++ b/code/modules/eventkit/gm_interfaces/fake_pda_conversations.dm @@ -73,7 +73,7 @@ Invoked by vv topic "fakepdapropconvo" in code\modules\admin\view_variables\topi return var/choice = tgui_alert(M,"Use TGUI or dialogue boxes?", "TGUI?", list("TGUI", "Dialogue", "Cancel")) - if(choice == "Cancel") return + if(!choice || choice == "Cancel") return var/datum/data/pda/app/messenger/ourPDA = find_program(/datum/data/pda/app/messenger) @@ -88,7 +88,10 @@ Invoked by vv topic "fakepdapropconvo" in code\modules\admin\view_variables\topi var/message = sanitize(tgui_input_text(M, "Input fake message. Leave empty to cancel. Can create up to 30 messages in a row",null), MAX_MESSAGE_LEN) if(!message) return - var/receipent = ((tgui_alert(M, "Received or Sent?", "Direction", list("Received", "Sent"))=="Sent") ? 1 : 0) + var/input = tgui_alert(M, "Received or Sent?", "Direction", list("Received", "Sent")) + if(!input) + return + var/receipent = ((input=="Sent") ? 1 : 0) ourPDA.createFakeMessage(name,identity,job,receipent, message) if(choice == "TGUI") diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index a3be0c5aa4..c4d8277fc8 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -346,7 +346,7 @@ if (W.w_class >= src.w_class || is_robot_module(W) || istype(W, /obj/item/weapon/holder)) return - if(tgui_alert(user,"You can't slice \the [src] here. Would you like to hide \the [W] inside it instead?","No Cutting Surface!",list("Yes","No")) == "No") + if(tgui_alert(user,"You can't slice \the [src] here. Would you like to hide \the [W] inside it instead?","No Cutting Surface!",list("Yes","No")) != "Yes") to_chat(user, "You cannot slice \the [src] here! You need a table or at least a tray to do it.") balloon_alert(user, "You cannot slice \the [src] here! You need a table or at least a tray to do it.") // CHOMPEdit return diff --git a/code/modules/instruments/songs/editor.dm b/code/modules/instruments/songs/editor.dm index 2927b0ddba..7069cbbadb 100644 --- a/code/modules/instruments/songs/editor.dm +++ b/code/modules/instruments/songs/editor.dm @@ -136,7 +136,7 @@ if(length_char(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS) var/cont = tgui_alert(usr, "Your message is too long! Would you like to continue editing it?", "Too long!", list("Yes", "No")) - if(cont == "No") + if(cont != "Yes") break while(length_char(t) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS) ParseSong(t) diff --git a/code/modules/mentor/mentor.dm b/code/modules/mentor/mentor.dm index 8301c986ea..5f9e2e13fd 100644 --- a/code/modules/mentor/mentor.dm +++ b/code/modules/mentor/mentor.dm @@ -181,6 +181,8 @@ var/list/mentor_verbs_default = list( set hidden = 1 var/mhelp = tgui_alert(usr, "Select the help you need.","Request for Help",list("Adminhelp","Mentorhelp")) == "Mentorhelp" + if(!mhelp) + return var/msg = tgui_input_text(usr, "Input your request for help.", "Request for Help", multiline = TRUE) if (mhelp) diff --git a/code/modules/mentor/mentorhelp.dm b/code/modules/mentor/mentorhelp.dm index 524bdbd898..54c8009818 100644 --- a/code/modules/mentor/mentorhelp.dm +++ b/code/modules/mentor/mentorhelp.dm @@ -448,7 +448,7 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new) spawn(1200) add_verb(src,/client/verb/mentorhelp ) // 2 minute cd to prevent abusing this to spam admins. //CHOMPEdit return - else if(choice == "Cancel") + else if(!choice || choice == "Cancel") return @@ -460,7 +460,10 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new) feedback_add_details("admin_verb","Mentorhelp") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! if(current_mentorhelp) - if(tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) != "No") + var/input = tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) + if(!input) + return + if(input == "Yes") if(current_mentorhelp) log_admin("Mentorhelp: [key_name(src)]: [msg]") current_mentorhelp.MessageNoRecipient(msg) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 5f5ac3c912..de6f1d643d 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -334,7 +334,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return if(CONFIG_GET(flag/antag_hud_restricted) && !has_enabled_antagHUD && !client.holder) // CHOMPEdit var/response = tgui_alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?",list("Yes","No")) - if(response == "No") return + if(response != "Yes") return can_reenter_corpse = FALSE set_respawn_timer(-1) // Foreeeever if(!has_enabled_antagHUD && !client.holder) @@ -1002,7 +1002,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp ghost_sprite = possible_ghost_sprites[choice] - if(finalized == "No") + if(!finalized || finalized == "No") icon_state = previous_state /mob/observer/dead/is_blind() @@ -1029,6 +1029,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(usr.client.prefs?.be_special & BE_PAI) var/choice = tgui_alert(usr, "Would you like to submit yourself to the recruitment list too?", "Confirmation", list("No", "Yes")) + if(!choice) + return if(choice == "Yes") paiController.recruitWindow(usr) var/count = 0 diff --git a/code/modules/mob/dead/observer/observer_vr.dm b/code/modules/mob/dead/observer/observer_vr.dm index beda07f263..53c9c169a8 100644 --- a/code/modules/mob/dead/observer/observer_vr.dm +++ b/code/modules/mob/dead/observer/observer_vr.dm @@ -38,7 +38,7 @@ sleep(15) //So if they are typing they get interrupted by sound and message, and don't type over the box var/response = tgui_alert(H,"[src] ([src.key]) wants to join into your Soulcatcher.","Soulcatcher Request",list("Deny","Allow")) - if(response == "Deny") + if(!response || response == "Deny") to_chat(src,"[H] denied your request.") return diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index 9b0acfaf54..4578c7a784 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -20,7 +20,7 @@ usr.visible_message(SPAN_NOTICE("\The [usr] holds out \the [I] to \the [target]."), SPAN_NOTICE("You hold out \the [I] to \the [target], waiting for them to accept it.")) - if(tgui_alert(target,"[src] wants to give you \a [I]. Will you accept it?","Item Offer",list("Yes","No")) == "No") + if(tgui_alert(target,"[src] wants to give you \a [I]. Will you accept it?","Item Offer",list("Yes","No")) != "Yes") target.visible_message(SPAN_NOTICE("\The [src] tried to hand \the [I] to \the [target], but \the [target] didn't want it.")) return diff --git a/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm b/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm index 5052e13912..81d36165be 100644 --- a/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm +++ b/code/modules/mob/living/carbon/human/species/lleill/lleill_abilities.dm @@ -178,7 +178,7 @@ to_chat(src,"You can't do that when restrained.") var/r_action = tgui_alert(src, "What would you like to do with your rings? You currently have [LL.lleill_energy] energy remaining.", "Actions", list("Spawn New Ring ([energy_cost_spawn])", "Teleport to Ring ([energy_cost_tele])", "Cancel")) - if(r_action == "Cancel") + if(!r_action || r_action == "Cancel") return if(findtext(r_action,"Spawn New Ring")) if(LL.lleill_energy < energy_cost_spawn) @@ -286,7 +286,7 @@ if(get_dist(src,chosen_target) > 1) to_chat(src, "You need to be standing next to [chosen_target].") return - if(accepted == "No") + if(!accepted || accepted == "No") to_chat(src, "\The [chosen_target] refuses the contact.") return if(accepted == "Yes") diff --git a/code/modules/mob/living/carbon/human/species/lleill/lleill_items.dm b/code/modules/mob/living/carbon/human/species/lleill/lleill_items.dm index 2a1603e8b8..9f4c9afa8a 100644 --- a/code/modules/mob/living/carbon/human/species/lleill/lleill_items.dm +++ b/code/modules/mob/living/carbon/human/species/lleill/lleill_items.dm @@ -156,7 +156,7 @@ if(homunculus) var/mob/living/simple_mob/homunculus/H = homunculus var/h_action = tgui_alert(user, "What would you like to do with your homunculus?", "Actions", list("Recall", "Speak Through", "Cancel")) - if(h_action == "Cancel") + if(!h_action || h_action == "Cancel") return if(h_action == "Recall") H.visible_message("\The [H] returns to the face.") @@ -244,7 +244,7 @@ else m_action= tgui_alert(M, "Do you want to destroy the ring, the owner of it may be aware that you have done this?", "Destroy ring", list("Yes", "No")) - if(m_action == "No") + if(!m_action || m_action == "No") return if(m_action == "Yes") @@ -287,4 +287,4 @@ icon_state = "pocket" //Glamour Floor -//Glamour Wall \ No newline at end of file +//Glamour Wall diff --git a/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm new file mode 100644 index 0000000000..6b8485c5d5 --- /dev/null +++ b/code/modules/mob/living/carbon/human/species/station/protean_vr/protean_powers.dm @@ -0,0 +1,407 @@ +#define PER_LIMB_STEEL_COST SHEET_MATERIAL_AMOUNT +//// +// One-part Refactor +//// +/mob/living/carbon/human/proc/nano_partswap() + set name = "Ref - Single Limb" + set desc = "Allows you to replace and reshape your limbs as you see fit." + set category = "Abilities" + set hidden = TRUE + + if(stat) + to_chat(src,"You must be awake and standing to perform this action!") + return + + if(!isturf(loc)) + to_chat(src,"You need more space to perform this action!") + return + + var/obj/item/organ/internal/nano/refactory/refactory = nano_get_refactory() + //Missing the organ that does this + if(!istype(refactory)) + to_chat(src,"You don't have a working refactory module!") + return + + var/choice = tgui_input_list(src,"Pick the bodypart to change:", "Refactor - One Bodypart", species.has_limbs) + if(!choice) + return + + //Organ is missing, needs restoring + if(!organs_by_name[choice] || istype(organs_by_name[choice], /obj/item/organ/external/stump)) //allows limb stumps to regenerate like removed limbs. + if(refactory.get_stored_material(MAT_STEEL) < PER_LIMB_STEEL_COST) + to_chat(src,"You're missing that limb, and need to store at least [PER_LIMB_STEEL_COST] steel to regenerate it.") + return + var/regen = tgui_alert(src,"That limb is missing, do you want to regenerate it in exchange for [PER_LIMB_STEEL_COST] steel?","Regenerate limb?",list("Yes","No")) + if(regen != "Yes") + return + if(!refactory.use_stored_material(MAT_STEEL,PER_LIMB_STEEL_COST)) + return + if(organs_by_name[choice]) + var/obj/item/organ/external/oldlimb = organs_by_name[choice] + oldlimb.removed() + qdel(oldlimb) + + var/mob/living/simple_mob/protean_blob/blob = nano_intoblob() + active_regen = TRUE + if(do_after(blob,5 SECONDS)) + var/list/limblist = species.has_limbs[choice] + var/limbpath = limblist["path"] + var/obj/item/organ/external/new_eo = new limbpath(src) + organs_by_name[choice] = new_eo + new_eo.robotize(synthetic ? synthetic.company : null) //Use the base we started with + new_eo.sync_colour_to_human(src) + regenerate_icons() + active_regen = FALSE + nano_outofblob(blob) + return + + //Organ exists, let's reshape it + var/list/usable_manufacturers = list() + for(var/company in chargen_robolimbs) + var/datum/robolimb/M = chargen_robolimbs[company] + if(!(choice in M.parts)) + continue + if(species?.base_species in M.species_cannot_use) + continue + if(M.whitelisted_to && !(ckey in M.whitelisted_to)) + continue + usable_manufacturers[company] = M + if(!usable_manufacturers.len) + return + var/manu_choice = tgui_input_list(src, "Which manufacturer do you wish to mimic for this limb?", "Manufacturer for [choice]", usable_manufacturers) + + if(!manu_choice) + return //Changed mind + + var/obj/item/organ/external/eo = organs_by_name[choice] + if(!eo) + return //Lost it meanwhile + + eo.robotize(manu_choice) + visible_message("[src]'s [choice] loses its shape, then reforms.") + update_icons_body() + +//// +// Full Refactor +//// +/mob/living/carbon/human/proc/nano_regenerate() //fixed the proc, it used to leave active_regen true. + set name = "Ref - Whole Body" + set desc = "Allows you to regrow limbs and replace organs, given you have enough materials." + set category = "Abilities" + set hidden = TRUE + + if(stat) + to_chat(src,"You must be awake and standing to perform this action!") + return + + if(!isturf(loc)) + to_chat(src,"You need more space to perform this action!") + return + + var/obj/item/organ/internal/nano/refactory/refactory = nano_get_refactory() + //Missing the organ that does this + if(!istype(refactory)) + to_chat(src,"You don't have a working refactory module!") + return + + //Already regenerating + if(active_regen) + to_chat(src, "You are already refactoring!") + return + + var/swap_not_rebuild = tgui_alert(src,"Do you want to rebuild, or reshape?","Rebuild or Reshape",list("Reshape","Cancel","Rebuild")) + if(!swap_not_rebuild || swap_not_rebuild == "Cancel") + return + if(swap_not_rebuild == "Reshape") + var/list/usable_manufacturers = list() + for(var/company in chargen_robolimbs) + var/datum/robolimb/M = chargen_robolimbs[company] + if(!(BP_TORSO in M.parts)) + continue + if(species?.base_species in M.species_cannot_use) + continue + if(M.whitelisted_to && !(ckey in M.whitelisted_to)) + continue + usable_manufacturers[company] = M + if(!usable_manufacturers.len) + return + var/manu_choice = tgui_input_list(src, "Which manufacturer do you wish to mimic?", "Manufacturer", usable_manufacturers) + + if(!manu_choice) + return //Changed mind + if(!organs_by_name[BP_TORSO]) + return //Ain't got a torso! + + var/obj/item/organ/external/torso = organs_by_name[BP_TORSO] + to_chat(src, "Remain still while the process takes place! It will take 5 seconds.") + visible_message("[src]'s form collapses into an amorphous blob of black ichor...") + + var/mob/living/simple_mob/protean_blob/blob = nano_intoblob() + active_regen = TRUE + if(do_after(blob,5 SECONDS)) + synthetic = usable_manufacturers[manu_choice] + torso.robotize(manu_choice) //Will cascade to all other organs. + regenerate_icons() + visible_message("[src]'s form reshapes into a new one...") + active_regen = FALSE + nano_outofblob(blob) + return + + //Not enough resources (AND spends the resources, should be the last check) + if(!refactory.use_stored_material(MAT_STEEL,refactory.max_storage)) + to_chat(src, "You need to be maxed out on normal metal to do this!") + return + + var/delay_length = round(active_regen_delay * species.active_regen_mult) + to_chat(src, "Remain still while the process takes place! It will take [delay_length/10] seconds.") + visible_message("[src]'s form begins to shift and ripple as if made of oil...") + active_regen = TRUE + + var/mob/living/simple_mob/protean_blob/blob = nano_intoblob() + if(do_after(blob, delay_length, null, 0)) + if(stat != DEAD && refactory) + var/list/holder = refactory.materials + species.create_organs(src) + var/obj/item/organ/external/torso = organs_by_name[BP_TORSO] + torso.robotize() //synthetic wasn't defined here. + LAZYCLEARLIST(blood_DNA) + LAZYCLEARLIST(feet_blood_DNA) + blood_color = null + feet_blood_color = null + regenerate_icons() //Probably worth it, yeah. + var/obj/item/organ/internal/nano/refactory/new_refactory = locate() in internal_organs + if(!new_refactory) + log_debug("[src] protean-regen'd but lacked a refactory when done.") + else + new_refactory.materials = holder + to_chat(src, "Your refactoring is complete.") //Guarantees the message shows no matter how bad the timing. + to_chat(blob, "Your refactoring is complete!") + else + to_chat(src, "Your refactoring has failed.") + to_chat(blob, "Your refactoring has failed!") + else + to_chat(src, "Your refactoring is interrupted.") + to_chat(blob, "Your refactoring is interrupted!") + active_regen = FALSE + nano_outofblob(blob) + + +//// +// Storing metal +//// +/mob/living/carbon/human/proc/nano_metalnom() + set name = "Ref - Store Metals" + set desc = "If you're holding a stack of material, you can consume some and store it for later." + set category = "Abilities" + set hidden = TRUE + + var/obj/item/organ/internal/nano/refactory/refactory = nano_get_refactory() + //Missing the organ that does this + if(!istype(refactory)) + to_chat(src,"You don't have a working refactory module!") + return + + var/held = get_active_hand() + if(!istype(held,/obj/item/stack/material)) + to_chat(src,"You aren't holding a stack of materials in your active hand...!") + return + + var/obj/item/stack/material/matstack = held + var/substance = matstack.material.name + var allowed = FALSE + for(var/material in PROTEAN_EDIBLE_MATERIALS) + if(material == substance) allowed = TRUE + if(!allowed) + to_chat(src,"You can't process [substance]!") + return //Only a few things matter, the rest are best not cluttering the lists. + + var/howmuch = tgui_input_number(src,"How much do you want to store? (0-[matstack.get_amount()])","Select amount",null,matstack.get_amount(),0) + if(!howmuch || matstack != get_active_hand() || howmuch > matstack.get_amount()) + return //Quietly fail + + var/actually_added = refactory.add_stored_material(substance,howmuch*matstack.perunit) + matstack.use(CEILING((actually_added/matstack.perunit), 1)) + if(actually_added && actually_added < howmuch) + to_chat(src,"Your refactory module is now full, so only [actually_added] units were stored.") + visible_message("[src] nibbles some of the [substance] right off the stack!") + else if(actually_added) + to_chat(src,"You store [actually_added] units of [substance].") + visible_message("[src] devours some of the [substance] right off the stack!") + else + to_chat(src,"You're completely capped out on [substance]!") + +//// +// Blob Form +//// +/mob/living/carbon/human/proc/nano_blobform() + set name = "Toggle Blobform" + set desc = "Switch between amorphous and humanoid forms." + set category = "Abilities" + set hidden = TRUE + + var/atom/movable/to_locate = temporary_form || src + if(!isturf(to_locate.loc)) + to_chat(to_locate,"You need more space to perform this action!") + return + + //Blob form + if(temporary_form) + if(health < maxHealth*0.5) + to_chat(temporary_form,"You need to regenerate more nanites first!") + else if(temporary_form.stat) + to_chat(temporary_form,"You can only do this while not stunned.") + else + nano_outofblob(temporary_form) + + //Human form + else if(stat) + to_chat(src,"You can only do this while not stunned.") + return + else + nano_intoblob() + +//// +// Change fitting +//// +/mob/living/carbon/human/proc/nano_change_fitting() + set name = "Change Species Fit" + set desc = "Tweak your shape to change what suits you fit into (and their sprites!)." + set category = "Abilities" + + if(stat) + to_chat(src,"You must be awake and standing to perform this action!") + return + + var/new_species = tgui_input_list(usr, "Please select a species to emulate.", "Shapeshifter Body", GLOB.playable_species) + if(new_species) + species?.base_species = new_species // Really though you better have a species + regenerate_icons() //Expensive, but we need to recrunch all the icons we're wearing + +//// +// Change size +//// +/mob/living/carbon/human/proc/nano_set_size() + set name = "Adjust Volume" + set category = "Abilities" + set hidden = TRUE + + var/mob/living/user = temporary_form || src + + var/obj/item/organ/internal/nano/refactory/refactory = nano_get_refactory() + //Missing the organ that does this + if(!istype(refactory)) + to_chat(user,"You don't have a working refactory module!") + return + + var/nagmessage = "Adjust your mass to be a size between 25 to 200% (or between 1 to 600% in dorms area). Up-sizing consumes metal, downsizing returns metal." + var/new_size = tgui_input_number(user, nagmessage, "Pick a Size", user.size_multiplier*100, 600, 1) + if(!new_size || !size_range_check(new_size)) + return + + var/size_factor = new_size/100 + + //Will be: -1.75 for 200->25, and 1.75 for 25->200 + var/sizediff = size_factor - user.size_multiplier + + //Negative if shrinking, positive if growing + //Will be (PLSC*2)*-1.75 to 1.75 + //For 2000 PLSC that's -7000 to 7000 + var/cost = (PER_LIMB_STEEL_COST*2)*sizediff + + //Sizing up + if(cost > 0) + if(refactory.use_stored_material(MAT_STEEL,cost)) + user.resize(size_factor, ignore_prefs = TRUE) + else + to_chat(user,"That size change would cost [cost] steel, which you don't have.") + //Sizing down (or not at all) + else if(cost <= 0) + cost = abs(cost) + var/actually_added = refactory.add_stored_material(MAT_STEEL,cost) + user.resize(size_factor, ignore_prefs = TRUE) + if(actually_added != cost) + to_chat(user,"Unfortunately, [cost-actually_added] steel was lost due to lack of storage space.") + + user.visible_message("Black mist swirls around [user] as they change size.") + +/// /// /// A helper to reuse +/mob/living/proc/nano_get_refactory(obj/item/organ/internal/nano/refactory/R) + if(istype(R)) + if(!(R.status & ORGAN_DEAD)) + return R + return + +/mob/living/simple_mob/protean_blob/nano_get_refactory() + if(refactory) + return ..(refactory) + if(humanform) + return humanform.nano_get_refactory() + +/mob/living/carbon/human/nano_get_refactory() + return ..(locate(/obj/item/organ/internal/nano/refactory) in internal_organs) + + + +/// /// /// Ability objects for stat panel +/obj/effect/protean_ability + name = "Activate" + desc = "" + icon = 'icons/mob/species/protean/protean_powers.dmi' + var/ability_name + var/to_call + +/obj/effect/protean_ability/proc/atom_button_text() + return src + +/obj/effect/protean_ability/Click(var/location, var/control, var/params) + var/list/clickprops = params2list(params) + var/opts = clickprops["shift"] + + if(opts) + to_chat(usr,"[ability_name] - [desc]") + else + //Humanform using it + if(ishuman(usr)) + do_ability(usr) + //Blobform using it + else + var/mob/living/simple_mob/protean_blob/blob = usr + do_ability(blob.humanform) + +/obj/effect/protean_ability/proc/do_ability(var/mob/living/L) + if(istype(L)) + call(L,to_call)() + return FALSE + +/// The actual abilities +/obj/effect/protean_ability/into_blob + ability_name = "Toggle Blobform" + desc = "Discard your shape entirely, changing to a low-energy blob that can fit into small spaces. You'll consume steel to repair yourself in this form." + icon_state = "blob" + to_call = /mob/living/carbon/human/proc/nano_blobform + +/obj/effect/protean_ability/change_volume + ability_name = "Change Volume" + desc = "Alter your size by consuming steel to produce additional nanites, or regain steel by reducing your size and reclaiming them." + icon_state = "volume" + to_call = /mob/living/carbon/human/proc/nano_set_size + +/obj/effect/protean_ability/reform_limb + ability_name = "Ref - Single Limb" + desc = "Rebuild or replace a single limb, assuming you have 2000 steel." + icon_state = "limb" + to_call = /mob/living/carbon/human/proc/nano_partswap + +/obj/effect/protean_ability/reform_body + ability_name = "Ref - Whole Body" + desc = "Rebuild your entire body into whatever design you want, assuming you have 10,000 metal." + icon_state = "body" + to_call = /mob/living/carbon/human/proc/nano_regenerate + +/obj/effect/protean_ability/metal_nom + ability_name = "Ref - Store Metals" + desc = "Store the metal you're holding. Your refactory can only store steel, and all other metals will be converted into nanites ASAP for various effects." + icon_state = "metal" + to_call = /mob/living/carbon/human/proc/nano_metalnom + +#undef PER_LIMB_STEEL_COST diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm index d3e9619009..7e992b87cb 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm @@ -1274,6 +1274,8 @@ return var/choice = tgui_alert(src, "Do you wish to change the color of your appendage, use it, or change its functionality?", "Selection List", list("Use it", "Color", "Functionality")) + if(!choice) + return if(choice == "Color") //Easy way to set color so we don't bloat up the menu with even more buttons. var/new_color = input(usr, "Choose a color to set your appendage to!", "", appendage_color) as color|null @@ -1282,6 +1284,8 @@ if(choice == "Functionality") //Easy way to set color so we don't bloat up the menu with even more buttons. var/choice2 = tgui_alert(usr, "Choose if you want to be pulled to the target or pull them to you!", "Functionality Setting", list("Pull target to self", "Pull self to target")) + if(!choice2) + return if(choice2 == "Pull target to self") appendage_alt_setting = 0 else @@ -1561,6 +1565,9 @@ var/choice = tgui_alert(src, "Do you wish to inject somebody, or adjust settings?", "Selection List", choices) + if(!choice) + return + if(choice == "Change reagent") var/reagent_choice = tgui_input_list(usr, "Choose which reagent to inject!", "Select reagent", trait_injection_reagents) if(reagent_choice) diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/traits_tutorial.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/traits_tutorial.dm index 3408032024..603f90184a 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/traits_tutorial.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/traits_tutorial.dm @@ -41,7 +41,7 @@ TGUI frontend path: tgui\packages\tgui\interfaces\TraitTutorial.tsx var/UI_choice = tgui_alert(src, "Would you like the tutorial text to be printed to chat?", "Choose preferred tutorial interface", list("TGUI","To Chat", "Cancel")) - if(UI_choice == "Cancel") + if(!UI_choice || UI_choice == "Cancel") return //Initializing associative lists diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e54fb13d81..90b2d6a936 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -122,7 +122,7 @@ else if(stat == DEAD) to_chat(src, span_blue("As much as you'd like, you can't die when already dead")) - else if(confirm1 == "No" || confirm2 == "No") + else if(!confirm1 || confirm1 == "No" || !confirm2 || confirm2 == "No") to_chat(src, span_blue("You chose to live another day.")) else to_chat(src, span_blue("You are not injured enough to succumb to death!")) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 0b959f7e52..b02b4140de 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -392,6 +392,9 @@ var/list/ai_verbs_default = list( var/confirm = tgui_alert(usr, "Are you sure you want to call the shuttle?", "Confirm Shuttle Call", list("Yes", "No")) + if(!confirm) + return + if(check_unable(AI_CHECK_WIRELESS)) return @@ -619,6 +622,9 @@ var/list/ai_verbs_default = list( if("Model") choice = tgui_alert(usr, "Would you like to select a hologram based on a (visible) crew member, switch to unique avatar, or load your character from your character slot?","Hologram Selection",list("Crew Member","Unique","My Character")) + if(!choice) + return + switch(choice) if("Crew Member") //A seeable crew member (or a dog) var/list/targets = trackable_mobs() diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 7a00db2e99..8978427b8d 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -511,7 +511,7 @@ if(radio) radio.recalculateChannels() return - if("Cancel") + if("Cancel", null) return else if (istype(W, /obj/item/weapon/card/id) && idaccessible == 0) to_chat(user, "[src] is not accepting access modifications at this time.") // CHOMPEDIT : purdev (spelling fix) diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm index 9b51753812..4fd32d3793 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_modules_vr.dm @@ -444,6 +444,8 @@ /obj/item/device/lightreplacer/dogborg/attack_self(mob/user)//Recharger refill is so last season. Now we recycle without magic! var/choice = tgui_alert(user, "Do you wish to check the reserves or change the color?", "Selection List", list("Reserves", "Color")) + if(!choice) + return if(choice == "Color") var/new_color = input(usr, "Choose a color to set the light to! (Default is [LIGHT_COLOR_INCANDESCENT_TUBE])", "", selected_color) as color|null if(new_color) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index a44aef526f..4c34bd7ac5 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -928,7 +928,7 @@ if(is_vore_predator(H) && H.devourable && src.feeding && src.devourable) var/switchy = tgui_alert(H, "Do you wish to eat [src] or feed yourself to them?", "Feed or Eat",list("Nevermind!", "Eat","Feed")) switch(switchy) - if("Nevermind!") + if("Nevermind!", null) return if("Eat") feed_grabbed_to_self(H, src) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 76c5f2156a..3793a80a10 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -390,7 +390,7 @@ // Final chance to abort "respawning" if(mind && timeofdeath) // They had spawned before var/choice = tgui_alert(usr, "Returning to the menu will prevent your character from being revived in-round. Are you sure?", "Confirmation", list("No, wait", "Yes, leave")) - if(choice == "No, wait") + if(!choice || choice == "No, wait") return else if(mind.assigned_role) var/extra_check = tgui_alert(usr, "Do you want to Quit This Round before you return to lobby?\ diff --git a/code/modules/modular_computers/file_system/programs/generic/file_browser.dm b/code/modules/modular_computers/file_system/programs/generic/file_browser.dm index 54e66497ea..72c2b73526 100644 --- a/code/modules/modular_computers/file_system/programs/generic/file_browser.dm +++ b/code/modules/modular_computers/file_system/programs/generic/file_browser.dm @@ -60,7 +60,7 @@ var/datum/computer_file/data/F = computer.find_file_by_uid(open_file) if(!F || !istype(F)) return - if(F.do_not_edit && (tgui_alert(usr, "WARNING: This file is not compatible with editor. Editing it may result in permanently corrupted formatting or damaged data consistency. Edit anyway?", "Incompatible File", list("No", "Yes")) == "No")) + if(F.do_not_edit && (tgui_alert(usr, "WARNING: This file is not compatible with editor. Editing it may result in permanently corrupted formatting or damaged data consistency. Edit anyway?", "Incompatible File", list("No", "Yes")) != "Yes")) return var/oldtext = html_decode(F.stored_data) diff --git a/code/modules/multiz/ladders.dm b/code/modules/multiz/ladders.dm index 0a01004d19..7fe7f1ded1 100644 --- a/code/modules/multiz/ladders.dm +++ b/code/modules/multiz/ladders.dm @@ -73,7 +73,7 @@ if(target_down && target_up) var/direction = tgui_alert(M,"Do you want to go up or down?", "Ladder", list("Up", "Down", "Cancel")) - if(direction == "Cancel") + if(!direction || direction == "Cancel") return if(!M.may_climb_ladders(src)) diff --git a/code/modules/multiz/movement_vr.dm b/code/modules/multiz/movement_vr.dm index ca6b12d4ac..2e03332bfb 100644 --- a/code/modules/multiz/movement_vr.dm +++ b/code/modules/multiz/movement_vr.dm @@ -138,13 +138,13 @@ if(!permit_human) var/sure = tgui_alert(H,"Are you sure you want to try without tools? It's VERY LIKELY \ you will fall and get hurt. More agile species might have better luck", "Second Thoughts", list("Bring it!", "Stay grounded")) - if(sure == "Stay grounded") return + if(sure || sure == "Stay grounded") return fall_chance = clamp(100 - H.species.agility, 40, 90) //This should be 80 for most species. Traceur would reduce to 10%, so clamping higher //If not a human mob, must be simple or silicon. They got a var stored on their mob we can check else if(!L.can_climb) var/sure = tgui_alert(L,"Are you sure you want to try without tools? It's VERY LIKELY \ you will fall and get hurt. More agile species might have better luck", "Second Thoughts", list("Bring it!", "Stay grounded")) - if(sure == "Stay grounded") return + if(!sure || sure == "Stay grounded") return if(isrobot(L)) fall_chance = 80 // Robots get no mercy else @@ -262,13 +262,13 @@ if(!permit_human) var/sure = tgui_alert(H,"Are you sure you want to try without tools? It's VERY LIKELY \ you will fall and get hurt. More agile species might have better luck", "Second Thoughts", list("Bring it!", "Stay grounded")) - if(sure == "Stay grounded") return + if(!sure || sure == "Stay grounded") return fall_chance = clamp(100 - H.species.agility, 40, 90) //This should be 80 for most species. Traceur would reduce to 10%, so clamping higher //If not a human mob, must be simple or silicon. They got a var stored on their mob we can check else if(!src.can_climb) var/sure = tgui_alert(src,"Are you sure you want to try without tools? It's VERY LIKELY \ you will fall and get hurt. More agile species might have better luck", "Second Thoughts", list("Bring it!", "Stay grounded")) - if(sure == "Stay grounded") return + if(!sure || sure == "Stay grounded") return if(isrobot(src)) fall_chance = 80 // Robots get no mercy else diff --git a/code/modules/paperwork/adminpaper.dm b/code/modules/paperwork/adminpaper.dm index c42756594a..1002207128 100644 --- a/code/modules/paperwork/adminpaper.dm +++ b/code/modules/paperwork/adminpaper.dm @@ -41,6 +41,8 @@ var/timehash = copytext(md5("[world.time]"),1,10) var/text = null var/logo = tgui_alert(usr, "Do you want the header of your fax to have a NanoTrasen, SolGov, or Trader logo?","Fax Logo",list("NanoTrasen","SolGov","Trader")) //VOREStation Add - Trader + if(!logo) + return if(logo == "SolGov") logo = "sglogo.png" //VOREStation Edit/Add diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 0a88edbeed..9c3cc5cd9d 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -283,7 +283,7 @@ Extracted to its own procedure for easier logic handling with paper bundles. var/choice = tgui_alert(usr, "[question_text] improve response time from staff when sending to discord. \ Renaming it changes its preview in staff chat.", \ "Default name detected", list("Change Title","Continue", "Cancel")) - if(choice == "Cancel") + if(!choice || choice == "Cancel") return TRUE else if(choice == "Change Title") var/new_name = tgui_input_text(usr, "Enter new fax title", "This will show up in the preview for staff chat on discord when sending \ diff --git a/code/modules/power/fusion/_setup.dm b/code/modules/power/fusion/_setup.dm index ca49070526..9438e9bf96 100644 --- a/code/modules/power/fusion/_setup.dm +++ b/code/modules/power/fusion/_setup.dm @@ -22,7 +22,7 @@ return var/response = tgui_alert(usr, "Are you sure?", "Engine setup", list("No", "Yes")) - if(!response || response == "No") + if(response != "Yes") return var/errors = 0 @@ -80,4 +80,4 @@ #undef SETUP_OK #undef SETUP_WARNING #undef SETUP_ERROR -#undef SETUP_DELAYED \ No newline at end of file +#undef SETUP_DELAYED diff --git a/code/modules/random_map/drop/droppod.dm b/code/modules/random_map/drop/droppod.dm index 5fb51edf03..26e327e6f7 100644 --- a/code/modules/random_map/drop/droppod.dm +++ b/code/modules/random_map/drop/droppod.dm @@ -163,7 +163,10 @@ if(!spawn_path) return - if(tgui_alert(usr, "Do you wish the mob to have a player?","Assign Player?",list("No","Yes")) == "No") + var/input = tgui_alert(usr, "Do you wish the mob to have a player?","Assign Player?",list("No","Yes")) + if(!input) + return + if(input == "No") var/spawn_count = tgui_input_number(usr, "How many mobs do you wish the pod to contain?", "Drop Pod Selection", null, min_value=1) if(spawn_count <= 0) return @@ -197,7 +200,7 @@ var/datum/antagonist/A = all_antag_types[antag_type] A.equip(spawned_mob) - if(tgui_alert(usr, "Are you SURE you wish to deploy this drop pod? It will cause a sizable explosion and gib anyone underneath it.","Danger!",list("No","Yes")) == "No") + if(tgui_alert(usr, "Are you SURE you wish to deploy this drop pod? It will cause a sizable explosion and gib anyone underneath it.","Danger!",list("No","Yes")) != "Yes") if(spawned_mob) qdel(spawned_mob) if(spawned_mobs.len) diff --git a/code/modules/random_map/drop/supply.dm b/code/modules/random_map/drop/supply.dm index bc3f82a852..c118fec37f 100644 --- a/code/modules/random_map/drop/supply.dm +++ b/code/modules/random_map/drop/supply.dm @@ -42,6 +42,8 @@ var/chosen_loot_type var/list/chosen_loot_types var/choice = tgui_alert(usr, "Do you wish to supply a custom loot list?","Supply Drop",list("No","Yes")) + if(!choice) + return if(choice == "Yes") chosen_loot_types = list() @@ -83,11 +85,13 @@ chosen_loot_types |= adding_loot_type else choice = tgui_alert(usr, "Do you wish to specify a loot type?","Supply Drop",list("No","Yes")) + if(!choice) + return if(choice == "Yes") chosen_loot_type = tgui_input_list(usr, "Select a loot type.", "Loot Selection", supply_drop_random_loot_types()) choice = tgui_alert(usr, "Are you SURE you wish to deploy this supply drop? It will cause a sizable explosion and gib anyone underneath it.","Supply Drop",list("No","Yes")) - if(choice == "No") + if(choice != "Yes") return log_admin("[key_name(usr)] dropped supplies at ([usr.x],[usr.y],[usr.z])") new /datum/random_map/droppod/supply(null, usr.x-2, usr.y-2, usr.z, supplied_drops = chosen_loot_types, supplied_drop = chosen_loot_type) diff --git a/code/modules/reagents/machinery/injector_maker.dm b/code/modules/reagents/machinery/injector_maker.dm index 3e83ec3e78..d18f5e3a14 100644 --- a/code/modules/reagents/machinery/injector_maker.dm +++ b/code/modules/reagents/machinery/injector_maker.dm @@ -239,7 +239,7 @@ amount_per_injector = CLAMP(beaker.reagents.total_volume / amount, 0, 15) if((size == "small injector" && amount_per_injector < 5) || size == "large injector" && amount_per_injector < 15) proceed = tgui_alert(usr, "Heads up! Less than max volume per injector!\n Making [amount] [size](s) filled with [amount_per_injector] total reagent volume each!","Proceed?",list("No","Yes")) - if(proceed == "No" || !amount_per_injector) + if(!proceed || proceed == "No" || !amount_per_injector) return for(var/i, i < amount, i++) switch(size) diff --git a/code/modules/research/rdconsole_tgui.dm b/code/modules/research/rdconsole_tgui.dm index efa29d15da..6c140cb953 100644 --- a/code/modules/research/rdconsole_tgui.dm +++ b/code/modules/research/rdconsole_tgui.dm @@ -421,7 +421,7 @@ to_chat(usr, "The destructive analyzer is busy at the moment.") return - if(tgui_alert(usr, "Proceeding will destroy loaded item. Continue?", "Destructive analyzer confirmation", list("Yes", "No")) == "No" || !linked_destroy) + if(tgui_alert(usr, "Proceeding will destroy loaded item. Continue?", "Destructive analyzer confirmation", list("Yes", "No")) != "Yes" || !linked_destroy) return linked_destroy.busy = 1 busy_msg = "Processing and Updating Database..." diff --git a/code/modules/resleeving/autoresleever.dm b/code/modules/resleeving/autoresleever.dm index 0ba7059561..51f80e9b18 100644 --- a/code/modules/resleeving/autoresleever.dm +++ b/code/modules/resleeving/autoresleever.dm @@ -133,7 +133,7 @@ spawn_slots -- return - if(tgui_alert(ghost, "Would you like to be resleeved?", "Resleeve", list("No","Yes")) == "No") + if(tgui_alert(ghost, "Would you like to be resleeved?", "Resleeve", list("No","Yes")) != "Yes") return var/mob/living/carbon/human/new_character new_character = new(spawnloc) diff --git a/code/modules/resleeving/computers.dm b/code/modules/resleeving/computers.dm index e7c6a484a3..533fe813bb 100644 --- a/code/modules/resleeving/computers.dm +++ b/code/modules/resleeving/computers.dm @@ -407,7 +407,7 @@ var/answer = tgui_alert(active_mr.mind_ref.current,"Someone is attempting to restore a backup of your mind. Do you want to abandon this body, and move there? You MAY suffer memory loss! (Same rules as CMD apply)","Resleeving",list("No","Yes")) //They declined to be moved. - if(answer == "No") + if(answer != "Yes") set_temp("Initiating resleeving... Error: Post-initialisation failed. Resleeving cycle aborted.", "danger") tgui_modal_clear(src) return TRUE diff --git a/code/modules/shuttles/shuttles_web.dm b/code/modules/shuttles/shuttles_web.dm index 5dd9666178..aa65d935c7 100644 --- a/code/modules/shuttles/shuttles_web.dm +++ b/code/modules/shuttles/shuttles_web.dm @@ -375,11 +375,11 @@ return 1 var/choice = tgui_alert(usr, "The shuttle is currently docked! Please undock before continuing.","Error",list("Cancel","Force Launch")) - if(choice == "Cancel") + if(!choice || choice == "Cancel") return 0 choice = tgui_alert(usr, "Forcing a shuttle launch while docked may result in severe injury, death and/or damage to property. Are you sure you wish to continue?", "Force Launch", list("Force Launch", "Cancel")) - if(choice == "Cancel") + if(choice || choice == "Cancel") return 0 return 1 diff --git a/code/modules/virus2/admin.dm b/code/modules/virus2/admin.dm index 14ac9ba110..b886413fbb 100644 --- a/code/modules/virus2/admin.dm +++ b/code/modules/virus2/admin.dm @@ -194,7 +194,7 @@ if(!antigens.len) var/a = tgui_alert(usr, "This disease has no antigens; it will be impossible to permanently immunise anyone without them.\ It is strongly recommended to set at least one antigen. Do you want to go back and edit your virus?", "Antigens", list("Yes", "No")) - if(a == "Yes") return + if(!a || a == "Yes") return var/datum/disease2/disease/D = new D.infectionchance = infectionchance D.spreadtype = spreadtype diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 6ec4f759c3..8234ec8fa0 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -1319,6 +1319,8 @@ set desc = "Print out your vorebelly messages into chat for copypasting." var/result = tgui_alert(src, "Would you rather open the export panel?", "Selected Belly Export", list("Open Panel", "Print to Chat")) + if(!result) + return if(result == "Open Panel") var/mob/living/user = usr if(!user) diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index c73555632f..f693d5213d 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -3820,7 +3820,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", . = TRUE if("b_del") var/alert = tgui_alert(user, "Are you sure you want to delete your [lowertext(host.vore_selected.name)]?","Confirmation",list("Cancel","Delete")) //ChompEDIT - user, not usr - if(!(alert == "Delete")) + if(alert != "Delete") return FALSE var/failure_msg = "" diff --git a/code/modules/vore/resizing/crackers.dm b/code/modules/vore/resizing/crackers.dm index 8d718d379d..2d2e494478 100644 --- a/code/modules/vore/resizing/crackers.dm +++ b/code/modules/vore/resizing/crackers.dm @@ -15,7 +15,7 @@ var/rigged = 0 //So that they can be rigged by varedits to go one way or the other. positive values mean holder always wins, negative values mean target always wins. var/list/prizes = list("shrinking","growing","drugged","invisibility","knocked over","teleport","wealth") var/list/jokes = list( - "When is a boat just like snow? When it’s adrift.", + "When is a boat just like snow? When it's adrift.", "What happens to naughty elves? Santa gives them the sack.", "What do you call an old snowman? Water.", "Why has Santa been banned from sooty chimneys? Carbon footprints.", @@ -29,7 +29,7 @@ "What's red, and smells like blue paint? Red paint.", "Where do cows go to dance? A meat ball.", "What do you call a person who steals all your toenail clippings? A cliptoemaniac.", - "What’s brown and sticky? A stick.", + "What's brown and sticky? A stick.", "What's the best way to kill a circus? Go for the juggler.", "What do you call a cow with no legs? Ground Beef.", "Why'd the scarecrow win the Nobel prize? He was outstanding in his field.") @@ -45,7 +45,7 @@ return to_chat(user, "You offer \the [src] to \the [target] to pull and wait to see how whether they do.") var/check_pull = tgui_alert(target, "\The [user] is offering to pull \the [src] with you, do you want to pull it?", "Pull Cracker", list("Yes", "No")) - if(check_pull == "No") + if(!check_pull || check_pull == "No") to_chat(user, "\The [target] chose not to pull \the [src]!") return if(!adjacent) diff --git a/code/modules/xenoarcheaology/tools/artifact_harvester.dm b/code/modules/xenoarcheaology/tools/artifact_harvester.dm index a8f19c916b..136a748df1 100644 --- a/code/modules/xenoarcheaology/tools/artifact_harvester.dm +++ b/code/modules/xenoarcheaology/tools/artifact_harvester.dm @@ -101,7 +101,7 @@ if("drainbattery") if(inserted_battery) if(inserted_battery.battery_effect && inserted_battery.stored_charge > 0) - if(tgui_alert(usr, "This action will dump all charge, safety gear is recommended before proceeding","Warning",list("Continue","Cancel"))) + if(tgui_alert(usr, "This action will dump all charge, safety gear is recommended before proceeding","Warning",list("Continue","Cancel")) == "Continue") if(!inserted_battery.battery_effect.activated) inserted_battery.battery_effect.ToggleActivate(1) last_process = world.time diff --git a/code/modules/xenoarcheaology/tools/geosample_scanner.dm b/code/modules/xenoarcheaology/tools/geosample_scanner.dm index bd79af08eb..6f0589a781 100644 --- a/code/modules/xenoarcheaology/tools/geosample_scanner.dm +++ b/code/modules/xenoarcheaology/tools/geosample_scanner.dm @@ -65,6 +65,8 @@ else if(istype(I, /obj/item/stack/nanopaste)) var/choice = tgui_alert(usr, "What do you want to do with the nanopaste?","Radiometric Scanner",list("Scan nanopaste","Fix seal integrity")) + if(!choice) + return if(choice == "Fix seal integrity") var/obj/item/stack/nanopaste/N = I var/amount_used = min(N.get_amount(), 10 - scanner_seal_integrity / 10) @@ -76,6 +78,8 @@ if(!G.is_open_container()) return var/choice = tgui_alert(usr, "What do you want to do with the container?","Radiometric Scanner",list("Add coolant","Empty coolant","Scan container")) + if(!choice) + return if(choice == "Add coolant") var/amount_transferred = min(src.reagents.maximum_volume - src.reagents.total_volume, G.reagents.total_volume) var/trans = G.reagents.trans_to_obj(src, amount_transferred) diff --git a/interface/interface.dm b/interface/interface.dm index ab05b2ed4c..74f8ca539d 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -21,7 +21,7 @@ set desc = "Visit the forum." set hidden = 1 if(CONFIG_GET(string/forumurl)) // CHOMPEdit - if(tgui_alert(usr, "This will open the forum in your browser. Are you sure?","Visit Website",list("Yes","No"))=="No") + if(tgui_alert(usr, "This will open the forum in your browser. Are you sure?","Visit Website",list("Yes","No")) != "Yes") return src << link(CONFIG_GET(string/forumurl)) // CHOMPEdit else @@ -34,7 +34,7 @@ set hidden = 1 if(CONFIG_GET(string/rulesurl)) // CHOMPEdit - if(tgui_alert(usr, "This will open the rules in your browser. Are you sure?","Visit Website",list("Yes","No"))=="No") + if(tgui_alert(usr, "This will open the rules in your browser. Are you sure?","Visit Website",list("Yes","No")) != "Yes") return src << link(CONFIG_GET(string/rulesurl)) // CHOMPEdit else @@ -47,7 +47,7 @@ set hidden = 1 if(CONFIG_GET(string/mapurl)) // CHOMPEdit - if(tgui_alert(usr, "This will open the map in your browser. Are you sure?","Visit Website",list("Yes","No"))=="No") + if(tgui_alert(usr, "This will open the map in your browser. Are you sure?","Visit Website",list("Yes","No")) != "Yes") return src << link(CONFIG_GET(string/mapurl)) // CHOMPEdit else @@ -60,7 +60,7 @@ set hidden = 1 if(CONFIG_GET(string/githuburl)) // CHOMPEdit - if(tgui_alert(usr, "This will open the GitHub in your browser. Are you sure?","Visit Website",list("Yes","No"))=="No") + if(tgui_alert(usr, "This will open the GitHub in your browser. Are you sure?","Visit Website",list("Yes","No")) != "Yes") return src << link(CONFIG_GET(string/githuburl)) // CHOMPEdit else @@ -73,7 +73,7 @@ set hidden = 1 if(CONFIG_GET(string/discordurl)) // CHOMPEdit - if(tgui_alert(usr, "This will open the Discord in your browser. Are you sure?","Visit Website",list("Yes","No"))=="No") + if(tgui_alert(usr, "This will open the Discord in your browser. Are you sure?","Visit Website",list("Yes","No")) != "Yes") return src << link(CONFIG_GET(string/discordurl)) // CHOMPEdit else @@ -86,7 +86,7 @@ set hidden = 1 if(CONFIG_GET(string/patreonurl)) // CHOMPEdit - if(tgui_alert(usr, "This will open the Patreon in your browser. Are you sure?","Visit Website",list("Yes","No"))=="No") + if(tgui_alert(usr, "This will open the Patreon in your browser. Are you sure?","Visit Website",list("Yes","No")) != "Yes") return src << link(CONFIG_GET(string/patreonurl)) // CHOMPEdit else diff --git a/modular_chomp/code/game/machinery/virtual_reality/vr_console.dm b/modular_chomp/code/game/machinery/virtual_reality/vr_console.dm index 4de8644050..05cef4fa46 100644 --- a/modular_chomp/code/game/machinery/virtual_reality/vr_console.dm +++ b/modular_chomp/code/game/machinery/virtual_reality/vr_console.dm @@ -196,7 +196,7 @@ if(!occupant) return - if(!forced && avatar && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) == "No") + if(!forced && avatar && tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) != "Yes") return if(avatar) @@ -233,7 +233,7 @@ avatar = occupant.vr_link // If they've already enterred VR, and are reconnecting, prompt if they want a new body - if(avatar && tgui_alert(occupant, "You already have a [avatar.stat == DEAD ? "" : "deceased "]Virtual Reality avatar. Would you like to use it?", "New avatar", list("Yes", "No")) == "No") + if(avatar && tgui_alert(occupant, "You already have a [avatar.stat == DEAD ? "" : "deceased "]Virtual Reality avatar. Would you like to use it?", "New avatar", list("Yes", "No")) != "Yes") // Delink the mob occupant.vr_link = null avatar = null diff --git a/modular_chomp/code/game/objects/items/devices/flipper.dm b/modular_chomp/code/game/objects/items/devices/flipper.dm index e6238277e2..f62071c316 100644 --- a/modular_chomp/code/game/objects/items/devices/flipper.dm +++ b/modular_chomp/code/game/objects/items/devices/flipper.dm @@ -194,7 +194,7 @@ return var/choice = tgui_alert(user, "You sure you want to inhabit this PAI, or submit yourself to being recruited?", "Confirmation", list("Inhabit", "Recruit", "Cancel")) - if(choice == "Cancel") + if(!choice || choice == "Cancel") return ..() if(choice == "Recruit") paiController.recruitWindow(user) diff --git a/modular_chomp/code/game/objects/items/devices/mind_binder.dm b/modular_chomp/code/game/objects/items/devices/mind_binder.dm index 691c3f2709..fff54752a4 100644 --- a/modular_chomp/code/game/objects/items/devices/mind_binder.dm +++ b/modular_chomp/code/game/objects/items/devices/mind_binder.dm @@ -75,7 +75,7 @@ if(self_bind) var/choice = tgui_alert(usr,"This will bind YOUR mind to the target! You may not be able to go back without help. Continue?","Confirmation",list("Continue","Cancel")) - if(choice == "Cancel") return + if(!choice || choice == "Cancel") return choice = tgui_alert(usr,"No really. You cannot OOC Escape this. Are you sure?","Confirmation",list("Yes I'm sure","Cancel")) if(choice == "Yes I'm sure" && usr.get_active_hand() == src && usr.Adjacent(target)) usr.visible_message("[usr] presses [src] against [target]. The device beginning to let out a series of beeps!","You begin to bind yourself into [target]!") @@ -119,7 +119,7 @@ if(self_bind) var/choice = tgui_alert(usr,"This will bind YOUR mind to the target! You will not be able to go back without help. Continue?","Confirmation",list("Continue","Cancel")) - if(choice == "Cancel") return + if(!choice || choice == "Cancel") return choice = tgui_alert(usr,"No really. You cannot OOC Escape this. Are you sure?","Confirmation",list("Yes I'm sure","Cancel")) if(choice == "Yes I'm sure" && usr.get_active_hand() == src && usr.Adjacent(item)) log_and_message_admins("attempted to bind themselves to \an [item] with a Mind Binder.") diff --git a/modular_chomp/code/modules/tickets/procs.dm b/modular_chomp/code/modules/tickets/procs.dm index 1a70b8d720..c4c2b638f5 100644 --- a/modular_chomp/code/modules/tickets/procs.dm +++ b/modular_chomp/code/modules/tickets/procs.dm @@ -27,7 +27,10 @@ feedback_add_details("admin_verb","Mentorhelp") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! if(current_ticket) - if(tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) != "No") + var/input = tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) + if(!input) + return + if(input == "Yes") if(current_ticket) log_admin("Mentorhelp: [key_name(src)]: [msg]") current_ticket.MessageNoRecipient(msg) @@ -95,7 +98,10 @@ feedback_add_details("admin_verb","Adminhelp") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! if(current_ticket) - if(tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) != "No") + var/input = tgui_alert(usr, "You already have a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) + if(!input) + return + if(input == "Yes") if(current_ticket) current_ticket.MessageNoRecipient(msg) to_chat(usr, "PM to-Admins: [msg]") @@ -159,7 +165,7 @@ to_chat(usr, "Error: You cannot request spice (muted from adminhelps).") return - if(tgui_alert(usr, "Are you sure you want to request the admins spice things up for you? You accept the consequences if you do.","Spicy!",list("Yes","No")) != "No") + if(tgui_alert(usr, "Are you sure you want to request the admins spice things up for you? You accept the consequences if you do.","Spicy!",list("Yes","No")) == "Yes") message_admins("[ADMIN_FULLMONTY(usr)] has requested the round be spiced up a little.") to_chat(usr, "You have requested some more spice in your round.") else diff --git a/modular_chomp/code/modules/tickets/tickets_ui.dm b/modular_chomp/code/modules/tickets/tickets_ui.dm index b434d72a7a..69ea0100e8 100644 --- a/modular_chomp/code/modules/tickets/tickets_ui.dm +++ b/modular_chomp/code/modules/tickets/tickets_ui.dm @@ -132,7 +132,10 @@ feedback_add_details("admin_verb","Admincreatedticket") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! if(player.current_ticket) - if(tgui_alert(usr, "The player already has a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) != "No") + var/input = tgui_alert(usr, "The player already has a ticket open. Is this for the same issue?","Duplicate?",list("Yes","No")) + if(!input) + return + if(input == "Yes") if(player.current_ticket) player.current_ticket.MessageNoRecipient(ticket_text) to_chat(usr, "PM to-Admins: [ticket_text]") diff --git a/modular_chomp/code/modules/vore/eating/soulcatcher.dm b/modular_chomp/code/modules/vore/eating/soulcatcher.dm index 09a2334f71..17fb698c5f 100644 --- a/modular_chomp/code/modules/vore/eating/soulcatcher.dm +++ b/modular_chomp/code/modules/vore/eating/soulcatcher.dm @@ -459,11 +459,12 @@ if(is_taken_over()) return if(!istype(M) || !gem) return if(!gem.owner) return - if((tgui_alert(gem.owner, "Do you want to allow [owner] to transfer [selected_soul] to your soulcatcher?", "Allow Transfer", list("No", "Yes")) == "Yes")) - if(!in_range(gem.owner, owner)) - return - if(!(gem.owner.soulcatcher_pref_flags & SOULCATCHER_ALLOW_TRANSFER)) - return + if((tgui_alert(gem.owner, "Do you want to allow [owner] to transfer [selected_soul] to your soulcatcher?", "Allow Transfer", list("No", "Yes")) != "Yes")) + return + if(!in_range(gem.owner, owner)) + return + if(!(gem.owner.soulcatcher_pref_flags & SOULCATCHER_ALLOW_TRANSFER)) + return if(M.mind == own_mind) own_mind = null brainmobs -= M diff --git a/modular_chomp/game/machinery/buttons.dm b/modular_chomp/game/machinery/buttons.dm index 82af719873..a58f930d58 100644 --- a/modular_chomp/game/machinery/buttons.dm +++ b/modular_chomp/game/machinery/buttons.dm @@ -8,10 +8,12 @@ var/mob_wanted = tgui_input_list(user, "Which Mob do you want to spawn?", "Mob spawn", vr_mob_spawner_options) if(!mob_wanted) return - QDEL_NULL(mobspawned) var/neutral = FALSE var/mobtype = vr_mob_spawner_options[mob_wanted] var/faction = tgui_alert(user, "Do you want the mob's faction to remain the same or be passive?","Faction",list("Normal","Neutral")) + if(!faction) + return + QDEL_NULL(mobspawned) if(faction == "Neutral") neutral = TRUE mobspawned = new mobtype(get_turf(GLOB.button_mob_spawner_landmark[link]))