Skip to content

Commit

Permalink
[READY] TGUI Input Collection (ParadiseSS13#23891)
Browse files Browse the repository at this point in the history
* List Input refresh

* Modal Alerts

* Text Input

* Number Input

* Split Button

* Renaming

* Alert converts

* Text Input Conversion (Part 1)

And TextArea Autofocus + maxLength

* Text Input Conversion (Part 2)

* AAAAAAAAAAAAAAAAAAAA

* I'm FUCKED

* @GDNgit review changes

* "&ParadiseSS13#39;" fixes

* Revert TGUI Alert from admin delete

* NumberInput Window size

* CRASH if empty list

* Update code/modules/tgui/tgui_input/list_input.dm

* TGUI Rebuild

* TGUI Rebuild

* Update code/modules/paperwork/faxmachine.dm

* _char

* compile

* Rebuild

---------

Co-authored-by: Aylong <[email protected]>
Co-authored-by: S34N <[email protected]>
  • Loading branch information
3 people committed Feb 19, 2024
1 parent 0d5986f commit ac5add4
Show file tree
Hide file tree
Showing 168 changed files with 2,310 additions and 1,066 deletions.
8 changes: 5 additions & 3 deletions code/__DEFINES/preferences_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@
#define PREFTOGGLE_2_DANCE_DISCO (1<<16) // 65536
#define PREFTOGGLE_2_MOD_ACTIVATION_METHOD (1<<17) // 131072
#define PREFTOGGLE_2_PARALLAX_IN_DARKNESS (1<<18) // 262144
#define PREFTOGGLE_2_DISABLE_TGUI_LISTS (1<<19) // 524288
#define PREFTOGGLE_2_DISABLE_TGUI_INPUT (1<<19) // 524288
#define PREFTOGGLE_2_ENABLE_TGUI_SAY_LIGHT_MODE (1<<20) // 1048576
#define PREFTOGGLE_2_SWAP_INPUT_BUTTONS (1<<21) // 2097152
#define PREFTOGGLE_2_LARGE_INPUT_BUTTONS (1<<22) // 4194304

#define TOGGLES_2_TOTAL 2097151 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.
#define TOGGLES_2_TOTAL 8388607 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.

#define TOGGLES_2_DEFAULT (PREFTOGGLE_2_FANCYUI|PREFTOGGLE_2_ITEMATTACK|PREFTOGGLE_2_WINDOWFLASHING|PREFTOGGLE_2_RUNECHAT|PREFTOGGLE_2_DEATHMESSAGE|PREFTOGGLE_2_SEE_ITEM_OUTLINES|PREFTOGGLE_2_THOUGHT_BUBBLE|PREFTOGGLE_2_DANCE_DISCO|PREFTOGGLE_2_MOD_ACTIVATION_METHOD)
#define TOGGLES_2_DEFAULT (PREFTOGGLE_2_FANCYUI|PREFTOGGLE_2_ITEMATTACK|PREFTOGGLE_2_WINDOWFLASHING|PREFTOGGLE_2_RUNECHAT|PREFTOGGLE_2_DEATHMESSAGE|PREFTOGGLE_2_SEE_ITEM_OUTLINES|PREFTOGGLE_2_THOUGHT_BUBBLE|PREFTOGGLE_2_DANCE_DISCO|PREFTOGGLE_2_MOD_ACTIVATION_METHOD|PREFTOGGLE_2_SWAP_INPUT_BUTTONS|PREFTOGGLE_2_LARGE_INPUT_BUTTONS)

// Sanity checks
#if TOGGLES_TOTAL > 16777215
Expand Down
12 changes: 12 additions & 0 deletions code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -858,3 +858,15 @@
// Pick something else from a list than we last picked
/proc/pick_excluding(list/l, exclude)
return pick(l - exclude)

///takes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate
///use this for lists of things that might have the same name, like mobs or objects, that you plan on giving to a player as input
/proc/avoid_assoc_duplicate_keys(input_key, list/used_key_list)
if(!input_key || !istype(used_key_list))
return
if(used_key_list[input_key])
used_key_list[input_key]++
input_key = "[input_key] ([used_key_list[input_key]])"
else
used_key_list[input_key] = 1
return input_key
4 changes: 2 additions & 2 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,8 @@ so as to remain in compliance with the most up-to-date laws."
if(!usr || !usr.client)
return
if(stone)
if(alert(usr, "Do you want to be captured by [stoner]'s soul stone? This will destroy your corpse and make it \
impossible for you to get back into the game as your regular character.",, "No", "Yes") == "Yes")
if(tgui_alert(usr, "Do you want to be captured by [stoner]'s soul stone? This will destroy your corpse and make it \
impossible for you to get back into the game as your regular character.", "Respawn", list("No", "Yes")) == "Yes")
stone?.opt_in = TRUE

/obj/screen/alert/notify_soulstone/Destroy()
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/non_firing/SSchangelog.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ SUBSYSTEM_DEF(changelog)
if("open_pr")
var/pr_num = params["pr_number"]
if(GLOB.configuration.url.github_url)
if(alert("This will open PR #[pr_num] in your browser. Are you sure?", "Open PR", "Yes", "No") == "No")
if(tgui_alert(usr, "This will open PR #[pr_num] in your browser. Are you sure?", "Open PR", list("Yes", "No")) == "No")
return

// If the github URL in the config has a trailing slash, it doesnt matter here, thankfully github accepts having a double slash: https://github.com/org/repo//pull/1
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/material_container.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
if(istype(I, /obj/item/stack) && precise_insertion)
var/atom/current_parent = parent
var/obj/item/stack/S = I
requested_amount = input(user, "How much do you want to insert?", "Inserting [S.singular_name]s") as num|null
requested_amount = tgui_input_number(user, "How much do you want to insert?", "Inserting [S.singular_name]s", max_value = S.amount)
if(isnull(requested_amount) || (requested_amount <= 0))
return
if(QDELETED(I) || QDELETED(user) || QDELETED(src) || parent != current_parent || user.incapacitated() || !in_range(current_parent, user) || user.l_hand != I && user.r_hand != I)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/spooky.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
change_name(H) //time for a new name!

/datum/component/spooky/proc/change_name(mob/living/carbon/human/H)
var/t = stripped_input(H, "Enter your new skeleton name", H.real_name, null, MAX_NAME_LEN)
var/t = tgui_input_text(H, "Enter your new skeleton name", H.real_name, max_length = MAX_NAME_LEN)
if(!t)
t = "spooky skeleton"
H.real_name = t
Expand Down
8 changes: 4 additions & 4 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@
return

var/mob/living/carbon/human/H = current
var/gear = alert("Agent or Scientist Gear","Gear","Agent","Scientist")
var/gear = alert("Agent or Scientist Gear", "Gear", "Agent", "Scientist")
if(gear)
if(gear=="Agent")
H.equipOutfit(/datum/outfit/abductor/agent)
Expand Down Expand Up @@ -1666,9 +1666,9 @@
SSticker.mode.update_wiz_icons_added(src)

/datum/mind/proc/make_Abductor()
var/role = alert("Abductor Role ?","Role","Agent","Scientist")
var/team = input("Abductor Team ?","Team ?") in list(1,2,3,4)
var/teleport = alert("Teleport to ship ?","Teleport","Yes","No")
var/role = alert("Abductor Role?", "Role", "Agent", "Scientist")
var/team = input("Abductor Team?", "Team?") in list(1,2,3,4)
var/teleport = alert("Teleport to ship?", "Teleport", "Yes", "No")

if(!role || !team || !teleport)
return
Expand Down
2 changes: 1 addition & 1 deletion code/datums/outfits/outfit_debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
to_chat(user, "You switch [src] to [change_voice ? "" : "not "]change your voice on syndicate communications.")

/obj/item/encryptionkey/syndicate/all_channels/AltClick(mob/user)
var/new_name = stripped_input(user, "Enter new fake agent name...", "New name")
var/new_name = tgui_input_text(user, "Enter new fake agent name...", "New name")
if(!new_name)
return
fake_name = copytext(new_name, 1, MAX_NAME_LEN + 1)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spells/alien_spells/whisper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/obj/effect/proc_holder/spell/alien_spell/whisper/cast(list/targets, mob/living/carbon/user)
var/mob/living/target = targets[1]

var/msg = sanitize(input("Message:", "Alien Whisper") as text|null)
var/msg = tgui_input_text(user, "Message:", "Alien Whisper")
if(!msg)
revert_cast(user)
return
Expand Down
2 changes: 1 addition & 1 deletion code/datums/spells/chaplain_bless.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
var/mob/living/carbon/human/target = targets[1]

spawn(0) // allows cast to complete even if recipient ignores the prompt
if(alert(target, "[user] wants to bless you, in the name of [user.p_their()] religion. Accept?", "Accept Blessing?", "Yes", "No") == "Yes") // prevents forced conversions
if(tgui_alert(target, "[user] wants to bless you, in the name of [user.p_their()] religion. Accept?", "Accept Blessing?", list("Yes", "No")) == "Yes") // prevents forced conversions
user.visible_message("[user] starts blessing [target] in the name of [SSticker.Bible_deity_name].", "<span class='notice'>You start blessing [target] in the name of [SSticker.Bible_deity_name].</span>")
if(do_after(user, 150, target = target))
user.visible_message("[user] has blessed [target] in the name of [SSticker.Bible_deity_name].", "<span class='notice'>You have blessed [target] in the name of [SSticker.Bible_deity_name].</span>")
Expand Down
12 changes: 5 additions & 7 deletions code/game/dna/mutations/mutation_powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@
var/obj/item/organ/external/head/head_organ = M.get_organ("head")
var/obj/item/organ/internal/eyes/eyes_organ = M.get_int_organ(/obj/item/organ/internal/eyes)

var/new_gender = alert(user, "Please select gender.", "Character Generation", "Male", "Female")
var/new_gender = tgui_alert(user, "Please select gender.", "Character Generation", list("Male", "Female"))
if(new_gender)
if(new_gender == "Male")
M.change_gender(MALE)
Expand Down Expand Up @@ -918,11 +918,10 @@
if(user.mind?.miming) // Dont let mimes telepathically talk
to_chat(user,"<span class='warning'>You can't communicate without breaking your vow of silence.</span>")
return
var/say = input("What do you wish to say") as text|null
var/say = tgui_input_text(user, "What do you wish to say?", "Project Mind")
if(!say || usr.stat)
return
say = strip_html(say)
say = pencode_to_html(say, usr, format = 0, fields = 0)
say = pencode_to_html(say, usr, format = FALSE, fields = FALSE)

for(var/mob/living/target in targets)
log_say("(TPATH to [key_name(target)]) [say]", user)
Expand Down Expand Up @@ -977,11 +976,10 @@
if(!(target in available_targets))
return
available_targets -= target
var/say = input("What do you wish to say") as text|null
var/say = tgui_input_text(user, "What do you wish to say?", "Scan Mind")
if(!say)
return
say = strip_html(say)
say = pencode_to_html(say, target, format = 0, fields = 0)
say = pencode_to_html(say, target, format = FALSE, fields = FALSE)
user.create_log(SAY_LOG, "Telepathically responded '[say]' using [src]", target)
log_say("(TPATH to [key_name(target)]) [say]", user)
if(target.dna?.GetSEState(GLOB.remotetalkblock))
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/cult_actions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
check_flags = AB_CHECK_CONSCIOUS

/datum/action/innate/cult/comm/Activate()
var/input = stripped_input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")
var/input = tgui_input_text(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", encode = FALSE)
if(!input || !IsAvailable())
return
cultist_commune(usr, input)
Expand Down
6 changes: 3 additions & 3 deletions code/game/gamemodes/cult/ritual.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
if(!(A in summon_areas))
to_chat(user, "<span class='cultlarge'>[SSticker.cultdat.entity_name] can only be summoned where the veil is weak - in [english_list(summon_areas)]!</span>")
return FALSE
var/confirm_final = alert(user, "This is the FINAL step to summon your deities power, it is a long, painful ritual and the crew will be alerted to your presence AND your location!",
"Are you prepared for the final battle?", "My life for [SSticker.cultdat.entity_name]!", "No")
var/confirm_final = tgui_alert(user, "This is the FINAL step to summon your deities power, it is a long, painful ritual and the crew will be alerted to your presence AND your location!",
"Are you prepared for the final battle?", list("My life for [SSticker.cultdat.entity_name]!", "No"))
if(user)
if(confirm_final == "No" || confirm_final == null)
to_chat(user, "<span class='cultitalic'><b>You decide to prepare further before scribing the rune.</b></span>")
Expand Down Expand Up @@ -124,7 +124,7 @@
if(rune == /obj/effect/rune/narsie)
narsie_rune = TRUE
if(initial(rune.req_keyword))
keyword = stripped_input(user, "Please enter a keyword for the rune.", "Enter Keyword")
keyword = tgui_input_text(user, "Please enter a keyword for the rune.", "Enter Keyword")
if(!keyword)
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ structure_check() searches for nearby cultist structures required for the invoca
log_game("Manifest rune failed - user is a ghost")
return

var/choice = alert(user, "You tear open a connection to the spirit realm...", null, "Summon a Cult Ghost", "Ascend as a Dark Spirit", "Cancel")
var/choice = tgui_alert(user, "You tear open a connection to the spirit realm...", "Invoke", list("Summon a Cult Ghost", "Ascend as a Dark Spirit", "Cancel"))
if(choice == "Summon a Cult Ghost")
if(!is_station_level(z) || istype(get_area(src), /area/space))
to_chat(user, "<span class='cultitalic'>The veil is not weak enough here to manifest spirits, you must be on station!</span>")
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/malfunction/Malf_Modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
if(!istype(T) || !is_station_level(T.z))
to_chat(owner, "<span class='warning'>You cannot activate the doomsday device while off-station!</span>")
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
Expand Down Expand Up @@ -582,7 +582,7 @@
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))
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/miniantags/abduction/abduction_gear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
to_chat(user, "<span class='warning'>Your target is already under a mind-controlling influence!</span>")
return

