Skip to content

Commit

Permalink
Add TGUI inputs and alerts (BeeStation#8080)
Browse files Browse the repository at this point in the history
* Replace tgalert with tgui_alert (#55157)

Adds TGUI-based alerts to replace the old tgalert system. Replaces all uses of tgalert with tgui_alert except for one, the 'Report Issue' button, as people were (understandably) concerned that this button using tgui will prevent a tgui bug from being easily reported.

These windows have a nice little progress bar indicator of how much time they have left, and will automatically close themselves after this time elapses.

Co-authored-by: Aleksej Komarov <[email protected]>

* Fixes from tg/58419

* Adds a autofocus arg to tgui_alert (#60452)

Co-authored-by: Mothblocks <[email protected]>

* Allows you to cancel TGUI alerts (#61072)

This was requested by someone downstream. Some TGUI alerts offer two options e.g. (Kill Bob, Kill Janice), In byond alerts you'd be able to cancel by pressing the X, but tgui alerts don't support this. I've added an option to enable the normal X in the top right, so you can cancel out of alerts if you enable it.

* Improve Close/null response state of alert()

* tgui: List Input (#56065)

Ported over from https://gitlab.com/cmdevs/colonial-warfare/-/merge_requests/613 which provides an input box to select an option from a list.
Has a search bar to allow filtering for results and an onKeyDown event to replicate default behaviour from the default list input boxes that BYOND provides (where you are able to type the first letter of an element in the list and it'll jump to the first element that matches and then the next and so on)
Right now, it is only applied to the holopad and "Drop Bomb" verb for administrators.

Credits to bobbahbrown for the Loader element from AlertModal.js which allows for a timed input (was needed on the CM codebase for timed inputs) and for the majority of the DM code.

Co-authored-by: Watermelon914 <[email protected]>
Co-authored-by: Aleksej Komarov <[email protected]>

* Refactor ListInput with new changes

* Added autofocus for the first button in the TGUI list input. (#56114)

Ported over from https://gitlab.com/cmdevs/colonial-warfare/-/merge_requests/647
When you open the TGUI list input, it'll auto-focus the first element so that you can easily navigate with the arrow keys without having to click on the page beforehand.

Small QoL when opening the thing, don't have to click on it if you want to navigate via arrows keys, etc.

* Swap buttons in ListInput for improved accessibility  (#57832)

Swapped OK/Cancel buttons in tgui list input, so that it stays consistent with Windows UI guidelines (was Cancel/OK before).

* tgui input list improvements (#59668)

pressing enter or space now selects the selected button
duplicate keys no longer cause input lists to break

* Fix tgui async modals (#59822)

* Fix tgui async modal constructor order

* Fix another bug with the async modals

* Refactors tgui list inputs to be more user-friendly (#61925)

Co-authored-by: Watermelon914 <[email protected]>

* TGUI input box framework (#63190)

About The Pull Request

Creates the framework for two new TGUI input boxes that can be toggled via game prefs.
This does not convert any actual inputs to TGUI
This does not convert any tgui_list_inputs into being toggleable
Example pictures

Input on a hand labeler. This has a MAX_LENGTH set, so it can be invalidated. Cancel always returns null. Enter button submits, if valid.
text input
(OUTDATED) Multiline input on newscaster. Newer version fills the window with a section, like the others
multiline
Sheets from a stack
number input
Why It's Good For The Game

1
So I did...

    Much sleeker input boxes
    Result should be a in place swap for most occurrences of input
    Renders casting as text/num/null obsolete but still doable
    Input validation from both sides handled
    Prefs toggle if you don't like the look

Changelog

cl
add: TGUI input boxes are on the way! You can find new preferences in the menu. They will be on by default.
/cl

* TGUI input box conversions 1 (#63313)

* Update to newest versions mostly, holy shit dude, learn to atomize your PRs

* Add generic themes

* Add Autofocus from tg/61313 (TGUI prefs)

* Fixes the inputs for the linear and exponential sustain options of the song editor. (#65008)

* Who added this

* Tweaks and testing verb

* Revert

Co-authored-by: Bobbahbrown <[email protected]>
Co-authored-by: Aleksej Komarov <[email protected]>
Co-authored-by: Wayland-Smithy <[email protected]>
Co-authored-by: Mothblocks <[email protected]>
Co-authored-by: AMonkeyThatCodes <[email protected]>
Co-authored-by: Watermelon914 <[email protected]>
Co-authored-by: Watermelon914 <[email protected]>
Co-authored-by: LatteKat <[email protected]>
Co-authored-by: Aronai Sieyes <[email protected]>
Co-authored-by: Jeremiah <[email protected]>
Co-authored-by: Ghom <[email protected]>
  • Loading branch information
12 people authored Jan 20, 2023
1 parent dc38c2d commit 5d798d2
Show file tree
Hide file tree
Showing 55 changed files with 1,869 additions and 79 deletions.
4 changes: 4 additions & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3534,7 +3534,11 @@
#include "code\modules\tgui\states.dm"
#include "code\modules\tgui\status_composers.dm"
#include "code\modules\tgui\tgui.dm"
#include "code\modules\tgui\tgui_alert.dm"
#include "code\modules\tgui\tgui_input_emoji.dm"
#include "code\modules\tgui\tgui_input_list.dm"
#include "code\modules\tgui\tgui_input_number.dm"
#include "code\modules\tgui\tgui_input_text.dm"
#include "code\modules\tgui\tgui_select_picture.dm"
#include "code\modules\tgui\tgui_window.dm"
#include "code\modules\tgui\states\admin.dm"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/cult_ritual_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
to_chat(cultist, "<span class='cultlarge'>\"I am already here. There is no need to try to summon me now.\"</span>")
return FALSE
var/confirm_final = alert(cultist, "This is the FINAL step to summon Nar'Sie; it is a long, painful ritual and the crew will be alerted to your presence.", "Are you prepared for the final battle?", "My life for Nar'Sie!", "No")
if(confirm_final == "No")
if(confirm_final == "No" || !confirm_final)
to_chat(cultist, "<span class='cult'>You decide to prepare further before scribing the rune.</span>")
return
if(!check_if_in_ritual_site(cultist, cult_team))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/launchpad_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
current_pad.display_name = new_name
. = TRUE
if("remove")
if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") != "Abort")
if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") == "I'm Sure")
launchpads -= current_pad
selected_id = null
. = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/law.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
current = null
return
M.install(current.laws, user)
if(alert("Do you wish to scramble the upload code?", "Scramble Code", "Yes", "No") == "No")
if(alert("Do you wish to scramble the upload code?", "Scramble Code", "Yes", "No") != "Yes")
return
message_admins("[ADMIN_LOOKUPFLW(usr)] has scrambled the upload code [GLOB.upload_code]!")
GLOB.upload_code = random_code(4)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ GLOBAL_LIST_EMPTY(cryopod_computers)
to_chat(user, "<span class='danger'>You can't put [target] into [src]. They're conscious.</span>")
return
else if(target.client)
if(alert(target,"Would you like to enter cryosleep?",,"Yes","No") == "No")
if(alert(target,"Would you like to enter cryosleep?",,"Yes","No") != "Yes")
return

var/generic_plsnoleave_message = " Please adminhelp before leaving the round, even if there are no administrators online!"
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/launch_pad.dm
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@
. = TRUE
if("remove")
. = TRUE
if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") != "Abort")
if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") == "I'm Sure")
pad = null
if("launch")
sending = TRUE
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/implants/implant_explosive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
/obj/item/implant/explosive/activate(cause)
. = ..()
if(!cause || !imp_in || active)
return 0
return FALSE
if(cause == "action_button" && !popup)
popup = TRUE
var/response = alert(imp_in, "Are you sure you want to activate your [name]? This will cause you to explode!", "[name] Confirmation", "Yes", "No")
popup = FALSE
if(response == "No")
return 0
if(response != "Yes")
return FALSE
heavy = round(heavy)
medium = round(medium)
weak = round(weak)
Expand All @@ -49,7 +49,7 @@
if(imp_in)
imp_in.gib(1)
qdel(src)
return
return TRUE
timed_explosion()

/obj/item/implant/explosive/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
Expand Down
7 changes: 3 additions & 4 deletions code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,10 @@
if (!usr.client.holder)
return
var/confirm = alert("End the round and restart the game world?", "End Round", "Yes", "Cancel")
if(confirm == "Cancel")
if(confirm != "Yes")
return
if(confirm == "Yes")
SSticker.force_ending = 1
SSblackbox.record_feedback("tally", "admin_verb", 1, "End Round") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
SSticker.force_ending = 1
SSblackbox.record_feedback("tally", "admin_verb", 1, "End Round") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

/datum/admins/proc/dynamic_mode_options(mob/user)
var/dat = {"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/permissionedit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
use_db = FALSE
else
use_db = alert("Permanent changes are saved to the database for future rounds, temporary changes will affect only the current round", "Permanent or Temporary?", "Permanent", "Temporary", "Cancel")
if(use_db == "Cancel")
if(use_db == "Cancel" || !use_db)
return
if(use_db == "Permanent")
use_db = TRUE
Expand Down
14 changes: 7 additions & 7 deletions code/modules/admin/secrets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ GLOBAL_DATUM_INIT(admin_secrets, /datum/admin_secrets, new)
if(!check_rights(R_ADMIN))
return
var/delete_mobs = alert("Clear all mobs?","Confirm","Yes","No","Cancel")
if(delete_mobs == "Cancel")
if(delete_mobs == "Cancel" || !delete_mobs)
return

log_admin("[key_name(usr)] reset the thunderdome to default with delete_mobs==[delete_mobs].", 1)
Expand Down Expand Up @@ -454,7 +454,7 @@ GLOBAL_DATUM_INIT(admin_secrets, /datum/admin_secrets, new)
if(animetype =="Yes")
droptype = alert("Make the uniforms undroppable?",,"Yes","No","Cancel")

if(animetype == "Cancel" || droptype == "Cancel")
if(animetype == "Cancel" || droptype == "Cancel" || !animetype || (!droptype && animetype == "Yes"))
return
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Chinese Cartoons"))
message_admins("[key_name_admin(usr)] made everything kawaii.")
Expand Down Expand Up @@ -695,7 +695,7 @@ GLOBAL_DATUM_INIT(admin_secrets, /datum/admin_secrets, new)
if("flipmovement")
if(!check_rights(R_FUN))
return
if(alert("Flip all movement controls?","Confirm","Yes","Cancel") == "Cancel")
if(alert("Flip all movement controls?","Confirm","Yes","Cancel") != "Yes")
return
var/list/movement_keys = SSinput.movement_keys
for(var/i in 1 to movement_keys.len)
Expand All @@ -707,7 +707,7 @@ GLOBAL_DATUM_INIT(admin_secrets, /datum/admin_secrets, new)
if("randommovement")
if(!check_rights(R_FUN))
return
if(alert("Randomize all movement controls?","Confirm","Yes","Cancel") == "Cancel")
if(alert("Randomize all movement controls?","Confirm","Yes","Cancel") != "Yes")
return
var/list/movement_keys = SSinput.movement_keys
for(var/i in 1 to movement_keys.len)
Expand All @@ -719,7 +719,7 @@ GLOBAL_DATUM_INIT(admin_secrets, /datum/admin_secrets, new)
if("custommovement")
if(!check_rights(R_FUN))
return
if(alert("Are you sure you want to change every movement key?","Confirm","Yes","Cancel") == "Cancel")
if(alert("Are you sure you want to change every movement key?","Confirm","Yes","Cancel") != "Yes")
return
var/list/movement_keys = SSinput.movement_keys
var/list/new_movement = list()
Expand All @@ -740,7 +740,7 @@ GLOBAL_DATUM_INIT(admin_secrets, /datum/admin_secrets, new)
if("resetmovement")
if(!check_rights(R_FUN))
return
if(alert("Are you sure you want to reset movement keys to default?","Confirm","Yes","Cancel") == "Cancel")
if(alert("Are you sure you want to reset movement keys to default?","Confirm","Yes","Cancel") != "Yes")
return
SSinput.setup_default_movement_keys()
message_admins("[key_name_admin(usr)] has reset all movement keys.")
Expand Down Expand Up @@ -820,7 +820,7 @@ GLOBAL_DATUM_INIT(admin_secrets, /datum/admin_secrets, new)
if(E)
E.processing = FALSE
if(E.announceWhen>0)
if(alert(usr, "Would you like to alert the crew?", "Alert", "Yes", "No") == "No")
if(alert(usr, "Would you like to alert the crew?", "Alert", "Yes", "No") != "Yes")
E.announceChance = 0
E.processing = TRUE
if (usr)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/sql_ban_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>")
return
var/target = ban_target_string(player_key, player_ip, player_cid)
if(alert(usr, "Please confirm unban of [target] from [role].", "Unban confirmation", "Yes", "No") == "No")
if(alert(usr, "Please confirm unban of [target] from [role].", "Unban confirmation", "Yes", "No") != "Yes")
return
var/kn = key_name(usr)
var/kna = key_name_admin(usr)
Expand Down
14 changes: 7 additions & 7 deletions code/modules/admin/stickyban.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
if (!ban)
to_chat(usr, "<span class='adminnotice'>Error: No sticky ban for [ckey] found!</span>")
return
if (alert("Are you sure you want to remove the sticky ban on [ckey]?","Are you sure","Yes","No") == "No")
if (alert("Are you sure you want to remove the sticky ban on [ckey]?","Are you sure","Yes","No") != "Yes")
return
if (!get_stickyban_from_ckey(ckey))
to_chat(usr, "<span class='adminnotice'>Error: The ban disappeared.</span>")
Expand Down Expand Up @@ -98,7 +98,7 @@
to_chat(usr, "<span class='adminnotice'>Error: [alt] is not linked to [ckey]'s sticky ban!</span>")
return

if (alert("Are you sure you want to disassociate [alt] from [ckey]'s sticky ban? \nNote: Nothing stops byond from re-linking them, Use \[E] to exempt them","Are you sure","Yes","No") == "No")
if (alert("Are you sure you want to disassociate [alt] from [ckey]'s sticky ban? \nNote: Nothing stops byond from re-linking them, Use \[E] to exempt them","Are you sure","Yes","No") != "Yes")
return

//we have to do this again incase something changes
Expand Down Expand Up @@ -180,7 +180,7 @@
to_chat(usr, "<span class='adminnotice'>Error: [alt] is not linked to [ckey]'s sticky ban!</span>")
return

if (alert("Are you sure you want to exempt [alt] from [ckey]'s sticky ban?","Are you sure","Yes","No") == "No")
if (alert("Are you sure you want to exempt [alt] from [ckey]'s sticky ban?","Are you sure","Yes","No") != "Yes")
return

//we have to do this again incase something changes
Expand Down Expand Up @@ -230,7 +230,7 @@
to_chat(usr, "<span class='adminnotice'>Error: [alt] is not exempt from [ckey]'s sticky ban!</span>")
return

if (alert("Are you sure you want to unexempt [alt] from [ckey]'s sticky ban?","Are you sure","Yes","No") == "No")
if (alert("Are you sure you want to unexempt [alt] from [ckey]'s sticky ban?","Are you sure","Yes","No") != "Yes")
return

//we have to do this again incase something changes
Expand Down Expand Up @@ -272,7 +272,7 @@

var/ckey = data["ckey"]

if (alert("Are you sure you want to put [ckey]'s stickyban on timeout until next round (or removed)?","Are you sure","Yes","No") == "No")
if (alert("Are you sure you want to put [ckey]'s stickyban on timeout until next round (or removed)?","Are you sure","Yes","No") != "Yes")
return
var/ban = get_stickyban_from_ckey(ckey)
if (!ban)
Expand All @@ -298,7 +298,7 @@
return
var/ckey = data["ckey"]

if (alert("Are you sure you want to lift the timeout on [ckey]'s stickyban?","Are you sure","Yes","No") == "No")
if (alert("Are you sure you want to lift the timeout on [ckey]'s stickyban?","Are you sure","Yes","No") != "Yes")
return

var/ban = get_stickyban_from_ckey(ckey)
Expand All @@ -323,7 +323,7 @@
if (!data["ckey"])
return
var/ckey = data["ckey"]
if (alert("Are you sure you want to revert the sticky ban on [ckey] to its state at round start (or last edit)?","Are you sure","Yes","No") == "No")
if (alert("Are you sure you want to revert the sticky ban on [ckey] to its state at round start (or last edit)?","Are you sure","Yes","No") != "Yes")
return
var/ban = get_stickyban_from_ckey(ckey)
if (!ban)
Expand Down
5 changes: 2 additions & 3 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1702,10 +1702,9 @@
if(!check_rights(R_ADMIN))
return
var/confirm = alert("Are you sure you want to reboot the server?", "Confirm Reboot", "Yes", "No")
if(confirm == "No")
if(confirm != "Yes")
return
if(confirm == "Yes")
restart()
restart()

else if(href_list["check_teams"])
if(!check_rights(R_ADMIN))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/verbs/_help.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
if("claim")
if(ticket.claimee)
var/confirm = alert("This ticket is already claimed, override claim?", null,"Yes", "No")
if(confirm == "No")
if(confirm != "Yes")
return
claim_ticket = CLAIM_OVERRIDE
if("reject")
Expand Down
6 changes: 3 additions & 3 deletions code/modules/admin/verbs/debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
else
H = M
if(H.l_store || H.r_store || H.s_store) //saves a lot of time for admins and coders alike
if(alert("Drop Items in Pockets? No will delete them.", "Robust quick dress shop", "Yes", "No") == "No")
if(alert("Drop Items in Pockets? No will delete them.", "Robust quick dress shop", "Yes", "No") != "Yes")
delete_pocket = TRUE

SSblackbox.record_feedback("tally", "admin_verb", 1, "Select Equipment") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
Expand Down Expand Up @@ -776,7 +776,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if (response == "Jump")
usr.forceMove(get_turf(exists[template]))
return
else if (response == "Cancel")
else if (response != "Place Another")
return

var/len = GLOB.ruin_landmarks.len
Expand All @@ -800,7 +800,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(ruin_size < 10 || ruin_size >= 200)
return
var/response = alert(src, "This will place the ruin at your current location.", "Spawn Ruin", "Spawn Ruin", "Cancel")
if (response == "Cancel")
if (response != "Spawn Ruin")
return
var/border_size = (world.maxx - ruin_size) / 2
generate_space_ruin(mob.x, mob.y, mob.z, border_size, border_size)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/verbs/healall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if(!check_rights(R_FUN))
to_chat(src, "You need the fun permission to use this command.")
return
if(alert(src, "Confirm Heal All?","Are you sure?","Yes","No") == "No")
if(alert(src, "Confirm Heal All?","Are you sure?","Yes","No") != "Yes")
return
message_admins("[key_name_admin(usr)] healed all living mobs")
log_admin("[key_name_admin(usr)] healed all living mobs")
Expand Down
25 changes: 24 additions & 1 deletion code/modules/admin/verbs/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list(
/client/proc/show_line_profiling,
/client/proc/create_mapping_job_icons,
/client/proc/debug_z_levels,
/client/proc/place_ruin
/client/proc/place_ruin,
/client/proc/test_tgui_inputs,
))
GLOBAL_PROTECT(admin_verbs_debug_mapping)

Expand Down Expand Up @@ -375,3 +376,25 @@ GLOBAL_VAR_INIT(say_disabled, FALSE)
messages += "</table>"

to_chat(src, messages.Join(""))

/client/proc/test_tgui_inputs()
set name = "Test TGUI Inputs"
set category = "Debug"
var/response = tgui_alert(usr, "Message Here", "Title Here", list("Button 1", "Button 2", "Button 3"))
to_chat(usr, response)
response = tgui_alert(usr, "Message Here", "Title Here", list("Yes", "No"))
to_chat(usr, response)
var/list/L = list()
for (var/obj/machinery/camera/cam in GLOB.cameranet.cameras)
L["[cam.c_tag]"] = cam
response = tgui_input_list(usr, "Message Here", "Title Here", L)
to_chat(usr, response)
response = tgui_input_number(usr, "Message Here", "Title Here", 10, 500, 2)
to_chat(usr, response)
response = tgui_input_text(usr, "Message Here", "Title Here", "Default Text", 32, FALSE)
to_chat(usr, response)
response = tgui_input_text(usr, "Message Here", "Title Here", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore\
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit\
in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id\
est laborum.", 1024, TRUE)
to_chat(usr, response)
6 changes: 3 additions & 3 deletions code/modules/admin/verbs/randomverbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ Traitors and the like can also be revived with the previous role mostly intact.

if ((devastation != -1) || (heavy != -1) || (light != -1) || (flash != -1) || (flames != -1))
if ((devastation > 20) || (heavy > 20) || (light > 20) || (flames > 20))
if (alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", "Yes", "No") == "No")
if (alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", "Yes", "No") != "Yes")
return

explosion(O, devastation, heavy, light, flash, null, null,flames)
Expand Down Expand Up @@ -683,7 +683,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
return

var/confirm = alert(src, "Drop a brain?", "Confirm", "Yes", "No","Cancel")
if(confirm == "Cancel")
if(confirm == "Cancel" || !confirm)
return
//Due to the delay here its easy for something to have happened to the mob
if(!M)
Expand Down Expand Up @@ -800,7 +800,7 @@ Traitors and the like can also be revived with the previous role mostly intact.


var/notifyplayers = alert(src, "Do you want to notify the players?", "Options", "Yes", "No", "Cancel")
if(notifyplayers == "Cancel")
if(notifyplayers == "Cancel" || !notifyplayers)
return

log_admin("Admin [key_name(src)] has forced the players to have random appearances.")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/view_variables/mass_edit_variables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@

if (VV_NEW_TYPE)
var/many = alert(src, "Create only one [value["type"]] and assign each or a new one for each thing", "How Many", "One", "Many", "Cancel")
if (many == "Cancel")
if (many == "Cancel" || !many)
return
if (many == "Many")
many = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/view_variables/modify_variables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ GLOBAL_PROTECT(VVpixelmovement)
return
var/assoc = 0
var/prompt = alert(src, "Do you want to edit the key or its assigned value?", "Associated List", "Key", "Assigned Value", "Cancel")
if (prompt == "Cancel")
if (prompt == "Cancel" || !prompt)
return
if (prompt == "Assigned Value")
assoc = 1
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/brainwashing/brainwashing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
log_objective(C, objective, admin)
while(alert(admin,"Add another objective?","More Brainwashing","Yes","No") == "Yes")

if(alert(admin,"Confirm Brainwashing?","Are you sure?","Yes","No") == "No")
if(alert(admin,"Confirm Brainwashing?","Are you sure?","Yes","No") != "Yes")
return

if(!LAZYLEN(objectives))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/changeling/powers/headcrab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/datum/action/changeling/headcrab/sting_action(mob/user)
set waitfor = FALSE
if(alert("Are we sure we wish to kill ourself and create a headslug?",,"Yes", "No") == "No")
if(alert("Are we sure we wish to kill ourself and create a headslug?",,"Yes", "No") != "Yes")
return
if(isliving(user))
var/mob/living/L = user
Expand Down
Loading

0 comments on commit 5d798d2

Please sign in to comment.