From dc22e02a1b5a9e729eb9136ba7a908531bc8a0e9 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Fri, 1 Oct 2021 23:08:08 -0700 Subject: [PATCH 01/35] Removes minesweeper --- code/game/machinery/computer/arcade.dm | 5 +- .../machinery/computer/arcade/minesweeper.dm | 413 ------------------ .../circuitboards/computer_circuitboards.dm | 5 - code/modules/asset_cache/asset_list_items.dm | 18 - code/modules/cargo/packs/misc.dm | 4 +- .../comp_board_designs_all_misc.dm | 8 - .../techweb/nodes/computer_hud_nodes.dm | 2 +- 7 files changed, 5 insertions(+), 450 deletions(-) delete mode 100644 code/game/machinery/computer/arcade/minesweeper.dm diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index dd2ebf287f..e430ac469f 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -82,9 +82,8 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( // If it's a generic arcade machine, pick a random arcade // circuit board for it and make the new machine if(!circuit) - var/list/gameodds = list(/obj/item/circuitboard/computer/arcade/battle = 33, - /obj/item/circuitboard/computer/arcade/orion_trail = 33, - /obj/item/circuitboard/computer/arcade/minesweeper = 33, + var/list/gameodds = list(/obj/item/circuitboard/computer/arcade/battle = 50, + /obj/item/circuitboard/computer/arcade/orion_trail = 50, /obj/item/circuitboard/computer/arcade/amputation = 2) var/thegame = pickweight(gameodds) var/obj/item/circuitboard/CB = new thegame() diff --git a/code/game/machinery/computer/arcade/minesweeper.dm b/code/game/machinery/computer/arcade/minesweeper.dm deleted file mode 100644 index 1027ab1815..0000000000 --- a/code/game/machinery/computer/arcade/minesweeper.dm +++ /dev/null @@ -1,413 +0,0 @@ -#define MINESWEEPER_GAME_MAIN_MENU 0 -#define MINESWEEPER_GAME_PLAYING 1 -#define MINESWEEPER_GAME_LOST 2 -#define MINESWEEPER_GAME_WON 3 -#define MINESWEEPERIMG(what) {""} //Basically bypassing asset.icon_tag() - -/obj/machinery/computer/arcade/minesweeper - name = "Minesweeper" - desc = "An arcade machine that generates grids. It seems that the machine sparks and screeches when a grid is generated, as if it cannot cope with the intensity of generating the grid." - icon_state = "arcade" - circuit = /obj/item/circuitboard/computer/arcade/minesweeper - var/area - var/difficulty = "" //To show what difficulty you are playing - var/flag_text = "" - var/flagging = FALSE - var/game_status = MINESWEEPER_GAME_MAIN_MENU - var/mine_limit = 0 - var/mine_placed = 0 - var/mine_sound = TRUE //So it doesn't get repeated when multiple mines are exposed - var/randomcolour = 1 - var/randomnumber = 1 //Random emagged game iteration number to be displayed, put here so it is persistent across one individual arcade machine - var/safe_squares_revealed - var/saved_web = "" //To display the web if you click on the arcade - var/win_condition - var/rows = 1 - var/columns = 1 - var/table[31][51] //Make the board boys, 30x50 board - var/spark_spam = FALSE - -/obj/machinery/computer/arcade/minesweeper/interact(mob/user) - var/emagged = CHECK_BITFIELD(obj_flags, EMAGGED) - var/dat - if(game_status == MINESWEEPER_GAME_MAIN_MENU) - dat += "Minesweeper
Minesweeper[emagged ? " EXTREME EDITION: Iteration #[randomnumber]" : ""]
" //Different colour mix for every random number made - dat += " [emagged ? "Explode in the game, explode in real life" : "Reveal all the squares without hitting a mine"]!
What difficulty do you want to play?



Easy (9x9 board, 10 mines)
Intermediate (16x16 board, 40 mines)
Hard (16x30 board, 99 mines)
Custom" - else - dat = saved_web - user = usr - - var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/simple/minesweeper) - assets.send(user) - - user << browse(dat,"window=minesweeper,size=400x500") - add_fingerprint(user) - - . = ..() - -/obj/machinery/computer/arcade/minesweeper/proc/reset_spark_spam() - spark_spam = FALSE - -/obj/machinery/computer/arcade/minesweeper/Topic(href, href_list) - . = ..() - if(.) - return - - var/exploding_hell = FALSE //For emagged failures - var/reset_board = FALSE - var/mob/living/user = usr //To identify who the hell is using this window, this should also make things like aliens and monkeys able to use the machine!! - var/web_difficulty_menu = " Reveal all the squares without hitting a mine!
What difficulty do you want to play?



Easy (9x9 board, 10 mines)
Intermediate (16x16 board, 40 mines)
Hard (16x30 board, 99 mines)
Custom" - var/web = "Minesweeper
Minesweeper
" - var/static_web = "Minesweeper
Minesweeper
" //When we need to revert to the main menu we set web as this - web = static_web - - if(CHECK_BITFIELD(obj_flags, EMAGGED)) - web = "Minesweeper
Minesweeper EXTREME EDITION: Iteration #[randomnumber]
" //Different colour mix for every random number made - if(!spark_spam) - do_sparks(5, 1, src) - spark_spam = TRUE - addtimer(CALLBACK(src, .proc/reset_spark_spam), 30) - - - var/startup_sound = CHECK_BITFIELD(obj_flags, EMAGGED) ? 'sound/arcade/minesweeper_emag2.ogg' : 'sound/arcade/minesweeper_startup.ogg' - - if(href_list["Main_Menu"]) - game_status = MINESWEEPER_GAME_MAIN_MENU - mine_limit = 0 - rows = 0 - columns = 0 - mine_placed = 0 - if(href_list["Easy"]) - playsound(loc, startup_sound, 50, FALSE, extrarange = -3) - flag_text = "OFF" - game_status = MINESWEEPER_GAME_PLAYING - reset_board = TRUE - difficulty = "Easy" - rows = 10 //9x9 board - columns = 10 - mine_limit = 10 - if(href_list["Intermediate"]) - playsound(loc, startup_sound, 50, FALSE, extrarange = -3) - flag_text = "OFF" - game_status = MINESWEEPER_GAME_PLAYING - reset_board = TRUE - difficulty = "Intermediate" - rows = 17 //16x16 board - columns = 17 - mine_limit = 40 - if(href_list["Hard"]) - playsound(loc, startup_sound, 50, FALSE, extrarange = -3) - flag_text = "OFF" - game_status = MINESWEEPER_GAME_PLAYING - reset_board = TRUE - difficulty = "Hard" - rows = 17 //16x30 board - columns = 31 - mine_limit = 99 - if(href_list["Custom"]) - if(custom_generation(usr)) - flag_text = "OFF" - game_status = MINESWEEPER_GAME_PLAYING - reset_board = TRUE - difficulty = "Custom" - playsound(loc, startup_sound, 50, FALSE, extrarange = -3) - if(href_list["Flag"]) - playsound(loc, 'sound/arcade/minesweeper_boardpress.ogg', 50, FALSE, extrarange = -3) - if(!flagging) - flagging = TRUE - flag_text = "ON" - else - flagging = FALSE - flag_text = "OFF" - - if(game_status == MINESWEEPER_GAME_MAIN_MENU) - if(CHECK_BITFIELD(obj_flags, EMAGGED)) - playsound(loc, 'sound/arcade/minesweeper_emag2.ogg', 50, FALSE, extrarange = -3) - web += "Explode in the game, explode in real life!
What difficulty do you want to play?



Easy (9x9 board, 10 mines)
Intermediate (16x16 board, 40 mines)
Hard (16x30 board, 99 mines)
Custom" - else - playsound(loc, 'sound/arcade/minesweeper_startup.ogg', 50, FALSE, extrarange = -3) - web += web_difficulty_menu - - if(game_status == MINESWEEPER_GAME_PLAYING) - mine_sound = TRUE - - area = (rows-1)*(columns-1) - - if(reset_board) - mine_placed = 0 - var/reset_everything = TRUE - make_mines(reset_everything) - - safe_squares_revealed = 0 - win_condition = area-mine_placed - - if(game_status != MINESWEEPER_GAME_MAIN_MENU) - for(var/y1=1;y1= 0) //Check that it's not already revealed, and stop flag removal if we're out of flag mode - table[y1][x1] += 10 - if(table[y1][x1] != 10) - playsound(loc, 'sound/arcade/minesweeper_boardpress.ogg', 50, FALSE, extrarange = -3) - else - if(game_status != MINESWEEPER_GAME_LOST && game_status != MINESWEEPER_GAME_WON) - game_status = MINESWEEPER_GAME_LOST - if(CHECK_BITFIELD(obj_flags, EMAGGED) && !exploding_hell) - exploding_hell = TRUE - explode_EVERYTHING() - if(QDELETED(src)) - return - if(mine_sound) - switch(rand(1,3)) //Play every time a mine is hit - if(1) - playsound(loc, 'sound/arcade/minesweeper_explosion1.ogg', 50, FALSE, extrarange = -3) - if(2) - playsound(loc, 'sound/arcade/minesweeper_explosion2.ogg', 50, FALSE, extrarange = -3) - if(3) - playsound(loc, 'sound/arcade/minesweeper_explosion3.ogg', 50, FALSE, extrarange = -3) - mine_sound = FALSE - else - playsound(loc, 'sound/arcade/minesweeper_boardpress.ogg', 50, FALSE, extrarange = -3) - if(table[y1][x1] >= 0) //Check that it's not already flagged - table[y1][x1] -= 10 - else if(table[y1][x1] < 0) //If flagged, remove the flag - table[y1][x1] += 10 - if(table[y1][x1] > 10 && !reset_board) - safe_squares_revealed += 1 - var/y2 = y1 - var/x2 = x1 - work_squares(y2, x2) //Work squares while in this loop so there's less load - reset_board = FALSE - CHECK_TICK - - web += "" //Start setting up the html table - web += "" - for(var/y1=1;y1= win_condition && game_status == MINESWEEPER_GAME_PLAYING) - game_status = MINESWEEPER_GAME_WON - if(rows < 10 || columns < 10) //If less than easy difficulty - playsound(loc, 'sound/arcade/minesweeper_winfail.ogg', 50, FALSE, extrarange = -3) - say("You cleared the board of all mines, but you picked too small of a board! Try again with at least a 9x9 board!") - else - playsound(loc, 'sound/arcade/minesweeper_win.ogg', 50, FALSE, extrarange = -3) - say("You cleared the board of all mines! Congratulations!") - if(CHECK_BITFIELD(obj_flags, EMAGGED)) - var/itemname - switch(rand(1,3)) - if(1) - itemname = "a syndicate bomb beacon" - new /obj/item/sbeacondrop/bomb(loc) - if(2) - itemname = "a rocket launcher" - new /obj/item/gun/ballistic/rocketlauncher/unrestricted(loc) - new /obj/item/ammo_casing/caseless/rocket(loc) - new /obj/item/ammo_casing/caseless/rocket(loc) - new /obj/item/ammo_casing/caseless/rocket(loc) - if(3) - itemname = "two bags of c4" - new /obj/item/storage/backpack/duffelbag/syndie/c4(loc) - new /obj/item/storage/backpack/duffelbag/syndie/x4(loc) - message_admins("[key_name_admin(user)] won emagged Minesweeper and got [itemname]!") - visible_message("[src] dispenses [itemname]!", "You hear a chime and a clunk.") - DISABLE_BITFIELD(obj_flags, EMAGGED) - else - var/dope_prizes = (area >= 480) ? 6 : (area >= 256) ? 4 : 2 - prizevend(user, dope_prizes) - - if(game_status == MINESWEEPER_GAME_WON) - web += "[(rows < 10 || columns < 10) ? "You won, but your board was too small! Pick a bigger board next time!" : "Congratulations, you have won!"]
Want to play again?
Easy (9x9 board, 10 mines)
Intermediate (16x16 board, 40 mines)
Hard (16x30 board, 99 mines)
Custom

Return to Main Menu
" - - if(game_status == MINESWEEPER_GAME_LOST) - web += "You have lost!
Try again?
Easy (9x9 board, 10 mines)
Intermediate (16x16 board, 40 mines)
Hard (16x30 board, 99 mines)
Custom

Return to Main Menu
" - - if(game_status == MINESWEEPER_GAME_PLAYING) - web += "Return to Main Menu
" - web += "
Difficulty: [difficulty]
Mines: [mine_placed]
Rows: [rows-1]
Columns: [columns-1]
Flagging mode: [flag_text]
" - - web += "" - var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/simple/minesweeper) - saved_web = sheet.css_tag() - saved_web += web - updateDialog() - return - -/obj/machinery/computer/arcade/minesweeper/emag_act(mob/user) - . = ..() - if(CHECK_BITFIELD(obj_flags, EMAGGED)) - return - desc = "An arcade machine that generates grids. It's clunking and sparking everywhere, almost as if threatening to explode at any moment!" - do_sparks(5, 1, src) - randomnumber = rand(1,255) - randomcolour = rgb(randomnumber,randomnumber/2,randomnumber/3) - ENABLE_BITFIELD(obj_flags, EMAGGED) - if(game_status == MINESWEEPER_GAME_MAIN_MENU) - to_chat(user, "An ominous tune plays from the arcade's speakers!") - playsound(user, 'sound/arcade/minesweeper_emag1.ogg', 100, FALSE, extrarange = 3) - else //Can't let you do that, star fox! - to_chat(user, "The machine buzzes and sparks... the game has been reset!") - playsound(user, 'sound/machines/buzz-sigh.ogg', 100, FALSE, extrarange = 3) //Loud buzz - game_status = MINESWEEPER_GAME_MAIN_MENU - return TRUE - -/obj/machinery/computer/arcade/minesweeper/proc/custom_generation(mob/user) - playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3) //Entered into the menu so ping sound - var/new_rows = input(user, "How many rows do you want? (Minimum: 4, Maximum: 30)", "Minesweeper Rows") as null|num - if(!new_rows || !user.canUseTopic(src, !hasSiliconAccessInArea(user))) - return FALSE - new_rows = clamp(new_rows + 1, 4, 20) - playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3) - var/new_columns = input(user, "How many columns do you want? (Minimum: 4, Maximum: 50)", "Minesweeper Squares") as null|num - if(!new_columns || !user.canUseTopic(src, !hasSiliconAccessInArea(user))) - return FALSE - new_columns = clamp(new_columns + 1, 4, 30) - playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3) - var/grid_area = (new_rows - 1) * (new_columns - 1) - var/lower_limit = round(grid_area*0.156) - var/upper_limit = round(grid_area*0.85) - var/new_mine_limit = input(user, "How many mines do you want? (Minimum: [lower_limit], Maximum: [upper_limit])", "Minesweeper Mines") as null|num - if(!new_mine_limit || !user.canUseTopic(src, !hasSiliconAccessInArea(user))) - return FALSE - playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, FALSE, extrarange = -3) - rows = new_rows - columns = new_columns - mine_limit = clamp(new_mine_limit, lower_limit, upper_limit) - return TRUE - -/obj/machinery/computer/arcade/minesweeper/proc/make_mines(var/reset_everything) - if(mine_placed < mine_limit) - for(var/y1=1;y1 0 && x3 > 0) - y2 = y3 - x2 = x3 - if(table[y2][x2] == 1) - for(y3=y2-1;y3= rows || y3 < 1) - continue - for(x3=x2-1;x3= columns || x3 < 1) - continue - if(table[y3][x3] == 0) - table[y2][x2] += 1 - if(table[y2][x2] == 11) - for(y3=y2-1;y3= rows || y3 < 1) - continue - for(x3=x2-1;x3= columns || x3 < 1) - continue - if(table[y3][x3] > 0 && table[y3][x3] < 10) - table[y3][x3] += 10 - work_squares(y3, x3) //Refresh so we check everything we might be missing - -/obj/machinery/computer/arcade/minesweeper/proc/explode_EVERYTHING() - var/mob/living/user = usr - to_chat(user, "You feel a great sense of dread wash over you, as if you just unleashed armageddon upon yourself!") - var/row_limit = rows-1 - var/column_limit = columns-1 - var/mine_limit_v2 = mine_limit - if(rows > 21) - row_limit = 20 - if(columns > 21) - column_limit = 20 - if(mine_limit > (rows*columns) * 0.25) - mine_limit_v2 = 24 - message_admins("[key_name_admin(user)] failed an emagged Minesweeper arcade and has unleashed an explosion armageddon of size [row_limit],[column_limit] around [ADMIN_LOOKUPFLW(user.loc)]!") - if(mine_limit_v2 < 10) - explosion(loc, 2, 5, 10, 15) //Thought you could survive by putting as few mines as possible, huh?? - else - explosion(loc, 1, 3, rand(1,5), rand(1,10)) - var/list/targets = list() - var/cur_y = y - round(row_limit * 0.5, 1) - var/starting_row = 1 - if(cur_y < 1) - starting_row -= cur_y - 1 - cur_y = 1 - var/start_x = x - round(column_limit * 0.5, 1) - var/starting_column = 1 - if(start_x < 1) - starting_column -= start_x - 1 - start_x = 1 - for(var/row in starting_row to length(table)) //translate the mines locations into actual turf coordinates. - if(!locate(cur_y, start_x, z)) - break - var/cur_x = start_x - for(var/column in starting_column to length(table[row])) - var/coord_value = table[row][column] - if(coord_value == 10 || coord_value == 0) //there is a mine in here. - var/turf/T = locate(cur_y, cur_x, z) - if(!T) - break - targets += T - cur_x++ - cur_y++ - var/num_explosions = 0 - for(var/T in shuffle(targets)) //Create a shitton of explosions in irl turfs if we lose, it will probably kill us - addtimer(CALLBACK(GLOBAL_PROC, /proc/explosion, T, 0, rand(1,2),rand(1,5),rand(3,10), FALSE), 15 * ++num_explosions) - if(num_explosions == mine_limit_v2) - return - -#undef MINESWEEPERIMG -#undef MINESWEEPER_GAME_MAIN_MENU -#undef MINESWEEPER_GAME_PLAYING -#undef MINESWEEPER_GAME_LOST -#undef MINESWEEPER_GAME_WON diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index afab49ac76..742a1fe3b0 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -259,11 +259,6 @@ build_path = /obj/machinery/computer/arcade/orion_trail -/obj/item/circuitboard/computer/arcade/minesweeper - name = "Minesweeper (Computer Board)" - icon_state = "generic" - build_path = /obj/machinery/computer/arcade/minesweeper - /obj/item/circuitboard/computer/holodeck// Not going to let people get this, but it's just here for future name = "Holodeck Control (Computer Board)" icon_state = "generic" diff --git a/code/modules/asset_cache/asset_list_items.dm b/code/modules/asset_cache/asset_list_items.dm index 0af024985e..2d680fe212 100644 --- a/code/modules/asset_cache/asset_list_items.dm +++ b/code/modules/asset_cache/asset_list_items.dm @@ -273,24 +273,6 @@ "frenching" = 'icons/UI_Icons/Achievements/Misc/frenchingthebubble.png' ) -/datum/asset/spritesheet/simple/minesweeper - name = "minesweeper" - assets = list( - "1" = 'icons/UI_Icons/minesweeper_tiles/one.png', - "2" = 'icons/UI_Icons/minesweeper_tiles/two.png', - "3" = 'icons/UI_Icons/minesweeper_tiles/three.png', - "4" = 'icons/UI_Icons/minesweeper_tiles/four.png', - "5" = 'icons/UI_Icons/minesweeper_tiles/five.png', - "6" = 'icons/UI_Icons/minesweeper_tiles/six.png', - "7" = 'icons/UI_Icons/minesweeper_tiles/seven.png', - "8" = 'icons/UI_Icons/minesweeper_tiles/eight.png', - "empty" = 'icons/UI_Icons/minesweeper_tiles/empty.png', - "flag" = 'icons/UI_Icons/minesweeper_tiles/flag.png', - "hidden" = 'icons/UI_Icons/minesweeper_tiles/hidden.png', - "mine" = 'icons/UI_Icons/minesweeper_tiles/mine.png', - "minehit" = 'icons/UI_Icons/minesweeper_tiles/minehit.png' - ) - /datum/asset/spritesheet/simple/pills name = "pills" assets = list( diff --git a/code/modules/cargo/packs/misc.dm b/code/modules/cargo/packs/misc.dm index 91663dbe0f..990e32df67 100644 --- a/code/modules/cargo/packs/misc.dm +++ b/code/modules/cargo/packs/misc.dm @@ -171,11 +171,11 @@ desc = "Start up your own grand casino with this crate filled with slot machine and arcade boards!" cost = 3000 contains = list(/obj/item/circuitboard/computer/arcade/battle, + /obj/item/circuitboard/computer/arcade/battle, /obj/item/circuitboard/computer/arcade/battle, /obj/item/circuitboard/computer/arcade/orion_trail, /obj/item/circuitboard/computer/arcade/orion_trail, - /obj/item/circuitboard/computer/arcade/minesweeper, - /obj/item/circuitboard/computer/arcade/minesweeper, + /obj/item/circuitboard/computer/arcade/orion_trail, /obj/item/circuitboard/computer/slot_machine, /obj/item/circuitboard/computer/slot_machine, /obj/item/circuitboard/computer/slot_machine, diff --git a/code/modules/research/designs/comp_board_designs/comp_board_designs_all_misc.dm b/code/modules/research/designs/comp_board_designs/comp_board_designs_all_misc.dm index 99caa5b480..8ea883edf1 100644 --- a/code/modules/research/designs/comp_board_designs/comp_board_designs_all_misc.dm +++ b/code/modules/research/designs/comp_board_designs/comp_board_designs_all_misc.dm @@ -21,14 +21,6 @@ category = list("Computer Boards") departmental_flags = DEPARTMENTAL_FLAG_ALL -/datum/design/board/minesweeper - name = "Computer Design (Minesweeper Arcade Machine)" - desc = "Allows for the construction of circuit boards used to build a new Minesweeper machine." - id = "arcade_minesweeper" - build_path = /obj/item/circuitboard/computer/arcade/minesweeper - category = list("Computer Boards") - departmental_flags = DEPARTMENTAL_FLAG_ALL - /datum/design/board/slot_machine name = "Computer Design (Slot Machine)" desc = "Allows for the construction of circuit boards used to build a new slot machine." diff --git a/code/modules/research/techweb/nodes/computer_hud_nodes.dm b/code/modules/research/techweb/nodes/computer_hud_nodes.dm index 2db03861e9..0f2cf2e4bd 100644 --- a/code/modules/research/techweb/nodes/computer_hud_nodes.dm +++ b/code/modules/research/techweb/nodes/computer_hud_nodes.dm @@ -56,5 +56,5 @@ display_name = "Games and Toys" description = "For the slackers on the station." prereq_ids = list("comptech") - design_ids = list("arcade_battle", "arcade_orion", "arcade_minesweeper", "slotmachine", "autoylathe") + design_ids = list("arcade_battle", "arcade_orion", "slotmachine", "autoylathe") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 1000) From c40d9c71b45311d297acd3b0a1c7245b25dcc642 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Fri, 1 Oct 2021 23:18:24 -0700 Subject: [PATCH 02/35] why was this not included --- tgstation.dme | 1 - 1 file changed, 1 deletion(-) diff --git a/tgstation.dme b/tgstation.dme index 86814261c5..6dbff30e17 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -932,7 +932,6 @@ #include "code\game\machinery\computer\telecrystalconsoles.dm" #include "code\game\machinery\computer\teleporter.dm" #include "code\game\machinery\computer\arcade\battle.dm" -#include "code\game\machinery\computer\arcade\minesweeper.dm" #include "code\game\machinery\computer\arcade\misc_arcade.dm" #include "code\game\machinery\computer\arcade\orion_trail.dm" #include "code\game\machinery\computer\prisoner\_prisoner.dm" From 82e6b6cf98210b238743e6227fbf5f8b6d7f3d66 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Fri, 1 Oct 2021 23:29:45 -0700 Subject: [PATCH 03/35] maps --- _maps/map_files/BoxStation/BoxStation.dmm | 6 +++--- _maps/map_files/CogStation/CogStation.dmm | 4 ++-- _maps/map_files/LambdaStation/dorms.dmm | 2 +- _maps/map_files/MetaStation/MetaStation.dmm | 2 +- _maps/map_files/Snaxi/Snaxi.dmm | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index 028d531f17..fd237458ef 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -17822,7 +17822,7 @@ /turf/open/floor/wood, /area/service/bar) "aRx" = ( -/obj/machinery/computer/arcade/minesweeper, +/obj/machinery/computer/arcade/orion_trail, /turf/open/floor/wood, /area/service/bar) "aRy" = ( @@ -60082,7 +60082,7 @@ /turf/open/floor/plasteel, /area/commons/dorms) "nZL" = ( -/obj/machinery/computer/arcade/minesweeper, +/obj/machinery/computer/arcade/orion_trail, /turf/open/floor/wood, /area/command/heads_quarters/captain) "oax" = ( @@ -64882,7 +64882,7 @@ /turf/open/floor/plasteel, /area/security/prison/upper) "vim" = ( -/obj/machinery/computer/arcade/minesweeper, +/obj/machinery/computer/arcade/battle, /obj/effect/decal/cleanable/dirt, /obj/structure/cable{ icon_state = "1-2" diff --git a/_maps/map_files/CogStation/CogStation.dmm b/_maps/map_files/CogStation/CogStation.dmm index 74debaa989..c5e8df8ed2 100644 --- a/_maps/map_files/CogStation/CogStation.dmm +++ b/_maps/map_files/CogStation/CogStation.dmm @@ -858,7 +858,7 @@ /turf/open/floor/plating/airless, /area/router/aux) "acf" = ( -/obj/machinery/computer/arcade/minesweeper, +/obj/machinery/computer/arcade/battle, /turf/open/floor/carpet/arcade, /area/commons/arcade) "acg" = ( @@ -4505,7 +4505,7 @@ /area/maintenance/solars/starboard/fore) "alg" = ( /obj/structure/frame/machine, -/obj/item/circuitboard/computer/arcade/minesweeper, +/obj/item/circuitboard/computer/arcade/orion_trail, /turf/open/floor/plating, /area/construction/secondary) "alh" = ( diff --git a/_maps/map_files/LambdaStation/dorms.dmm b/_maps/map_files/LambdaStation/dorms.dmm index afe85da6cc..e1133584b8 100644 --- a/_maps/map_files/LambdaStation/dorms.dmm +++ b/_maps/map_files/LambdaStation/dorms.dmm @@ -9501,7 +9501,7 @@ /obj/machinery/camera/autoname{ dir = 4 }, -/obj/machinery/computer/arcade/minesweeper{ +/obj/machinery/computer/arcade/orion_trail{ dir = 4 }, /turf/open/floor/plasteel, diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 5b5885aca6..cc78b62bdc 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -70208,7 +70208,7 @@ }, /area/command/gateway) "pCQ" = ( -/obj/machinery/computer/arcade/minesweeper{ +/obj/machinery/computer/arcade/battle{ dir = 4 }, /turf/open/floor/plasteel, diff --git a/_maps/map_files/Snaxi/Snaxi.dmm b/_maps/map_files/Snaxi/Snaxi.dmm index d9cf6c7948..1db8a64a97 100644 --- a/_maps/map_files/Snaxi/Snaxi.dmm +++ b/_maps/map_files/Snaxi/Snaxi.dmm @@ -870,7 +870,7 @@ /obj/machinery/light{ dir = 4 }, -/obj/machinery/computer/arcade/minesweeper{ +/obj/machinery/computer/arcade/orion_trail{ dir = 8 }, /obj/structure/sign/poster/official/nanomichi_ad{ @@ -5842,7 +5842,7 @@ /turf/open/floor/plating, /area/maintenance/aft/secondary) "akQ" = ( -/obj/machinery/computer/arcade/minesweeper, +/obj/machinery/computer/arcade/battle, /turf/open/floor/plasteel/dark, /area/security/prison) "akR" = ( @@ -34938,7 +34938,7 @@ dir = 1; pixel_y = -24 }, -/obj/machinery/computer/arcade/minesweeper{ +/obj/machinery/computer/arcade/orion_trail{ dir = 4 }, /turf/open/floor/plasteel/dark, From bbe32fa38adf208849178a5c22f1ceb0c2e22141 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Tue, 5 Oct 2021 00:33:49 -0300 Subject: [PATCH 04/35] Upload files --- code/__HELPERS/reagents.dm | 6 +- code/__HELPERS/text.dm | 2 +- code/controllers/subsystem/mapping.dm | 4 +- code/controllers/subsystem/shuttle.dm | 2 +- .../storage/concrete/bag_of_holding.dm | 2 +- code/datums/explosion.dm | 2 +- code/game/gamemodes/dynamic/dynamic.dm | 2 +- code/game/gamemodes/gangs/dominator.dm | 2 +- code/game/machinery/bloodbankgen.dm | 2 +- .../machinery/computer/launchpad_control.dm | 2 +- code/game/machinery/computer/mechlaunchpad.dm | 2 +- code/game/machinery/computer/security.dm | 2 +- code/game/machinery/cryopod.dm | 4 +- code/game/machinery/launch_pad.dm | 2 +- code/game/machinery/syndicatebomb.dm | 2 +- code/game/objects/items/AI_modules.dm | 2 +- code/game/objects/items/cards_ids.dm | 6 +- code/game/objects/items/crab17.dm | 2 +- code/game/objects/items/devices/aicard.dm | 2 +- code/game/objects/items/dualsaber.dm | 2 +- .../items/implants/implant_explosive.dm | 2 +- code/game/objects/items/melee/energy.dm | 2 +- code/game/objects/items/toys.dm | 2 +- code/game/objects/objs.dm | 6 +- .../crates_lockers/closets/genpop.dm | 2 +- .../objects/structures/ghost_role_spawners.dm | 2 +- code/game/objects/structures/mirror.dm | 6 +- code/modules/admin/DB_ban/functions.dm | 4 +- code/modules/admin/admin.dm | 18 +- code/modules/admin/admin_verbs.dm | 4 +- code/modules/admin/antag_panel.dm | 4 +- code/modules/admin/callproc/callproc.dm | 2 +- code/modules/admin/check_antagonists.dm | 2 +- code/modules/admin/create_poll.dm | 8 +- code/modules/admin/fun_balloon.dm | 2 +- code/modules/admin/outfit_editor.dm | 4 +- code/modules/admin/permissionedit.dm | 6 +- code/modules/admin/sql_message_system.dm | 6 +- code/modules/admin/stickyban.dm | 14 +- code/modules/admin/topic.dm | 156 ++++----- code/modules/admin/verbs/adminhelp.dm | 2 +- code/modules/admin/verbs/ak47s.dm | 2 +- code/modules/admin/verbs/debug.dm | 40 +-- code/modules/admin/verbs/diagnostics.dm | 6 +- code/modules/admin/verbs/dice.dm | 4 +- code/modules/admin/verbs/fps.dm | 2 +- code/modules/admin/verbs/getlogs.dm | 2 +- .../admin/verbs/map_template_loadverb.dm | 8 +- code/modules/admin/verbs/mapping.dm | 2 +- code/modules/admin/verbs/maprotation.dm | 2 +- code/modules/admin/verbs/onlyone.dm | 2 +- code/modules/admin/verbs/playsound.dm | 4 +- code/modules/admin/verbs/randomverbs.dm | 40 +-- .../admin/verbs/reestablish_db_connection.dm | 4 +- code/modules/admin/verbs/secrets.dm | 32 +- code/modules/admin/verbs/selectequipment.dm | 6 +- code/modules/admin/verbs/shuttlepanel.dm | 6 +- .../admin/view_variables/admin_delete.dm | 2 +- .../admin/view_variables/get_variables.dm | 4 +- .../view_variables/mass_edit_variables.dm | 6 +- .../admin/view_variables/modify_variables.dm | 10 +- code/modules/admin/view_variables/topic.dm | 4 +- .../admin/view_variables/topic_list.dm | 2 +- code/modules/antagonists/abductor/abductor.dm | 2 +- .../bloodsucker/objects/bloodsucker_coffin.dm | 2 +- .../bloodsucker/objects/bloodsucker_crypt.dm | 4 +- .../antagonists/brainwashing/brainwashing.dm | 4 +- .../changeling/powers/fakedeath.dm | 2 +- .../antagonists/changeling/powers/headcrab.dm | 2 +- .../clockcult/clock_effects/clock_sigils.dm | 2 +- .../clock_items/construct_chassis.dm | 2 +- .../clockcult/clock_mobs/_eminence.dm | 4 +- .../antagonists/clockcult/clock_scripture.dm | 2 +- .../ark_of_the_clockwork_justicar.dm | 8 +- .../clock_structures/clockwork_obelisk.dm | 2 +- .../clock_structures/eminence_spire.dm | 8 +- .../clock_structures/heralds_beacon.dm | 2 +- .../ratvar_the_clockwork_justicar.dm | 2 +- code/modules/antagonists/cult/blood_magic.dm | 4 +- code/modules/antagonists/cult/cult_comms.dm | 2 +- code/modules/antagonists/cult/ritual.dm | 2 +- code/modules/antagonists/cult/runes.dm | 2 +- code/modules/antagonists/devil/devil.dm | 2 +- .../antagonists/disease/disease_mob.dm | 2 +- code/modules/antagonists/monkey/monkey.dm | 4 +- .../nukeop/equipment/nuclear_challenge.dm | 4 +- .../traitor/equipment/Malf_Modules.dm | 4 +- .../antagonists/wizard/equipment/soulstone.dm | 2 +- code/modules/assembly/holder.dm | 2 +- code/modules/awaymissions/capture_the_flag.dm | 2 +- code/modules/awaymissions/corpse.dm | 4 +- code/modules/awaymissions/signpost.dm | 2 +- code/modules/buildmode/submodes/advanced.dm | 4 +- code/modules/buildmode/submodes/fill.dm | 6 +- code/modules/buildmode/submodes/mapgen.dm | 2 +- code/modules/cargo/centcom_podlauncher.dm | 10 +- code/modules/client/client_procs.dm | 2 +- code/modules/client/preferences.dm | 8 +- code/modules/client/preferences_toggles.dm | 10 +- code/modules/client/verbs/ooc.dm | 2 +- code/modules/client/verbs/suicide.dm | 16 +- code/modules/clothing/spacesuits/hardsuit.dm | 2 +- code/modules/events/immovable_rod.dm | 2 +- code/modules/events/pirates.dm | 2 +- code/modules/events/spacevine.dm | 2 +- code/modules/hydroponics/beekeeping/beebox.dm | 2 +- code/modules/hydroponics/hydroponics.dm | 2 +- code/modules/library/lib_machines.dm | 12 +- code/modules/library/soapstone.dm | 2 +- code/modules/mob/dead/dead.dm | 2 +- .../modules/mob/dead/new_player/new_player.dm | 8 +- code/modules/mob/dead/observer/observer.dm | 8 +- code/modules/mob/dead/observer/respawn.dm | 6 +- .../carbon/alien/humanoid/alien_powers.dm | 2 +- .../mob/living/carbon/alien/larva/powers.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 10 +- code/modules/mob/living/living.dm | 2 +- code/modules/mob/living/silicon/ai/ai.dm | 6 +- .../mob/living/silicon/pai/personality.dm | 2 +- .../mob/living/silicon/pai/software.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 4 +- .../friendly/drone/drones_as_items.dm | 2 +- .../friendly/drone/interaction.dm | 2 +- .../living/simple_animal/friendly/plushie.dm | 2 +- .../simple_animal/hostile/banana_spider.dm | 2 +- .../mob/living/simple_animal/hostile/bread.dm | 2 +- .../simple_animal/hostile/giant_spider.dm | 2 +- .../hostile/megafauna/colossus.dm | 4 +- .../hostile/mining_mobs/elites/elite.dm | 2 +- .../simple_animal/hostile/space_dragon.dm | 4 +- .../simple_animal/hostile/venus_human_trap.dm | 2 +- .../living/simple_animal/simple_animal_vr.dm | 4 +- code/modules/mob/say.dm | 4 +- code/modules/mob/transform_procs.dm | 4 +- .../computers/item/computer.dm | 2 +- code/modules/newscaster/newscaster_machine.dm | 18 +- .../ninja_suit_initialisation.dm | 2 +- code/modules/paperwork/contract.dm | 4 +- code/modules/photography/camera/camera.dm | 2 +- code/modules/power/apc.dm | 2 +- code/modules/projectiles/pins.dm | 2 +- .../chemistry/machinery/chem_dispenser.dm | 4 +- .../reagents/reagent_containers/spray.dm | 2 +- .../xenobiology/crossbreeding/_misc.dm | 2 +- .../research/xenobiology/xenobiology.dm | 2 +- .../ruins/objects_and_mobs/necropolis_gate.dm | 2 +- .../ruins/spaceruin_code/hilbertshotel.dm | 2 +- code/modules/tgui/tgui_input_text.dm | 299 ++++++++++++++++++ code/modules/tgui_panel/external.dm | 2 +- code/modules/vore/eating/living.dm | 4 +- interface/interface.dm | 8 +- .../projectiles/guns/ballistic/rifles.dm | 4 +- .../projectiles/guns/energy/energy_gun.dm | 2 +- tgstation.dme | 1 + tgui/packages/tgui/interfaces/InputModal.js | 117 +++++++ 156 files changed, 830 insertions(+), 413 deletions(-) create mode 100644 code/modules/tgui/tgui_input_text.dm create mode 100644 tgui/packages/tgui/interfaces/InputModal.js diff --git a/code/__HELPERS/reagents.dm b/code/__HELPERS/reagents.dm index fa655efce4..d5080c863d 100644 --- a/code/__HELPERS/reagents.dm +++ b/code/__HELPERS/reagents.dm @@ -75,11 +75,11 @@ /proc/choose_reagent_id(mob/user) var/chosen_id - switch(alert(user, "Choose a method.", "Add Reagents", "Search", "Choose from a list", "I'm feeling lucky")) + switch(tgui_alert(user, "Choose a method.", "Add Reagents", list("Search", "Choose from a list", "I'm feeling lucky"))) if("Search") var/valid_id while(!valid_id) - chosen_id = input(user, "Enter the ID of the reagent you want to add.", "Search reagents") as null|text + chosen_id = tgui_input_text(user, "Enter the ID of the reagent you want to add.", "Search reagents") if(isnull(chosen_id)) //Get me out of here! break if(!ispath(text2path(chosen_id))) @@ -91,7 +91,7 @@ if(!valid_id) to_chat(user, "A reagent with that ID doesn't exist!") if("Choose from a list") - chosen_id = input(user, "Choose a reagent to add.", "Choose a reagent.") as null|anything in subtypesof(/datum/reagent) + chosen_id = tgui_input_list(user, "Choose a reagent to add.", "Choose a reagent.", subtypesof(/datum/reagent)) if("I'm feeling lucky") chosen_id = pick(subtypesof(/datum/reagent)) return chosen_id diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index dec44653af..62703ab2e6 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -42,7 +42,7 @@ /proc/sanitize_name(t,list/repl_chars = null) if(t == "space" || t == "floor" || t == "wall" || t == "r-wall" || t == "monkey" || t == "unknown" || t == "inactive ai") //prevents these common metagamey names - alert("Invalid name.") + tgui_alert(usr, "Invalid name.") return "" return sanitize(t) diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index d0a6336223..fb8ad4a078 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -483,7 +483,7 @@ GLOBAL_LIST_EMPTY(the_station_areas) if(!holder ||!check_rights(R_FUN)) return - var/choice = alert(src, "What kind of level would you like to load?", "Load Away/VR", AWAY_MISSION_NAME, VIRT_REALITY_NAME, "Cancel") + var/choice = tgui_alert(src, "What kind of level would you like to load?", "Load Away/VR", list(AWAY_MISSION_NAME, VIRT_REALITY_NAME, "Cancel")) var/list/possible_options var/list/ztraits @@ -493,7 +493,7 @@ GLOBAL_LIST_EMPTY(the_station_areas) ztraits = list(ZTRAIT_AWAY = TRUE, ZTRAIT_VR = TRUE) if(AWAY_MISSION_NAME) if(!GLOB.the_gateway) - if(alert("There's no home gateway on the station. You sure you want to continue ?", "Uh oh", "Yes", "No") != "Yes") + if(tgui_alert(src, "There's no home gateway on the station. You sure you want to continue ?", "Uh oh", list("Yes", "No")) != "Yes") return possible_options = GLOB.potential_away_levels ztraits = list(ZTRAIT_AWAY = TRUE) diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 6af79d4d14..34e79b6549 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -943,6 +943,6 @@ SUBSYSTEM_DEF(shuttle) SSblackbox.record_feedback("text", "shuttle_manipulator", 1, "[mdp.name]") shuttle_loading = FALSE if(emergency == mdp) //you just changed the emergency shuttle, there are events in game + captains that can change your snowflake choice. - var/set_purchase = alert(usr, "Do you want to also disable shuttle purchases/random events that would change the shuttle?", "Butthurt Admin Prevention", "Yes, disable purchases/events", "No, I want to possibly get owned") + var/set_purchase = tgui_alert(usr, "Do you want to also disable shuttle purchases/random events that would change the shuttle?", "Butthurt Admin Prevention", list("Yes, disable purchases/events", "No, I want to possibly get owned")) if(set_purchase == "Yes, disable purchases/events") SSshuttle.shuttle_purchased = SHUTTLEPURCHASE_FORCED diff --git a/code/datums/components/storage/concrete/bag_of_holding.dm b/code/datums/components/storage/concrete/bag_of_holding.dm index e19edc89d8..010437dbb1 100644 --- a/code/datums/components/storage/concrete/bag_of_holding.dm +++ b/code/datums/components/storage/concrete/bag_of_holding.dm @@ -5,7 +5,7 @@ var/list/obj/item/storage/backpack/holding/matching = typecache_filter_list(W.GetAllContents(), typecacheof(/obj/item/storage/backpack/holding)) matching -= A if(istype(W, /obj/item/storage/backpack/holding) || matching.len) - var/safety = alert(user, "Doing this will have extremely dire consequences for the station and its crew. Be sure you know what you're doing.", "Put in [A.name]?", "Abort", "Proceed") + var/safety = tgui_alert(user, "Doing this will have extremely dire consequences for the station and its crew. Be sure you know what you're doing.", "Put in [A.name]?", list("Abort", "Proceed")) if(safety != "Proceed" || QDELETED(A) || QDELETED(W) || QDELETED(user) || !user.canUseTopic(A, BE_CLOSE, iscarbon(user))) return var/turf/loccheck = get_turf(A) diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm index 8cdfaa4308..a7add7cc3c 100644 --- a/code/datums/explosion.dm +++ b/code/datums/explosion.dm @@ -385,7 +385,7 @@ GLOBAL_LIST_EMPTY(explosions) set name = "Check Bomb Impact" set category = "Debug" - var/newmode = alert("Use reactionary explosions?","Check Bomb Impact", "Yes", "No") + var/newmode = tgui_alert(src, "Use reactionary explosions?","Check Bomb Impact", list("Yes", "No")) var/turf/epicenter = get_turf(mob) if(!epicenter) return diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index c7fee7df96..0839f25137 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -311,7 +311,7 @@ GLOBAL_VAR_INIT(dynamic_forced_storyteller, null) /datum/game_mode/dynamic/proc/show_threatlog(mob/admin) if(!SSticker.HasRoundStarted()) - alert("The round hasn't started yet!") + tgui_alert(usr, "The round hasn't started yet!") return if(!check_rights(R_ADMIN)) diff --git a/code/game/gamemodes/gangs/dominator.dm b/code/game/gamemodes/gangs/dominator.dm index a253aa906c..8c997f8cde 100644 --- a/code/game/gamemodes/gangs/dominator.dm +++ b/code/game/gamemodes/gangs/dominator.dm @@ -176,7 +176,7 @@ return var/time = round(tempgang.determine_domination_time()/60,0.1) - if(alert(user,"A takeover will require [time] minutes.\nYour gang will be unable to gain influence while it is active.\nThe entire station will likely be alerted to it once it starts.\nYou have [tempgang.dom_attempts] attempt(s) remaining. Are you ready?","Confirm","Ready","Later") == "Ready") + if(tgui_alert(user,"A takeover will require [time] minutes.\nYour gang will be unable to gain influence while it is active.\nThe entire station will likely be alerted to it once it starts.\nYou have [tempgang.dom_attempts] attempt(s) remaining. Are you ready?","Confirm",list("Ready","Later")) == "Ready") if((tempgang.domination_time != NOT_DOMINATING) || !tempgang.dom_attempts || !in_range(src, user) || !isturf(loc)) return 0 diff --git a/code/game/machinery/bloodbankgen.dm b/code/game/machinery/bloodbankgen.dm index 31fac02d83..b089b06a88 100644 --- a/code/game/machinery/bloodbankgen.dm +++ b/code/game/machinery/bloodbankgen.dm @@ -185,7 +185,7 @@ to_chat(user, "This machine already has bags attached.") if(!bag && !outbag) - var/choice = alert(user, "Choose where to place [O]", "", "Input", "Cancel", "Output") + var/choice = tgui_alert(user, "Choose where to place [O]", "", list("Input", "Cancel", "Output")) switch(choice) if("Cancel") return FALSE diff --git a/code/game/machinery/computer/launchpad_control.dm b/code/game/machinery/computer/launchpad_control.dm index 18a0aeb221..93eca02bdb 100644 --- a/code/game/machinery/computer/launchpad_control.dm +++ b/code/game/machinery/computer/launchpad_control.dm @@ -116,7 +116,7 @@ return current_pad.display_name = new_name if("remove") - if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") != "Abort") + if(usr && tgui_alert(usr, "Are you sure?", "Unlink Launchpad", list("I'm Sure", "Abort")) != "Abort") launchpads -= current_pad selected_id = null . = TRUE diff --git a/code/game/machinery/computer/mechlaunchpad.dm b/code/game/machinery/computer/mechlaunchpad.dm index 86c4a35799..ecd063a85c 100644 --- a/code/game/machinery/computer/mechlaunchpad.dm +++ b/code/game/machinery/computer/mechlaunchpad.dm @@ -155,7 +155,7 @@ return current_pad.display_name = new_name if("remove") - if(usr && alert(usr, "Are you sure?", "Unlink Orbital Pad", "I'm Sure", "Abort") != "Abort") + if(usr && tgui_alert(usr, "Are you sure?", "Unlink Orbital Pad", list("I'm Sure", "Abort")) != "Abort") mechpads -= current_pad LAZYREMOVE(current_pad.consoles, src) selected_id = null diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 45bb9bd327..681a903bef 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -687,7 +687,7 @@ What a mess.*/ temp += "
  • [rank]
  • " temp += "" else - alert(usr, "You do not have the required rank to do this!") + tgui_alert(usr, "You do not have the required rank to do this!") //TEMPORARY MENU FUNCTIONS else//To properly clear as per clear screen. temp=null diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index f2f8c20776..41c60dd18c 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -439,7 +439,7 @@ to_chat(user, "You can't put [target] into [src]. They're conscious.") return else if(target.client) - if(alert(target,"Would you like to enter cryosleep?",,"Yes","No") == "No") + if(tgui_alert(target,"Would you like to enter cryosleep?",,list("Yes","No")) == "No") return var/generic_plsnoleave_message = " Please adminhelp before leaving the round, even if there are no administrators online!" @@ -462,7 +462,7 @@ LAZYADD(caught_string, "Revolutionary") if(caught_string) - alert(target, "You're a [english_list(caught_string)]![generic_plsnoleave_message][addendum]") + tgui_alert(target, "You're a [english_list(caught_string)]![generic_plsnoleave_message][addendum]") target.client.cryo_warned = world.time return diff --git a/code/game/machinery/launch_pad.dm b/code/game/machinery/launch_pad.dm index 87989b18ec..49ff0e7609 100644 --- a/code/game/machinery/launch_pad.dm +++ b/code/game/machinery/launch_pad.dm @@ -339,7 +339,7 @@ pad.display_name = new_name if("remove") . = TRUE - if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") != "Abort") + if(usr && tgui_alert(usr, "Are you sure?", "Unlink Launchpad", list("I'm Sure", "Abort")) != "Abort") pad = null if("launch") sending = TRUE diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 4009b1b56b..9bbbbc46bb 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -197,7 +197,7 @@ if(in_range(src, user) && isliving(user)) //No running off and setting bombs from across the station timer_set = clamp(new_timer, minimum_timer, maximum_timer) loc.visible_message("[icon2html(src, viewers(src))] timer set for [timer_set] seconds.") - if(alert(user,"Would you like to start the countdown now?",,"Yes","No") == "Yes" && in_range(src, user) && isliving(user)) + if(tgui_alert(user,"Would you like to start the countdown now?",,list("Yes","No")) == "Yes" && in_range(src, user) && isliving(user)) if(defused || active) if(defused) visible_message("[icon2html(src, viewers(src))] Device error: User intervention required.") diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index 59dd420d23..df482ea0bf 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -233,7 +233,7 @@ AI MODULES if(newpos == null) return if(newpos < 15) - var/response = alert("Error: The law priority of [newpos] is invalid, Law priorities below 14 are reserved for core laws, Would you like to change that that to 15?", "Invalid law priority", "Change to 15", "Cancel") + var/response = tgui_alert(user, "Error: The law priority of [newpos] is invalid, Law priorities below 14 are reserved for core laws, Would you like to change that that to 15?", "Invalid law priority", list("Change to 15", "Cancel")) if (!response || response == "Cancel") return newpos = 15 diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index df7d6467f0..d6178fa6a1 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -478,9 +478,9 @@ var/popup_input if(bank_support == ID_FREE_BANK_ACCOUNT) - popup_input = alert(user, "Choose Action", "Agent ID", "Show", "Forge/Reset", "Change Account ID") + popup_input = tgui_alert(user, "Choose Action", "Agent ID", list("Show", "Forge/Reset", "Change Account ID")) else - popup_input = alert(user, "Choose Action", "Agent ID", "Show", "Forge/Reset") + popup_input = tgui_alert(user, "Choose Action", "Agent ID", list("Show", "Forge/Reset")) if(!user.canUseTopic(src, BE_CLOSE, FALSE)) return if(popup_input == "Forge/Reset" && !forged) @@ -843,7 +843,7 @@ if(user.incapacitated() || !istype(user)) to_chat(user, "You can't do that right now!") return TRUE - if(alert("Are you sure you want to recolor your id?", "Confirm Repaint", "Yes", "No") == "Yes") + if(tgui_alert(user, "Are you sure you want to recolor your id?", "Confirm Repaint", list("Yes", "No")) == "Yes") var/energy_color_input = input(usr,"","Choose Energy Color",id_color) as color|null if(!in_range(src, user) || !energy_color_input) return TRUE diff --git a/code/game/objects/items/crab17.dm b/code/game/objects/items/crab17.dm index 8d55d3d5a2..b831a118de 100644 --- a/code/game/objects/items/crab17.dm +++ b/code/game/objects/items/crab17.dm @@ -14,7 +14,7 @@ if(dumped) to_chat(user, "You already activated Protocol CRAB-17.") return FALSE - if(alert(user, "Are you sure you want to crash this market with no survivors?", "Protocol CRAB-17", "Yes", "No") == "Yes") + if(tgui_alert(user, "Are you sure you want to crash this market with no survivors?", "Protocol CRAB-17", list("Yes", "No")) == "Yes") if(dumped || QDELETED(src)) //Prevents fuckers from cheesing alert return FALSE var/turf/targetturf = get_safe_random_station_turf() diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 503e2a9473..1cb4d3be22 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -84,7 +84,7 @@ if(flush) flush = FALSE else - var/confirm = alert("Are you sure you want to wipe this card's memory?", name, "Yes", "No") + var/confirm = tgui_alert(usr, "Are you sure you want to wipe this card's memory?", name, list("Yes", "No")) if(confirm == "Yes" && !..()) flush = TRUE if(AI && AI.loc == src) diff --git a/code/game/objects/items/dualsaber.dm b/code/game/objects/items/dualsaber.dm index eea189c3be..70c9e9034a 100644 --- a/code/game/objects/items/dualsaber.dm +++ b/code/game/objects/items/dualsaber.dm @@ -318,7 +318,7 @@ if(user.incapacitated() || !istype(user)) to_chat(user, "You can't do that right now!") return - if(alert("Are you sure you want to recolor your blade?", "Confirm Repaint", "Yes", "No") == "Yes") + if(tgui_alert(user, "Are you sure you want to recolor your blade?", "Confirm Repaint", list("Yes", "No")) == "Yes") var/energy_color_input = input(usr,"","Choose Energy Color",light_color) as color|null if(!energy_color_input || !user.canUseTopic(src, BE_CLOSE, FALSE) || hacked) return diff --git a/code/game/objects/items/implants/implant_explosive.dm b/code/game/objects/items/implants/implant_explosive.dm index 370924063d..1479763efa 100644 --- a/code/game/objects/items/implants/implant_explosive.dm +++ b/code/game/objects/items/implants/implant_explosive.dm @@ -33,7 +33,7 @@ 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") + var/response = tgui_alert(imp_in, "Are you sure you want to activate your [name]? This will cause you to explode!", "[name] Confirmation", list("Yes", "No")) popup = FALSE if(response == "No") return FALSE diff --git a/code/game/objects/items/melee/energy.dm b/code/game/objects/items/melee/energy.dm index 275536d370..9f5abfcca3 100644 --- a/code/game/objects/items/melee/energy.dm +++ b/code/game/objects/items/melee/energy.dm @@ -415,7 +415,7 @@ to_chat(user, "You can't do that right now!") return TRUE - if(alert("Are you sure you want to recolor your blade?", "Confirm Repaint", "Yes", "No") == "Yes") + if(tgui_alert(user, "Are you sure you want to recolor your blade?", "Confirm Repaint", list("Yes", "No")) == "Yes") var/energy_color_input = input(usr,"","Choose Energy Color",light_color) as color|null if(energy_color_input) light_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 547217366b..c2693510cd 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -340,7 +340,7 @@ to_chat(user, "You can't do that right now!") return TRUE - if(alert("Are you sure you want to recolor your blade?", "Confirm Repaint", "Yes", "No") == "Yes") + if(tgui_alert(user, "Are you sure you want to recolor your blade?", "Confirm Repaint", list("Yes", "No")) == "Yes") var/energy_color_input = input(usr,"","Choose Energy Color",light_color) as color|null if(energy_color_input) light_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 58c571d9e6..e802e084f8 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -282,14 +282,14 @@ message_admins("[key_name_admin(usr)] modified the armor on [src] ([type]) to melee: [armor.melee], bullet: [armor.bullet], laser: [armor.laser], energy: [armor.energy], bomb: [armor.bomb], bio: [armor.bio], rad: [armor.rad], fire: [armor.fire], acid: [armor.acid]") if(href_list[VV_HK_MASS_DEL_TYPE]) if(check_rights(R_DEBUG|R_SERVER)) - var/action_type = alert("Strict type ([type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel") + var/action_type = tgui_alert(usr, "Strict type ([type]) or type and all subtypes?",,list("Strict type","Type and subtypes","Cancel")) if(action_type == "Cancel" || !action_type) return - if(alert("Are you really sure you want to delete all objects of type [type]?",,"Yes","No") != "Yes") + if(tgui_alert(usr, "Are you really sure you want to delete all objects of type [type]?",,list("Yes","No")) != "Yes") return - if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes") + if(tgui_alert(usr, "Second confirmation required. Delete?",,list("Yes","No")) != "Yes") return var/O_type = type diff --git a/code/game/objects/structures/crates_lockers/closets/genpop.dm b/code/game/objects/structures/crates_lockers/closets/genpop.dm index 7be12a4819..789d86a67f 100644 --- a/code/game/objects/structures/crates_lockers/closets/genpop.dm +++ b/code/game/objects/structures/crates_lockers/closets/genpop.dm @@ -71,7 +71,7 @@ if(!broken && locked && registered_id != null) var/name = registered_id.registered_name - var/result = alert(user, "This locker currently contains [name]'s personal belongings ","Locker In Use","Reset","Amend ID", "Open") + var/result = tgui_alert(user, "This locker currently contains [name]'s personal belongings ","Locker In Use",list("Reset","Amend ID", "Open")) if(!user.Adjacent(src)) return if(result == "Reset") diff --git a/code/game/objects/structures/ghost_role_spawners.dm b/code/game/objects/structures/ghost_role_spawners.dm index 40af75002f..87ec3d042c 100644 --- a/code/game/objects/structures/ghost_role_spawners.dm +++ b/code/game/objects/structures/ghost_role_spawners.dm @@ -184,7 +184,7 @@ /obj/effect/mob_spawn/human/golem/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) if(isgolem(user) && can_transfer) - var/transfer_choice = alert("Transfer your soul to [src]? (Warning, your old body will die!)",,"Yes","No") + var/transfer_choice = tgui_alert("Transfer your soul to [src]? (Warning, your old body will die!)",,list("Yes","No")) if(transfer_choice != "Yes" || QDELETED(src) || uses <= 0 || !user.canUseTopic(src, BE_CLOSE, NO_DEXTERY, NO_TK)) return log_game("[key_name(user)] golem-swapped into [src]") diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index a70d9d4678..edd1d33bc4 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -214,14 +214,14 @@ if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return if(H.gender == "male") - if(alert(H, "Become a Witch?", "Confirmation", "Yes", "No") == "Yes") + if(tgui_alert(H, "Become a Witch?", "Confirmation", list("Yes", "No")) == "Yes") H.gender = "female" to_chat(H, "Man, you feel like a woman!") else return else - if(alert(H, "Become a Warlock?", "Confirmation", "Yes", "No") == "Yes") + if(tgui_alert(H, "Become a Warlock?", "Confirmation", list("Yes", "No")) == "Yes") H.gender = "male" to_chat(H, "Whoa man, you feel like a man!") else @@ -231,7 +231,7 @@ H.update_mutations_overlay() //(hulk male/female) if("hair") - var/hairchoice = alert(H, "Hair style or hair color?", "Change Hair", "Style", "Color") + var/hairchoice = tgui_alert(H, "Hair style or hair color?", "Change Hair", list("Style", "Color")) if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return if(hairchoice == "Style") //So you just want to use a mirror then? diff --git a/code/modules/admin/DB_ban/functions.dm b/code/modules/admin/DB_ban/functions.dm index b8d2452874..d2efcbb3ac 100644 --- a/code/modules/admin/DB_ban/functions.dm +++ b/code/modules/admin/DB_ban/functions.dm @@ -92,7 +92,7 @@ qdel(query_add_ban_get_ckey) if(!seen_before) if(!had_banned_mob || (had_banned_mob && !banned_mob_guest_key)) - if(alert(usr, "[bankey] has not been seen before, are you sure you want to create a ban for them?", "Unknown ckey", "Yes", "No", "Cancel") != "Yes") + if(tgui_alert(usr, "[bankey] has not been seen before, are you sure you want to create a ban for them?", "Unknown ckey", list("Yes", "No", "Cancel")) != "Yes") return var/a_key @@ -314,7 +314,7 @@ qdel(query_edit_ban_duration) message_admins("[key_name_admin(usr)] has edited a ban for [p_key]'s duration from [duration] to [value]") if("unban") - if(alert("Unban [p_key]?", "Unban?", "Yes", "No") == "Yes") + if(tgui_alert(usr, "Unban [p_key]?", "Unban?", list("Yes", "No")) == "Yes") DB_ban_unban_by_id(banid) return else diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index d4afc3dbb4..70360dffd3 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -481,7 +481,7 @@ options += "Server Restart (Kill and restart DD)"; if(SSticker.admin_delay_notice) - if(alert(usr, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", "Yes", "No") != "Yes") + if(tgui_alert(usr, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", list("Yes", "No")) != "Yes") return FALSE var/result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options @@ -491,7 +491,7 @@ switch(result) if("Regular Restart") if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses))) - if(alert("Are you sure you want to restart the server?","This server is live","Restart","Cancel") != "Restart") + if(tgui_alert(usr, "Are you sure you want to restart the server?","This server is live",list("Restart","Cancel")) != "Restart") return FALSE SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10) if("Regular Restart (with delay)") @@ -499,7 +499,7 @@ if(!delay) return FALSE if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses))) - if(alert("Are you sure you want to restart the server?","This server is live","Restart","Cancel") != "Restart") + if(tgui_alert(usr, "Are you sure you want to restart the server?","This server is live",list("Restart","Cancel")) != "Restart") return FALSE SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", delay * 10) if("Hard Restart (No Delay, No Feeback Reason)") @@ -519,7 +519,7 @@ if (!usr.client.holder) return - var/confirm = alert("End the round and restart the game world?", "End Round", "Yes", "Cancel") + var/confirm = tgui_alert(usr, "End the round and restart the game world?", "End Round", list("Yes", "Cancel")) if(confirm == "Cancel") return if(confirm == "Yes") @@ -610,7 +610,7 @@ if(!SSticker.start_immediately) var/localhost_addresses = list("127.0.0.1", "::1") if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses))) - if(alert("Are you sure you want to start the round?","Start Now","Start Now","Cancel") != "Start Now") + if(tgui_alert(usr, "Are you sure you want to start the round?","Start Now",list("Start Now","Cancel")) != "Start Now") return FALSE SSticker.start_immediately = TRUE log_admin("[usr.key] has started the game.") @@ -697,7 +697,7 @@ var/newtime = input("Set a new time in seconds. Set -1 for indefinite delay.","Set Delay",round(SSticker.GetTimeLeft()/10)) as num|null if(SSticker.current_state > GAME_STATE_PREGAME) - return alert("Too late... The game has already started!") + return tgui_alert(usr, "Too late... The game has already started!") if(newtime) newtime = newtime*10 SSticker.SetTimeLeft(newtime) @@ -733,7 +733,7 @@ message_admins("[key_name_admin(usr)] has unprisoned [key_name_admin(M)]") log_admin("[key_name(usr)] has unprisoned [key_name(M)]") else - alert("[M.name] is not prisoned.") + tgui_alert(usr, "[M.name] is not prisoned.") SSblackbox.record_feedback("tally", "admin_verb", 1, "Unprison") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! ////////////////////////////////////////////////////////////////////////////////////////////////ADMIN HELPER PROCS @@ -898,7 +898,7 @@ var/count = 0 if(!SSjob.initialized) - alert(usr, "You cannot manage jobs before the job subsystem is initialized!") + tgui_alert(usr, "You cannot manage jobs before the job subsystem is initialized!") return dat += "
    " @@ -1012,7 +1012,7 @@ question = "This mob already has a user ([tomob.key]) in control of it! " question += "Are you sure you want to place [frommob.name]([frommob.key]) in control of [tomob.name]?" - var/ask = alert(question, "Place ghost in control of mob?", "Yes", "No") + var/ask = tgui_alert(usr, question, "Place ghost in control of mob?", list("Yes", "No")) if (ask != "Yes") return TRUE diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 437c74991c..a4db70076c 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -545,7 +545,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) if(flash_range == null) return if(devastation_range > GLOB.MAX_EX_DEVESTATION_RANGE || heavy_impact_range > GLOB.MAX_EX_HEAVY_RANGE || light_impact_range > GLOB.MAX_EX_LIGHT_RANGE || flash_range > GLOB.MAX_EX_FLASH_RANGE) - if(alert("Bomb is bigger than the maxcap. Continue?",,"Yes","No") != "Yes") + if(tgui_alert(src, "Bomb is bigger than the maxcap. Continue?",,list("Yes","No")) != "Yes") return epicenter = mob.loc //We need to reupdate as they may have moved again explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, TRUE, TRUE) @@ -585,7 +585,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) return block_resistance = max(0, block_resistance) if(power > 500) - var/sure = alert(src, "Explosion power is extremely high. Are you absolutely sure?", "Uhh...", "No", "Yes") + var/sure = tgui_alert(src, "Explosion power is extremely high. Are you absolutely sure?", "Uhh...", list("No", "Yes")) if(sure != "Yes") return // point of no return diff --git a/code/modules/admin/antag_panel.dm b/code/modules/admin/antag_panel.dm index 2d1aa63a91..106acd2bd2 100644 --- a/code/modules/admin/antag_panel.dm +++ b/code/modules/admin/antag_panel.dm @@ -91,10 +91,10 @@ GLOBAL_VAR(antag_prototypes) /datum/mind/proc/traitor_panel() if(!SSticker.HasRoundStarted()) - alert("Not before round-start!", "Alert") + tgui_alert(usr, "Not before round-start!", "Alert") return if(QDELETED(src)) - alert("This mind doesn't have a mob, or is deleted! For some reason!", "Edit Memory") + tgui_alert(usr, "This mind doesn't have a mob, or is deleted! For some reason!", "Edit Memory") return var/out = "[name][(current && (current.real_name!=name))?" (as [current.real_name])":""]
    " diff --git a/code/modules/admin/callproc/callproc.dm b/code/modules/admin/callproc/callproc.dm index 21bf732493..495cbdfd59 100644 --- a/code/modules/admin/callproc/callproc.dm +++ b/code/modules/admin/callproc/callproc.dm @@ -12,7 +12,7 @@ var/targetselected = FALSE var/returnval - switch(alert("Proc owned by something?",,"Yes","No")) + switch(tgui_alert(usr, "Proc owned by something?",,list("Yes","No"))) if("Yes") targetselected = TRUE var/list/value = vv_get_value(default_class = VV_ATOM_REFERENCE, classes = list(VV_ATOM_REFERENCE, VV_DATUM_REFERENCE, VV_MOB_REFERENCE, VV_CLIENT, VV_MARKED_DATUM, VV_TEXT_LOCATE, VV_PROCCALL_RETVAL)) diff --git a/code/modules/admin/check_antagonists.dm b/code/modules/admin/check_antagonists.dm index 532a11a532..8ae036703a 100644 --- a/code/modules/admin/check_antagonists.dm +++ b/code/modules/admin/check_antagonists.dm @@ -134,7 +134,7 @@ /datum/admins/proc/check_antagonists() if(!SSticker.HasRoundStarted()) - alert("The game hasn't started yet!") + tgui_alert(usr, "The game hasn't started yet!") return var/list/dat = list("Round Status

    Round Status

    ") if(SSticker.mode.replacementmode) diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm index e5391f0f43..6124fe9dc6 100644 --- a/code/modules/admin/create_poll.dm +++ b/code/modules/admin/create_poll.dm @@ -49,7 +49,7 @@ endtime = query_validate_time.item[1] qdel(query_validate_time) var/adminonly - switch(alert("Admin only poll?",,"Yes","No","Cancel")) + switch(tgui_alert(usr, "Admin only poll?",,list("Yes","No","Cancel"))) if("Yes") adminonly = 1 if("No") @@ -57,7 +57,7 @@ else return var/dontshow - switch(alert("Hide poll results from tracking until completed?",,"Yes","No","Cancel")) + switch(tgui_alert(usr, "Hide poll results from tracking until completed?",,list("Yes","No","Cancel"))) if("Yes") dontshow = 1 if("No") @@ -76,7 +76,7 @@ return var/default_percentage_calc = 0 if(polltype != POLLTYPE_IRV) - switch(alert("Should this option be included by default when poll result percentages are generated?",,"Yes","No","Cancel")) + switch(tgui_alert(usr, "Should this option be included by default when poll result percentages are generated?",,list("Yes","No","Cancel"))) if("Yes") default_percentage_calc = 1 if("No") @@ -111,7 +111,7 @@ "text" = option, "minval" = minval, "maxval" = maxval, "descmin" = descmin, "descmid" = descmid, "descmax" = descmax, "default_percentage_calc" = default_percentage_calc)) - switch(alert(" ",,"Add option","Finish", "Cancel")) + switch(tgui_alert(usr, " ",,list("Add option","Finish", "Cancel"))) if("Add option") add_option = 1 if("Finish") diff --git a/code/modules/admin/fun_balloon.dm b/code/modules/admin/fun_balloon.dm index 417663fcb7..f11b193680 100644 --- a/code/modules/admin/fun_balloon.dm +++ b/code/modules/admin/fun_balloon.dm @@ -35,7 +35,7 @@ /obj/effect/fun_balloon/attack_ghost(mob/user) if(!user.client || !user.client.holder || popped) return - var/confirmation = alert("Pop [src]?","Fun Balloon","Yes","No") + var/confirmation = tgui_alert(user, "Pop [src]?","Fun Balloon",list("Yes","No")) if(confirmation == "Yes" && !popped) popped = TRUE effect() diff --git a/code/modules/admin/outfit_editor.dm b/code/modules/admin/outfit_editor.dm index 9a99d8b20e..e50f1bec4c 100644 --- a/code/modules/admin/outfit_editor.dm +++ b/code/modules/admin/outfit_editor.dm @@ -117,11 +117,11 @@ if(!choice) return if(!ispath(choice)) - alert(owner, "Invalid item", OUTFIT_EDITOR_NAME, "oh no") + tgui_alert(owner, "Invalid item", OUTFIT_EDITOR_NAME, "oh no") return if(initial(choice.icon_state) == null) //hacky check copied from experimentor code var/msg = "Warning: This item's icon_state is null, indicating it is very probably not actually a usable item." - if(alert(owner, msg, OUTFIT_EDITOR_NAME, "Use it anyway", "Cancel") != "Use it anyway") + if(tgui_alert(owner, msg, OUTFIT_EDITOR_NAME, list("Use it anyway", "Cancel")) != "Use it anyway") return if(drip.vars.Find(slot)) diff --git a/code/modules/admin/permissionedit.dm b/code/modules/admin/permissionedit.dm index 9f5dc00a48..fe45a04673 100644 --- a/code/modules/admin/permissionedit.dm +++ b/code/modules/admin/permissionedit.dm @@ -165,7 +165,7 @@ to_chat(usr, "Unable to connect to database, changes are temporary only.", confidential = TRUE) 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") + use_db = tgui_alert(usr, "Permanent changes are saved to the database for future rounds, temporary changes will affect only the current round", "Permanent or Temporary?", list("Permanent", "Temporary", "Cancel")) if(use_db == "Cancel") return if(use_db == "Permanent") @@ -247,7 +247,7 @@ qdel(query_add_admin_log) /datum/admins/proc/remove_admin(admin_ckey, admin_key, use_db, datum/admins/D) - if(alert("Are you sure you want to remove [admin_ckey]?","Confirm Removal","Do it","Cancel") == "Do it") + if(tgui_alert(usr, "Are you sure you want to remove [admin_ckey]?","Confirm Removal",list("Do it","Cancel")) == "Do it") GLOB.admin_datums -= admin_ckey GLOB.deadmins -= admin_ckey if(D) @@ -492,7 +492,7 @@ to_chat(usr, "Error: Rank deletion attempted while rank still used; Tell a coder, this shouldn't happen.", confidential = TRUE) return qdel(query_admins_with_rank) - if(alert("Are you sure you want to remove [admin_rank]?","Confirm Removal","Do it","Cancel") == "Do it") + if(tgui_alert(usr, "Are you sure you want to remove [admin_rank]?","Confirm Removal",list("Do it","Cancel")) == "Do it") var/m1 = "[key_name_admin(usr)] removed rank [admin_rank] permanently" var/m2 = "[key_name(usr)] removed rank [admin_rank] permanently" var/datum/db_query/query_add_rank = SSdbcore.NewQuery( diff --git a/code/modules/admin/sql_message_system.dm b/code/modules/admin/sql_message_system.dm index 3ba309bc24..0f24f8364c 100644 --- a/code/modules/admin/sql_message_system.dm +++ b/code/modules/admin/sql_message_system.dm @@ -18,7 +18,7 @@ qdel(query_find_ckey) return if(!query_find_ckey.NextRow()) - if(alert(usr, "[new_key]/([new_ckey]) has not been seen before, are you sure you want to create a [type] for them?", "Unknown ckey", "Yes", "No", "Cancel") != "Yes") + if(tgui_alert(usr, "[new_key]/([new_ckey]) has not been seen before, are you sure you want to create a [type] for them?", "Unknown ckey", list("Yes", "No", "Cancel")) != "Yes") qdel(query_find_ckey) return qdel(query_find_ckey) @@ -45,7 +45,7 @@ if (ssqlname) server = ssqlname if(isnull(secret)) - switch(alert("Hide note from being viewed by players?", "Secret note?","Yes","No","Cancel")) + switch(tgui_alert(usr, "Hide note from being viewed by players?", "Secret note?",list("Yes","No","Cancel"))) if("Yes") secret = 1 if("No") @@ -53,7 +53,7 @@ else return if(isnull(expiry)) - if(alert(usr, "Set an expiry time? Expired messages are hidden like deleted ones.", "Expiry time?", "Yes", "No", "Cancel") == "Yes") + if(tgui_alert(usr, "Set an expiry time? Expired messages are hidden like deleted ones.", "Expiry time?", list("Yes", "No", "Cancel")) == "Yes") var/expire_time = input("Set expiry time for [type] as format YYYY-MM-DD HH:MM:SS. All times in server time. HH:MM:SS is optional and 24-hour. Must be later than current time for obvious reasons.", "Set expiry time", SQLtime()) as null|text if(!expire_time) return diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm index 57487f3144..3e0cf768a3 100644 --- a/code/modules/admin/stickyban.dm +++ b/code/modules/admin/stickyban.dm @@ -61,7 +61,7 @@ if (!ban) to_chat(usr, "Error: No sticky ban for [ckey] found!", confidential = TRUE) return - if (alert("Are you sure you want to remove the sticky ban on [ckey]?","Are you sure","Yes","No") == "No") + if (tgui_alert(usr, "Are you sure you want to remove the sticky ban on [ckey]?","Are you sure",list("Yes","No")) == "No") return if (!get_stickyban_from_ckey(ckey)) to_chat(usr, "Error: The ban disappeared.", confidential = TRUE) @@ -98,7 +98,7 @@ to_chat(usr, "Error: [alt] is not linked to [ckey]'s sticky ban!", confidential = TRUE) 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 (tgui_alert(usr, "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",list("Yes","No")) == "No") return //we have to do this again incase something changes @@ -180,7 +180,7 @@ to_chat(usr, "Error: [alt] is not linked to [ckey]'s sticky ban!", confidential = TRUE) return - if (alert("Are you sure you want to exempt [alt] from [ckey]'s sticky ban?","Are you sure","Yes","No") == "No") + if (tgui_alert(usr, "Are you sure you want to exempt [alt] from [ckey]'s sticky ban?","Are you sure",list("Yes","No")) == "No") return //we have to do this again incase something changes @@ -230,7 +230,7 @@ to_chat(usr, "Error: [alt] is not exempt from [ckey]'s sticky ban!", confidential = TRUE) return - if (alert("Are you sure you want to unexempt [alt] from [ckey]'s sticky ban?","Are you sure","Yes","No") == "No") + if (tgui_alert(usr, "Are you sure you want to unexempt [alt] from [ckey]'s sticky ban?","Are you sure",list("Yes","No")) == "No") return //we have to do this again incase something changes @@ -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 (tgui_alert(usr, "Are you sure you want to put [ckey]'s stickyban on timeout until next round (or removed)?","Are you sure",list("Yes","No")) == "No") return var/ban = get_stickyban_from_ckey(ckey) if (!ban) @@ -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 (tgui_alert(usr, "Are you sure you want to lift the timeout on [ckey]'s stickyban?","Are you sure",list("Yes","No")) == "No") return var/ban = get_stickyban_from_ckey(ckey) @@ -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 (tgui_alert(usr, "Are you sure you want to revert the sticky ban on [ckey] to its state at round start (or last edit)?","Are you sure",list("Yes","No")) == "No") return var/ban = get_stickyban_from_ckey(ckey) if (!ban) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 4224b406b3..343955bb25 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -176,7 +176,7 @@ var/datum/round_event/event = E.runEvent() if(event.announceWhen>0) event.processing = FALSE - var/prompt = alert(usr, "Would you like to alert the crew?", "Alert", "Yes", "No", "Cancel") + var/prompt = tgui_alert(usr, "Would you like to alert the crew?", "Alert", list("Yes", "No", "Cancel")) switch(prompt) if("Cancel") event.kill() @@ -428,8 +428,8 @@ return message_admins("[key_name_admin(usr)] is considering ending the round.") - if(alert(usr, "This will end the round, are you SURE you want to do this?", "Confirmation", "Yes", "No") == "Yes") - if(alert(usr, "Final Confirmation: End the round NOW?", "Confirmation", "Yes", "No") == "Yes") + if(tgui_alert(usr, "This will end the round, are you SURE you want to do this?", "Confirmation", list("Yes", "No")) == "Yes") + if(tgui_alert(usr, "Final Confirmation: End the round NOW?", "Confirmation", list("Yes", "No")) == "Yes") message_admins("[key_name_admin(usr)] has ended the round.") SSticker.force_ending = 1 //Yeah there we go APC destroyed mission accomplished return @@ -448,7 +448,7 @@ return var/delmob = 0 - switch(alert("Delete old mob?","Message","Yes","No","Cancel")) + switch(tgui_alert(usr, "Delete old mob?","Message",list("Yes","No","Cancel"))) if("Cancel") return if("Yes") @@ -518,11 +518,11 @@ var/banfolder = href_list["unbanf"] GLOB.Banlist.cd = "/base/[banfolder]" var/key = GLOB.Banlist["key"] - if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes") + if(tgui_alert(usr, "Are you sure you want to unban [key]?", "Confirmation", list("Yes", "No")) == "Yes") if(RemoveBan(banfolder)) unbanpanel() else - alert(usr, "This ban has already been lifted / does not exist.", "Error", "Ok") + tgui_alert(usr, "This ban has already been lifted / does not exist.", "Error", list("Ok")) unbanpanel() else if(href_list["unbane"]) @@ -544,7 +544,7 @@ var/duration - switch(alert("Temporary Ban for [banned_key]?",,"Yes","No")) + switch(tgui_alert(usr, "Temporary Ban for [banned_key]?",,list("Yes","No"))) if("Yes") temp = 1 var/mins = 0 @@ -592,7 +592,7 @@ if(jobban_isbanned(M, "appearance")) - switch(alert("Remove appearance ban?","Please Confirm","Yes","No")) + switch(tgui_alert(usr, "Remove appearance ban?","Please Confirm",list("Yes","No"))) if("Yes") ban_unban_log_save("[key_name(usr)] removed [key_name(M)]'s appearance ban.") log_admin_private("[key_name(usr)] removed [key_name(M)]'s appearance ban.") @@ -602,7 +602,7 @@ message_admins("[key_name_admin(usr)] removed [key_name_admin(M)]'s appearance ban.") to_chat(M, "[usr.client.key] has removed your appearance ban.") - else switch(alert("Appearance ban [M.key]?",,"Yes","No", "Cancel")) + else switch(tgui_alert(usr, "Appearance ban [M.key]?",,list("Yes","No", "Cancel"))) if("Yes") var/reason = input(usr,"Please State Reason.","Reason") as message|null if(!reason) @@ -1025,7 +1025,7 @@ //Banning comes first if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban. var/severity = null - switch(alert("Temporary Ban for [M.key]?",,"Yes","No", "Cancel")) + switch(tgui_alert(usr, "Temporary Ban for [M.key]?",,list("Yes","No", "Cancel"))) if("Yes") var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null if(mins <= 0) @@ -1094,7 +1094,7 @@ var/reason = jobban_isbanned(M, job) if(!reason) continue //skip if it isn't jobbanned anyway - switch(alert("Job: '[job]' Reason: '[reason]' Un-jobban?","Please Confirm","Yes","No")) + switch(tgui_alert(usr, "Job: '[job]' Reason: '[reason]' Un-jobban?","Please Confirm",list("Yes","No"))) if("Yes") ban_unban_log_save("[key_name(usr)] unjobbanned [key_name(M)] from [job]") log_admin_private("[key_name(usr)] unbanned [key_name(M)] from [job]") @@ -1122,7 +1122,7 @@ if(!check_if_greater_rights_than(M.client)) to_chat(usr, "Error: They have more rights than you do.") return - if(alert(usr, "Kick [key_name(M)]?", "Confirm", "Yes", "No") != "Yes") + if(tgui_alert(usr, "Kick [key_name(M)]?", "Confirm", list("Yes", "No")) != "Yes") return if(!M) to_chat(usr, "Error: [M] no longer exists!") @@ -1176,7 +1176,7 @@ else if(href_list["deletemessage"]) if(!check_rights(R_ADMIN)) return - var/safety = alert("Delete message/note?",,"Yes","No"); + var/safety = tgui_alert(usr, "Delete message/note?",,list("Yes","No")); if (safety == "Yes") var/message_id = href_list["deletemessage"] delete_message(message_id) @@ -1184,7 +1184,7 @@ else if(href_list["deletemessageempty"]) if(!check_rights(R_ADMIN)) return - var/safety = alert("Delete message/note?",,"Yes","No"); + var/safety = tgui_alert(usr, "Delete message/note?",,list("Yes","No")); if (safety == "Yes") var/message_id = href_list["deletemessageempty"] delete_message(message_id, browse = TRUE) @@ -1301,7 +1301,7 @@ if(M.client && M.client.holder) return //admins cannot be banned. Even if they could, the ban doesn't affect them anyway - switch(alert("Temporary Ban for [M.key]?",,"Yes","No", "Cancel")) + switch(tgui_alert(usr, "Temporary Ban for [M.key]?",,list("Yes","No", "Cancel"))) if("Yes") var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null if(mins <= 0) @@ -1333,7 +1333,7 @@ var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null if(!reason) return - switch(alert(usr,"IP ban?",,"Yes","No","Cancel")) + switch(tgui_alert(usr,"IP ban?",,list("Yes","No","Cancel"))) if("Cancel") return if("Yes") @@ -1376,9 +1376,9 @@ if(!check_rights(R_ADMIN)) return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode.", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode.", null, null, null, null) var/roundstart_rules = list() for (var/rule in subtypesof(/datum/dynamic_ruleset/roundstart)) var/datum/dynamic_ruleset/roundstart/newrule = new rule() @@ -1411,9 +1411,9 @@ if(!check_rights(R_ADMIN)) return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode.", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode.", null, null, null, null) var/list/choices = list() for(var/T in config.storyteller_cache) var/datum/dynamic_storyteller/S = T @@ -1437,9 +1437,9 @@ if(!check_rights(R_ADMIN)) return if(!SSticker || !SSticker.mode) - return alert(usr, "The game must start first.", null, null, null, null) + return tgui_alert(usr, "The game must start first.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/latejoin_rules = list() for (var/rule in subtypesof(/datum/dynamic_ruleset/latejoin)) var/datum/dynamic_ruleset/latejoin/newrule = new rule() @@ -1466,9 +1466,9 @@ if(!check_rights(R_ADMIN)) return if(!SSticker || !SSticker.mode) - return alert(usr, "The game must start first.", null, null, null, null) + return tgui_alert(usr, "The game must start first.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/midround_rules = list() for (var/rule in subtypesof(/datum/dynamic_ruleset/midround)) var/datum/dynamic_ruleset/midround/newrule = new rule() @@ -1485,9 +1485,9 @@ return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) dynamic_mode_options(usr) @@ -1495,9 +1495,9 @@ if(!check_rights(R_ADMIN)) return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/new_centre = input(usr,"Change the centre of the dynamic mode threat curve. A negative value will give a more peaceful round ; a positive value, a round with higher threat. Any number is allowed. This is adjusted by dynamic voting.", "Change curve centre", null) as num @@ -1510,13 +1510,13 @@ if(!check_rights(R_ADMIN)) return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/new_width = input(usr,"Change the width of the dynamic mode threat curve. A higher value will favour extreme rounds ; a lower value, a round closer to the average. Any Number between 0.5 and 4 are allowed.", "Change curve width", null) as num if (new_width < 0.5 || new_width > 4) - return alert(usr, "Only values between 0.5 and +2.5 are allowed.", null, null, null, null) + return tgui_alert(usr, "Only values between 0.5 and +2.5 are allowed.", null, null, null, null) log_admin("[key_name(usr)] changed the distribution curve width to [new_width].") message_admins("[key_name(usr)] changed the distribution curve width to [new_width]", 1) @@ -1527,14 +1527,14 @@ if(!check_rights(R_ADMIN)) return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/new_min = input(usr,"Change the minimum delay of latejoin injection in minutes.", "Change latejoin injection delay minimum", null) as num if(new_min <= 0) - return alert(usr, "The minimum can't be zero or lower.", null, null, null, null) + return tgui_alert(usr, "The minimum can't be zero or lower.", null, null, null, null) if((new_min MINUTES) > GLOB.dynamic_latejoin_delay_max) - return alert(usr, "The minimum must be lower than the maximum.", null, null, null, null) + return tgui_alert(usr, "The minimum must be lower than the maximum.", null, null, null, null) log_admin("[key_name(usr)] changed the latejoin injection minimum delay to [new_min] minutes.") message_admins("[key_name(usr)] changed the latejoin injection minimum delay to [new_min] minutes", 1) @@ -1545,14 +1545,14 @@ if(!check_rights(R_ADMIN)) return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/new_max = input(usr,"Change the maximum delay of latejoin injection in minutes.", "Change latejoin injection delay maximum", null) as num if(new_max <= 0) - return alert(usr, "The maximum can't be zero or lower.", null, null, null, null) + return tgui_alert(usr, "The maximum can't be zero or lower.", null, null, null, null) if((new_max MINUTES) < GLOB.dynamic_latejoin_delay_min) - return alert(usr, "The maximum must be higher than the minimum.", null, null, null, null) + return tgui_alert(usr, "The maximum must be higher than the minimum.", null, null, null, null) log_admin("[key_name(usr)] changed the latejoin injection maximum delay to [new_max] minutes.") message_admins("[key_name(usr)] changed the latejoin injection maximum delay to [new_max] minutes", 1) @@ -1563,14 +1563,14 @@ if(!check_rights(R_ADMIN)) return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/new_min = input(usr,"Change the minimum delay of midround injection in minutes.", "Change midround injection delay minimum", null) as num if(new_min <= 0) - return alert(usr, "The minimum can't be zero or lower.", null, null, null, null) + return tgui_alert(usr, "The minimum can't be zero or lower.", null, null, null, null) if((new_min MINUTES) > GLOB.dynamic_midround_delay_max) - return alert(usr, "The minimum must be lower than the maximum.", null, null, null, null) + return tgui_alert(usr, "The minimum must be lower than the maximum.", null, null, null, null) log_admin("[key_name(usr)] changed the midround injection minimum delay to [new_min] minutes.") message_admins("[key_name(usr)] changed the midround injection minimum delay to [new_min] minutes", 1) @@ -1581,14 +1581,14 @@ if(!check_rights(R_ADMIN)) return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/new_max = input(usr,"Change the maximum delay of midround injection in minutes.", "Change midround injection delay maximum", null) as num if(new_max <= 0) - return alert(usr, "The maximum can't be zero or lower.", null, null, null, null) + return tgui_alert(usr, "The maximum can't be zero or lower.", null, null, null, null) if((new_max MINUTES) > GLOB.dynamic_midround_delay_max) - return alert(usr, "The maximum must be higher than the minimum.", null, null, null, null) + return tgui_alert(usr, "The maximum must be higher than the minimum.", null, null, null, null) log_admin("[key_name(usr)] changed the midround injection maximum delay to [new_max] minutes.") message_admins("[key_name(usr)] changed the midround injection maximum delay to [new_max] minutes", 1) @@ -1600,7 +1600,7 @@ return if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) GLOB.dynamic_forced_extended = !GLOB.dynamic_forced_extended log_admin("[key_name(usr)] set 'forced_extended' to [GLOB.dynamic_forced_extended].") @@ -1612,7 +1612,7 @@ return if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) GLOB.dynamic_no_stacking = !GLOB.dynamic_no_stacking log_admin("[key_name(usr)] set 'no_stacking' to [GLOB.dynamic_no_stacking].") @@ -1624,7 +1624,7 @@ return if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) GLOB.dynamic_classic_secret = !GLOB.dynamic_classic_secret log_admin("[key_name(usr)] set 'classic_secret' to [GLOB.dynamic_classic_secret].") @@ -1636,7 +1636,7 @@ return if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) GLOB.dynamic_stacking_limit = input(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) as num log_admin("[key_name(usr)] set 'stacking_limit' to [GLOB.dynamic_stacking_limit].") @@ -1648,14 +1648,14 @@ return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/new_value = input(usr, "Enter the high-pop override threshold for dynamic mode.", "High pop override") as num if (new_value < 0) - return alert(usr, "Only positive values allowed!", null, null, null, null) + return tgui_alert(usr, "Only positive values allowed!", null, null, null, null) GLOB.dynamic_high_pop_limit = new_value log_admin("[key_name(usr)] set 'high_pop_limit' to [GLOB.dynamic_high_pop_limit].") @@ -1667,14 +1667,14 @@ return if(SSticker && SSticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "dynamic") - return alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be dynamic mode!", null, null, null, null) var/new_value = input(usr, "Enter the forced threat level for dynamic mode.", "Forced threat level") as num if (new_value > 100) - return alert(usr, "The value must be be under 100.", null, null, null, null) + return tgui_alert(usr, "The value must be be under 100.", null, null, null, null) GLOB.dynamic_forced_threat_level = new_value log_admin("[key_name(usr)] set 'forced_threat_level' to [GLOB.dynamic_forced_threat_level].") @@ -1686,7 +1686,7 @@ return if (SSticker.HasRoundStarted()) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) GLOB.master_mode = href_list["c_mode2"] log_admin("[key_name(usr)] set the mode as [GLOB.master_mode].") message_admins("[key_name_admin(usr)] set the mode as [GLOB.master_mode].") @@ -1700,9 +1700,9 @@ return if(SSticker.HasRoundStarted()) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "secret") - return alert(usr, "The game mode has to be secret!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be secret!", null, null, null, null) GLOB.secret_force_mode = href_list["f_secret2"] log_admin("[key_name(usr)] set the forced secret mode as [GLOB.secret_force_mode].") message_admins("[key_name_admin(usr)] set the forced secret mode as [GLOB.secret_force_mode].") @@ -1786,7 +1786,7 @@ to_chat(usr, "This cannot be used on instances of type /mob/living/silicon/ai.") return - if(alert(usr, "Send [key_name(M)] to Prison?", "Message", "Yes", "No") != "Yes") + if(tgui_alert(usr, "Send [key_name(M)] to Prison?", "Message", list("Yes", "No")) != "Yes") return M.forceMove(pick(GLOB.prisonwarp)) @@ -1809,7 +1809,7 @@ to_chat(usr, "[M] doesn't seem to have an active client.") return - if(alert(usr, "Send [key_name(M)] back to Lobby?", "Message", "Yes", "No") != "Yes") + if(tgui_alert(usr, "Send [key_name(M)] back to Lobby?", "Message", list("Yes", "No")) != "Yes") return log_admin("[key_name(usr)] has sent [key_name(M)] back to the Lobby, removing their respawn restrictions if they existed.") @@ -1826,7 +1826,7 @@ if(!check_rights(R_FUN)) return - if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + if(tgui_alert(usr, "Confirm?", "Message", list("Yes", "No")) != "Yes") return var/mob/M = locate(href_list["tdome1"]) @@ -1853,7 +1853,7 @@ if(!check_rights(R_FUN)) return - if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + if(tgui_alert(usr, "Confirm?", "Message", list("Yes", "No")) != "Yes") return var/mob/M = locate(href_list["tdome2"]) @@ -1880,7 +1880,7 @@ if(!check_rights(R_FUN)) return - if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + if(tgui_alert(usr, "Confirm?", "Message", list("Yes", "No")) != "Yes") return var/mob/M = locate(href_list["tdomeadmin"]) @@ -1904,7 +1904,7 @@ if(!check_rights(R_FUN)) return - if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + if(tgui_alert(usr, "Confirm?", "Message", list("Yes", "No")) != "Yes") return var/mob/M = locate(href_list["tdomeobserve"]) @@ -2275,7 +2275,7 @@ if(!check_rights(R_ADMIN)) return - if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + if(tgui_alert(usr, "Confirm?", "Message", list("Yes", "No")) != "Yes") return var/mob/M = locate(href_list["getmob"]) usr.client.Getmob(M) @@ -2327,7 +2327,7 @@ return if(!SSticker.HasRoundStarted()) - alert("The game hasn't started yet!") + tgui_alert(usr, "The game hasn't started yet!") return var/mob/M = locate(href_list["traitor"]) @@ -2408,10 +2408,10 @@ paths += path if(!paths) - alert("The path list you sent is empty.") + tgui_alert(usr, "The path list you sent is empty.") return if(length(paths) > 5) - alert("Select fewer object types, (max 5).") + tgui_alert(usr, "Select fewer object types, (max 5).") return var/list/offset = splittext(href_list["offset"],",") @@ -2536,7 +2536,7 @@ if(src.admincaster_feed_channel.channel_name == "" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]" || check ) src.admincaster_screen=7 else - var/choice = alert("Please confirm Feed channel creation.","Network Channel Handler","Confirm","Cancel") + var/choice = tgui_alert(usr, "Please confirm Feed channel creation.","Network Channel Handler",list("Confirm","Cancel")) if(choice=="Confirm") GLOB.news_network.CreateFeedChannel(src.admincaster_feed_channel.channel_name, src.admin_signature, src.admincaster_feed_channel.locked, 1) SSblackbox.record_feedback("tally", "newscaster_channels", 1, src.admincaster_feed_channel.channel_name) @@ -2631,7 +2631,7 @@ if(src.admincaster_wanted_message.criminal == "" || src.admincaster_wanted_message.body == "") src.admincaster_screen = 16 else - var/choice = alert("Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler","Confirm","Cancel") + var/choice = tgui_alert(usr, "Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler",list("Confirm","Cancel")) if(choice=="Confirm") if(input_param==1) //If input_param == 1 we're submitting a new wanted issue. At 2 we're just editing an existing one. See the else below GLOB.news_network.submitWanted(admincaster_wanted_message.criminal, admincaster_wanted_message.body, admin_signature, null, 1, 1) @@ -2645,7 +2645,7 @@ else if(href_list["ac_cancel_wanted"]) if(!check_rights(R_ADMIN)) return - var/choice = alert("Please confirm Wanted Issue removal.","Network Security Handler","Confirm","Cancel") + var/choice = tgui_alert(usr, "Please confirm Wanted Issue removal.","Network Security Handler",list("Confirm","Cancel")) if(choice=="Confirm") GLOB.news_network.deleteWanted() src.admincaster_screen=17 @@ -2759,7 +2759,7 @@ return if(SSticker.IsRoundInProgress()) var/afkonly = text2num(href_list["afkonly"]) - if(alert("Are you sure you want to kick all [afkonly ? "AFK" : ""] clients from the lobby??","Message","Yes","Cancel") != "Yes") + if(tgui_alert(usr, "Are you sure you want to kick all [afkonly ? "AFK" : ""] clients from the lobby??","Message",list("Yes","Cancel")) != "Yes") to_chat(usr, "Kick clients from lobby aborted") return var/list/listkicked = kick_clients_in_lobby("You were kicked from the lobby by [usr.client.holder.fakekey ? "an Administrator" : "[usr.client.key]"].", afkonly) @@ -2937,7 +2937,7 @@ var/answer = href_list["slowquery"] if(answer == "yes") log_query_debug("[usr.key] | Reported a server hang") - if(alert(usr, "Had you just press any admin buttons?", "Query server hang report", "Yes", "No") == "Yes") + if(tgui_alert(usr, "Had you just press any admin buttons?", "Query server hang report", list("Yes", "No")) == "Yes") var/response = input(usr,"What were you just doing?","Query server hang report") as null|text if(response) log_query_debug("[usr.key] | [response]") @@ -2949,7 +2949,7 @@ return if(SSticker.HasRoundStarted()) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) var/dat = {"What mode do you wish to play?
    "} for(var/mode in config.modes) dat += {"[config.mode_names[mode]]
    "} @@ -2963,9 +2963,9 @@ return if(SSticker.HasRoundStarted()) - return alert(usr, "The game has already started.", null, null, null, null) + return tgui_alert(usr, "The game has already started.", null, null, null, null) if(GLOB.master_mode != "secret") - return alert(usr, "The game mode has to be secret!", null, null, null, null) + return tgui_alert(usr, "The game mode has to be secret!", null, null, null, null) var/dat = {"What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.
    "} for(var/mode in config.modes) dat += {"[config.mode_names[mode]]
    "} diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 5c35450592..ec7d4e94cf 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -530,7 +530,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) SSblackbox.record_feedback("tally", "admin_verb", 1, "Adminhelp") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! if(current_ticket) - if(alert(usr, "You already have a ticket open. Is this for the same issue?",,"Yes","No") != "No") + if(tgui_alert(usr, "You already have a ticket open. Is this for the same issue?",,list("Yes","No")) != "No") if(current_ticket) current_ticket.MessageNoRecipient(msg) current_ticket.TimeoutVerb() diff --git a/code/modules/admin/verbs/ak47s.dm b/code/modules/admin/verbs/ak47s.dm index 561037060f..b2081b84d2 100644 --- a/code/modules/admin/verbs/ak47s.dm +++ b/code/modules/admin/verbs/ak47s.dm @@ -1,7 +1,7 @@ GLOBAL_VAR_INIT(terrorism, FALSE) /client/proc/ak47s() // For when you just can't summon guns worthy of a firefight if(!SSticker.HasRoundStarted()) - alert("The game hasn't started yet!") + tgui_alert(usr, "The game hasn't started yet!") return GLOB.terrorism = TRUE diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 138913b3a4..ccb58cc540 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -31,7 +31,7 @@ set name = "Make Robot" if(!SSticker.HasRoundStarted()) - alert("Wait until the game starts") + tgui_alert(usr, "Wait until the game starts") return if(ishuman(M)) log_admin("[key_name(src)] has robotized [M.key].") @@ -40,21 +40,21 @@ H.Robotize() else - alert("Invalid mob") + tgui_alert(usr, "Invalid mob") /client/proc/cmd_admin_blobize(mob/M in GLOB.mob_list) set category = "Admin.Fun" set name = "Make Blob" if(!SSticker.HasRoundStarted()) - alert("Wait until the game starts") + tgui_alert(usr, "Wait until the game starts") return if(ishuman(M)) log_admin("[key_name(src)] has blobized [M.key].") var/mob/living/carbon/human/H = M H.become_overmind() else - alert("Invalid mob") + tgui_alert(usr, "Invalid mob") /client/proc/cmd_admin_animalize(mob/M in GLOB.mob_list) @@ -62,15 +62,15 @@ set name = "Make Simple Animal" if(!SSticker.HasRoundStarted()) - alert("Wait until the game starts") + tgui_alert(usr, "Wait until the game starts") return if(!M) - alert("That mob doesn't seem to exist, close the panel and try again.") + tgui_alert(usr, "That mob doesn't seem to exist, close the panel and try again.") return if(isnewplayer(M)) - alert("The mob must not be a new_player.") + tgui_alert(usr, "The mob must not be a new_player.") return log_admin("[key_name(src)] has animalized [M.key].") @@ -110,7 +110,7 @@ set name = "Make Alien" if(!SSticker.HasRoundStarted()) - alert("Wait until the game starts") + tgui_alert(usr, "Wait until the game starts") return if(ishuman(M)) INVOKE_ASYNC(M, /mob/living/carbon/human/proc/Alienize) @@ -118,14 +118,14 @@ log_admin("[key_name(usr)] made [key_name(M)] into an alien at [AREACOORD(M)].") message_admins("[key_name_admin(usr)] made [ADMIN_LOOKUPFLW(M)] into an alien.") else - alert("Invalid mob") + tgui_alert(usr, "Invalid mob") /client/proc/cmd_admin_slimeize(mob/M in GLOB.mob_list) set category = "Admin.Fun" set name = "Make slime" if(!SSticker.HasRoundStarted()) - alert("Wait until the game starts") + tgui_alert(usr, "Wait until the game starts") return if(ishuman(M)) INVOKE_ASYNC(M, /mob/living/carbon/human/proc/slimeize) @@ -133,7 +133,7 @@ log_admin("[key_name(usr)] made [key_name(M)] into a slime at [AREACOORD(M)].") message_admins("[key_name_admin(usr)] made [ADMIN_LOOKUPFLW(M)] into a slime.") else - alert("Invalid mob") + tgui_alert(usr, "Invalid mob") //TODO: merge the vievars version into this or something maybe mayhaps /client/proc/cmd_debug_del_all(object as text) @@ -173,7 +173,7 @@ set name = "Grant Full Access" if(!SSticker.HasRoundStarted()) - alert("Wait until the game starts") + tgui_alert(usr, "Wait until the game starts") return if(ishuman(M)) var/mob/living/carbon/human/H = M @@ -205,7 +205,7 @@ H.equip_to_slot(id,SLOT_WEAR_ID) else - alert("Invalid mob") + tgui_alert(usr, "Invalid mob") SSblackbox.record_feedback("tally", "admin_verb", 1, "Grant Full Access") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(src)] has granted [M.key] full access.") message_admins("[key_name_admin(usr)] has granted [M.key] full access.") @@ -216,7 +216,7 @@ set desc = "Direct intervention" if(M.ckey) - if(alert("This mob is being controlled by [M.key]. Are you sure you wish to assume control of it? [M.key] will be made a ghost.",,"Yes","No") != "Yes") + if(tgui_alert(src, "This mob is being controlled by [M.key]. Are you sure you wish to assume control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes") return else var/mob/dead/observer/ghost = new/mob/dead/observer(get_turf(M), M) @@ -236,12 +236,12 @@ if(!M) return if(M.ckey) - if(alert("This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,"Yes","No") != "Yes") + if(tgui_alert(usr, "This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes") return var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sortList(GLOB.clients) var/mob/oldmob = newkey.mob var/delmob = FALSE - if((isobserver(oldmob) || alert("Do you want to delete [newkey]'s old mob?","Delete?","Yes","No") != "No")) + if((isobserver(oldmob) || tgui_alert(usr, "Do you want to delete [newkey]'s old mob?","Delete?",list("Yes","No")) != "No")) delmob = TRUE if(!M || QDELETED(M)) to_chat(usr, "The target mob no longer exists, aborting.") @@ -542,7 +542,7 @@ set name = "Start Singularity" set desc = "Sets up the singularity and all machines to get power flowing through the station" - if(alert("Are you sure? This will start up the engine. Should only be used during debug!",,"Yes","No") != "Yes") + if(tgui_alert(usr, "Are you sure? This will start up the engine. Should only be used during debug!",,list("Yes","No")) != "Yes") return for(var/obj/machinery/power/emitter/E in GLOB.machines) @@ -731,7 +731,7 @@ return var/datum/map_template/ruin/template = data[1] if (exists[template]) - var/response = alert("There is already a [template] in existence.", "Spawn Ruin", "Jump", "Place Another", "Cancel") + var/response = tgui_alert(usr, "There is already a [template] in existence.", "Spawn Ruin", list("Jump", "Place Another", "Cancel")) if (response == "Jump") usr.forceMove(get_turf(exists[template])) return @@ -755,7 +755,7 @@ set desc = "Deallocates all reserved space, restoring it to round start conditions." if(!holder) return - var/answer = alert("WARNING: THIS WILL WIPE ALL RESERVED SPACE TO A CLEAN SLATE! ANY MOVING SHUTTLES, ELEVATORS, OR IN-PROGRESS PHOTOGRAPHY WILL BE DELETED!", "Really wipe dynamic turfs?", "YES", "NO") + var/answer = tgui_alert(usr, "WARNING: THIS WILL WIPE ALL RESERVED SPACE TO A CLEAN SLATE! ANY MOVING SHUTTLES, ELEVATORS, OR IN-PROGRESS PHOTOGRAPHY WILL BE DELETED!", "Really wipe dynamic turfs?", list("YES", "NO")) if(answer != "YES") return message_admins("[key_name_admin(src)] cleared dynamic transit space.") @@ -845,5 +845,5 @@ set desc = "Force config reload to world default" if(!check_rights(R_DEBUG)) return - if(alert(usr, "Are you absolutely sure you want to reload the configuration from the default path on the disk, wiping any in-round modificatoins?", "Really reset?", "No", "Yes") == "Yes") + if(tgui_alert(usr, "Are you absolutely sure you want to reload the configuration from the default path on the disk, wiping any in-round modificatoins?", "Really reset?", list("No", "Yes")) == "Yes") config.admin_reload() diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 8defd78a06..ff476ee716 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -56,7 +56,7 @@ if(!src.holder) return - var/confirm = alert(src, "Are you sure you want to reload all admins?", "Confirm", "Yes", "No") + var/confirm = tgui_alert(src, "Are you sure you want to reload all admins?", "Confirm", list("Yes", "No")) if(confirm !="Yes") return @@ -68,7 +68,7 @@ set name = "Toggle CDN" set category = "Server" var/static/admin_disabled_cdn_transport = null - if (alert(usr, "Are you sure you want to toggle the CDN asset transport?", "Confirm", "Yes", "No") != "Yes") + if (tgui_alert(usr, "Are you sure you want to toggle the CDN asset transport?", "Confirm", list("Yes", "No")) != "Yes") return var/current_transport = CONFIG_GET(string/asset_transport) if (!current_transport || current_transport == "simple") @@ -80,7 +80,7 @@ log_admin("[key_name(usr)] re-enabled the CDN asset transport") else to_chat(usr, "The CDN is not enabled!") - if (alert(usr, "The CDN asset transport is not enabled! If you having issues with assets you can also try disabling filename mutations.", "The CDN asset transport is not enabled!", "Try disabling filename mutations", "Nevermind") == "Try disabling filename mutations") + if (tgui_alert(usr, "The CDN asset transport is not enabled! If you having issues with assets you can also try disabling filename mutations.", "The CDN asset transport is not enabled!", list("Try disabling filename mutations", "Nevermind")) == "Try disabling filename mutations") SSassets.transport.dont_mutate_filenames = !SSassets.transport.dont_mutate_filenames message_admins("[key_name_admin(usr)] [(SSassets.transport.dont_mutate_filenames ? "disabled" : "re-enabled")] asset filename transforms") log_admin("[key_name(usr)] [(SSassets.transport.dont_mutate_filenames ? "disabled" : "re-enabled")] asset filename transforms") diff --git a/code/modules/admin/verbs/dice.dm b/code/modules/admin/verbs/dice.dm index f033351f96..567d48362f 100644 --- a/code/modules/admin/verbs/dice.dm +++ b/code/modules/admin/verbs/dice.dm @@ -13,12 +13,12 @@ var/dice = num2text(sum) + "d" + num2text(side) - if(alert("Do you want to inform the world about your game?",,"Yes", "No") == "Yes") + if(tgui_alert(src, "Do you want to inform the world about your game?",,list("Yes", "No")) == "Yes") to_chat(world, "

    The dice have been rolled by Gods!

    ") var/result = roll(dice) - if(alert("Do you want to inform the world about the result?",,"Yes", "No") == "Yes") + if(tgui_alert(src, "Do you want to inform the world about the result?",,list("Yes", "No")) == "Yes") to_chat(world, "

    Gods rolled [dice], result is [result]

    ") message_admins("[key_name_admin(src)] rolled dice [dice], result is [result]") diff --git a/code/modules/admin/verbs/fps.dm b/code/modules/admin/verbs/fps.dm index 2b65d2a44c..d1f2578041 100644 --- a/code/modules/admin/verbs/fps.dm +++ b/code/modules/admin/verbs/fps.dm @@ -14,7 +14,7 @@ to_chat(src, "Error: set_server_fps(): Invalid world.fps value. No changes made.") return if(new_fps > cfg_fps * 1.5) - if(alert(src, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [cfg_fps]","Warning!","Confirm","ABORT-ABORT-ABORT") != "Confirm") + if(tgui_alert(src, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [cfg_fps]","Warning!",list("Confirm","ABORT-ABORT-ABORT")) != "Confirm") return var/msg = "[key_name(src)] has modified world.fps to [new_fps]" diff --git a/code/modules/admin/verbs/getlogs.dm b/code/modules/admin/verbs/getlogs.dm index 446dbcc69a..46f9092bdb 100644 --- a/code/modules/admin/verbs/getlogs.dm +++ b/code/modules/admin/verbs/getlogs.dm @@ -24,7 +24,7 @@ return message_admins("[key_name_admin(src)] accessed file: [path]") - switch(alert("View (in game), Open (in your system's text editor), or Download?", path, "View", "Open", "Download")) + switch(tgui_alert(src, "View (in game), Open (in your system's text editor), or Download?", path, list("View", "Open", "Download"))) if ("View") src << browse("
    [html_encode(file2text(file(path)))]
    ", list2params(list("window" = "viewfile.[path]"))) if ("Open") diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm index e89c3ad5a6..cda19e1201 100644 --- a/code/modules/admin/verbs/map_template_loadverb.dm +++ b/code/modules/admin/verbs/map_template_loadverb.dm @@ -22,7 +22,7 @@ var/choice = input(src, "Which orientation? Maps are normally facing SOUTH.", "Template Orientation", "South") as null|anything in orientations var/orientation = orientations[choice] images += preview - if(alert(src,"Confirm location.","Template Confirm","Yes","No") == "Yes") + if(tgui_alert(src, "Confirm location.","Template Confirm",list("Yes","No")) == "Yes") if(template.load(T, centered = TRUE, orientation = orientation)) message_admins("[key_name_admin(src)] has placed a map template ([template.name]) at [ADMIN_COORDJMP(T)]") else @@ -40,7 +40,7 @@ to_chat(src, "Filename must end in '.dmm': [map]") return var/datum/map_template/M - switch(alert(src, "What kind of map is this?", "Map type", "Normal", "Shuttle", "Cancel")) + switch(tgui_alert(src, "What kind of map is this?", "Map type", list("Normal", "Shuttle", "Cancel"))) if("Normal") M = new /datum/map_template(map, "[map]", TRUE) if("Shuttle") @@ -58,11 +58,11 @@ report_link = " - validation report" to_chat(src, "Map template '[map]' failed validation.") if(report.loadable) - var/response = alert(src, "The map failed validation, would you like to load it anyways?", "Map Errors", "Cancel", "Upload Anyways") + var/response = tgui_alert(src, "The map failed validation, would you like to load it anyways?", "Map Errors", list("Cancel", "Upload Anyways")) if(response != "Upload Anyways") return else - alert(src, "The map failed validation and cannot be loaded.", "Map Errors", "Oh Darn") + tgui_alert(src, "The map failed validation and cannot be loaded.", "Map Errors", list("Oh Darn")) return SSmapping.map_templates[M.name] = M diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 0dfee4c38c..221f43c6e6 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -110,7 +110,7 @@ GLOBAL_LIST_EMPTY(dirty_vars) set name = "Camera Report" if(!Master) - alert(usr,"Master_controller not found.","Sec Camera Report") + tgui_alert(usr, "Master_controller not found.","Sec Camera Report") return 0 var/list/obj/machinery/camera/CL = list() diff --git a/code/modules/admin/verbs/maprotation.dm b/code/modules/admin/verbs/maprotation.dm index af8bd6e9fb..378aab0f70 100644 --- a/code/modules/admin/verbs/maprotation.dm +++ b/code/modules/admin/verbs/maprotation.dm @@ -1,7 +1,7 @@ /client/proc/forcerandomrotate() set category = "Server" set name = "Trigger Random Map Rotation" - var/rotate = alert("Force a random map rotation to trigger?", "Rotate map?", "Yes", "Cancel") + var/rotate = tgui_alert(usr, "Force a random map rotation to trigger?", "Rotate map?", list("Yes", "Cancel")) if (rotate != "Yes") return message_admins("[key_name_admin(usr)] is forcing a random map rotation.") diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index 3860706538..a2b8ce3418 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -1,7 +1,7 @@ GLOBAL_VAR_INIT(highlander, FALSE) /client/proc/only_one() //Gives everyone kilts, berets, claymores, and pinpointers, with the objective to hijack the emergency shuttle. if(!SSticker.HasRoundStarted()) - alert("The game hasn't started yet!") + tgui_alert(usr, "The game hasn't started yet!") return GLOB.highlander = TRUE diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index c9a5cafd9b..de064835c3 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -20,7 +20,7 @@ admin_sound.status = SOUND_STREAM admin_sound.volume = vol - var/res = alert(usr, "Show the title of this song to the players?",, "Yes","No", "Cancel") + var/res = tgui_alert(usr, "Show the title of this song to the players?",, list("Yes","No", "Cancel")) switch(res) if("Yes") to_chat(world, "An admin played: [S]", confidential = TRUE) @@ -98,7 +98,7 @@ music_extra_data["link"] = data["webpage_url"] music_extra_data["title"] = data["title"] - var/res = alert(usr, "Show the title of and link to this song to the players?\n[title]",, "No", "Yes", "Cancel") + var/res = tgui_alert(usr, "Show the title of and link to this song to the players?\n[title]",, list("No", "Yes", "Cancel")) switch(res) if("Yes") to_chat(world, "An admin played: [webpage_url]") diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 72ec804d28..1635fc9a52 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -4,7 +4,7 @@ if(!check_rights(R_ADMIN)) return - var/confirm = alert(src, "Make [M] drop everything?", "Message", "Yes", "No") + var/confirm = tgui_alert(src, "Make [M] drop everything?", "Message", list("Yes", "No")) if(confirm != "Yes") return @@ -358,7 +358,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something //Check if they were an alien if(G_found.mind.assigned_role == ROLE_ALIEN) - if(alert("This character appears to have been an alien. Would you like to respawn them as such?",,"Yes","No")=="Yes") + if(tgui_alert(usr, "This character appears to have been an alien. Would you like to respawn them as such?",,list("Yes","No"))=="Yes") var/turf/T if(GLOB.xeno_spawn.len) T = pick(GLOB.xeno_spawn) @@ -393,7 +393,7 @@ Traitors and the like can also be revived with the previous role mostly intact. //check if they were a monkey else if(findtext(G_found.real_name,"monkey")) - if(alert("This character appears to have been a monkey. Would you like to respawn them as such?",,"Yes","No")=="Yes") + if(tgui_alert(usr, "This character appears to have been a monkey. Would you like to respawn them as such?",,list("Yes","No"))=="Yes") var/mob/living/carbon/monkey/new_monkey = new SSjob.SendToLateJoin(new_monkey) G_found.mind.transfer_to(new_monkey) //be careful when doing stuff like this! I've already checked the mind isn't in use @@ -487,10 +487,10 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!issilicon(new_character))//If they are not a cyborg/AI. if(!record_found&&new_character.mind.assigned_role!=new_character.mind.special_role)//If there are no records for them. If they have a record, this info is already in there. MODE people are not announced anyway. //Power to the user! - if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes") + if(tgui_alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,list("No","Yes"))=="Yes") GLOB.data_core.manifest_inject(new_character) - if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes") + if(tgui_alert(new_character,"Would you like an active AI to announce this character?",,list("No","Yes"))=="Yes") AnnounceArrival(new_character, new_character.mind.assigned_role) var/msg = "[admin] has respawned [player_key] as [new_character.real_name]." @@ -516,7 +516,7 @@ Traitors and the like can also be revived with the previous role mostly intact. log_admin("Admin [key_name(usr)] has added a new AI law - [input]") message_admins("Admin [key_name_admin(usr)] has added a new AI law - [input]") - var/show_log = alert(src, "Show ion message?", "Message", "Yes", "No") + var/show_log = tgui_alert(src, "Show ion message?", "Message", list("Yes", "No")) var/announce_ion_laws = (show_log == "Yes" ? 1 : -1) var/datum/round_event/ion_storm/add_law_only/ion = new() @@ -535,7 +535,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!mob) return if(!istype(M)) - alert("Cannot revive a ghost") + tgui_alert(src, "Cannot revive a ghost") return M.revive(full_heal = 1, admin_revive = 1) @@ -556,7 +556,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!input) return - var/confirm = alert(src, "Do you want to announce the contents of the report to the crew?", "Announce", "Yes", "No", "Cancel") + var/confirm = tgui_alert(src, "Do you want to announce the contents of the report to the crew?", "Announce", list("Yes", "No", "Cancel")) var/announce_command_report = TRUE switch(confirm) if("Yes") @@ -648,7 +648,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 (tgui_alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", list("Yes", "No")) == "No") return explosion(O, devastation, heavy, light, flash, null, null,flames) @@ -682,7 +682,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/confirm = alert(src, "Drop a brain?", "Confirm", "Yes", "No","Cancel") + var/confirm = tgui_alert(src, "Drop a brain?", "Confirm", list("Yes", "No","Cancel")) if(confirm == "Cancel") return //Due to the delay here its easy for something to have happened to the mob @@ -705,7 +705,7 @@ Traitors and the like can also be revived with the previous role mostly intact. set name = "Gibself" set category = "Admin.Fun" - var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") + var/confirm = tgui_alert(src, "You sure?", "Confirm", list("Yes", "No")) if(confirm == "Yes") log_admin("[key_name(usr)] used gibself.") message_admins("[key_name_admin(usr)] used gibself.") @@ -746,7 +746,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") + var/confirm = tgui_alert(src, "You sure?", "Confirm", list("Yes", "No")) if(confirm != "Yes") return @@ -761,7 +761,7 @@ Traitors and the like can also be revived with the previous role mostly intact. set name = "Cancel Shuttle" if(!check_rights(0)) return - if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") + if(tgui_alert(src, "You sure?", "Confirm", list("Yes", "No")) != "Yes") return if(EMERGENCY_AT_LEAST_DOCKED) @@ -783,7 +783,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(SSshuttle.emergency.mode == SHUTTLE_DISABLED) to_chat(usr, "Error, shuttle is already disabled.") return - if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") + if(tgui_alert(src, "You sure?", "Confirm", list("Yes", "No")) != "Yes") return message_admins("[key_name_admin(usr)] disabled the shuttle.") SSshuttle.lastMode = SSshuttle.emergency.mode @@ -803,7 +803,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(SSshuttle.emergency.mode != SHUTTLE_DISABLED) to_chat(usr, "Error, shuttle not disabled.") return - if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") + if(tgui_alert(src, "You sure?", "Confirm", list("Yes", "No")) != "Yes") return message_admins("[key_name_admin(usr)] enabled the emergency shuttle.") SSshuttle.adminEmergencyNoRecall = FALSE @@ -833,7 +833,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return - var/notifyplayers = alert(src, "Do you want to notify the players?", "Options", "Yes", "No", "Cancel") + var/notifyplayers = tgui_alert(src, "Do you want to notify the players?", "Options", list("Yes", "No", "Cancel")) if(notifyplayers == "Cancel") return @@ -1142,7 +1142,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/confirm = alert(src, "Please confirm you want to add latent zombie organs in all humans?", "Confirm Zombies", "Yes", "No") + var/confirm = tgui_alert(src, "Please confirm you want to add latent zombie organs in all humans?", "Confirm Zombies", list("Yes", "No")) if(confirm != "Yes") return @@ -1160,7 +1160,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/confirm = alert(src, "Please confirm you want to cure all zombies?", "Confirm Zombie Cure", "Yes", "No") + var/confirm = tgui_alert(src, "Please confirm you want to cure all zombies?", "Confirm Zombie Cure", list("Yes", "No")) if(confirm != "Yes") return @@ -1179,7 +1179,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - var/confirm = alert(src, "Please confirm you want polymorph all mobs?", "Confirm Polymorph", "Yes", "No") + var/confirm = tgui_alert(src, "Please confirm you want polymorph all mobs?", "Confirm Polymorph", list("Yes", "No")) if(confirm != "Yes") return @@ -1378,7 +1378,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!ispath(delivery)) delivery = pick_closest_path(target_path) if(!delivery) - alert("ERROR: Incorrect / improper path given.") + tgui_alert(src, "ERROR: Incorrect / improper path given.") new delivery(pod) new /obj/effect/pod_landingzone(get_turf(target), pod) if(ADMIN_PUNISHMENT_SUPPLYPOD) diff --git a/code/modules/admin/verbs/reestablish_db_connection.dm b/code/modules/admin/verbs/reestablish_db_connection.dm index 2090902ebc..503379c551 100644 --- a/code/modules/admin/verbs/reestablish_db_connection.dm +++ b/code/modules/admin/verbs/reestablish_db_connection.dm @@ -7,10 +7,10 @@ if (SSdbcore.IsConnected()) if (!check_rights(R_DEBUG,0)) - alert("The database is already connected! (Only those with +debug can force a reconnection)", "The database is already connected!") + tgui_alert(src, "The database is already connected! (Only those with +debug can force a reconnection)", "The database is already connected!") return - var/reconnect = alert("The database is already connected! If you *KNOW* that this is incorrect, you can force a reconnection", "The database is already connected!", "Force Reconnect", "Cancel") + var/reconnect = tgui_alert(src, "The database is already connected! If you *KNOW* that this is incorrect, you can force a reconnection", "The database is already connected!", list("Force Reconnect", "Cancel")) if (reconnect != "Force Reconnect") return diff --git a/code/modules/admin/verbs/secrets.dm b/code/modules/admin/verbs/secrets.dm index 80344d076c..d8b927c670 100644 --- a/code/modules/admin/verbs/secrets.dm +++ b/code/modules/admin/verbs/secrets.dm @@ -130,11 +130,11 @@ holder.holder.output_ai_laws()//huh, inconvenient var naming, huh? if("showgm") if(!SSticker.HasRoundStarted()) - alert("The game hasn't started yet!") + tgui_alert(holder, "The game hasn't started yet!") else if (SSticker.mode) - alert("The game mode is [SSticker.mode.name]") + tgui_alert(holder, "The game mode is [SSticker.mode.name]") else - alert("For some reason there's a SSticker, but not a game mode") + tgui_alert(holder, "For some reason there's a SSticker, but not a game mode") if("manifest") var/dat = "Showing Crew Manifest.
    " dat += "
    " @@ -163,7 +163,7 @@ if("ctfbutton") toggle_all_ctf(holder) if("tdomereset") - var/delete_mobs = alert("Clear all mobs?","Confirm","Yes","No","Cancel") + var/delete_mobs = tgui_alert(holder, "Clear all mobs?","Confirm",list("Yes","No","Cancel")) if(delete_mobs == "Cancel") return @@ -195,7 +195,7 @@ message_admins("[key_name_admin(holder)] reset the station name.") priority_announce("[command_name()] has renamed the station to \"[new_name]\".") if("night_shift_set") - var/val = alert(holder, "What do you want to set night shift to? This will override the automatic system until set to automatic again.", "Night Shift", "On", "Off", "Automatic") + var/val = tgui_alert(holder, "What do you want to set night shift to? This will override the automatic system until set to automatic again.", "Night Shift", list("On", "Off", "Automatic")) switch(val) if("Automatic") if(CONFIG_GET(flag/enable_night_shifts)) @@ -239,7 +239,7 @@ if(!is_funmin) return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Virus Outbreak")) - switch(alert("Do you want this to be a random disease or do you have something in mind?",,"Make Your Own","Random","Choose")) + switch(tgui_alert(holder, "Do you want this to be a random disease or do you have something in mind?",,list("Make Your Own","Random","Choose"))) if("Make Your Own") AdminCreateVirus(holder) if("Random") @@ -297,7 +297,7 @@ if("onlyone") if(!is_funmin) return - var/response = alert("Delay by 40 seconds?", "There can, in fact, only be one", "Instant!", "40 seconds (crush the hope of a normal shift)") + var/response = tgui_alert(holder, "Delay by 40 seconds?", "There can, in fact, only be one", list("Instant!", "40 seconds (crush the hope of a normal shift)")) if(response == "Instant!") holder.only_one() else @@ -308,7 +308,7 @@ return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Guns")) var/survivor_probability = 0 - switch(alert("Do you want this to create survivors antagonists?",,"No Antags","Some Antags","All Antags!")) + switch(tgui_alert(holder, "Do you want this to create survivors antagonists?",,list("No Antags","Some Antags","All Antags!"))) if("Some Antags") survivor_probability = 25 if("All Antags!") @@ -320,7 +320,7 @@ return SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Magic")) var/survivor_probability = 0 - switch(alert("Do you want this to create magician antagonists?",,"No Antags","Some Antags","All Antags!")) + switch(tgui_alert(holder, "Do you want this to create magician antagonists?",,list("No Antags","Some Antags","All Antags!"))) if("Some Antags") survivor_probability = 25 if("All Antags!") @@ -331,12 +331,12 @@ if(!is_funmin) return if(!SSevents.wizardmode) - if(alert("Do you want to toggle summon events on?",,"Yes","No") == "Yes") + if(tgui_alert(holder, "Do you want to toggle summon events on?",,list("Yes","No")) == "Yes") summonevents() SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Events", "Activate")) else - switch(alert("What would you like to do?",,"Intensify Summon Events","Turn Off Summon Events","Nothing")) + switch(tgui_alert(holder, alert("What would you like to do?",,"Intensify Summon Events",list("Turn Off Summon Events","Nothing")))) if("Intensify Summon Events") summonevents() SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Summon Events", "Intensify")) @@ -471,7 +471,7 @@ if(!is_funmin) return if(!SSticker.HasRoundStarted()) - alert("The game hasn't started yet!") + tgui_alert(holder, "The game hasn't started yet!") return var/objective = stripped_input(holder, "Enter an objective") if(!objective) @@ -497,7 +497,7 @@ if(!is_funmin) return if(!SSticker.HasRoundStarted()) - alert("The game hasn't started yet!") + tgui_alert(holder, "The game hasn't started yet!") return message_admins("[key_name_admin(holder)] activated AK-47s for Everyone!") holder.ak47s() @@ -516,11 +516,11 @@ if("anime") if(!is_funmin) return - var/animetype = alert("Would you like to have the clothes be changed?",,"Yes","No","Cancel") + var/animetype = tgui_alert(holder, "Would you like to have the clothes be changed?",,list("Yes","No","Cancel")) var/droptype if(animetype =="Yes") - droptype = alert("Make the uniforms Nodrop?",,"Yes","No","Cancel") + droptype = tgui_alert(holder, "Make the uniforms Nodrop?",,list("Yes","No","Cancel")) if(animetype == "Cancel" || droptype == "Cancel") return @@ -584,7 +584,7 @@ if(E) E.processing = FALSE if(E.announceWhen>0) - switch(alert(holder, "Would you like to alert the crew?", "Alert", "Yes", "No", "Cancel")) + switch(tgui_alert(holder, "Would you like to alert the crew?", "Alert", list("Yes", "No", "Cancel"))) if("Cancel") E.kill() return diff --git a/code/modules/admin/verbs/selectequipment.dm b/code/modules/admin/verbs/selectequipment.dm index eb75df9ac1..12b2c42d9f 100644 --- a/code/modules/admin/verbs/selectequipment.dm +++ b/code/modules/admin/verbs/selectequipment.dm @@ -37,7 +37,7 @@ user = CLIENT_FROM_VAR(_user) if(!ishuman(target) && !isobserver(target)) - alert("Invalid mob") + tgui_alert(usr, "Invalid mob") return target_mob = target @@ -197,7 +197,7 @@ /client/proc/admin_apply_outfit(mob/target, dresscode) if(!ishuman(target) && !isobserver(target)) - alert("Invalid mob") + tgui_alert(usr, "Invalid mob") return if(!dresscode) @@ -210,7 +210,7 @@ else human_target = target if(human_target.l_store || human_target.r_store || human_target.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(tgui_alert(src, "Drop Items in Pockets? No will delete them.", "Robust quick dress shop", list("Yes", "No")) == "No") 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! diff --git a/code/modules/admin/verbs/shuttlepanel.dm b/code/modules/admin/verbs/shuttlepanel.dm index 7552936136..ef584272b7 100644 --- a/code/modules/admin/verbs/shuttlepanel.dm +++ b/code/modules/admin/verbs/shuttlepanel.dm @@ -35,12 +35,12 @@ setTimer(ignitionTime) if("Delete Shuttle") - if(alert(user, "Really delete [name || id]?", "Delete Shuttle", "Cancel", "Really!") != "Really!") + if(tgui_alert(user, "Really delete [name || id]?", "Delete Shuttle", list("Cancel", "Really!")) != "Really!") return jumpToNullSpace() if("Into The Sunset (delete & greentext 'escape')") - if(alert(user, "Really delete [name || id] and greentext escape objectives?", "Delete Shuttle", "Cancel", "Really!") != "Really!") + if(tgui_alert(user, "Really delete [name || id] and greentext escape objectives?", "Delete Shuttle", list("Cancel", "Really!")) != "Really!") return intoTheSunset() @@ -52,7 +52,7 @@ return // use the existing verbs for this /obj/docking_port/mobile/arrivals/admin_fly_shuttle(mob/user) - switch(alert(user, "Would you like to fly the arrivals shuttle once or change its destination?", "Fly Shuttle", "Fly", "Retarget", "Cancel")) + switch(tgui_alert(user, "Would you like to fly the arrivals shuttle once or change its destination?", "Fly Shuttle", list("Fly", "Retarget", "Cancel"))) if("Cancel") return if("Fly") diff --git a/code/modules/admin/view_variables/admin_delete.dm b/code/modules/admin/view_variables/admin_delete.dm index 947ad5db2c..592b2680be 100644 --- a/code/modules/admin/view_variables/admin_delete.dm +++ b/code/modules/admin/view_variables/admin_delete.dm @@ -10,7 +10,7 @@ else jmp_coords = coords = "in nullspace" - if (alert(src, "Are you sure you want to delete:\n[D]\n[coords]?", "Confirmation", "Yes", "No") == "Yes") + if (tgui_alert(src, "Are you sure you want to delete:\n[D]\n[coords]?", "Confirmation", list("Yes", "No")) == "Yes") log_admin("[key_name(usr)] deleted [D] [coords]") message_admins("[key_name_admin(usr)] deleted [D] [jmp_coords]") SSblackbox.record_feedback("tally", "admin_verb", 1, "Delete") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/view_variables/get_variables.dm b/code/modules/admin/view_variables/get_variables.dm index 3f90002edc..15263ec695 100644 --- a/code/modules/admin/view_variables/get_variables.dm +++ b/code/modules/admin/view_variables/get_variables.dm @@ -261,10 +261,10 @@ break D = locate(ref) if(!D) - alert("Invalid ref!") + tgui_alert(usr, "Invalid ref!") continue if(!D.can_vv_mark()) - alert("Datum can not be marked!") + tgui_alert(usr, "Datum can not be marked!") continue while(!D) .["type"] = D.type diff --git a/code/modules/admin/view_variables/mass_edit_variables.dm b/code/modules/admin/view_variables/mass_edit_variables.dm index 5b120b6cef..6d7d10ebc0 100644 --- a/code/modules/admin/view_variables/mass_edit_variables.dm +++ b/code/modules/admin/view_variables/mass_edit_variables.dm @@ -52,7 +52,7 @@ if(variable in GLOB.VVpixelmovement) if(!check_rights(R_DEBUG)) return - var/prompt = alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT") + var/prompt = tgui_alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", list("ABORT ", "Continue", " ABORT")) if (prompt != "Continue") return @@ -118,7 +118,7 @@ var/pre_processing = new_value var/unique if (varsvars?.len) - unique = alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", "Unique", "Same") + unique = tgui_alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", list("Unique", "Same")) if(unique == "Unique") unique = TRUE else @@ -145,7 +145,7 @@ CHECK_TICK 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") + 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") return if (many == "Many") diff --git a/code/modules/admin/view_variables/modify_variables.dm b/code/modules/admin/view_variables/modify_variables.dm index b9de3e09bc..2febd0e0ef 100644 --- a/code/modules/admin/view_variables/modify_variables.dm +++ b/code/modules/admin/view_variables/modify_variables.dm @@ -9,7 +9,7 @@ GLOBAL_PROTECT(VVpixelmovement) /client/proc/vv_parse_text(O, new_var) if(O && findtext(new_var,"\[")) - var/process_vars = alert(usr,"\[] detected in string, process as variables?","Process Variables?","Yes","No") + var/process_vars = tgui_alert(usr, "\[] detected in string, process as variables?","Process Variables?",list("Yes","No")) if(process_vars == "Yes") . = string2listofvars(new_var, O) @@ -24,7 +24,7 @@ GLOBAL_PROTECT(VVpixelmovement) if (!subtypes || !subtypes.len) return FALSE if (subtypes?.len) - switch(alert("Strict object type detection?", "Type detection", "Strictly this type","This type and subtypes", "Cancel")) + switch(tgui_alert(src, "Strict object type detection?", "Type detection", list("Strictly this type","This type and subtypes", "Cancel"))) if("Strictly this type") return FALSE if("This type and subtypes") @@ -97,7 +97,7 @@ GLOBAL_PROTECT(VVpixelmovement) L += var_value - switch(alert("Would you like to associate a value with the list entry?",,"Yes","No")) + switch(tgui_alert(src, "Would you like to associate a value with the list entry?",,list("Yes","No"))) if("Yes") L[var_value] = mod_list_add_ass(O) //hehe if (O) @@ -116,7 +116,7 @@ GLOBAL_PROTECT(VVpixelmovement) return if(L.len > 1000) - var/confirm = alert(src, "The list you're trying to edit is very long, continuing may crash the server.", "Warning", "Continue", "Abort") + var/confirm = tgui_alert(src, "The list you're trying to edit is very long, continuing may crash the server.", "Warning", list("Continue", "Abort")) if(confirm != "Continue") return @@ -178,7 +178,7 @@ GLOBAL_PROTECT(VVpixelmovement) if (index == null) 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") + 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") return if (prompt == "Assigned Value") diff --git a/code/modules/admin/view_variables/topic.dm b/code/modules/admin/view_variables/topic.dm index c32b7a9ad7..29b5f539fe 100644 --- a/code/modules/admin/view_variables/topic.dm +++ b/code/modules/admin/view_variables/topic.dm @@ -32,7 +32,7 @@ // If the new name is something that would be restricted by IC chat filters, // give the admin a warning but allow them to do it anyway if they want. - // if(CHAT_FILTER_CHECK(new_name) && alert(usr, "Your selected name contains words restricted by IC chat filters. Confirm this new name?", "IC Chat Filter Conflict", "Confirm", "Cancel") == "Cancel") + // if(CHAT_FILTER_CHECK(new_name) && tgui_alert(usr, "Your selected name contains words restricted by IC chat filters. Confirm this new name?", "IC Chat Filter Conflict", list("Confirm", "Cancel")) == "Cancel") // return if( !new_name || !M ) @@ -69,7 +69,7 @@ to_chat(usr, "This can only be done to instances of type /mob/living/carbon/monkey", confidential = TRUE) return - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + if(tgui_alert(usr, "Confirm mob type change?",,list("Transform","Cancel")) != "Transform") return if(!Mo) to_chat(usr, "Mob doesn't exist anymore", confidential = TRUE) diff --git a/code/modules/admin/view_variables/topic_list.dm b/code/modules/admin/view_variables/topic_list.dm index 349d9da698..9351f58152 100644 --- a/code/modules/admin/view_variables/topic_list.dm +++ b/code/modules/admin/view_variables/topic_list.dm @@ -9,7 +9,7 @@ mod_list(target, null, "list", "contents", target_index, autodetect_class = FALSE) if(href_list[VV_HK_LIST_REMOVE]) var/variable = target[target_index] - var/prompt = alert("Do you want to remove item number [target_index] from list?", "Confirm", "Yes", "No") + var/prompt = tgui_alert(src, "Do you want to remove item number [target_index] from list?", "Confirm", list("Yes", "No")) if (prompt != "Yes") return target.Cut(target_index, target_index+1) diff --git a/code/modules/antagonists/abductor/abductor.dm b/code/modules/antagonists/abductor/abductor.dm index 7eb7ec2af2..cbd631b889 100644 --- a/code/modules/antagonists/abductor/abductor.dm +++ b/code/modules/antagonists/abductor/abductor.dm @@ -119,7 +119,7 @@ to_chat(admin, "This only works on humans!") return var/mob/living/carbon/human/H = owner.current - var/gear = alert(admin,"Agent or Scientist Gear","Gear","Agent","Scientist") + var/gear = tgui_alert(admin, "Agent or Scientist Gear","Gear",list("Agent","Scientist")) if(gear) if(gear=="Agent") H.equipOutfit(/datum/outfit/abductor/agent) diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm index 881da8f282..d93ae9ed2b 100644 --- a/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm +++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm @@ -143,7 +143,7 @@ A = get_area(src) // Claim? if(!bloodsuckerdatum.coffin && !resident && (is_station_level(Turf.z) || !A.map_name == "Space")) - switch(alert(user,"Do you wish to claim this as your coffin? [get_area(src)] will be your lair.","Claim Lair","Yes", "No")) + switch(tgui_alert(user, "Do you wish to claim this as your coffin? [get_area(src)] will be your lair.","Claim Lair",list("Yes", "No"))) if("Yes") ClaimCoffin(user) if (user.AmStaked()) // Stake? No Heal! diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm index e8fb82a5d1..c0c500e619 100644 --- a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm +++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm @@ -232,7 +232,7 @@ if(B.lair != get_area(src)) to_chat(user, "You may only activate this structure in your lair: [B.lair].") return - switch(alert(user,"Do you wish to afix this structure here? Be aware you wont be able to unsecure it anymore", "Secure [src]", "Yes", "No")) + switch(tgui_alert(user, "Do you wish to afix this structure here? Be aware you wont be able to unsecure it anymore", "Secure [src]", list("Yes", "No"))) if("Yes") owner = user density = FALSE @@ -398,7 +398,7 @@ alert_text += "\n\nYou will no longer be loyal to the station!" if(SSticker.mode.AmValidAntag(target.mind)) */ alert_text += "\n\nYou will not lose your current objectives, but they come second to the will of your new master!" - switch(alert(target, alert_text,"THE HORRIBLE PAIN! WHEN WILL IT END?!","Yes, Master!", "NEVER!")) + switch(tgui_alert(target, alert_text,"THE HORRIBLE PAIN! WHEN WILL IT END?!",list("Yes, Master!", "NEVER!"))) if("Yes, Master!") disloyalty_accept(target) else diff --git a/code/modules/antagonists/brainwashing/brainwashing.dm b/code/modules/antagonists/brainwashing/brainwashing.dm index 491ee9d2e5..0bcdd980bf 100644 --- a/code/modules/antagonists/brainwashing/brainwashing.dm +++ b/code/modules/antagonists/brainwashing/brainwashing.dm @@ -54,9 +54,9 @@ var/objective = stripped_input(admin, "Add an objective, or leave empty to finish.", "Brainwashing", null, MAX_MESSAGE_LEN) if(objective) objectives += objective - while(alert(admin,"Add another objective?","More Brainwashing","Yes","No") == "Yes") + while(tgui_alert(admin, "Add another objective?","More Brainwashing",list("Yes","No")) == "Yes") - if(alert(admin,"Confirm Brainwashing?","Are you sure?","Yes","No") == "No") + if(tgui_alert(admin, "Confirm Brainwashing?","Are you sure?",list("Yes","No")) == "No") return if(!LAZYLEN(objectives)) diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm index 08dc85efbf..0bbbeefbd3 100644 --- a/code/modules/antagonists/changeling/powers/fakedeath.dm +++ b/code/modules/antagonists/changeling/powers/fakedeath.dm @@ -36,7 +36,7 @@ to_chat(user, "We are already reviving.") return if(!user.stat) //Confirmation for living changelings if they want to fake their death - switch(alert("Are we sure we wish to fake our own death?",,"Yes", "No")) + switch(tgui_alert(user, "Are we sure we wish to fake our own death?",,list("Yes", "No"))) if("No") return return ..() diff --git a/code/modules/antagonists/changeling/powers/headcrab.dm b/code/modules/antagonists/changeling/powers/headcrab.dm index 867f160081..c88790b800 100644 --- a/code/modules/antagonists/changeling/powers/headcrab.dm +++ b/code/modules/antagonists/changeling/powers/headcrab.dm @@ -12,7 +12,7 @@ /obj/effect/proc_holder/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(tgui_alert(user, "Are we sure we wish to kill ourself and create a headslug?",,list("Yes", "No")) == "No") return var/datum/mind/M = user.mind var/list/organs = user.getorganszone(BODY_ZONE_HEAD, 1) diff --git a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm index 1e8c7242ad..d23a5d119b 100644 --- a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm +++ b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm @@ -465,7 +465,7 @@ var/datum/clockwork_rite/CR = possible_rites[input_key] if(!CR) return - var/choice = alert(user, "What to do with this rite?", "What to do?", "Cast", "Show Info", "Cancel") + var/choice = tgui_alert(user, "What to do with this rite?", "What to do?", list("Cast", "Show Info", "Cancel")) switch(choice) if("Cast") CR.try_cast(src, user) diff --git a/code/modules/antagonists/clockcult/clock_items/construct_chassis.dm b/code/modules/antagonists/clockcult/clock_items/construct_chassis.dm index daee9f5c2c..eba7c4be72 100644 --- a/code/modules/antagonists/clockcult/clock_items/construct_chassis.dm +++ b/code/modules/antagonists/clockcult/clock_items/construct_chassis.dm @@ -48,7 +48,7 @@ to_chat(user, "You were too late! Better luck next time.") return user.forceMove(get_turf(src)) //If we attack through the alert, jump to the chassis so we know what we're getting into - if(alert(user, "Become a [construct_name]? You can no longer be cloned!", construct_name, "Yes", "Cancel") == "Cancel") + if(tgui_alert(user, "Become a [construct_name]? You can no longer be cloned!", construct_name, list("Yes", "Cancel")) == "Cancel") return if(QDELETED(src)) to_chat(user, "You were too late! Better luck next time.") diff --git a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm index e7aeb7e796..db8b4b48ae 100644 --- a/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm +++ b/code/modules/antagonists/clockcult/clock_mobs/_eminence.dm @@ -131,7 +131,7 @@ if(!G.recalls_remaining) to_chat(src, "The Ark can no longer recall!") return - if(alert(src, "Initiate mass recall?", "Mass Recall", "Yes", "No") != "Yes" || QDELETED(src) || QDELETED(G) || !G.obj_integrity) + if(tgui_alert(src, "Initiate mass recall?", "Mass Recall", list("Yes", "No")) != "Yes" || QDELETED(src) || QDELETED(G) || !G.obj_integrity) return G.initiate_mass_recall() //wHOOPS LOOKS LIKE A HULK GOT THROUGH @@ -334,6 +334,6 @@ /datum/action/innate/eminence/mass_recall/Activate() var/obj/structure/destructible/clockwork/massive/celestial_gateway/G = GLOB.ark_of_the_clockwork_justiciar if(G && !G.recalling && G.recalls_remaining) - if(alert(owner, "Initiate mass recall?", "Mass Recall", "Yes", "No") != "Yes" || QDELETED(owner) || QDELETED(G) || !G.obj_integrity) + if(tgui_alert(owner, "Initiate mass recall?", "Mass Recall", list("Yes", "No")) != "Yes" || QDELETED(owner) || QDELETED(G) || !G.obj_integrity) return G.initiate_mass_recall() diff --git a/code/modules/antagonists/clockcult/clock_scripture.dm b/code/modules/antagonists/clockcult/clock_scripture.dm index 6922c7cd81..17d03c020f 100644 --- a/code/modules/antagonists/clockcult/clock_scripture.dm +++ b/code/modules/antagonists/clockcult/clock_scripture.dm @@ -276,7 +276,7 @@ Judgement 80k power or nine converts return var/obj/structure/destructible/clockwork/massive/celestial_gateway/G = GLOB.ark_of_the_clockwork_justiciar if(G && !G.active && combat_construct && is_reebe(invoker.z) && !confirmed) //Putting marauders on the base during the prep phase is a bad idea mmkay - if(alert(invoker, "This is a combat construct, and you cannot easily get it to the station. Are you sure you want to make one here?", "Construct Alert", "Yes", "Cancel") == "Cancel") + if(tgui_alert(invoker, "This is a combat construct, and you cannot easily get it to the station. Are you sure you want to make one here?", "Construct Alert", list("Yes", "Cancel")) == "Cancel") return if(!is_servant_of_ratvar(invoker) || !invoker.canUseTopic(slab)) return diff --git a/code/modules/antagonists/clockcult/clock_structures/ark_of_the_clockwork_justicar.dm b/code/modules/antagonists/clockcult/clock_structures/ark_of_the_clockwork_justicar.dm index 6204871a77..9d0adfdba8 100644 --- a/code/modules/antagonists/clockcult/clock_structures/ark_of_the_clockwork_justicar.dm +++ b/code/modules/antagonists/clockcult/clock_structures/ark_of_the_clockwork_justicar.dm @@ -42,7 +42,7 @@ /obj/structure/destructible/clockwork/massive/celestial_gateway/on_attack_hand(mob/user, act_intent, unarmed_attack_flags) if(!active && is_servant_of_ratvar(user) && user.canUseTopic(src, !issilicon(user), NO_DEXTERY)) - if(alert(user, "Are you sure you want to activate the ark? Once enabled, there will be no turning back.", "Enabling the ark", "Activate!", "Cancel") == "Activate!") + if(tgui_alert(user, "Are you sure you want to activate the ark? Once enabled, there will be no turning back.", "Enabling the ark", list("Activate!", "Cancel")) == "Activate!") if(active) return log_game("[key_name(user)] has activated an Ark of the Clockwork Justicar at [COORD(src)].") @@ -356,9 +356,9 @@ if(GLOB.servants_active) to_chat(user, "The Ark is already counting down.") return ..() - if(alert(user, "Activate the Ark's countdown?", name, "Yes", "No") == "Yes") - if(alert(user, "REALLY activate the Ark's countdown?", name, "Yes", "No") == "Yes") - if(alert(user, "You're REALLY SURE? This cannot be undone.", name, "Yes - Activate the Ark", "No") == "Yes - Activate the Ark") + if(tgui_alert(user, "Activate the Ark's countdown?", name, list("Yes", "No")) == "Yes") + if(tgui_alert(user, "REALLY activate the Ark's countdown?", name, list("Yes", "No")) == "Yes") + if(tgui_alert(user, "You're REALLY SURE? This cannot be undone.", name, list("Yes - Activate the Ark", "No")) == "Yes - Activate the Ark") message_admins("Admin [key_name_admin(user)] started the Ark's countdown!") log_admin("Admin [key_name(user)] started the Ark's countdown on a non-clockcult mode!") to_chat(user, "The gamemode is now being treated as clockwork cult, and the Ark is counting down from 5 \ diff --git a/code/modules/antagonists/clockcult/clock_structures/clockwork_obelisk.dm b/code/modules/antagonists/clockcult/clock_structures/clockwork_obelisk.dm index 2b4b797b4d..cef6e70ec3 100644 --- a/code/modules/antagonists/clockcult/clock_structures/clockwork_obelisk.dm +++ b/code/modules/antagonists/clockcult/clock_structures/clockwork_obelisk.dm @@ -53,7 +53,7 @@ if(!is_servant_of_ratvar(user) || !can_access_clockwork_power(src, hierophant_cost) || !anchored) to_chat(user, "You place your hand on [src], but it doesn't react.") return - var/choice = alert(user,"You place your hand on [src]...",,"Hierophant Broadcast","Spatial Gateway","Cancel") //Will create a stable gateway instead if between two obelisks one of which is onstation and the other on reebe + var/choice = tgui_alert(user, "You place your hand on [src]...",,list("Hierophant Broadcast","Spatial Gateway","Cancel")) //Will create a stable gateway instead if between two obelisks one of which is onstation and the other on reebe switch(choice) if("Hierophant Broadcast") if(active) diff --git a/code/modules/antagonists/clockcult/clock_structures/eminence_spire.dm b/code/modules/antagonists/clockcult/clock_structures/eminence_spire.dm index 5302153b9c..de7dfabbd0 100644 --- a/code/modules/antagonists/clockcult/clock_structures/eminence_spire.dm +++ b/code/modules/antagonists/clockcult/clock_structures/eminence_spire.dm @@ -56,7 +56,7 @@ if(!GLOB.servants_active) to_chat(user, "The Ark must be active first!") return - if(alert(user, "Become the Eminence using admin?", "Become Eminence", "Yes", "No") != "Yes") + if(tgui_alert(user, "Become the Eminence using admin?", "Become Eminence", list("Yes", "No")) != "Yes") return message_admins("Admin [key_name_admin(user)] directly became the Eminence of the cult!") log_admin("Admin [key_name(user)] made themselves the Eminence.") @@ -67,7 +67,7 @@ M.playsound_local(M, 'sound/machines/clockcult/eminence_selected.ogg', 50, FALSE) /obj/structure/destructible/clockwork/eminence_spire/proc/nomination(mob/living/nominee) //A user is nominating themselves or ghosts to become Eminence - var/nomination_choice = alert(nominee, "Who would you like to nominate?", "Eminence Nomination", "Nominate Yourself", "Nominate Ghosts", "Cancel") + var/nomination_choice = tgui_alert(nominee, "Who would you like to nominate?", "Eminence Nomination", list("Nominate Yourself", "Nominate Ghosts", "Cancel")) if(!is_servant_of_ratvar(nominee) || !nominee.canUseTopic(src) || eminence_nominee) return switch(nomination_choice) @@ -84,7 +84,7 @@ selection_timer = addtimer(CALLBACK(src, .proc/kingmaker), 300, TIMER_STOPPABLE) /obj/structure/destructible/clockwork/eminence_spire/proc/objection(mob/living/wright) - if(alert(wright, "Object to the selection of [eminence_nominee] as Eminence?", "Objection!", "Object", "Cancel") == "Cancel" || !is_servant_of_ratvar(wright) || !wright.canUseTopic(src) || !eminence_nominee) + if(tgui_alert(wright, "Object to the selection of [eminence_nominee] as Eminence?", "Objection!", list("Object", "Cancel")) == "Cancel" || !is_servant_of_ratvar(wright) || !wright.canUseTopic(src) || !eminence_nominee) return hierophant_message("[wright] objects to the nomination of [eminence_nominee]! The eminence spire has been reset.") for(var/mob/M in servants_and_ghosts()) @@ -93,7 +93,7 @@ deltimer(selection_timer) /obj/structure/destructible/clockwork/eminence_spire/proc/cancelation(mob/living/cold_feet) - if(alert(cold_feet, "Cancel your nomination?", "Cancel Nomination", "Withdraw Nomination", "Cancel") == "Cancel" || !is_servant_of_ratvar(cold_feet) || !cold_feet.canUseTopic(src) || !eminence_nominee) + if(tgui_alert(cold_feet, "Cancel your nomination?", "Cancel Nomination", list("Withdraw Nomination", "Cancel")) == "Cancel" || !is_servant_of_ratvar(cold_feet) || !cold_feet.canUseTopic(src) || !eminence_nominee) return hierophant_message("[eminence_nominee] has withdrawn their nomination! The eminence spire has been reset.") for(var/mob/M in servants_and_ghosts()) diff --git a/code/modules/antagonists/clockcult/clock_structures/heralds_beacon.dm b/code/modules/antagonists/clockcult/clock_structures/heralds_beacon.dm index f8a3afbf91..76220702c0 100644 --- a/code/modules/antagonists/clockcult/clock_structures/heralds_beacon.dm +++ b/code/modules/antagonists/clockcult/clock_structures/heralds_beacon.dm @@ -71,7 +71,7 @@ to_chat(user, "You can no longer vote with [src].") return var/voting = !(user.key in voters) - if(alert(user, "[voting ? "Cast a" : "Undo your"] vote to activate the beacon?", "Herald's Beacon", "Change Vote", "Cancel") == "Cancel") + if(tgui_alert(user, "[voting ? "Cast a" : "Undo your"] vote to activate the beacon?", "Herald's Beacon", list("Change Vote", "Cancel")) == "Cancel") return if(!user.canUseTopic(src) || !is_servant_of_ratvar(user) || !available) return diff --git a/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm b/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm index 51f8dc7101..b08b90bbfa 100644 --- a/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm +++ b/code/modules/antagonists/clockcult/clock_structures/ratvar_the_clockwork_justicar.dm @@ -42,7 +42,7 @@ //ATTACK GHOST IGNORING PARENT RETURN VALUE /obj/structure/destructible/clockwork/massive/ratvar/attack_ghost(mob/dead/observer/O) - var/alertresult = alert(O, "Embrace the Justiciar's light? You can no longer be cloned!",,"Yes", "No") + var/alertresult = tgui_alert(O, "Embrace the Justiciar's light? You can no longer be cloned!",,list("Yes", "No")) if(alertresult == "No" || QDELETED(O) || !istype(O) || !O.key) return FALSE var/mob/living/simple_animal/drone/cogscarab/ratvar/R = new/mob/living/simple_animal/drone/cogscarab/ratvar(get_turf(src)) diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index 9bd1030685..b31b93744e 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -192,7 +192,7 @@ magic_path = "/obj/item/melee/blood_magic/armor" /datum/action/innate/cult/blood_spell/equipment/Activate() - var/choice = alert(owner,"Choose your equipment type",,"Combat Equipment","Ritual Dagger","Cancel") + var/choice = tgui_alert(owner, "Choose your equipment type",,"Combat Equipment",list("Ritual Dagger","Cancel")) if(choice == "Ritual Dagger") var/turf/T = get_turf(owner) owner.visible_message("[owner]'s hand glows red for a moment.", \ @@ -610,7 +610,7 @@ candidate.color = "black" if(do_after(user, 90, target = candidate)) candidate.emp_act(80) - var/construct_class = alert(user, "Please choose which type of construct you wish to create.",,"Juggernaut","Wraith","Artificer") + var/construct_class = tgui_alert(user, "Please choose which type of construct you wish to create.",,list("Juggernaut","Wraith","Artificer")) user.visible_message("The dark cloud receedes from what was formerly [candidate], revealing a\n [construct_class]!") switch(construct_class) if("Juggernaut") diff --git a/code/modules/antagonists/cult/cult_comms.dm b/code/modules/antagonists/cult/cult_comms.dm index bbdf41ff48..dcc6379c1f 100644 --- a/code/modules/antagonists/cult/cult_comms.dm +++ b/code/modules/antagonists/cult/cult_comms.dm @@ -79,7 +79,7 @@ return ..() /datum/action/innate/cult/mastervote/Activate() - var/choice = alert(owner, "The mantle of leadership is heavy. Success in this role requires an expert level of communication and experience. Are you sure?",, "Yes", "No") + var/choice = tgui_alert(owner, "The mantle of leadership is heavy. Success in this role requires an expert level of communication and experience. Are you sure?",, list("Yes", "No")) if(choice == "Yes" && IsAvailable()) var/datum/antagonist/cult/C = owner.mind.has_antag_datum(/datum/antagonist/cult,TRUE) if(!C.cult_team) diff --git a/code/modules/antagonists/cult/ritual.dm b/code/modules/antagonists/cult/ritual.dm index 98889169c6..f299bdc4b2 100644 --- a/code/modules/antagonists/cult/ritual.dm +++ b/code/modules/antagonists/cult/ritual.dm @@ -101,7 +101,7 @@ This file contains the cult dagger and rune list code if(!(A in summon_objective.summon_spots)) to_chat(user, "The Geometer can only be summoned where the veil is weak - in [english_list(summon_objective.summon_spots)]!") return - var/confirm_final = alert(user, "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") + var/confirm_final = tgui_alert(user, "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?", list("My life for Nar'Sie!", "No")) if(confirm_final == "No") to_chat(user, "You decide to prepare further before scribing the rune.") return diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index 7981a10701..af5ab08d05 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -853,7 +853,7 @@ structure_check() searches for nearby cultist structures required for the invoca . = ..() var/mob/living/user = invokers[1] var/turf/T = get_turf(src) - var/choice = alert(user,"You tear open a connection to the spirit realm...",,"Summon a Cult Ghost","Ascend as a Dark Spirit","Cancel") + var/choice = tgui_alert(user, "You tear open a connection to the spirit realm...",,list("Summon a Cult Ghost","Ascend as a Dark Spirit","Cancel")) if(choice == "Summon a Cult Ghost") var/area/A = get_area(T) if(A.map_name == "Space" || is_mining_level(T.z)) diff --git a/code/modules/antagonists/devil/devil.dm b/code/modules/antagonists/devil/devil.dm index 65ce89d33f..9db621db40 100644 --- a/code/modules/antagonists/devil/devil.dm +++ b/code/modules/antagonists/devil/devil.dm @@ -131,7 +131,7 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master", log_admin("[key_name_admin(admin)] set [owner.current] devil ascendable to [ascendable])") /datum/antagonist/devil/admin_add(datum/mind/new_owner,mob/admin) - switch(alert(admin,"Should the devil be able to ascend",,"Yes","No","Cancel")) + switch(tgui_alert(admin, "Should the devil be able to ascend",,list("Yes","No","Cancel"))) if("Yes") ascendable = TRUE if("No") diff --git a/code/modules/antagonists/disease/disease_mob.dm b/code/modules/antagonists/disease/disease_mob.dm index f6c8c3dbe1..654986d355 100644 --- a/code/modules/antagonists/disease/disease_mob.dm +++ b/code/modules/antagonists/disease/disease_mob.dm @@ -296,7 +296,7 @@ the new instance inside the host to be updated to the template's stats. /mob/camera/disease/proc/confirm_initial_infection(mob/living/carbon/human/H) set waitfor = FALSE - if(alert(src, "Select [H.name] as your initial host?", "Select Host", "Yes", "No") != "Yes") + if(tgui_alert(src, "Select [H.name] as your initial host?", "Select Host", list("Yes", "No")) != "Yes") return if(!freemove) return diff --git a/code/modules/antagonists/monkey/monkey.dm b/code/modules/antagonists/monkey/monkey.dm index 971532958f..6c03e3c686 100644 --- a/code/modules/antagonists/monkey/monkey.dm +++ b/code/modules/antagonists/monkey/monkey.dm @@ -69,7 +69,7 @@ /datum/antagonist/monkey/admin_remove(mob/admin) var/mob/living/carbon/monkey/M = owner.current if(istype(M)) - switch(alert(admin, "Humanize?", "Humanize", "Yes", "No")) + switch(tgui_alert(admin, "Humanize?", "Humanize", list("Yes", "No"))) if("Yes") if(admin == M) admin = M.humanize(TR_KEEPITEMS | TR_KEEPIMPLANTS | TR_KEEPORGANS | TR_KEEPDAMAGE | TR_KEEPVIRUS | TR_DEFAULTMSG) @@ -89,7 +89,7 @@ /datum/antagonist/monkey/leader/admin_add(datum/mind/new_owner,mob/admin) var/mob/living/carbon/human/H = new_owner.current if(istype(H)) - switch(alert(admin, "Monkeyize?", "Monkeyize", "Yes", "No")) + switch(tgui_alert(admin, "Monkeyize?", "Monkeyize", list("Yes", "No"))) if("Yes") if(admin == H) admin = H.monkeyize() diff --git a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm index 39dc4a1ed2..2e0ec0568a 100644 --- a/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm +++ b/code/modules/antagonists/nukeop/equipment/nuclear_challenge.dm @@ -26,7 +26,7 @@ GLOBAL_VAR_INIT(war_declared, FALSE) return declaring_war = TRUE - var/are_you_sure = alert(user, "Consult your team carefully before you declare war on [station_name()]]. Are you sure you want to alert the enemy crew? You have [DisplayTimeText(world.time-SSticker.round_start_time - CHALLENGE_TIME_LIMIT)] to decide", "Declare war?", "Yes", "No") + var/are_you_sure = tgui_alert(user, "Consult your team carefully before you declare war on [station_name()]]. Are you sure you want to alert the enemy crew? You have [DisplayTimeText(world.time-SSticker.round_start_time - CHALLENGE_TIME_LIMIT)] to decide", "Declare war?", list("Yes", "No")) declaring_war = FALSE if(!check_allowed(user)) @@ -39,7 +39,7 @@ GLOBAL_VAR_INIT(war_declared, FALSE) var/war_declaration = "[user.real_name] has declared [user.p_their()] intent to utterly destroy [station_name()] with a nuclear device, and dares the crew to try and stop [user.p_them()]." declaring_war = TRUE - var/custom_threat = alert(user, "Do you want to customize your declaration?", "Customize?", "Yes", "No") + var/custom_threat = tgui_alert(user, "Do you want to customize your declaration?", "Customize?", list("Yes", "No")) declaring_war = FALSE if(!check_allowed(user)) diff --git a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm index fcc8bcade8..f734e3289c 100644 --- a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm +++ b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm @@ -255,7 +255,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( if(!istype(T) || !is_station_level(T.z)) to_chat(owner, "You cannot activate the doomsday device while off-station!") return - if(alert(owner, "Send arming signal? (true = arm, false = cancel)", "purge_all_life()", "confirm = TRUE;", "confirm = FALSE;") != "confirm = TRUE;") + if(tgui_alert(owner, "Send arming signal? (true = arm, false = cancel)", "purge_all_life()", list("confirm = TRUE;", "confirm = FALSE;")) != "confirm = TRUE;") return if (active) return //prevent the AI from activating an already active doomsday @@ -695,7 +695,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( if(!owner_AI.can_place_transformer(src)) return active = TRUE - if(alert(owner, "Are you sure you want to place the machine here?", "Are you sure?", "Yes", "No") == "No") + if(tgui_alert(owner, "Are you sure you want to place the machine here?", "Are you sure?", list("Yes", "No")) == "No") active = FALSE return if(!owner_AI.can_place_transformer(src)) diff --git a/code/modules/antagonists/wizard/equipment/soulstone.dm b/code/modules/antagonists/wizard/equipment/soulstone.dm index fe9770e64a..5a876ea9db 100644 --- a/code/modules/antagonists/wizard/equipment/soulstone.dm +++ b/code/modules/antagonists/wizard/equipment/soulstone.dm @@ -222,7 +222,7 @@ var/obj/structure/constructshell/T = target var/mob/living/simple_animal/hostile/construct/shade/A = locate() in src if(A) - var/construct_class = alert(user, "Please choose which type of construct you wish to create.",,"Juggernaut","Wraith","Artificer") + var/construct_class = tgui_alert(user, "Please choose which type of construct you wish to create.",,list("Juggernaut","Wraith","Artificer")) if(!T || !T.loc) return switch(construct_class) diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index 84e70bbbb3..9decf4ab88 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -116,7 +116,7 @@ to_chat(user, "Assembly part missing!") return if(istype(a_left,a_right.type))//If they are the same type it causes issues due to window code - switch(alert("Which side would you like to use?",,"Left","Right")) + switch(tgui_alert(user, "Which side would you like to use?",,list("Left","Right"))) if("Left") a_left.attack_self(user) if("Right") diff --git a/code/modules/awaymissions/capture_the_flag.dm b/code/modules/awaymissions/capture_the_flag.dm index d32905e007..d76c85848c 100644 --- a/code/modules/awaymissions/capture_the_flag.dm +++ b/code/modules/awaymissions/capture_the_flag.dm @@ -210,7 +210,7 @@ /obj/machinery/capture_the_flag/attack_ghost(mob/user) if(ctf_enabled == FALSE) if(user.client && user.client.holder) - var/response = alert("Enable CTF?", "CTF", "Yes", "No") + var/response = tgui_alert(user, "Enable CTF?", "CTF", list("Yes", "No")) if(response == "Yes") toggle_all_ctf(user) return diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index cd5c2f76f3..27138a9d40 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -49,7 +49,7 @@ var/mob/dead/observer/O = user if(!O.can_reenter_round() && !skip_reentry_check) return FALSE - var/ghost_role = alert(latejoinercalling ? "Latejoin as [mob_name]? (This is a ghost role, and as such, it's very likely to be off-station.)" : "Become [mob_name]? (Warning, You can no longer be cloned!)",,"Yes","No") + var/ghost_role = tgui_alert(user, latejoinercalling ? "Latejoin as [mob_name]? (This is a ghost role, and as such, it's very likely to be off-station.)" : "Become [mob_name]? (Warning, You can no longer be cloned!)",,list("Yes","No")) if(ghost_role == "No" || !loc) return if(QDELETED(src) || QDELETED(user)) @@ -595,7 +595,7 @@ job_description = "Space Bar Patron" /obj/effect/mob_spawn/human/alive/space_bar_patron/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) - var/despawn = alert("Return to cryosleep? (Warning, Your mob will be deleted!)",,"Yes","No") + var/despawn = tgui_alert(user, "Return to cryosleep? (Warning, Your mob will be deleted!)",,list("Yes","No")) if(despawn == "No" || !loc || !Adjacent(user)) return user.visible_message("[user.name] climbs back into cryosleep...") diff --git a/code/modules/awaymissions/signpost.dm b/code/modules/awaymissions/signpost.dm index 4d85d947c2..76f4e004bd 100644 --- a/code/modules/awaymissions/signpost.dm +++ b/code/modules/awaymissions/signpost.dm @@ -16,7 +16,7 @@ . = ..() if(.) return - if(alert(question,name,"Yes","No") == "Yes" && Adjacent(user)) + if(tgui_alert(user, question,name,list("Yes","No")) == "Yes" && Adjacent(user)) var/turf/T = find_safe_turf(zlevels=zlevels) if(T) diff --git a/code/modules/buildmode/submodes/advanced.dm b/code/modules/buildmode/submodes/advanced.dm index 418f504777..69aefaa3a5 100644 --- a/code/modules/buildmode/submodes/advanced.dm +++ b/code/modules/buildmode/submodes/advanced.dm @@ -22,11 +22,11 @@ if(!ispath(objholder)) objholder = pick_closest_path(target_path) if(!objholder) - alert("No path was selected") + tgui_alert(c, "No path was selected") return else if(ispath(objholder, /area)) objholder = null - alert("That path is not allowed.") + tgui_alert(c, "That path is not allowed.") return /datum/buildmode_mode/advanced/handle_click(client/c, params, obj/object) diff --git a/code/modules/buildmode/submodes/fill.dm b/code/modules/buildmode/submodes/fill.dm index b7d87edef2..baa306040c 100644 --- a/code/modules/buildmode/submodes/fill.dm +++ b/code/modules/buildmode/submodes/fill.dm @@ -1,6 +1,6 @@ /datum/buildmode_mode/fill key = "fill" - + use_corner_selection = TRUE var/objholder = null @@ -17,11 +17,11 @@ if(!ispath(objholder)) objholder = pick_closest_path(target_path) if(!objholder) - alert("No path has been selected.") + tgui_alert(c, "No path has been selected.") return else if(ispath(objholder, /area)) objholder = null - alert("Area paths are not supported for this mode, use the area edit mode instead.") + tgui_alert(c, "Area paths are not supported for this mode, use the area edit mode instead.") return deselect_region() diff --git a/code/modules/buildmode/submodes/mapgen.dm b/code/modules/buildmode/submodes/mapgen.dm index 7ed99afd50..5e3541c569 100644 --- a/code/modules/buildmode/submodes/mapgen.dm +++ b/code/modules/buildmode/submodes/mapgen.dm @@ -42,7 +42,7 @@ return G.defineRegion(cornerA, cornerB, 1) highlight_region(G.map) - var/confirm = alert("Are you sure you want run the map generator?", "Run generator", "Yes", "No") + var/confirm = tgui_alert(c, "Are you sure you want run the map generator?", "Run generator", list("Yes", "No")) if(confirm == "Yes") G.generate() log_admin("Build Mode: [key_name(c)] ran the map generator '[G.buildmode_name]' in the region from [AREACOORD(cornerA)] to [AREACOORD(cornerB)]") diff --git a/code/modules/cargo/centcom_podlauncher.dm b/code/modules/cargo/centcom_podlauncher.dm index e4060de1a2..641c6f3f6d 100644 --- a/code/modules/cargo/centcom_podlauncher.dm +++ b/code/modules/cargo/centcom_podlauncher.dm @@ -288,7 +288,7 @@ if (isnull(boomInput[i])) return if (!isnum(boomInput[i])) //If the user doesn't input a number, set that specific explosion value to zero - alert(usr, "That wasn't a number! Value set to default (zero) instead.") + tgui_alert(usr, "That wasn't a number! Value set to default (zero) instead.") boomInput = 0 explosionChoice = 1 temp_pod.explosionSize = boomInput @@ -310,7 +310,7 @@ if (isnull(damageInput)) return if (!isnum(damageInput)) //Sanitize the input for damage to deal.s - alert(usr, "That wasn't a number! Value set to default (zero) instead.") + tgui_alert(usr, "That wasn't a number! Value set to default (zero) instead.") damageInput = 0 damageChoice = 1 temp_pod.damage = damageInput @@ -351,7 +351,7 @@ if (isnull(shrapnelMagnitude)) return if (!isnum(shrapnelMagnitude)) - alert(usr, "That wasn't a number! Value set to 3 instead.") + tgui_alert(usr, "That wasn't a number! Value set to 3 instead.") shrapnelMagnitude = 3 temp_pod.shrapnel_type = shrapnelInput temp_pod.shrapnel_magnitude = shrapnelMagnitude @@ -452,7 +452,7 @@ if (isnull(soundLen)) return if (!isnum(soundLen)) - alert(usr, "That wasn't a number! Value set to default ([initial(temp_pod.fallingSoundLength)*0.1]) instead.") + tgui_alert(usr, "That wasn't a number! Value set to default ([initial(temp_pod.fallingSoundLength)*0.1]) instead.") temp_pod.fallingSound = soundInput temp_pod.fallingSoundLength = 10 * soundLen . = TRUE @@ -521,7 +521,7 @@ updateSelector() . = TRUE if("clearBay") //Delete all mobs and objs in the selected bay - if(alert(usr, "This will delete all objs and mobs in [bay]. Are you sure?", "Confirmation", "Delete that shit", "No") == "Delete that shit") + if(tgui_alert(usr, "This will delete all objs and mobs in [bay]. Are you sure?", "Confirmation", list("Delete that shit", "No")) == "Delete that shit") clearBay() refreshBay() . = TRUE diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 571adb406b..73902f18fb 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -356,7 +356,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if(alert_mob_dupe_login) spawn() - alert(mob, "You have logged in already with another key this round, please log out of this one NOW or risk being banned!") + tgui_alert(mob, "You have logged in already with another key this round, please log out of this one NOW or risk being banned!") connection_time = world.time connection_realtime = world.realtime diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index cb262e57f3..94220f6c23 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1622,7 +1622,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) ghost_orbit = new_orbit if("ghostaccs") - var/new_ghost_accs = alert("Do you want your ghost to show full accessories where possible, hide accessories but still use the directional sprites where possible, or also ignore the directions and stick to the default sprites?",,GHOST_ACCS_FULL_NAME, GHOST_ACCS_DIR_NAME, GHOST_ACCS_NONE_NAME) + var/new_ghost_accs = tgui_alert(user, "Do you want your ghost to show full accessories where possible, hide accessories but still use the directional sprites where possible, or also ignore the directions and stick to the default sprites?",,list(GHOST_ACCS_FULL_NAME, GHOST_ACCS_DIR_NAME, GHOST_ACCS_NONE_NAME)) switch(new_ghost_accs) if(GHOST_ACCS_FULL_NAME) ghost_accs = GHOST_ACCS_FULL @@ -1632,7 +1632,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) ghost_accs = GHOST_ACCS_NONE if("ghostothers") - var/new_ghost_others = alert("Do you want the ghosts of others to show up as their own setting, as their default sprites or always as the default white ghost?",,GHOST_OTHERS_THEIR_SETTING_NAME, GHOST_OTHERS_DEFAULT_SPRITE_NAME, GHOST_OTHERS_SIMPLE_NAME) + var/new_ghost_others = tgui_alert(user, "Do you want the ghosts of others to show up as their own setting, as their default sprites or always as the default white ghost?",,list(GHOST_OTHERS_THEIR_SETTING_NAME, GHOST_OTHERS_DEFAULT_SPRITE_NAME, GHOST_OTHERS_SIMPLE_NAME)) switch(new_ghost_others) if(GHOST_OTHERS_THEIR_SETTING_NAME) ghost_others = GHOST_OTHERS_THEIR_SETTING @@ -2718,7 +2718,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) save_preferences() if("keybindings_reset") - var/choice = tgalert(user, "Would you prefer 'hotkey' or 'classic' defaults?", "Setup keybindings", "Hotkey", "Classic", "Cancel") + var/choice = tgui_alert(user, "Would you prefer 'hotkey' or 'classic' defaults?", "Setup keybindings", list("Hotkey", "Classic", "Cancel")) if(choice == "Cancel") ShowChoices(user) return @@ -3199,7 +3199,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) /// Resets the client's keybindings. Asks them for which /datum/preferences/proc/force_reset_keybindings() - var/choice = tgalert(parent.mob, "Your basic keybindings need to be reset, emotes will remain as before. Would you prefer 'hotkey' or 'classic' mode?", "Reset keybindings", "Hotkey", "Classic") + var/choice = tgui_alert(parent.mob, "Your basic keybindings need to be reset, emotes will remain as before. Would you prefer 'hotkey' or 'classic' mode?", "Reset keybindings", list("Hotkey", "Classic")) hotkeys = (choice != "Classic") force_reset_keybindings_direct(hotkeys) diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index a019ade471..a43f781377 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -277,7 +277,7 @@ GLOBAL_LIST_INIT(ghost_forms, list("ghost","ghostking","ghostian2","skeleghost", "ghost_mellow","ghost_rainbow","ghost_camo","ghost_fire", "catghost")) /client/proc/pick_form() if(!is_content_unlocked()) - alert("This setting is for accounts with BYOND premium only.") + tgui_alert(src, "This setting is for accounts with BYOND premium only.") return var/new_form = input(src, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_forms if(new_form) @@ -291,7 +291,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS /client/proc/pick_ghost_orbit() if(!is_content_unlocked()) - alert("This setting is for accounts with BYOND premium only.") + tgui_alert(src, "This setting is for accounts with BYOND premium only.") return var/new_orbit = input(src, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_orbits if(new_orbit) @@ -302,7 +302,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS O.ghost_orbit = new_orbit /client/proc/pick_ghost_accs() - var/new_ghost_accs = alert("Do you want your ghost to show full accessories where possible, hide accessories but still use the directional sprites where possible, or also ignore the directions and stick to the default sprites?",,"full accessories", "only directional sprites", "default sprites") + var/new_ghost_accs = tgui_alert(src, "Do you want your ghost to show full accessories where possible, hide accessories but still use the directional sprites where possible, or also ignore the directions and stick to the default sprites?",,list("full accessories", "only directional sprites", "default sprites")) if(new_ghost_accs) switch(new_ghost_accs) if("full accessories") @@ -321,7 +321,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS set category = "Preferences" set desc = "Customize your ghastly appearance." if(is_content_unlocked()) - switch(alert("Which setting do you want to change?",,"Ghost Form","Ghost Orbit","Ghost Accessories")) + switch(tgui_alert(src, "Which setting do you want to change?",,list("Ghost Form","Ghost Orbit","Ghost Accessories"))) if("Ghost Form") pick_form() if("Ghost Orbit") @@ -335,7 +335,7 @@ GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS set name = "Ghosts of Others" set category = "Preferences" set desc = "Change display settings for the ghosts of other players." - var/new_ghost_others = alert("Do you want the ghosts of others to show up as their own setting, as their default sprites or always as the default white ghost?",,"Their Setting", "Default Sprites", "White Ghost") + var/new_ghost_others = tgui_alert(src, "Do you want the ghosts of others to show up as their own setting, as their default sprites or always as the default white ghost?",,list("Their Setting", "Default Sprites", "White Ghost")) if(new_ghost_others) switch(new_ghost_others) if("Their Setting") diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 07087e70a3..d70f0546c9 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -37,7 +37,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, "#002eb8") msg = emoji_parse(msg) if((msg[1] in list(".",";",":","#")) || findtext_char(msg, "say", 1, 5)) - if(alert("Your message \"[raw_msg]\" looks like it was meant for in game communication, say it in OOC?", "Meant for OOC?", "No", "Yes") != "Yes") + if(tgui_alert(src, "Your message \"[raw_msg]\" looks like it was meant for in game communication, say it in OOC?", "Meant for OOC?", list("No", "Yes")) != "Yes") return if(!holder) diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm index 453c22e7f2..fbfba04996 100644 --- a/code/modules/client/verbs/suicide.dm +++ b/code/modules/client/verbs/suicide.dm @@ -5,7 +5,7 @@ if(!canSuicide()) return var/oldkey = ckey - var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No") + var/confirm = tgui_alert(src, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No")) if(ckey != oldkey) return if(!canSuicide()) @@ -84,7 +84,7 @@ set hidden = 1 if(!canSuicide()) return - var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No") + var/confirm = tgui_alert(src, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No")) if(!canSuicide()) return if(confirm == "Yes") @@ -100,7 +100,7 @@ set hidden = 1 if(!canSuicide()) return - var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No") + var/confirm = tgui_alert(src, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No")) if(!canSuicide()) return if(confirm == "Yes") @@ -117,7 +117,7 @@ set hidden = 1 if(!canSuicide()) return - var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No") + var/confirm = tgui_alert(src, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No")) if(!canSuicide()) return if(confirm == "Yes") @@ -135,7 +135,7 @@ set hidden = 1 if(!canSuicide()) return - var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No") + var/confirm = tgui_alert(src, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No")) if(!canSuicide()) return if(confirm == "Yes") @@ -151,7 +151,7 @@ /mob/living/silicon/pai/verb/suicide() set hidden = 1 - var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No") + var/confirm = tgui_alert(src, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No")) if(confirm == "Yes") var/turf/T = get_turf(src.loc) T.visible_message("[src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"", null, \ @@ -167,7 +167,7 @@ set hidden = 1 if(!canSuicide()) return - var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No") + var/confirm = tgui_alert(src, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No")) if(!canSuicide()) return if(confirm == "Yes") @@ -186,7 +186,7 @@ set hidden = 1 if(!canSuicide()) return - var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No") + var/confirm = tgui_alert(src, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No")) if(!canSuicide()) return if(confirm == "Yes") diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index cd48a81350..60db121b72 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -986,7 +986,7 @@ to_chat(user, "You can't do that right now!") return TRUE - if(alert("Are you sure you want to recolor your armor stripes?", "Confirm Repaint", "Yes", "No") == "Yes") + if(tgui_alert(user, "Are you sure you want to recolor your armor stripes?", "Confirm Repaint", list("Yes", "No")) == "Yes") var/energy_color_input = input(usr,"","Choose Energy Color",energy_color) as color|null if(energy_color_input) energy_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1) diff --git a/code/modules/events/immovable_rod.dm b/code/modules/events/immovable_rod.dm index a9ee0f5412..0675ea39f4 100644 --- a/code/modules/events/immovable_rod.dm +++ b/code/modules/events/immovable_rod.dm @@ -19,7 +19,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 if(!check_rights(R_FUN)) return - var/aimed = alert("Aimed at current location?","Sniperod", "Yes", "No") + var/aimed = tgui_alert(usr, "Aimed at current location?","Sniperod", list("Yes", "No")) if(aimed == "Yes") special_target = get_turf(usr) diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm index d284146ea3..ac23e44b8d 100644 --- a/code/modules/events/pirates.dm +++ b/code/modules/events/pirates.dm @@ -158,7 +158,7 @@ /obj/machinery/shuttle_scrambler/interact(mob/user) if(!active) - if(alert(user, "Turning the scrambler on will make the shuttle trackable by GPS. Are you sure you want to do it?", "Scrambler", "Yes", "Cancel") == "Cancel") + if(tgui_alert(user, "Turning the scrambler on will make the shuttle trackable by GPS. Are you sure you want to do it?", "Scrambler", list("Yes", "Cancel")) == "Cancel") return if(active || !user.canUseTopic(src, BE_CLOSE)) return diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 6fcaa5e6b0..9f90a4e288 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -391,7 +391,7 @@ /datum/spacevine_controller/vv_do_topic(href_list) . = ..() if(href_list[VV_HK_SPACEVINE_PURGE]) - if(alert(usr, "Are you sure you want to delete this spacevine cluster?", "Delete Vines", "Yes", "No") == "Yes") + if(tgui_alert(usr, "Are you sure you want to delete this spacevine cluster?", "Delete Vines", list("Yes", "No")) == "Yes") DeleteVines() /datum/spacevine_controller/proc/DeleteVines() //this is kill diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 2857099d0f..1655f7769f 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -212,7 +212,7 @@ else visible_message("[user] disturbs the [name] to no effect!") else - var/option = alert(user, "What action do you wish to perform?","Apiary","Remove a Honey Frame","Remove the Queen Bee", "Cancel") + var/option = tgui_alert(user, "What action do you wish to perform?","Apiary",list("Remove a Honey Frame","Remove the Queen Bee", "Cancel")) if(!Adjacent(user)) return switch(option) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index fa7decc437..a3d069c175 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -684,7 +684,7 @@ if(!anchored) update_icon() return FALSE - var/warning = alert(user, "Are you sure you wish to empty the tray's nutrient beaker?","Empty Tray Nutrients?", "Yes", "No") + var/warning = tgui_alert(user, "Are you sure you wish to empty the tray's nutrient beaker?","Empty Tray Nutrients?", list("Yes", "No")) if(warning == "Yes" && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) reagents.clear_reagents() to_chat(user, "You empty [src]'s nutrient tank.") diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 1125d15bca..52dd6dac73 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -416,7 +416,7 @@ var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort") if(choice == "Confirm") if (!SSdbcore.Connect()) - alert("Connection to Archive has been severed. Aborting.") + tgui_alert(usr, "Connection to Archive has been severed. Aborting.") else var/msg = "[key_name(usr)] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs" var/datum/db_query/query_library_upload = SSdbcore.NewQuery({" @@ -425,15 +425,15 @@ "}, list("title" = scanner.cache.name, "author" = scanner.cache.author, "content" = scanner.cache.dat, "category" = upload_category, "ckey" = usr.ckey, "round_id" = GLOB.round_id)) if(!query_library_upload.Execute()) qdel(query_library_upload) - alert("Database error encountered uploading to Archive") + tgui_alert(usr, "Database error encountered uploading to Archive") return else log_game(msg) qdel(query_library_upload) - alert("Upload Complete. Uploaded title will be unavailable for printing for a short period") + tgui_alert(usr, "Upload Complete. Uploaded title will be unavailable for printing for a short period") if(href_list["newspost"]) if(!GLOB.news_network) - alert("No news network found on station. Aborting.") + tgui_alert(usr, "No news network found on station. Aborting.") var/channelexists = 0 for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == "Nanotrasen Book Club") @@ -442,7 +442,7 @@ if(!channelexists) GLOB.news_network.CreateFeedChannel("Nanotrasen Book Club", "Library", null) GLOB.news_network.SubmitArticle(scanner.cache.dat, "[scanner.cache.name]", "Nanotrasen Book Club", null) - alert("Upload complete. Your uploaded title is now available on station newscasters.") + tgui_alert(usr, "Upload complete. Your uploaded title is now available on station newscasters.") if(href_list["orderbyid"]) if(printer_cooldown > world.time) say("Printer unavailable. Please allow a short time before attempting to print.") @@ -455,7 +455,7 @@ if(href_list["targetid"]) var/id = href_list["targetid"] if (!SSdbcore.Connect()) - alert("Connection to Archive has been severed. Aborting.") + tgui_alert(usr, "Connection to Archive has been severed. Aborting.") if(printer_cooldown > world.time) say("Printer unavailable. Please allow a short time before attempting to print.") else diff --git a/code/modules/library/soapstone.dm b/code/modules/library/soapstone.dm index fd268a7774..86da58339e 100644 --- a/code/modules/library/soapstone.dm +++ b/code/modules/library/soapstone.dm @@ -265,7 +265,7 @@ if("delete") if(!is_admin) return - var/confirm = alert(user, "Confirm deletion of engraved message?", "Confirm Deletion", "Yes", "No") + var/confirm = tgui_alert(user, "Confirm deletion of engraved message?", "Confirm Deletion", list("Yes", "No")) if(confirm == "Yes") persists = FALSE qdel(src) diff --git a/code/modules/mob/dead/dead.dm b/code/modules/mob/dead/dead.dm index 5647bc2305..da205a1dfb 100644 --- a/code/modules/mob/dead/dead.dm +++ b/code/modules/mob/dead/dead.dm @@ -86,7 +86,7 @@ INITIALIZE_IMMEDIATE(/mob/dead) var/addr = csa[pick] - if(alert(src, "Jump to server [pick] ([addr])?", "Server Hop", "Yes", "No") != "Yes") + if(tgui_alert(src, "Jump to server [pick] ([addr])?", "Server Hop", list("Yes", "No")) != "Yes") return var/client/C = client diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index f7f3450f6e..042bc69997 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -448,7 +448,7 @@ var/mintime = max(CONFIG_GET(number/respawn_delay), (SSticker.round_start_time + (CONFIG_GET(number/respawn_minimum_delay_roundstart) * 600)) - world.time, 0) - var/this_is_like_playing_right = alert(src,"Are you sure you wish to observe? You will not be able to respawn for [round(mintime / 600, 0.1)] minutes!!","Player Setup","Yes","No") + var/this_is_like_playing_right = tgui_alert(src, "Are you sure you wish to observe? You will not be able to respawn for [round(mintime / 600, 0.1)] minutes!!","Player Setup",list("Yes","No")) if(QDELETED(src) || !src.client || this_is_like_playing_right != "Yes") ready = PLAYER_NOT_READY @@ -530,11 +530,11 @@ /mob/dead/new_player/proc/AttemptLateSpawn(rank) var/error = IsJobUnavailable(rank) if(error != JOB_AVAILABLE) - alert(src, get_job_unavailable_error_message(error, rank)) + tgui_alert(src, get_job_unavailable_error_message(error, rank)) return FALSE if(SSticker.late_join_disabled) - alert(src, "An administrator has disabled late join spawning.") + tgui_alert(src, "An administrator has disabled late join spawning.") return FALSE if(!respawn_latejoin_check(notify = TRUE)) @@ -544,7 +544,7 @@ if(SSshuttle.arrivals) close_spawn_windows() //In case we get held up if(SSshuttle.arrivals.damaged && CONFIG_GET(flag/arrivals_shuttle_require_safe_latejoin)) - src << alert("The arrivals shuttle is currently malfunctioning! You cannot join.") + tgui_alert(src, "The arrivals shuttle is currently malfunctioning! You cannot join.") return FALSE if(CONFIG_GET(flag/arrivals_shuttle_require_undocked)) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 1aa2863eda..c66e45c3b4 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -336,7 +336,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(stat == DEAD || sig_flags & COMPONENT_FREE_GHOSTING) ghostize(1) else - var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst alive you won't be able to re-enter this round [penalty ? "or play ghost roles [penalty == CANT_REENTER_ROUND ? "until the round is over" : "for the next [DisplayTimeText(penalty)]"]" : ""]! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?","Ghost","Stay in body") + var/response = tgui_alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst alive you won't be able to re-enter this round [penalty ? "or play ghost roles [penalty == CANT_REENTER_ROUND ? "until the round is over" : "for the next [DisplayTimeText(penalty)]"]" : ""]! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?",list("Ghost","Stay in body")) if(response != "Ghost") return //didn't want to ghost after-all if(istype(loc, /obj/machinery/cryopod)) @@ -372,7 +372,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(sig_flags & COMPONENT_FREE_GHOSTING) ghostize(1) else - var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst alive you won't be able to re-enter this round [penalty ? "or play ghost roles [penalty == CANT_REENTER_ROUND ? "until the round is over" : "for the next [DisplayTimeText(penalty)]"]" : ""]! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?","Ghost","Stay in body") + var/response = tgui_alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost whilst alive you won't be able to re-enter this round [penalty ? "or play ghost roles [penalty == CANT_REENTER_ROUND ? "until the round is over" : "for the next [DisplayTimeText(penalty)]"]" : ""]! You can't change your mind so choose wisely!!)","Are you sure you want to ghost?",list("Ghost","Stay in body")) if(response != "Ghost") return ghostize(0, penalize = TRUE) @@ -431,7 +431,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(usr, "You're already stuck out of your body!") return FALSE - var/response = alert(src, "Are you sure you want to prevent (almost) all means of resuscitation? This cannot be undone. THIS WILL ALSO STOP YOU FROM RESPAWNING!!!","Are you sure you want to stay dead and never respawn?","Yes","No") + var/response = tgui_alert(src, "Are you sure you want to prevent (almost) all means of resuscitation? This cannot be undone. THIS WILL ALSO STOP YOU FROM RESPAWNING!!!","Are you sure you want to stay dead and never respawn?",list("Yes","No")) if(response != "Yes") return @@ -707,7 +707,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return 0 if(can_reenter_corpse && mind && mind.current) - if(alert(src, "Your soul is still tied to your former life as [mind.current.name], if you go forward there is no going back to that life. Are you sure you wish to continue?", "Move On", "Yes", "No") == "No") + if(tgui_alert(src, "Your soul is still tied to your former life as [mind.current.name], if you go forward there is no going back to that life. Are you sure you wish to continue?", "Move On", list("Yes", "No")) == "No") return 0 if(target.key) to_chat(src, "Someone has taken this body while you were choosing!") diff --git a/code/modules/mob/dead/observer/respawn.dm b/code/modules/mob/dead/observer/respawn.dm index 94ebf42a2a..3b559c1a9c 100644 --- a/code/modules/mob/dead/observer/respawn.dm +++ b/code/modules/mob/dead/observer/respawn.dm @@ -29,7 +29,7 @@ var/mob/M = player.mob if(istype(M, /mob/dead/observer)) var/mob/dead/observer/O = M - var/confirm = alert(src, "Send [O]([ckey]) back to the lobby without respawn restrictions?", "Send to Lobby", "Yes", "No") + var/confirm = tgui_alert(src, "Send [O]([ckey]) back to the lobby without respawn restrictions?", "Send to Lobby", list("Yes", "No")) if(confirm != "Yes") return message_admins("[key_name_admin(src)] gave [key_name_admin(O)] a full respawn and sent them back to the lobby.") @@ -39,7 +39,7 @@ O.client.prefs.dnr_triggered = FALSE else if(istype(M, /mob/dead/new_player)) var/mob/dead/new_player/NP = M - var/confirm = alert(src, "Remove [NP]'s respawn restrictions?", "Remove Restrictions", "Yes", "No") + var/confirm = tgui_alert(src, "Remove [NP]'s respawn restrictions?", "Remove Restrictions", list("Yes", "No")) if(confirm != "Yes") return message_admins("[key_name_admin(src)] removed [ckey]'s respawn restrictions.") @@ -165,7 +165,7 @@ /** * Actual proc that removes us and puts us back on lobby - * + * * Returns the new mob. */ /mob/dead/observer/proc/transfer_to_lobby() diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 28d311b034..8f335be1e5 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -61,7 +61,7 @@ Doesn't work on other aliens/AI.*/ /obj/effect/proc_holder/alien/proc/check_vent_block(mob/living/user) var/obj/machinery/atmospherics/components/unary/atmos_thing = locate() in user.loc if(atmos_thing) - var/rusure = alert(user, "Laying eggs and shaping resin here would block access to [atmos_thing]. Do you want to continue?", "Blocking Atmospheric Component", "Yes", "No") + var/rusure = tgui_alert(user, "Laying eggs and shaping resin here would block access to [atmos_thing]. Do you want to continue?", "Blocking Atmospheric Component", list("Yes", "No")) if(rusure != "Yes") return FALSE return TRUE diff --git a/code/modules/mob/living/carbon/alien/larva/powers.dm b/code/modules/mob/living/carbon/alien/larva/powers.dm index 7204759db5..cb26d7b51f 100644 --- a/code/modules/mob/living/carbon/alien/larva/powers.dm +++ b/code/modules/mob/living/carbon/alien/larva/powers.dm @@ -42,7 +42,7 @@ to_chat(L, "Hunters are the most agile caste, tasked with hunting for hosts. They are faster than a human and can even pounce, but are not much tougher than a drone.") to_chat(L, "Sentinels are tasked with protecting the hive. With their ranged spit, invisibility, and high health, they make formidable guardians and acceptable secondhand hunters.") to_chat(L, "Drones are the weakest and slowest of the castes, but can grow into a praetorian and then queen if no queen exists, and are vital to maintaining a hive with their resin secretion abilities.") - var/alien_caste = alert(L, "Please choose which alien caste you shall belong to.",,"Hunter","Sentinel","Drone") + var/alien_caste = tgui_alert(L, "Please choose which alien caste you shall belong to.",,list("Hunter","Sentinel","Drone")) if(user.incapacitated()) //something happened to us while we were choosing. return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f6ef8e8177..550a128a31 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1078,7 +1078,7 @@ if(href_list[VV_HK_MAKE_AI]) if(!check_rights(R_SPAWN)) return - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + if(tgui_alert(usr, "Confirm mob type change?",,list("Transform","Cancel")) != "Transform") return usr.client.holder.Topic("vv_override", list("makeai"=href_list[VV_HK_TARGET])) if(href_list[VV_HK_MODIFY_ORGANS]) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5edc52376e..bd4664ae54 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -452,7 +452,7 @@ return if(href_list["add_crime"]) - switch(alert("What crime would you like to add?","Security HUD","Minor Crime","Major Crime","Cancel")) + switch(tgui_alert(usr, "What crime would you like to add?","Security HUD",list("Minor Crime","Major Crime","Cancel"))) if("Minor Crime") if(R) var/t1 = stripped_input("Please input minor crime names:", "Security HUD", "", null) @@ -892,25 +892,25 @@ if(href_list[VV_HK_MAKE_MONKEY]) if(!check_rights(R_SPAWN)) return - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + if(tgui_alert(usr, "Confirm mob type change?",,list("Transform","Cancel")) != "Transform") return usr.client.holder.Topic("vv_override", list("monkeyone"=href_list[VV_HK_TARGET])) if(href_list[VV_HK_MAKE_CYBORG]) if(!check_rights(R_SPAWN)) return - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + if(tgui_alert(usr, "Confirm mob type change?",,list("Transform","Cancel")) != "Transform") return usr.client.holder.Topic("vv_override", list("makerobot"=href_list[VV_HK_TARGET])) if(href_list[VV_HK_MAKE_ALIEN]) if(!check_rights(R_SPAWN)) return - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + if(tgui_alert(usr, "Confirm mob type change?",,list("Transform","Cancel")) != "Transform") return usr.client.holder.Topic("vv_override", list("makealien"=href_list[VV_HK_TARGET])) if(href_list[VV_HK_MAKE_SLIME]) if(!check_rights(R_SPAWN)) return - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") + if(tgui_alert(usr, "Confirm mob type change?",,list("Transform","Cancel")) != "Transform") return usr.client.holder.Topic("vv_override", list("makeslime"=href_list[VV_HK_TARGET])) if(href_list[VV_HK_SET_SPECIES]) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 5603801dce..12b1d82dfe 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -489,7 +489,7 @@ to_chat(src, "You are already sleeping.") return else - if(alert(src, "You sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes") + if(tgui_alert(src, "You sure you want to sleep for a while?", "Sleep", list("Yes", "No")) == "Yes") SetSleeping(400) //Short nap /mob/proc/get_contents() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index b2b1d2fb5f..2019458ebc 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -632,7 +632,7 @@ if(incapacitated()) return var/input - switch(alert("Would you like to select a hologram based on a crew member, an animal, or switch to a unique avatar?",,"Crew Member","Unique","Animal")) + switch(tgui_alert(src, "Would you like to select a hologram based on a crew member, an animal, or switch to a unique avatar?",,list("Crew Member","Unique","Animal"))) if("Crew Member") var/list/personnel_list = list() @@ -646,7 +646,7 @@ qdel(holo_icon)//Clear old icon so we're not storing it in memory. holo_icon = getHologramIcon(icon(character_icon)) else - alert("No suitable records found. Aborting.") + tgui_alert(src, "No suitable records found. Aborting.") if("Animal") var/list/icon_list = list( @@ -1018,7 +1018,7 @@ if(incapacitated()) return - switch(alert("Would you like to enter cryo? This will ghost you. Remember to AHELP before cryoing out of important roles, even with no admins online.",,"Yes.","No.")) + switch(tgui_alert(src, "Would you like to enter cryo? This will ghost you. Remember to AHELP before cryoing out of important roles, even with no admins online.",,list("Yes.","No."))) if("Yes.") src.ghostize(FALSE, penalize = TRUE) var/announce_rank = "Artificial Intelligence," diff --git a/code/modules/mob/living/silicon/pai/personality.dm b/code/modules/mob/living/silicon/pai/personality.dm index 62f2ed7047..41be56268d 100644 --- a/code/modules/mob/living/silicon/pai/personality.dm +++ b/code/modules/mob/living/silicon/pai/personality.dm @@ -51,7 +51,7 @@ if (isnull(version) || version != 1) fdel(path) if (!silent) - alert(user, "Your savefile was incompatible with this version and was deleted.") + tgui_alert(user, "Your savefile was incompatible with this version and was deleted.") return 0 F["name"] >> src.name diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 04665401c5..f15b6e1d5c 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -222,7 +222,7 @@ pda.silent = !pda.silent else if(href_list["target"]) if(silent) - return alert("Communications circuits remain uninitialized.") + return tgui_alert(src, "Communications circuits remain uninitialized.") var/target = locate(href_list["target"]) pda.create_message(src, target) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 7ab826cae3..2c7e963e73 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -516,7 +516,7 @@ if(stat == DEAD) return //won't work if dead if(locked) - switch(alert("You cannot lock your cover again, are you sure?\n (You can still ask for a human to lock it)", "Unlock Own Cover", "Yes", "No")) + switch(tgui_alert(src, "You cannot lock your cover again, are you sure?\n (You can still ask for a human to lock it)", "Unlock Own Cover", list("Yes", "No"))) if("Yes") locked = FALSE update_icons() @@ -1298,7 +1298,7 @@ set desc = "Select your resting pose." sitting = 0 bellyup = 0 - var/choice = alert(src, "Select resting pose", "", "Resting", "Sitting", "Belly up") + var/choice = tgui_alert(src, "Select resting pose", "", list("Resting", "Sitting", "Belly up")) switch(choice) if("Resting") update_icons() diff --git a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm index 948be53abc..921c600f5a 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm @@ -54,7 +54,7 @@ if(!SSticker.mode) to_chat(user, "Can't become a drone before the game has started.") return - var/be_drone = alert("Become a drone? (Warning, You can no longer be cloned!)",,"Yes","No") + var/be_drone = tgui_alert(user, "Become a drone? (Warning, You can no longer be cloned!)",,list("Yes","No")) if(be_drone == "No" || QDELETED(src) || !isobserver(user)) return var/mob/living/simple_animal/drone/D = new drone_type(get_turf(loc)) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm index d9ea6f4a8a..6ab2eb5e3e 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm @@ -8,7 +8,7 @@ /mob/living/simple_animal/drone/attack_drone(mob/living/simple_animal/drone/D) if(D != src && stat == DEAD) - var/d_input = alert(D,"Perform which action?","Drone Interaction","Reactivate","Cannibalize","Nothing") + var/d_input = tgui_alert(D, "Perform which action?","Drone Interaction",list("Reactivate","Cannibalize","Nothing")) if(d_input) switch(d_input) if("Reactivate") diff --git a/code/modules/mob/living/simple_animal/friendly/plushie.dm b/code/modules/mob/living/simple_animal/friendly/plushie.dm index ff95e8fe86..5c4b8d40f1 100644 --- a/code/modules/mob/living/simple_animal/friendly/plushie.dm +++ b/code/modules/mob/living/simple_animal/friendly/plushie.dm @@ -45,7 +45,7 @@ //attacking yourself transfers your mind into the plush! /obj/item/toy/plushie_shell/attack_self(mob/user) if(user.mind) - var/safety = alert(user, "The plushie is staring back at you intensely, it seems cursed! (Permanently become a plushie)", "Hugging this is a bad idea.", "Hug it!", "Cancel") + var/safety = tgui_alert(user, "The plushie is staring back at you intensely, it seems cursed! (Permanently become a plushie)", "Hugging this is a bad idea.", list("Hug it!", "Cancel")) if(safety == "Cancel" || !in_range(src, user)) return to_chat(user, "You hug the strange plushie. You fool.") diff --git a/code/modules/mob/living/simple_animal/hostile/banana_spider.dm b/code/modules/mob/living/simple_animal/hostile/banana_spider.dm index a88593ed74..9c1c0dae89 100644 --- a/code/modules/mob/living/simple_animal/hostile/banana_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/banana_spider.dm @@ -51,7 +51,7 @@ if(!SSticker.mode) to_chat(user, "Can't become a banana spider before the game has started.") return - var/be_spider = alert("Become a banana spider? (Warning, You can no longer be cloned!)",,"Yes","No") + var/be_spider = tgui_alert(user, "Become a banana spider? (Warning, You can no longer be cloned!)",,list("Yes","No")) if(be_spider == "No" || QDELETED(src) || !isobserver(user)) return if(key) diff --git a/code/modules/mob/living/simple_animal/hostile/bread.dm b/code/modules/mob/living/simple_animal/hostile/bread.dm index 70c8b0c540..3eadc7104c 100644 --- a/code/modules/mob/living/simple_animal/hostile/bread.dm +++ b/code/modules/mob/living/simple_animal/hostile/bread.dm @@ -52,7 +52,7 @@ if(!SSticker.mode) to_chat(user, "Can't become a tumor bread before the game has started.") return - var/be_bread = alert("Become a tumor bread? (Warning, You can no longer be cloned!)",,"Yes","No") + var/be_bread = tgui_alert(user, "Become a tumor bread? (Warning, You can no longer be cloned!)",,list("Yes","No")) if(be_bread == "No" || QDELETED(src) || !isobserver(user)) return if(key) diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 2349685a4e..9c165f3ef4 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -93,7 +93,7 @@ var/mob/dead/observer/O = user if(!O.can_reenter_round()) return FALSE - var/spider_ask = alert("Become a spider?", "Are you australian?", "Yes", "No") + var/spider_ask = tgui_alert(user, "Become a spider?", "Are you australian?", list("Yes", "No")) if(spider_ask == "No" || !src || QDELETED(src)) return TRUE if(key) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 7ca2f6c561..46d3463684 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -426,7 +426,7 @@ Difficulty: Very Hard /obj/machinery/anomalous_crystal/honk //Strips and equips you as a clown. I apologize for nothing observer_desc = "This crystal strips and equips its targets as clowns." - possible_methods = list(ACTIVATE_TOUCH) //Because We love AOE transformations! + possible_methods = list(ACTIVATE_TOUCH) //Because We love AOE transformations! activation_sound = 'sound/items/bikehorn.ogg' /obj/machinery/anomalous_crystal/honk/ActivationReaction(mob/user) @@ -574,7 +574,7 @@ Difficulty: Very Hard if(ready_to_deploy) if(!user.can_reenter_round()) return FALSE - var/be_helper = alert("Become a Lightgeist? (Warning, You can no longer be cloned!)",,"Yes","No") + var/be_helper = tgui_alert(user, "Become a Lightgeist? (Warning, You can no longer be cloned!)",,list("Yes","No")) if(be_helper == "Yes" && !QDELETED(src) && isobserver(user)) var/mob/living/simple_animal/hostile/lightgeist/W = new /mob/living/simple_animal/hostile/lightgeist(get_turf(loc)) user.transfer_ckey(W, FALSE) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm index de6b858f79..82df5af169 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm @@ -44,7 +44,7 @@ if(istype(target, /obj/structure/elite_tumor)) var/obj/structure/elite_tumor/T = target if(T.mychild == src && T.activity == TUMOR_PASSIVE) - var/elite_remove = alert("Re-enter the tumor?", "Despawn yourself?", "Yes", "No") + var/elite_remove = tgui_alert(usr, "Re-enter the tumor?", "Despawn yourself?", list("Yes", "No")) if(elite_remove == "No" || !src || QDELETED(src)) return T.mychild = null diff --git a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm index 39e9e84ed2..e49286afef 100644 --- a/code/modules/mob/living/simple_animal/hostile/space_dragon.dm +++ b/code/modules/mob/living/simple_animal/hostile/space_dragon.dm @@ -99,7 +99,7 @@ if(!chosen_color) dragon_name() color_selection() - + /mob/living/simple_animal/hostile/space_dragon/Life() . = ..() @@ -666,7 +666,7 @@ /obj/structure/carp_rift/proc/summon_carp(mob/user) if(carp_stored <= 0)//Not enough carp points return FALSE - var/carp_ask = alert("Become a carp?", "Help bring forth the horde?", "Yes", "No") + var/carp_ask = tgui_alert(user, "Become a carp?", "Help bring forth the horde?", list("Yes", "No")) if(carp_ask == "No" || !src || QDELETED(src) || QDELETED(user)) return FALSE if(carp_stored <= 0) diff --git a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm index cc5b0b8a75..cf86fcfe7a 100644 --- a/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm +++ b/code/modules/mob/living/simple_animal/hostile/venus_human_trap.dm @@ -157,7 +157,7 @@ /mob/living/simple_animal/hostile/venus_human_trap/proc/humanize_plant(mob/user) if(key || !playable_plant || stat) return - var/plant_ask = alert("Become a venus human trap?", "Are you reverse vegan?", "Yes", "No") + var/plant_ask = tgui_alert(user, "Become a venus human trap?", "Are you reverse vegan?", list("Yes", "No")) if(plant_ask == "No" || QDELETED(src)) return if(key) diff --git a/code/modules/mob/living/simple_animal/simple_animal_vr.dm b/code/modules/mob/living/simple_animal/simple_animal_vr.dm index de5bb578b8..355c940d76 100644 --- a/code/modules/mob/living/simple_animal/simple_animal_vr.dm +++ b/code/modules/mob/living/simple_animal/simple_animal_vr.dm @@ -113,13 +113,13 @@ return if(vore_selected.digest_mode == DM_HOLD) - var/confirm = alert(usr, "Enabling digestion on [name] will cause it to digest all stomach contents. Using this to break OOC prefs is against the rules. Digestion will disable itself after 20 minutes.", "Enabling [name]'s Digestion", "Enable", "Cancel") + var/confirm = tgui_alert(usr, "Enabling digestion on [name] will cause it to digest all stomach contents. Using this to break OOC prefs is against the rules. Digestion will disable itself after 20 minutes.", "Enabling [name]'s Digestion", list("Enable", "Cancel")) if(confirm == "Enable") vore_selected.digest_mode = DM_DIGEST sleep(20 MINUTES) vore_selected.digest_mode = vore_default_mode else - var/confirm = alert(usr, "This mob is currently set to digest all stomach contents. Do you want to disable this?", "Disabling [name]'s Digestion", "Disable", "Cancel") + var/confirm = tgui_alert(usr, "This mob is currently set to digest all stomach contents. Do you want to disable this?", "Disabling [name]'s Digestion", list("Disable", "Cancel")) if(confirm == "Disable") vore_selected.digest_mode = DM_HOLD diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 3b6f37184a..4198b6d757 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -5,7 +5,7 @@ set hidden = TRUE set category = "IC" display_typing_indicator() - var/message = input(usr, "", "say") as text|null + var/message = tgui_input_text(usr, null, "say") // If they don't type anything just drop the message. clear_typing_indicator() // clear it immediately! if(!length(message)) @@ -28,7 +28,7 @@ set hidden = TRUE set category = "IC" display_typing_indicator() - var/message = input(usr, "", "me") as message|null + var/message = tgui_input_message(usr, null, "me") // If they don't type anything just drop the message. clear_typing_indicator() // clear it immediately! if(!length(message)) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index fcaa77cac4..44822e8771 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -542,7 +542,7 @@ if(!mobpath) return if(mind) - mind_transfer = alert("Want to transfer their mind into the new mob", "Mind Transfer", "Yes", "No") == "Yes" ? TRUE : FALSE + mind_transfer = tgui_alert(usr, "Want to transfer their mind into the new mob", "Mind Transfer", list("Yes", "No")) == "Yes" ? TRUE : FALSE if(mob_transforming) return @@ -577,7 +577,7 @@ if(!mobpath) return if(mind) - mind_transfer = alert("Want to transfer their mind into the new mob", "Mind Transfer", "Yes", "No") == "Yes" ? TRUE : FALSE + mind_transfer = tgui_alert(usr, "Want to transfer their mind into the new mob", "Mind Transfer", list("Yes", "No")) == "Yes" ? TRUE : FALSE var/mob/new_mob = new mobpath(src.loc) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 635ec2e54c..4a7d57eeba 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -137,7 +137,7 @@ if(enabled) ui_interact(user) else if(IsAdminGhost(user)) - var/response = alert(user, "This computer is turned off. Would you like to turn it on?", "Admin Override", "Yes", "No") + var/response = tgui_alert(user, "This computer is turned off. Would you like to turn it on?", "Admin Override", list("Yes", "No")) if(response == "Yes") turn_on(user) diff --git a/code/modules/newscaster/newscaster_machine.dm b/code/modules/newscaster/newscaster_machine.dm index c81a8f5d1a..151ebd49d9 100644 --- a/code/modules/newscaster/newscaster_machine.dm +++ b/code/modules/newscaster/newscaster_machine.dm @@ -369,7 +369,7 @@ GLOBAL_LIST_EMPTY(allCasters) if(channel_name == "" || channel_name == "\[REDACTED\]" || scanned_user == "Unknown" || check || (scanned_user in existing_authors) ) screen=7 else - var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel") + var/choice = tgui_alert(usr, "Please confirm Feed channel creation","Network Channel Handler",list("Confirm","Cancel")) if(choice=="Confirm") scan_user(usr) GLOB.news_network.CreateFeedChannel(channel_name, scanned_user, c_locked) @@ -442,7 +442,7 @@ GLOBAL_LIST_EMPTY(allCasters) if(msg == "" || channel_name == "" || scanned_user == "Unknown") screen = 16 else - var/choice = alert("Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler","Confirm","Cancel") + var/choice = tgui_alert(usr, "Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler",list("Confirm","Cancel")) if(choice=="Confirm") scan_user(usr) if(input_param==1) //If input_param == 1 we're submitting a new wanted issue. At 2 we're just editing an existing one. @@ -450,16 +450,16 @@ GLOBAL_LIST_EMPTY(allCasters) screen = 15 else if(GLOB.news_network.wanted_issue.isAdminMsg) - alert("The wanted issue has been distributed by a Nanotrasen higherup. You cannot edit it.","Ok") + tgui_alert(usr, "The wanted issue has been distributed by a Nanotrasen higherup. You cannot edit it.",list("Ok")) return GLOB.news_network.submitWanted(channel_name, msg, scanned_user, picture) screen = 19 updateUsrDialog() else if(href_list["cancel_wanted"]) if(GLOB.news_network.wanted_issue.isAdminMsg) - alert("The wanted issue has been distributed by a Nanotrasen higherup. You cannot take it down.","Ok") + tgui_alert(usr, "The wanted issue has been distributed by a Nanotrasen higherup. You cannot take it down.",list("Ok")) return - var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel") + var/choice = tgui_alert(usr, "Please confirm Wanted Issue removal","Network Security Handler",list("Confirm","Cancel")) if(choice=="Confirm") GLOB.news_network.deleteWanted() screen=17 @@ -470,21 +470,21 @@ GLOBAL_LIST_EMPTY(allCasters) else if(href_list["censor_channel_author"]) var/datum/news/feed_channel/FC = locate(href_list["censor_channel_author"]) if(FC.is_admin_channel) - alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok") + tgui_alert(usr, "This channel was created by a Nanotrasen Officer. You cannot censor it.",list("Ok")) return FC.toggleCensorAuthor() updateUsrDialog() else if(href_list["censor_channel_story_author"]) var/datum/news/feed_message/MSG = locate(href_list["censor_channel_story_author"]) if(MSG.is_admin_message) - alert("This message was created by a Nanotrasen Officer. You cannot censor its author.","Ok") + tgui_alert(usr, "This message was created by a Nanotrasen Officer. You cannot censor its author.",list("Ok")) return MSG.toggleCensorAuthor() updateUsrDialog() else if(href_list["censor_channel_story_body"]) var/datum/news/feed_message/MSG = locate(href_list["censor_channel_story_body"]) if(MSG.is_admin_message) - alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok") + tgui_alert(usr, "This channel was created by a Nanotrasen Officer. You cannot censor it.",list("Ok")) return MSG.toggleCensorBody() updateUsrDialog() @@ -496,7 +496,7 @@ GLOBAL_LIST_EMPTY(allCasters) else if(href_list["toggle_d_notice"]) var/datum/news/feed_channel/FC = locate(href_list["toggle_d_notice"]) if(FC.is_admin_channel) - alert("This channel was created by a Nanotrasen Officer. You cannot place a D-Notice upon it.","Ok") + tgui_alert(usr, "This channel was created by a Nanotrasen Officer. You cannot place a D-Notice upon it.",list("Ok")) return FC.toggleCensorDclass() updateUsrDialog() diff --git a/code/modules/ninja/suit/ninja_equipment_actions/ninja_suit_initialisation.dm b/code/modules/ninja/suit/ninja_equipment_actions/ninja_suit_initialisation.dm index c1a3c77814..9c041977de 100644 --- a/code/modules/ninja/suit/ninja_equipment_actions/ninja_suit_initialisation.dm +++ b/code/modules/ninja/suit/ninja_equipment_actions/ninja_suit_initialisation.dm @@ -95,7 +95,7 @@ GLOBAL_LIST_INIT(ninja_deinitialize_messages, list( if (!ninja || !ninja.mind) s_busy = FALSE return - if (phase == 0 && alert("Are you certain you wish to remove the suit? This will take time and remove all abilities.",,"Yes","No") == "No") + if (phase == 0 && tgui_alert(ninja, "Are you certain you wish to remove the suit? This will take time and remove all abilities.",,list("Yes","No")) == "No") s_busy = FALSE return diff --git a/code/modules/paperwork/contract.dm b/code/modules/paperwork/contract.dm index f46d4bf029..ea2bcad3aa 100644 --- a/code/modules/paperwork/contract.dm +++ b/code/modules/paperwork/contract.dm @@ -228,11 +228,11 @@ var/response = "No" if(ghost) ghost.notify_cloning("A devil has offered you revival, at the cost of your soul.",'sound/effects/genetics.ogg', H) - response = tgalert(ghost, "A devil is offering you another chance at life, at the price of your soul, do you accept?", "Infernal Resurrection", "Yes", "No", "Never for this round", 0, 200) + response = tgui_alert(ghost, "A devil is offering you another chance at life, at the price of your soul, do you accept?", "Infernal Resurrection", list("Yes", "No", "Never for this round"), 200, 0) if(!ghost) return //handle logouts that happen whilst the alert is waiting for a response. else - response = tgalert(target.current, "A devil is offering you another chance at life, at the price of your soul, do you accept?", "Infernal Resurrection", "Yes", "No", "Never for this round", 0, 200) + response = tgui_alert(target.current, "A devil is offering you another chance at life, at the price of your soul, do you accept?", "Infernal Resurrection", list("Yes", "No", "Never for this round"), 200, 0) if(response == "Yes") H.revive(1,0) log_combat(user, H, "infernally revived via contract") diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm index 49821e55e0..2ee284431a 100644 --- a/code/modules/photography/camera/camera.dm +++ b/code/modules/photography/camera/camera.dm @@ -204,7 +204,7 @@ to_chat(user, "[pictures_left] photos left.") var/customise = "No" if(can_customise) - customise = alert(user, "Do you want to customize the photo?", "Customization", "Yes", "No") + customise = tgui_alert(user, "Do you want to customize the photo?", "Customization", list("Yes", "No")) if(customise == "Yes") var/name1 = stripped_input(user, "Set a name for this photo, or leave blank. 32 characters max.", "Name", max_length = 32) var/desc1 = stripped_input(user, "Set a description to add to photo, or leave blank. 128 characters max.", "Caption", max_length = 128) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 515349d666..51388a236b 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1303,7 +1303,7 @@ user.visible_message("[user] slots [card] into [src]...", "Transfer process initiated. Sending request for AI approval...") playsound(src, 'sound/machines/click.ogg', 50, TRUE) SEND_SOUND(occupier, sound('sound/misc/notice2.ogg')) //To alert the AI that someone's trying to card them if they're tabbed out - if(alert(occupier, "[user] is attempting to transfer you to \a [card.name]. Do you consent to this?", "APC Transfer", "Yes - Transfer Me", "No - Keep Me Here") == "No - Keep Me Here") + if(tgui_alert(occupier, "[user] is attempting to transfer you to \a [card.name]. Do you consent to this?", "APC Transfer", list("Yes - Transfer Me", "No - Keep Me Here")) == "No - Keep Me Here") to_chat(user, "AI denied transfer request. Process terminated.") playsound(src, 'sound/machines/buzz-sigh.ogg', 50, TRUE) transfer_in_progress = FALSE diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index cef730366e..16356fa2d0 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -259,7 +259,7 @@ . = TRUE if(!can_toggle || !user.canUseTopic(src, BE_CLOSE)) return - var/selection = alert(user, "Which setting would you want to modify?", "Firing Pin Settings", "Minimum Level Setting", "Maximum Level Setting", "Lethals Only Toggle") + var/selection = tgui_alert(user, "Which setting would you want to modify?", "Firing Pin Settings", list("Minimum Level Setting", "Maximum Level Setting", "Lethals Only Toggle")) if(QDELETED(src) || QDELETED(user) || !user.canUseTopic(src, BE_CLOSE)) return var/static/list/till_designs_pr_isnt_merged = list("green", "blue", "amber", "red", "delta") diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 22aadc06f4..e9ae0ac1cb 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -322,7 +322,7 @@ if("clear_recipes") if(!is_operational()) return - var/yesno = alert("Clear all recipes?",, "Yes","No") + var/yesno = tgui_alert(usr, "Clear all recipes?",, list("Yes","No")) if(yesno == "Yes") saved_recipes = list() . = TRUE @@ -337,7 +337,7 @@ var/name = stripped_input(usr,"Name","What do you want to name this recipe?", "Recipe", MAX_NAME_LEN) if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr))) return - if(saved_recipes[name] && alert("\"[name]\" already exists, do you want to overwrite it?",, "Yes", "No") == "No") + if(saved_recipes[name] && tgui_alert(usr, "\"[name]\" already exists, do you want to overwrite it?",, list("Yes", "No")) == "No") return if(name && recording_recipe) var/list/logstring = list() diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index f59e45ff01..17366e31d4 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -111,7 +111,7 @@ set src in usr if(usr.incapacitated()) return - if (alert(usr, "Are you sure you want to empty that?", "Empty Bottle:", "Yes", "No") != "Yes") + if (tgui_alert(usr, "Are you sure you want to empty that?", "Empty Bottle:", list("Yes", "No")) != "Yes") return if(isturf(usr.loc) && src.loc == usr) to_chat(usr, "You empty \the [src] onto the floor.") diff --git a/code/modules/research/xenobiology/crossbreeding/_misc.dm b/code/modules/research/xenobiology/crossbreeding/_misc.dm index 4684352ef5..cb6a2f25bc 100644 --- a/code/modules/research/xenobiology/crossbreeding/_misc.dm +++ b/code/modules/research/xenobiology/crossbreeding/_misc.dm @@ -100,7 +100,7 @@ return if(M.mind) to_chat(user, "You offer the device to [M].") - if(alert(M, "Would you like to enter [user]'s capture device?", "Gold Capture Device", "Yes", "No") == "Yes") + if(tgui_alert(M, "Would you like to enter [user]'s capture device?", "Gold Capture Device", list("Yes", "No")) == "Yes") if(user.canUseTopic(src, BE_CLOSE) && user.canUseTopic(M, BE_CLOSE)) to_chat(user, "You store [M] in the capture device.") to_chat(M, "The world warps around you, and you're suddenly in an endless void, with a window to the outside floating in front of you.") diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 70cd28718c..d9679d0fb3 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -737,7 +737,7 @@ return prompted = 1 - if(alert("This will permanently transfer your consciousness to [SM]. Are you sure you want to do this?",,"Yes","No")=="No") + if(tgui_alert(usr, "This will permanently transfer your consciousness to [SM]. Are you sure you want to do this?",,list("Yes","No"))=="No") prompted = 0 return diff --git a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm index d62b3c2611..cccb37a359 100644 --- a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm +++ b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm @@ -169,7 +169,7 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate) /obj/structure/necropolis_gate/legion_gate/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) if(!open && !changing_openness) - var/safety = alert(user, "You think this might be a bad idea...", "Knock on the door?", "Proceed", "Abort") + var/safety = tgui_alert(user, "You think this might be a bad idea...", "Knock on the door?", list("Proceed", "Abort")) if(safety == "Abort" || !in_range(src, user) || !src || open || changing_openness || user.incapacitated()) return user.visible_message("[user] knocks on [src]...", "You tentatively knock on [src]...") diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index 7109c87999..ca502584d7 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -258,7 +258,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) if(!parentSphere) to_chat(user, "The door seems to be malfunctioning and refuses to operate!") return - if(alert(user, "Hilbert's Hotel would like to remind you that while we will do everything we can to protect the belongings you leave behind, we make no guarantees of their safety while you're gone, especially that of the health of any living creatures. With that in mind, are you ready to leave?", "Exit", "Leave", "Stay") == "Leave") + if(tgui_alert(user, "Hilbert's Hotel would like to remind you that while we will do everything we can to protect the belongings you leave behind, we make no guarantees of their safety while you're gone, especially that of the health of any living creatures. With that in mind, are you ready to leave?", "Exit", list("Leave", "Stay")) == "Leave") if(!CHECK_MOBILITY(user, MOBILITY_MOVE) || (get_dist(get_turf(src), get_turf(user)) > 1)) //no teleporting around if they're dead or moved away during the prompt. return user.forceMove(get_turf(parentSphere)) diff --git a/code/modules/tgui/tgui_input_text.dm b/code/modules/tgui/tgui_input_text.dm new file mode 100644 index 0000000000..a8dcb6a984 --- /dev/null +++ b/code/modules/tgui/tgui_input_text.dm @@ -0,0 +1,299 @@ +/** + * Creates a TGUI input text window and returns the user's response. + * + * This proc should be used to create alerts that the caller will wait for a response from. + * Arguments: + * * user - The user to show the input box to. + * * message - The content of the input box, shown in the body of the TGUI window. + * * title - The title of the input box, shown on the top of the TGUI window. + * * default - The default value pre-populated in the input box. + * * timeout - The timeout of the input box, after which the input box will close and qdel itself. Set to zero for no timeout. + */ +/proc/tgui_input_text(mob/user, message, title, default, timeout = 0) + if (istext(user)) + stack_trace("tgui_input_text() received text for user instead of mob") + return + if (!user) + user = usr + if (!istype(user)) + if (istype(user, /client)) + var/client/client = user + user = client.mob + else + return + var/datum/tgui_input_dialog/input = new(user, message, title, default, timeout) + input.input_type = "text" + input.ui_interact(user) + input.wait() + if (input) + . = input.choice + qdel(input) + +/** + * Creates a TGUI input message window and returns the user's response. + * + * This proc should be used to create alerts that the caller will wait for a response from. + * Arguments: + * * user - The user to show the input box to. + * * message - The content of the input box, shown in the body of the TGUI window. + * * title - The title of the input box, shown on the top of the TGUI window. + * * default - The default value pre-populated in the input box. + * * timeout - The timeout of the input box, after which the input box will close and qdel itself. Set to zero for no timeout. + */ +/proc/tgui_input_message(mob/user, message, title, default, timeout = 0) + if (istext(user)) + stack_trace("tgui_input_message() received text for user instead of mob") + return + if (!user) + user = usr + if (!istype(user)) + if (istype(user, /client)) + var/client/client = user + user = client.mob + else + return + var/datum/tgui_input_dialog/input = new(user, message, title, default, timeout) + input.input_type = "message" + input.ui_interact(user) + input.wait() + if (input) + . = input.choice + qdel(input) + +/** + * Creates a TGUI input num window and returns the user's response. + * + * This proc should be used to create alerts that the caller will wait for a response from. + * Arguments: + * * user - The user to show the input box to. + * * message - The content of the input box, shown in the body of the TGUI window. + * * title - The title of the input box, shown on the top of the TGUI window. + * * default - The default value pre-populated in the input box. + * * timeout - The timeout of the input box, after which the input box will close and qdel itself. Set to zero for no timeout. + */ +/proc/tgui_input_num(mob/user, message, title, default, timeout = 0) + if (istext(user)) + stack_trace("tgui_input_num() received text for user instead of mob") + return + if (!user) + user = usr + if (!istype(user)) + if (istype(user, /client)) + var/client/client = user + user = client.mob + else + return + var/datum/tgui_input_dialog/input = new(user, message, title, default, timeout) + input.input_type = "num" + input.ui_interact(user) + input.wait() + if (input) + . = input.choice + qdel(input) + +/** + * Creates an asynchronous TGUI input text window with an associated callback. + * + * This proc should be used to create inputs that invoke a callback with the user's chosen option. + * Arguments: + * * user - The user to show the input box to. + * * message - The content of the input box, shown in the body of the TGUI window. + * * title - The title of the input box, shown on the top of the TGUI window. + * * default - The default value pre-populated in the input box. + * * callback - The callback to be invoked when a choice is made. + * * timeout - The timeout of the input box, after which the menu will close and qdel itself. Set to zero for no timeout. + */ +/proc/tgui_input_text_async(mob/user, message, title, default, datum/callback/callback, timeout = 60 SECONDS) + if (istext(user)) + stack_trace("tgui_input_text_async() received text for user instead of mob") + return + if (!user) + user = usr + if (!istype(user)) + if (istype(user, /client)) + var/client/client = user + user = client.mob + else + return + var/datum/tgui_input_dialog/async/input = new(user, message, title, default, callback, timeout) + input.input_type = "text" + input.ui_interact(user) + +/** + * Creates an asynchronous TGUI input message window with an associated callback. + * + * This proc should be used to create inputs that invoke a callback with the user's chosen option. + * Arguments: + * * user - The user to show the input box to. + * * message - The content of the input box, shown in the body of the TGUI window. + * * title - The title of the input box, shown on the top of the TGUI window. + * * default - The default value pre-populated in the input box. + * * callback - The callback to be invoked when a choice is made. + * * timeout - The timeout of the input box, after which the menu will close and qdel itself. Set to zero for no timeout. + */ +/proc/tgui_input_message_async(mob/user, message, title, default, datum/callback/callback, timeout = 60 SECONDS) + if (istext(user)) + stack_trace("tgui_input_message_async() received text for user instead of mob") + return + if (!user) + user = usr + if (!istype(user)) + if (istype(user, /client)) + var/client/client = user + user = client.mob + else + return + var/datum/tgui_input_dialog/async/input = new(user, message, title, default, callback, timeout) + input.input_type = "message" + input.ui_interact(user) + +/** + * Creates an asynchronous TGUI input num window with an associated callback. + * + * This proc should be used to create inputs that invoke a callback with the user's chosen option. + * Arguments: + * * user - The user to show the input box to. + * * message - The content of the input box, shown in the body of the TGUI window. + * * title - The title of the input box, shown on the top of the TGUI window. + * * default - The default value pre-populated in the input box. + * * callback - The callback to be invoked when a choice is made. + * * timeout - The timeout of the input box, after which the menu will close and qdel itself. Set to zero for no timeout. + */ +/proc/tgui_input_num_async(mob/user, message, title, default, datum/callback/callback, timeout = 60 SECONDS) + if (istext(user)) + stack_trace("tgui_input_num_async() received text for user instead of mob") + return + if (!user) + user = usr + if (!istype(user)) + if (istype(user, /client)) + var/client/client = user + user = client.mob + else + return + var/datum/tgui_input_dialog/async/input = new(user, message, title, default, callback, timeout) + input.input_type = "num" + input.ui_interact(user) + +/** + * # tgui_input_dialog + * + * Datum used for instantiating and using a TGUI-controlled input that prompts the user with + * a message and a box for accepting text/message/num input. + */ +/datum/tgui_input_dialog + /// The title of the TGUI window + var/title + /// The textual body of the TGUI window + var/message + /// The default value to initially populate the input box. + var/initial + /// The value that the user input into the input box, null if cancelled. + var/choice + /// The time at which the tgui_text_input was created, for displaying timeout progress. + var/start_time + /// The lifespan of the tgui_text_input, after which the window will close and delete itself. + var/timeout + /// Boolean field describing if the tgui_text_input was closed by the user. + var/closed + /// Indicates the data type we want to collect ("text", "message", "num") + var/input_type = "text" + +/datum/tgui_input_dialog/New(mob/user, message, title, default, timeout) + src.title = title + src.message = message + // TODO - Do we need to sanitize the initial value for illegal characters? + src.initial = default + if (timeout) + src.timeout = timeout + start_time = world.time + QDEL_IN(src, timeout) + +/datum/tgui_input_dialog/Destroy(force, ...) + SStgui.close_uis(src) + . = ..() + +/** + * Waits for a user's response to the tgui_text_input's prompt before returning. Returns early if + * the window was closed by the user. + */ +/datum/tgui_input_dialog/proc/wait() + while (!choice && !closed) + stoplag(1) + +/datum/tgui_input_dialog/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "InputModal") + ui.open() + +/datum/tgui_input_dialog/ui_close(mob/user) + . = ..() + closed = TRUE + +/datum/tgui_input_dialog/ui_state(mob/user) + return GLOB.always_state + +/datum/tgui_input_dialog/ui_static_data(mob/user) + . = list( + "title" = title, + "message" = message, + "initial" = initial, + "input_type" = input_type + ) + +/datum/tgui_input_dialog/ui_data(mob/user) + . = list() + if(timeout) + .["timeout"] = clamp((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS), 0, 1) + +/datum/tgui_input_dialog/ui_act(action, list/params) + . = ..() + if (.) + return + switch(action) + if("choose") + set_choice(params["choice"]) + if(isnull(src.choice)) + return + SStgui.close_uis(src) + return TRUE + if("cancel") + SStgui.close_uis(src) + closed = TRUE + return TRUE + +/datum/tgui_input_dialog/proc/set_choice(choice) + if(input_type == "num") + src.choice = text2num(choice) + return + src.choice = choice + +/** + * # async tgui_text_input + * + * An asynchronous version of tgui_text_input to be used with callbacks instead of waiting on user responses. + */ +/datum/tgui_input_dialog/async + /// The callback to be invoked by the tgui_text_input upon having a choice made. + var/datum/callback/callback + +/datum/tgui_input_dialog/async/New(mob/user, message, title, default, callback, timeout) + ..(user, title, message, default, timeout) + src.callback = callback + +/datum/tgui_input_dialog/async/Destroy(force, ...) + QDEL_NULL(callback) + . = ..() + +/datum/tgui_input_dialog/async/ui_close(mob/user) + . = ..() + qdel(src) + +/datum/tgui_input_dialog/async/set_choice(choice) + . = ..() + if(!isnull(src.choice)) + callback?.InvokeAsync(src.choice) + +/datum/tgui_input_dialog/async/wait() + return diff --git a/code/modules/tgui_panel/external.dm b/code/modules/tgui_panel/external.dm index 89973a925d..3db779c758 100644 --- a/code/modules/tgui_panel/external.dm +++ b/code/modules/tgui_panel/external.dm @@ -17,7 +17,7 @@ nuke_chat() // Failed to fix - action = alert(src, "Did that work?", "", "Yes", "No, switch to old ui") + action = tgui_alert(src, "Did that work?", "", list("Yes", "No, switch to old ui")) if (action == "No, switch to old ui") winset(src, "output", "on-show=&is-disabled=0&is-visible=1") winset(src, "browseroutput", "is-disabled=1;is-visible=0") diff --git a/code/modules/vore/eating/living.dm b/code/modules/vore/eating/living.dm index 6bc44e6489..7705db7b92 100644 --- a/code/modules/vore/eating/living.dm +++ b/code/modules/vore/eating/living.dm @@ -226,7 +226,7 @@ //You're in a belly! if(isbelly(loc)) var/obj/belly/B = loc - var/confirm = alert(src, "You're in a mob. If you're otherwise unable to escape from a pred AFK for a long time, use this.", "Confirmation", "Okay", "Cancel") + var/confirm = tgui_alert(src, "You're in a mob. If you're otherwise unable to escape from a pred AFK for a long time, use this.", "Confirmation", list("Okay", "Cancel")) if(!confirm == "Okay" || loc != B) return //Actual escaping @@ -246,7 +246,7 @@ else if(istype(loc, /obj/item/dogborg/sleeper)) var/obj/item/dogborg/sleeper/belly = loc //The belly! - var/confirm = alert(src, "You're in a dogborg sleeper. This is for escaping from preference-breaking or if your predator disconnects/AFKs. You can also resist out naturally too.", "Confirmation", "Okay", "Cancel") + var/confirm = tgui_alert(src, "You're in a dogborg sleeper. This is for escaping from preference-breaking or if your predator disconnects/AFKs. You can also resist out naturally too.", "Confirmation", list("Okay", "Cancel")) if(!confirm == "Okay" || loc != belly) return //Actual escaping diff --git a/interface/interface.dm b/interface/interface.dm index 2aece7cb6c..fdcc461b6d 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -24,7 +24,7 @@ set hidden = 1 var/forumurl = CONFIG_GET(string/forumurl) if(forumurl) - if(alert("This will open the forum in your browser. Are you sure?",,"Yes","No")!="Yes") + if(tgui_alert(src, "This will open the forum in your browser. Are you sure?",,list("Yes","No"))!="Yes") return src << link(forumurl) else @@ -37,7 +37,7 @@ set hidden = 1 var/rulesurl = CONFIG_GET(string/rulesurl) if(rulesurl) - if(alert("This will open the rules in your browser. Are you sure?",,"Yes","No")!="Yes") + if(tgui_alert(src, "This will open the rules in your browser. Are you sure?",,list("Yes","No"))!="Yes") return src << link(rulesurl) else @@ -50,7 +50,7 @@ set hidden = 1 var/githuburl = CONFIG_GET(string/githuburl) if(githuburl) - if(alert("This will open the Github repository in your browser. Are you sure?",,"Yes","No")!="Yes") + if(tgui_alert(src, "This will open the Github repository in your browser. Are you sure?",,list("Yes","No"))!="Yes") return src << link(githuburl) else @@ -67,7 +67,7 @@ if(GLOB.revdata.testmerge.len) message += "
    The following experimental changes are active and are probably the cause of any new or sudden issues you may experience. If possible, please try to find a specific thread for your issue instead of posting to the general issue tracker:
    " message += GLOB.revdata.GetTestMergeInfo(FALSE) - if(tgalert(src, message, "Report Issue","Yes","No")!="Yes") + if(tgalert(src, message, "Report Issue","Yes","No")!="Yes") //Untouched, issues must be reported at all costs. return var/static/issue_template = file2text(".github/ISSUE_TEMPLATE.md") var/servername = CONFIG_GET(string/servername) diff --git a/modular_citadel/code/modules/projectiles/guns/ballistic/rifles.dm b/modular_citadel/code/modules/projectiles/guns/ballistic/rifles.dm index e89bb92b33..eacb7a7038 100644 --- a/modular_citadel/code/modules/projectiles/guns/ballistic/rifles.dm +++ b/modular_citadel/code/modules/projectiles/guns/ballistic/rifles.dm @@ -98,7 +98,7 @@ wound_bonus = 15 sharpness = SHARP_EDGED wound_falloff_tile = 0 - + ///ammo casings (CASELESS AMMO CASINGS WOOOOOOOO)/// /obj/item/ammo_casing/caseless/flechetteap @@ -239,7 +239,7 @@ if(user.incapacitated() || !istype(user)) to_chat(user, "You can't do that right now!") return - if(alert("Are you sure you want to recolor your gun?", "Confirm Repaint", "Yes", "No") == "Yes") + if(tgui_alert(user, "Are you sure you want to recolor your gun?", "Confirm Repaint", list("Yes", "No")) == "Yes") var/body_color_input = input(usr,"","Choose Shroud Color",body_color) as color|null if(body_color_input) body_color = sanitize_hexcolor(body_color_input, desired_format=6, include_crunch=1) diff --git a/modular_citadel/code/modules/projectiles/guns/energy/energy_gun.dm b/modular_citadel/code/modules/projectiles/guns/energy/energy_gun.dm index 9a8ee4bab1..5a5f20652f 100644 --- a/modular_citadel/code/modules/projectiles/guns/energy/energy_gun.dm +++ b/modular_citadel/code/modules/projectiles/guns/energy/energy_gun.dm @@ -33,7 +33,7 @@ if(user.incapacitated() || !istype(user)) to_chat(user, "You can't do that right now!") return - if(alert("Are you sure you want to repaint your gun?", "Confirm Repaint", "Yes", "No") == "Yes") + if(tgui_alert(user, "Are you sure you want to repaint your gun?", "Confirm Repaint", list("Yes", "No")) == "Yes") var/body_color_input = input(usr,"","Choose Body Color",body_color) as color|null if(body_color_input) body_color = sanitize_hexcolor(body_color_input, desired_format=6, include_crunch=1) diff --git a/tgstation.dme b/tgstation.dme index 86814261c5..4bb4f09616 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3606,6 +3606,7 @@ #include "code\modules\tgui\tgui.dm" #include "code\modules\tgui\tgui_alert.dm" #include "code\modules\tgui\tgui_input_list.dm" +#include "code\modules\tgui\tgui_input_text.dm" #include "code\modules\tgui\tgui_window.dm" #include "code\modules\tgui\states\admin.dm" #include "code\modules\tgui\states\always.dm" diff --git a/tgui/packages/tgui/interfaces/InputModal.js b/tgui/packages/tgui/interfaces/InputModal.js new file mode 100644 index 0000000000..2e8308e8f9 --- /dev/null +++ b/tgui/packages/tgui/interfaces/InputModal.js @@ -0,0 +1,117 @@ +/** + * @file + * @copyright 2021 Leshana + * @license MIT + */ + +import { clamp01 } from 'common/math'; +import { useBackend, useLocalState } from '../backend'; +import { Box, Button, Section, Input, Stack, TextArea } from '../components'; +import { KEY_ESCAPE } from 'common/keycodes'; +import { Window } from '../layouts'; +import { createLogger } from '../logging'; + +const logger = createLogger('inputmodal'); + +export const InputModal = (props, context) => { + const { act, data } = useBackend(context); + const { title, message, initial, input_type, timeout } = data; + + // Current Input Value + const [curValue, setCurValue] = useLocalState(context, 'curValue', initial); + + const handleKeyDown = e => { + if (e.keyCode === KEY_ESCAPE) { + e.preventDefault(); + act("cancel"); + return; + } + }; + + let initialHeight, initialWidth; + let modalBody; + switch (input_type) { + case 'text': + case 'num': + initialWidth = 325; + initialHeight = message ? Math.max(150, message.length) : 110; + modalBody = ( + { + setCurValue(val); + }} + onEnter={(_e, val) => { + act('choose', { choice: val }); + }} + /> + ); + break; + case 'message': + initialWidth = 450; + initialHeight = 350; + modalBody = ( +
    NamePosition