var/command = stripped_input(user, "Enter the command for your target to follow. Uses Left: [G.mind_control_uses], Duration: [DisplayTimeText(G.mind_control_duration)]", "Enter command")
var/command = tgui_input_text(user, "Enter the command for your target to follow. Uses Left: [G.mind_control_uses], Duration: [DisplayTimeText(G.mind_control_duration)]", "Enter command")

if(!command)
return
Expand All @@ -341,7 +341,7 @@
if(L.stat == DEAD)
to_chat(user, "<span class='warning'>Your target is dead!</span>")
return
var/message = stripped_input(user, "Write a message to send to your target's brain.", "Enter message")
var/message = tgui_input_text(user, "Write a message to send to your target's brain.", "Enter message")
if(!message)
return
if(QDELETED(L) || L.stat == DEAD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
if(!choice)
return

var/msg = stripped_input(usr, "What do you wish to tell [choice]?", null, "")
var/msg = tgui_input_text(usr, "What do you wish to tell [choice]?", null, "")
if(!(msg))
return
log_say("(SLAUGHTER to [key_name(choice)]) [msg]", usr)
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/miniantags/guardian/guardian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
/mob/living/simple_animal/hostile/guardian/proc/Communicate(message)
var/input
if(!message)
input = stripped_input(src, "Please enter a message to tell your summoner.", "Guardian", "")
input = tgui_input_text(src, "Please enter a message to tell your summoner.", "Guardian")
else
input = message
if(!input || !summoner)
Expand Down Expand Up @@ -282,7 +282,7 @@
to_chat(user, "[used_message]")
return
used = TRUE // Set this BEFORE the popup to prevent people using the injector more than once, polling ghosts multiple times, and receiving multiple guardians.
var/choice = alert(user, "[confirmation_message]",, "Yes", "No")
var/choice = tgui_alert(user, "[confirmation_message]", "Confirm", list("Yes", "No"))
if(choice == "No")
to_chat(user, "<span class='warning'>You decide against using the [name].</span>")
used = FALSE
Expand Down
6 changes: 3 additions & 3 deletions code/game/gamemodes/miniantags/guardian/host_actions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
button_icon_state = "communicate"

/datum/action/guardian/communicate/Trigger(left_click)
var/input = stripped_input(owner, "Enter a message to tell your guardian:", "Message", "")
var/input = tgui_input_text(owner, "Enter a message to tell your guardian:", "Message")
if(!input || !guardian)
return

Expand Down Expand Up @@ -76,7 +76,7 @@
to_chat(owner, "<span class='warning'>This ability is still recharging.</span>")
return

var/confirm = alert("Are you sure you want replace your guardian's player?", "Confirm", "Yes", "No")
var/confirm = tgui_alert(owner, "Are you sure you want replace your guardian's player?", "Confirm", list("Yes", "No"))
if(confirm == "No")
return

Expand Down Expand Up @@ -170,7 +170,7 @@

/obj/effect/proc_holder/spell/choose_battlecry/cast(list/targets, mob/living/user = usr)
var/mob/living/simple_animal/hostile/guardian/punch/guardian_user = user
var/input = stripped_input(guardian_user, "What do you want your battlecry to be? Max length of 5 characters.", ,"", 6)
var/input = tgui_input_text(guardian_user, "What do you want your battlecry to be? Max length of 6 characters.", "Change Battlecry", guardian_user.battlecry, 6)
if(!input)
revert_cast()
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
/obj/effect/proc_holder/spell/revenant_transmit/cast(list/targets, mob/living/simple_animal/revenant/user = usr)
for(var/mob/living/M in targets)
spawn(0)
var/msg = stripped_input(user, "What do you wish to tell [M]?", null, "")
var/msg = tgui_input_text(user, "What do you wish to tell [M]?", "Transmit")
if(!msg)
cooldown_handler.revert_cast()
return
Expand Down
6 changes: 3 additions & 3 deletions code/game/gamemodes/nuclear/nuclear_challenge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
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 [-round((world.time-SSticker.round_start_time - CHALLENGE_TIME_LIMIT)/10)] seconds 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 [-round((world.time-SSticker.round_start_time - CHALLENGE_TIME_LIMIT)/10)] seconds to decide.", "Declare war?", list("Yes", "No"))
declaring_war = FALSE

if(!check_allowed(user))
Expand All @@ -34,15 +34,15 @@
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 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))
return

