From 2f19f66cc5f2270db0322fffb8ad1bdcad0d10ac Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Sun, 1 Sep 2024 20:27:26 +0200 Subject: [PATCH] default tgui alert input handling (#16241) * default handling * do not push that * fix * . * . --- code/controllers/subsystems/media_tracks.dm | 4 +-- code/game/antagonist/antagonist_factions.dm | 4 +-- .../gamemodes/changeling/powers/fake_death.dm | 4 +-- 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 +- .../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 | 7 ++-- code/modules/admin/verbs/cinematic.dm | 7 ++-- 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 | 5 +-- .../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 | 15 ++++---- .../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 | 2 +- .../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 +- code/modules/mob/mob_helpers_vr.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 | 3 +- code/modules/power/fusion/_setup.dm | 4 +-- code/modules/random_map/drop/droppod.dm | 7 ++-- code/modules/random_map/drop/supply.dm | 8 +++-- .../reagents/machinery/injector_maker.dm | 2 +- code/modules/research/rdconsole_tgui.dm | 2 +- code/modules/resleeving/autoresleever.dm | 2 +- code/modules/resleeving/computers.dm | 4 +-- 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 +++---- 99 files changed, 248 insertions(+), 173 deletions(-) diff --git a/code/controllers/subsystems/media_tracks.dm b/code/controllers/subsystems/media_tracks.dm index 96c11b5edd..9bd4f3ca1a 100644 --- a/code/controllers/subsystems/media_tracks.dm +++ b/code/controllers/subsystems/media_tracks.dm @@ -130,7 +130,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 @@ -138,7 +138,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 6e18b57a3b..2ae28151d5 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]!") @@ -47,4 +47,4 @@ set category = "Abilities" if(!M.mind) return - convert_to_faction(M.mind, loyalists) \ No newline at end of file + convert_to_faction(M.mind, loyalists) diff --git a/code/game/gamemodes/changeling/powers/fake_death.dm b/code/game/gamemodes/changeling/powers/fake_death.dm index daa0b9e246..19d2291b37 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.") @@ -50,4 +50,4 @@ to_chat(src, "We are ready to rise. Use the Revive verb when you are ready.") feedback_add_details("changeling_powers","FD") - return 1 \ No newline at end of file + return 1 diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 35e1ed8eb9..41d3f2a716 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 50e204b215..5c3fde2659 100644 --- a/code/game/machinery/virtual_reality/vr_console.dm +++ b/code/game/machinery/virtual_reality/vr_console.dm @@ -188,7 +188,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) @@ -225,7 +225,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 08aded1cf0..f3fb2ecbc6 100644 --- a/code/game/mecha/combat/phazon.dm +++ b/code/game/mecha/combat/phazon.dm @@ -144,6 +144,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 6b924f31ab..261153e47c 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 76ec48aa5b..1a054c7cbc 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.antag_hud_restricted && has_enabled_antagHUD == 1) 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 27299df56e..d9292282bf 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -77,7 +77,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/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 072bd9cddb..0042d6357e 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) @@ -550,7 +550,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")) @@ -589,7 +589,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 6f378d92a0..fb2fa68299 100644 --- a/code/game/objects/structures/ghost_pods/event_vr.dm +++ b/code/game/objects/structures/ghost_pods/event_vr.dm @@ -87,7 +87,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 a50d434207..99d6843da8 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 996f2febff..a7bfab8d2e 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 3dd620b0c0..6695f2b6b6 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -52,7 +52,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 9135a5c067..94b1266c9d 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]!") @@ -993,7 +993,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.") @@ -1530,9 +1530,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 295be20e51..1102602a64 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -527,7 +527,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.") @@ -540,7 +540,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 17909c4c29..c4755129e3 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 981a7434d2..1c72267b2f 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 7bb048a0b5..6ce57b47f6 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -292,7 +292,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]") @@ -356,6 +356,8 @@ var/duration switch(tgui_alert(usr, "Temporary Ban?","Temporary Ban",list("Yes","No"))) + if(null) + return if("Yes") temp = 1 var/mins = 0 @@ -774,6 +776,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!") @@ -910,6 +914,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) @@ -946,7 +952,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 52eaede877..e09dce2734 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -612,7 +612,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 d6bdb37f21..ed2f46fe5a 100644 --- a/code/modules/admin/verbs/adminhelp_vr.dm +++ b/code/modules/admin/verbs/adminhelp_vr.dm @@ -25,7 +25,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/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 ebfdd9b195..05901040d1 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 2cafd14ee4..c2b60de327 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)) @@ -96,4 +95,4 @@ M.update_dna(M) M.update_hair(FALSE) - M.update_icons_body() \ No newline at end of file + M.update_icons_body() diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm index 477f2f032c..4b370a925b 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 @@ -24,4 +25,4 @@ log_admin("[key_name(src)] launched cinematic \"[cinematic]\"") message_admins("[key_name_admin(src)] launched cinematic \"[cinematic]\"", 1) - return \ No newline at end of file + return diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 623dbc2dae..0cb7504ca4 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 a0da92eb42..9dca3689a4 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 332e6a7d62..beb144f55d 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 15bf773829..932652bbb4 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 7b2fa323d3..42631da193 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 c57ad0b706..cbfd0371e0 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 1cf5db2640..527d455be8 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 d4836faf54..77ad3ff558 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 d183738cf2..38db8df120 100644 --- a/code/modules/admin/verbs/smite.dm +++ b/code/modules/admin/verbs/smite.dm @@ -103,7 +103,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 737ab67f84..af7e42c872 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 04e89cbaba..340f7466dc 100644 --- a/code/modules/casino/casino.dm +++ b/code/modules/casino/casino.dm @@ -593,8 +593,9 @@ to_chat(user, "The SPASM beeps in an upset manner, you already have a collar!") return var/confirm = tgui_alert(usr, "Are you sure you want to become a sentient prize?", "Confirm Sentient Prize", list("Yes", "No")) - if(confirm == "Yes") - to_chat(user, "You are now a prize!") + if(confirm != "Yes") + return + to_chat(user, "You are now a prize!") if(safety_ckey in sentientprizes_ckeys_list) to_chat(user, "The SPASM beeps in an upset manner, you already have a collar!") return diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index e416121034..d075e751a6 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -929,7 +929,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 599424723c..819d67ecc1 100644 --- a/code/modules/client/preference_setup/vore/02_size.dm +++ b/code/modules/client/preference_setup/vore/02_size.dm @@ -140,6 +140,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 85c97bcbb7..20f2e00c84 100644 --- a/code/modules/client/preference_setup/vore/07_traits.dm +++ b/code/modules/client/preference_setup/vore/07_traits.dm @@ -569,7 +569,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(usr, "\[Cost:[initial(path.cost)]\] [initial(path.desc)]",initial(path.name), list("Take Trait","Go Back")) - 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 642af69152..255eb037c3 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 aba094ce3c..48432ee370 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 5334111cc3..402d21bbf0 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) @@ -336,4 +336,3 @@ else result = tgui_input_list(usr, "Select an atom type", "Spawn Atom", matches, strict_modern = TRUE) 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 e6ff399c01..8a88f6c5a7 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 db627b7103..cc19a8bb47 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -300,7 +300,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.") return else 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 e28202745e..49f113b6ef 100644 --- a/code/modules/mentor/mentor.dm +++ b/code/modules/mentor/mentor.dm @@ -168,6 +168,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 5b23a244af..d9deb92a76 100644 --- a/code/modules/mentor/mentorhelp.dm +++ b/code/modules/mentor/mentorhelp.dm @@ -443,7 +443,7 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new) spawn(1200) src.verbs += /client/verb/mentorhelp // 2 minute cd to prevent abusing this to spam admins. return - else if(choice == "Cancel") + else if(!choice || choice == "Cancel") return @@ -455,7 +455,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 dc7c1cbbdd..62196605cd 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -330,7 +330,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return if(config.antag_hud_restricted && !has_enabled_antagHUD && !client.holder) 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) @@ -979,7 +979,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() @@ -1006,6 +1006,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 d138a0b163..01014e4ff4 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 43bab179d6..3dee402b41 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 e428f331a5..c2f816e9da 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 index bff5a09e39..6b8485c5d5 100644 --- 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 @@ -110,7 +110,7 @@ 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 == "Cancel") + if(!swap_not_rebuild || swap_not_rebuild == "Cancel") return if(swap_not_rebuild == "Reshape") var/list/usable_manufacturers = list() 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 d35fd9832c..804f071258 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 @@ -1270,6 +1270,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 @@ -1277,6 +1279,8 @@ appendage_color = new_color 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 @@ -1556,6 +1560,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 05aff46d1f..b00990b462 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 972cf64c31..3cb39ea3f8 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -116,7 +116,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 cb067098e1..cf1c520fe9 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -386,6 +386,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 @@ -613,6 +616,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 5992d9695b..b26aaf34ff 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -513,7 +513,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 modifcations at this time.") 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 36c2dcbd8c..4e0ab3d7e2 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 @@ -372,6 +372,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 4cc3de8410..f2da0d392f 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -910,7 +910,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 0cfa747e4c..7431cc3980 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -393,7 +393,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/mob/mob_helpers_vr.dm b/code/modules/mob/mob_helpers_vr.dm index fd9e60f2ea..03b42486c7 100644 --- a/code/modules/mob/mob_helpers_vr.dm +++ b/code/modules/mob/mob_helpers_vr.dm @@ -29,6 +29,8 @@ var/toggle toggle = tgui_alert(src, "Would you like to see visible stomachs?", "Visible Tummy?", list("Yes", "No")) + if(!toggle) + return if(toggle =="Yes") stomach_vision = 1 //Simple! Easy! if(!(VIS_CH_STOMACH in vis_enabled)) 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 fa000ef4b7..9aaf3f89a6 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 @@ -261,13 +261,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 229bcf0869..424b24c7c1 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 733d14846b..f3adcb28d3 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -279,7 +279,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 \ @@ -510,4 +510,3 @@ Extracted to its own procedure for easier logic handling with paper bundles. query_string += "&reason=[url_encode(reason)]" query_string += "&job=[url_encode(jobname)]" world.Export("[config.chat_webhook_url]?[query_string]") - 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 5e57f76923..6ceb139537 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 d1cc04211d..d17f148654 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) \ No newline at end of file + 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 80f2f1167b..34c870cac6 100644 --- a/code/modules/research/rdconsole_tgui.dm +++ b/code/modules/research/rdconsole_tgui.dm @@ -411,7 +411,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 fe4e4fa916..d8afe1750d 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 d7b0f81cce..67c861428f 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 @@ -525,4 +525,4 @@ #undef MENU_MAIN #undef MENU_BODY -#undef MENU_MIND \ No newline at end of file +#undef MENU_MIND 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 914043cfb4..9975268162 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 470c6d9b7c..49afffafe9 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -1234,6 +1234,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 3223b50f85..acd41f9a64 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -1704,7 +1704,7 @@ var/global/list/belly_colorable_only_fullscreens = list("a_synth_flesh_mono", . = TRUE if("b_del") var/alert = tgui_alert(usr, "Are you sure you want to delete your [lowertext(host.vore_selected.name)]?","Confirmation",list("Cancel","Delete")) - 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 1a2771d81b..f2e57398e5 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -21,7 +21,7 @@ set desc = "Visit the forum." set hidden = 1 if( config.forumurl ) - 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.forumurl) else @@ -34,7 +34,7 @@ set hidden = 1 if(config.rulesurl) - 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.rulesurl) else @@ -47,7 +47,7 @@ set hidden = 1 if(config.mapurl) - 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.mapurl) else @@ -60,7 +60,7 @@ set hidden = 1 if(config.githuburl) - 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.githuburl) else @@ -73,7 +73,7 @@ set hidden = 1 if(config.discordurl) - 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.discordurl) else @@ -86,7 +86,7 @@ set hidden = 1 if(config.patreonurl) - 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.patreonurl) else