if(custom_threat == "Yes")
declaring_war = TRUE
war_declaration = stripped_input(user, "Insert your custom declaration", "Declaration")
war_declaration = tgui_input_text(user, "Insert your custom declaration", "Declaration")
declaring_war = FALSE

if(!check_allowed(user) || !war_declaration)
Expand Down
11 changes: 6 additions & 5 deletions code/game/gamemodes/nuclear/nuclearbomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ GLOBAL_VAR(bomb_set)
yes_code = FALSE
return
// If no code set, enter new one
var/tempcode = input(usr, "Code", "Input Code", null) as num|null
var/tempcode = tgui_input_number(usr, "Code", "Input Code", max_value = 999999)
if(tempcode)
code = min(max(round(tempcode), 0), 999999)
code = tempcode
if(code == r_code)
yes_code = TRUE
code = null
Expand Down Expand Up @@ -478,9 +478,10 @@ GLOBAL_VAR(bomb_set)

switch(action)
if("set_time")
var/time = input(usr, "Detonation time (seconds, min 120, max 600)", "Input Time", 120) as num|null
if(time)
timeleft = min(max(round(time), 120), 600)
var/time = tgui_input_number(usr, "Detonation time (seconds, min 120, max 600)", "Input Time", 120, 600, 120)
if(!time)
return
timeleft = time
if("toggle_safety")
safety = !(safety)
if(safety)
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/nuclear/pinpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
target = null
location = null

switch(alert("Please select the mode you want to put the pinpointer in.", "Pinpointer Mode Select", "Location", "Disk Recovery", "Other Signature"))
switch(tgui_alert(user, "Please select the mode you want to put the pinpointer in.", "Pinpointer Mode Select", list("Location", "Disk Recovery", "Other Signature")))
if("Location")
setting = SETTING_LOCATION

Expand All @@ -211,7 +211,7 @@

if("Other Signature")
setting = SETTING_OBJECT
switch(alert("Search for item signature or DNA fragment?" , "Signature Mode Select" , "Item" , "DNA"))
switch(tgui_alert(user, "Search for item signature or DNA fragment?", "Signature Mode Select", list("Item", "DNA")))
if("Item")
var/list/item_names[0]
var/list/item_paths[0]
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/wizard/spellbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -655,13 +655,13 @@

/datum/spellbook_entry/loadout/Buy(mob/living/carbon/human/user, obj/item/spellbook/book)
if(destroy_spellbook)
var/response = alert(user, "The [src] loadout cannot be refunded once bought. Are you sure this is what you want?", "No refunds!", "No", "Yes")
var/response = tgui_alert(user, "The [src] loadout cannot be refunded once bought. Are you sure this is what you want?", "No refunds!", list("No", "Yes"))
if(response == "No")
return FALSE
to_chat(user, "<span class='notice'>[book] crumbles to ashes as you acquire its knowledge.</span>")
qdel(book)
else if(items_path.len)
var/response = alert(user, "The [src] loadout contains items that will not be refundable if bought. Are you sure this is what you want?", "No refunds!", "No", "Yes")
var/response = tgui_alert(user, "The [src] loadout contains items that will not be refundable if bought. Are you sure this is what you want?", "No refunds!", list("No", "Yes"))
if(response == "No")
return FALSE
if(items_path.len)
Expand Down
Loading

0 comments on commit ac5add4

Please sign in to comment.