[READY] TGUI Input Collection (#23891)

* 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

* "'" 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 <69762909+Aylong220@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
Aylong
2024-02-19 11:55:01 +00:00
committed by GitHub
co-authored by Aylong S34N
parent 0d5986fc5c
commit ac5add482f
168 changed files with 2310 additions and 1066 deletions
+5 -3
View File
@@ -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
+12
View File
@@ -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
+2 -2
View File
@@ -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()
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+4 -4
View File
@@ -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)
@@ -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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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>")
+5 -7
View File
@@ -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)
@@ -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)
@@ -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))
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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>")
@@ -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
+1 -1
View File
@@ -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>")
@@ -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
@@ -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))
@@ -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
@@ -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)
@@ -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)
@@ -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)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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))
@@ -34,7 +34,7 @@
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))
@@ -42,7 +42,7 @@
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)
+6 -5
View File
@@ -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
@@ -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)
+2 -2
View File
@@ -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
@@ -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]
+2 -2
View File
@@ -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)
@@ -113,7 +113,7 @@
if(direct != "LEAVE IT")
C.dir = text2dir(direct)
if(i != 0)
var/confirm = alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", "Yes", "No")
var/confirm = tgui_alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", list("Yes", "No"))
if(confirm == "Yes")
break
+1 -1
View File
@@ -168,7 +168,7 @@
log_game("[key_name(usr)] has completed an AI core in [R]: [COORD(loc)].")
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
if(!brain)
var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes"
var/open_for_latejoin = tgui_alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", list("Yes", "No")) == "Yes"
var/obj/structure/AIcore/deactivated/D = new(loc)
if(open_for_latejoin)
GLOB.empty_playable_ai_cores += D
@@ -173,7 +173,7 @@ GLOBAL_LIST_EMPTY(gas_sensors)
// This is its own proc so it can be modified in child types
/obj/machinery/computer/general_air_control/proc/configure_sensors(mob/living/user, obj/item/multitool/M)
var/choice = alert(user, "Would you like to add or remove a sensor/meter", "Configuration", "Add", "Remove", "Cancel")
var/choice = tgui_alert(user, "Would you like to add or remove a sensor/meter", "Configuration", list("Add", "Remove", "Cancel"))
if((choice == "Cancel") || !Adjacent(user))
return
@@ -198,7 +198,7 @@ GLOBAL_LIST_EMPTY(gas_sensors)
if(!to_remove)
return
var/confirm = alert(user, "Are you sure you want to remove the sensor/meter '[to_remove]'?", "Warning", "Yes", "No")
var/confirm = tgui_alert(user, "Are you sure you want to remove the sensor/meter '[to_remove]'?", "Warning", list("Yes", "No"))
if((confirm != "Yes") || !Adjacent(user))
return
@@ -353,7 +353,7 @@ GLOBAL_LIST_EMPTY(gas_sensors)
return TRUE
/obj/machinery/computer/general_air_control/large_tank_control/proc/configure_inlet(mob/living/user, obj/item/multitool/M)
var/choice = alert(user, "Would you like to add/replace the existing inlet or clear it?", "Configuration", "Add/Replace", "Clear", "Cancel")
var/choice = tgui_alert(user, "Would you like to add/replace the existing inlet or clear it?", "Configuration", list("Add/Replace", "Clear", "Cancel"))
if((choice == "Cancel") || !Adjacent(user))
return
@@ -389,7 +389,7 @@ GLOBAL_LIST_EMPTY(gas_sensors)
/obj/machinery/computer/general_air_control/large_tank_control/proc/configure_outlet(mob/living/user, obj/item/multitool/M)
var/choice = alert(user, "Would you like to add/replace the existing outlet or clear it?", "Configuration", "Add/Replace", "Clear", "Cancel")
var/choice = tgui_alert(user, "Would you like to add/replace the existing outlet or clear it?", "Configuration", list("Add/Replace", "Clear", "Cancel"))
if((choice == "Cancel") || !Adjacent(user))
return
@@ -521,7 +521,7 @@
catastasis = "STANDARD"
opposite_catastasis = "BROAD"
var/choice = alert("Current receiver spectrum is set to: [catastasis]", "Multitool-Circuitboard interface", "Switch to [opposite_catastasis]", "Cancel")
var/choice = tgui_alert(user, "Current receiver spectrum is set to: [catastasis]", "Multitool-Circuitboard interface", list("Switch to [opposite_catastasis]", "Cancel"))
if(choice == "Cancel")
return
+3 -3
View File
@@ -675,10 +675,10 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
regenerate_id_name()
return
if("account") // card account number
var/account_num = input(usr, "Account Number", "Input Number", null) as num|null
if(!scan || !modify)
var/account_num = tgui_input_number(usr, "Account Number", "Input Number", modify.associated_account_number, 9999999, 1000000)
if(!scan || !modify || !account_num)
return FALSE
modify.associated_account_number = clamp(round(account_num), 1000000, 9999999) //force a 7 digit number
modify.associated_account_number = account_num
//for future reference, you should never be able to modify the money account datum through the card computer
return
if("skin")
@@ -186,7 +186,7 @@
if(isAI(ui.user) || isrobot(ui.user))
to_chat(ui.user, "<span class='warning'>Firewalls prevent you from recalling the shuttle.</span>")
return
var/response = alert("Are you sure you wish to recall the shuttle?", "Confirm", "Yes", "No")
var/response = tgui_alert(usr, "Are you sure you wish to recall the shuttle?", "Confirm", list("Yes", "No"))
if(response == "Yes")
cancel_call_proc(ui.user)
if(SSshuttle.emergency.timer)
@@ -246,7 +246,7 @@
if(centcomm_message_cooldown > world.time)
to_chat(ui.user, "<span class='warning'>Arrays recycling. Please stand by.</span>")
return
var/input = stripped_input(ui.user, "Please enter the reason for requesting the nuclear self-destruct codes. Misuse of the nuclear request system will not be tolerated under any circumstances. Transmission does not guarantee a response.", "Self Destruct Code Request.","")
var/input = tgui_input_text(ui.user, "Please enter the reason for requesting the nuclear self-destruct codes. Misuse of the nuclear request system will not be tolerated under any circumstances. Transmission does not guarantee a response.", "Self Destruct Code Request.")
if(!input || ..() || !(is_authenticated(ui.user) >= COMM_AUTHENTICATION_CAPT))
return
if(length(input) < COMM_CCMSGLEN_MINIMUM)
@@ -264,7 +264,7 @@
if(centcomm_message_cooldown > world.time)
to_chat(ui.user, "<span class='warning'>Arrays recycling. Please stand by.</span>")
return
var/input = stripped_input(ui.user, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
var/input = tgui_input_text(ui.user, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "CentComm Message")
if(!input || ..() || !(is_authenticated(ui.user) >= COMM_AUTHENTICATION_CAPT))
return
if(length(input) < COMM_CCMSGLEN_MINIMUM)
@@ -283,7 +283,7 @@
if(centcomm_message_cooldown > world.time)
to_chat(ui.user, "Arrays recycling. Please stand by.")
return
var/input = stripped_input(ui.user, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "To abort, send an empty message.", "")
var/input = tgui_input_text(ui.user, "Please choose a message to transmit to \[ABNORMAL ROUTING CORDINATES\] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response.", "Send Message")
if(!input || ..() || !(is_authenticated(ui.user) >= COMM_AUTHENTICATION_CAPT))
return
if(length(input) < COMM_CCMSGLEN_MINIMUM)
@@ -333,7 +333,7 @@
to_chat(user, "<span class='warning'>[src] has already been used to transmit a message to the Syndicate.</span>")
return
message_sent = TRUE
var/input = stripped_input(user, "Please choose a message to transmit to Syndicate HQ via quantum entanglement. Transmission does not guarantee a response. This function may only be used ONCE.", "To abort, send an empty message.", "")
var/input = tgui_input_text(user, "Please choose a message to transmit to Syndicate HQ via quantum entanglement. Transmission does not guarantee a response. This function may only be used ONCE.", "Send Message")
if(!input)
message_sent = FALSE
return
@@ -1,9 +1,4 @@
// Allows you to monitor messages that passes the server.
/obj/machinery/computer/message_monitor
name = "message monitoring console"
desc = "Used to monitor the crew's messages that are sent via PDA. It can also be used to view Request Console messages."
@@ -415,7 +410,7 @@
continue
sendPDAs += P
if(GLOB.PDAs && GLOB.PDAs.len > 0)
customrecepient = tgui_input_list(usr, "Select a PDA from the list.", buttons = sortAtom(sendPDAs))
customrecepient = tgui_input_list(usr, "Select a PDA from the list.", items = sortAtom(sendPDAs))
else
customrecepient = null
+6 -5
View File
@@ -449,7 +449,6 @@
/obj/machinery/cryopod/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/grab))
var/obj/item/grab/G = I
@@ -472,8 +471,9 @@
return
if(M.client)
if(alert(M,"Would you like to enter long-term storage?",,"Yes","No") == "Yes")
if(!M || !G || !G.affecting) return
if(tgui_alert(M, "Would you like to enter long-term storage?", "Cryosleep", list("Yes", "No")) == "Yes")
if(!M || !G || !G.affecting)
return
willing = willing_time_divisor
else
willing = 1
@@ -547,8 +547,9 @@
time_till_despawn = initial(time_till_despawn)
if(L.client)
if(alert(L,"Would you like to enter cryosleep?",,"Yes","No") == "Yes")
if(!L) return
if(tgui_alert(L, "Would you like to enter cryosleep?", "Cryosleep", list("Yes", "No")) == "Yes")
if(!L)
return
willing = willing_time_divisor
else
willing = 1
+4 -5
View File
@@ -345,7 +345,7 @@
if(params["prisoner_name"])
prisoner_name = params["prisoner_name"]
else
prisoner_name = input("Prisoner Name:", name, prisoner_name) as text|null
prisoner_name = tgui_input_text(usr, "Prisoner Name:", name, prisoner_name, MAX_NAME_LEN, encode = FALSE)
if(prisoner_name)
var/datum/data/record/R = find_security_record("name", prisoner_name)
if(istype(R))
@@ -353,10 +353,9 @@
else
prisoner_hasrecord = FALSE
if("prisoner_charge")
prisoner_charge = input("Prisoner Charge:", name, prisoner_charge) as text|null
prisoner_charge = tgui_input_text(usr, "Prisoner Charge:", name, prisoner_charge, encode = FALSE)
if("prisoner_time")
prisoner_time = input("Prisoner Time (in minutes):", name, prisoner_time) as num|null
prisoner_time = min(max(round(prisoner_time), 0), 60)
prisoner_time = tgui_input_number(usr, "Prisoner Time (in minutes):", name, prisoner_time, 60)
if("start")
if(!prisoner_name || !prisoner_charge || !prisoner_time)
return FALSE
@@ -371,7 +370,7 @@
update_icon(UPDATE_ICON_STATE)
if("restart_timer")
if(timing)
var/reset_reason = sanitize(copytext(input(usr, "Reason for resetting timer:", name, "") as text|null, 1, MAX_MESSAGE_LEN))
var/reset_reason = tgui_input_text(usr, "Reason for resetting timer:", name)
if(!reset_reason)
to_chat(usr, "<span class='warning'>Cancelled reset: reason field is required.</span>")
return FALSE
+5 -5
View File
@@ -162,7 +162,7 @@ Transponder Codes:<UL>"}
usr.set_machine(src)
if(href_list["locedit"])
var/newloc = copytext(sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null),1,MAX_MESSAGE_LEN)
var/newloc = tgui_input_text(usr, "Enter New Location", "Navigation Beacon", location)
if(newloc)
location = newloc
updateDialog()
@@ -170,12 +170,12 @@ Transponder Codes:<UL>"}
else if(href_list["edit"])
var/codekey = href_list["code"]
var/newkey = stripped_input(usr, "Enter Transponder Code Key", "Navigation Beacon", codekey)
var/newkey = tgui_input_text(usr, "Enter Transponder Code Key", "Navigation Beacon", codekey)
if(!newkey)
return
var/codeval = codes[codekey]
var/newval = stripped_input(usr, "Enter Transponder Code Value", "Navigation Beacon", codeval)
var/newval = tgui_input_text(usr, "Enter Transponder Code Value", "Navigation Beacon", codeval)
if(!newval)
newval = codekey
return
@@ -192,11 +192,11 @@ Transponder Codes:<UL>"}
else if(href_list["add"])
var/newkey = stripped_input(usr, "Enter New Transponder Code Key", "Navigation Beacon")
var/newkey = tgui_input_text(usr, "Enter New Transponder Code Key", "Navigation Beacon")
if(!newkey)
return
var/newval = stripped_input(usr, "Enter New Transponder Code Value", "Navigation Beacon")
var/newval = tgui_input_text(usr, "Enter New Transponder Code Value", "Navigation Beacon")
if(!newval)
newval = "1"
return
+2 -2
View File
@@ -186,7 +186,7 @@ GLOBAL_LIST_EMPTY(allRequestConsoles)
if(reject_bad_text(params["write"]))
recipient = params["write"] //write contains the string of the receiving department's name
var/new_message = sanitize(input("Write your message:", "Awaiting Input", ""))
var/new_message = tgui_input_text(usr, "Write your message:", "Awaiting Input", encode = FALSE)
if(new_message)
message = new_message
screen = RCS_MESSAUTH
@@ -201,7 +201,7 @@ GLOBAL_LIST_EMPTY(allRequestConsoles)
reset_message(TRUE)
if("writeAnnouncement")
var/new_message = input("Write your message:", "Awaiting Input", message) as message|null
var/new_message = tgui_input_text(usr, "Write your message:", "Awaiting Input", message, multiline = TRUE, encode = FALSE)
if(new_message)
message = new_message
else
+1 -1
View File
@@ -250,7 +250,7 @@
if(can_interact(user)) //No running off and setting bombs from across the station
timer_set = clamp(new_timer, minimum_timer, maximum_timer)
loc.visible_message("<span class='notice'>[bicon(src)] timer set for [timer_set] seconds.</span>")
if(alert(user,"Would you like to start the countdown now?",,"Yes","No") == "Yes" && can_interact(user))
if(tgui_alert(user, "Would you like to start the countdown now?", "Countdown", list("Yes", "No")) == "Yes" && can_interact(user))
if(defused || active)
if(defused)
loc.visible_message("<span class='notice'>[bicon(src)] Device error: User intervention required.</span>")
+1 -1
View File
@@ -205,7 +205,7 @@
if("unlink")
if(!linked)
return
var/choice = alert(usr, "Are you SURE you want to unlink this relay?\nYou wont be able to re-link without the core password", "Unlink","Yes","No")
var/choice = tgui_alert(usr, "Are you SURE you want to unlink this relay?\nYou wont be able to re-link without the core password", "Unlink", list("Yes", "No"))
if(choice == "Yes")
log_action(usr, "Unlinked [network_id] from [linked_core.network_id]")
Reset()
+13 -7
View File
@@ -285,7 +285,9 @@
// Imports and exports
if("import")
var/json = input(usr, "Provide configuration JSON below.", "Load Config", nttc.nttc_serialize()) as message
var/json = tgui_input_text(usr, "Provide configuration JSON below.", "Load Config", nttc.nttc_serialize(), multiline = TRUE, encode = FALSE)
if(!json)
return
if(nttc.nttc_deserialize(json, usr.ckey))
log_action(usr, "has uploaded a NTTC JSON configuration: [ADMIN_SHOWDETAILS("Show", json)]", TRUE)
@@ -294,7 +296,9 @@
// Set network ID
if("network_id")
var/new_id = input(usr, "Please enter a new network ID", "Network ID", network_id)
var/new_id = tgui_input_text(usr, "Please enter a new network ID", "Network ID", network_id)
if(!new_id)
return
log_action(usr, "renamed core with ID [network_id] to [new_id]")
to_chat(usr, "<span class='notice'>Device ID changed from <b>[network_id]</b> to <b>[new_id]</b>.</span>")
network_id = new_id
@@ -302,7 +306,7 @@
if("unlink")
var/obj/machinery/tcomms/relay/R = locate(params["addr"])
if(istype(R, /obj/machinery/tcomms/relay))
var/confirm = alert("Are you sure you want to unlink this relay?\nID: [R.network_id]\nADDR: \ref[R]", "Relay Unlink", "Yes", "No")
var/confirm = tgui_alert(usr, "Are you sure you want to unlink this relay?\nID: [R.network_id]\nADDR: \ref[R]", "Relay Unlink", list("Yes", "No"))
if(confirm == "Yes")
log_action(usr, "has unlinked tcomms relay with ID [R.network_id] from tcomms core with ID [network_id]", TRUE)
R.Reset()
@@ -310,15 +314,17 @@
to_chat(usr, "<span class='alert'><b>ERROR:</b> Relay not found. Please file an issue report.</span>")
if("change_password")
var/new_password = input(usr, "Please enter a new password","New Password", link_password)
var/new_password = tgui_input_text(usr, "Please enter a new password", "New Password", link_password)
if(!new_password)
return
log_action(usr, "has changed the password on core with ID [network_id] from [link_password] to [new_password]")
to_chat(usr, "<span class='notice'>Successfully changed password from <b>[link_password]</b> to <b>[new_password]</b>.</span>")
link_password = new_password
if("add_filter")
// This is a stripped input because I did NOT come this far for this system to be abused by HTML injection
var/name_to_add = html_decode(stripped_input(usr, "Enter a name to add to the filtering list", "Name Entry"))
if(name_to_add == "")
var/name_to_add = tgui_input_text(usr, "Enter a name to add to the filtering list", "Name Entry")
if(!name_to_add)
return
if(name_to_add in nttc.filtering)
to_chat(usr, "<span class='alert'><b>ERROR:</b> User already in filtering list.</span>")
@@ -332,7 +338,7 @@
if(!(name_to_remove in nttc.filtering))
to_chat(usr, "<span class='alert'><b>ERROR:</b> Name does not exist in filter list. Please file an issue report.</span>")
else
var/confirm = alert(usr, "Are you sure you want to remove [name_to_remove] from the filtering list?", "Confirm Removal", "Yes", "No")
var/confirm = tgui_alert(usr, "Are you sure you want to remove [name_to_remove] from the filtering list?", "Confirm Removal", list("Yes", "No"))
if(confirm == "Yes")
nttc.filtering -= name_to_remove
log_action(usr, "has removed [name_to_remove] from the NTTC filter list on core with ID [network_id]", TRUE)
+1 -1
View File
@@ -458,7 +458,7 @@
var/datum/material/M = materials.materials[id]
if(!M || !M.amount)
return
var/num_sheets = input(usr, "How many sheets do you want to withdraw?", "Withdrawing [M.name]") as num|null
var/num_sheets = tgui_input_number(usr, "How many sheets do you want to withdraw?", "Withdrawing [M.name]", max_value = round(M.amount / 2000))
if(isnull(num_sheets) || num_sheets <= 0)
return
materials.retrieve_sheets(num_sheets, id)
+4 -10
View File
@@ -204,11 +204,8 @@
to_chat(usr, "<span class='warning'>Error! Please notify administration.</span>")
return area_created
var/list/turf/turfs = res
var/str = trim(stripped_input(usr,"New area name:", "Blueprint Editing", "", MAX_NAME_LEN))
if(!str || !length(str)) //cancel
return area_created
if(length(str) > 50)
to_chat(usr, "<span class='warning'>The given name is too long. The area remains undefined.</span>")
var/str = tgui_input_text(usr, "New area name:", "Blueprint Editing", max_length = MAX_NAME_LEN, encode = FALSE)
if(!str || !length(str)) // Cancel
return area_created
var/area/A = new
A.name = str
@@ -239,11 +236,8 @@
/obj/item/areaeditor/proc/edit_area()
var/area/A = get_area()
var/prevname = "[sanitize(A.name)]"
var/str = trim(stripped_input(usr,"New area name:", "Blueprint Editing", prevname, MAX_NAME_LEN))
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)
to_chat(usr, "<span class='warning'>The given name is too long. The area's name is unchanged.</span>")
var/str = tgui_input_text(usr, "New area name:", "Blueprint Editing", prevname, MAX_NAME_LEN, encode = FALSE)
if(!str || !length(str) || str == prevname) // Cancel
return
set_area_machinery_title(A,str,prevname)
A.name = str
+1 -1
View File
@@ -98,7 +98,7 @@
if(flush) // Don't doublewipe.
to_chat(user, "<span class='warning'>You are already wiping this AI!</span>")
return
var/confirm = alert("Are you sure you want to wipe this card's memory? This cannot be undone once started.", "Confirm Wipe", "Yes", "No")
var/confirm = tgui_alert(user, "Are you sure you want to wipe this card's memory? This cannot be undone once started.", "Confirm Wipe", list("Yes", "No"))
if(confirm == "Yes" && (ui_status(user, GLOB.inventory_state) == UI_INTERACTIVE)) // And make doubly sure they want to wipe (three total clicks)
msg_admin_attack("[key_name_admin(user)] wiped [key_name_admin(AI)] with \the [src].", ATKLOG_FEW)
add_attack_logs(user, AI, "Wiped with [src].")
+1 -4
View File
@@ -56,10 +56,7 @@
to_chat(user, "<span class='warning'>[src] needs to recharge!</span>")
return
var/message = input(user, "Shout a message:", "Megaphone") as text|null
if(!message)
return
message = sanitize(copytext(message, 1, MAX_MESSAGE_LEN))
var/message = tgui_input_text(user, "Shout a message:", "Megaphone")
if(!message)
return
message = capitalize(message)
+2 -2
View File
@@ -260,7 +260,7 @@
looking_for_personality = 1
GLOB.paiController.findPAI(src, usr)
if(href_list["wipe"])
var/confirm = input("Are you CERTAIN you wish to delete the current personality? This action cannot be undone.", "Personality Wipe") in list("Yes", "No")
var/confirm = tgui_alert(usr, "Are you certain you wish to delete the current personality? This action cannot be undone.", "Personality Wipe", list("No", "Yes"))
if(confirm == "Yes")
for(var/mob/M in src)
to_chat(M, "<font color = #ff0000><h2>You feel yourself slipping away from reality.</h2></font>")
@@ -281,7 +281,7 @@
if(2)
radio.ToggleReception()
if(href_list["setlaws"])
var/newlaws = sanitize(copytext(input("Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws) as message,1,MAX_MESSAGE_LEN))
var/newlaws = tgui_input_text(usr, "Enter any additional directives you would like your pAI personality to follow. Note that these directives will not override the personality's allegiance to its imprinted master. Conflicting directives will be ignored.", "pAI Directive Configuration", pai.pai_laws)
if(newlaws)
pai.pai_laws = newlaws
to_chat(pai, "Your supplemental directives have been updated. Your new directives are:")
@@ -278,7 +278,7 @@
to_chat(user, "<span class='notice'>The injector is empty!</span>")
return
used = TRUE // Set this BEFORE the popup to prevent people using the injector more than once.
var/choice = alert(user, "The injector is still unused. Do you wish to use it?", "Fireproofing injector", "Yes", "No")
var/choice = tgui_alert(user, "The injector is still unused. Do you wish to use it?", "Fireproofing injector", list("Yes", "No"))
if(choice == "No")
to_chat(user, "<span class='notice'>You decide against using [src].</span>")
used = FALSE
@@ -104,7 +104,10 @@
var/heldname = "default name"
/obj/item/borg/upgrade/rename/attack_self(mob/user)
heldname = stripped_input(user, "Enter new robot name", "Cyborg Reclassification", heldname, MAX_NAME_LEN)
var/new_heldname = tgui_input_text(user, "Enter new robot name", "Cyborg Reclassification", heldname, MAX_NAME_LEN)
if(!new_heldname)
return
heldname = new_heldname
/obj/item/borg/upgrade/rename/do_install(mob/living/silicon/robot/R)
if(!R.allow_rename)
@@ -320,7 +320,7 @@
if(affecting.status & ORGAN_SPLINTED)
to_chat(user, "<span class='danger'>[H]'s [limb] is already splinted!</span>")
if(alert(user, "Would you like to remove the splint from [H]'s [limb]?", "Splint removal.", "Yes", "No") == "Yes")
if(tgui_alert(user, "Would you like to remove the splint from [H]'s [limb]?", "Splint removal", list("Yes", "No")) == "Yes")
affecting.status &= ~ORGAN_SPLINTED
H.handle_splints()
to_chat(user, "<span class='notice'>You remove the splint from [H]'s [limb].</span>")
+1 -1
View File
@@ -348,7 +348,7 @@
//get amount from user
var/min = 0
var/max = get_amount()
var/stackmaterial = round(input(user, "How many sheets do you wish to take out of this stack? (Maximum: [max])") as null|num)
var/stackmaterial = tgui_input_number(user, "How many sheets do you wish to take out of this stack? (Max: [max])", "Stack Split", max_value = max)
if(stackmaterial == null || stackmaterial <= min || stackmaterial > get_amount())
return
if(!Adjacent(user, 1))
+27 -18
View File
@@ -116,8 +116,10 @@ AI MODULES
/obj/item/aiModule/safeguard/attack_self(mob/user as mob)
..()
var/targName = stripped_input(usr, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)
targetName = targName
var/new_targetName = tgui_input_text(user, "Please enter the name of the person to safeguard.", "Safeguard who?", user.name)
if(!new_targetName)
return
targetName = new_targetName
desc = "A 'safeguard' AI module: 'Safeguard [targetName]. Individuals that threaten [targetName] are not crew and must be eliminated.'"
/obj/item/aiModule/safeguard/install(obj/machinery/computer/C)
@@ -143,8 +145,10 @@ AI MODULES
/obj/item/aiModule/oneCrewMember/attack_self(mob/user as mob)
..()
var/targName = stripped_input(usr, "Please enter the name of the person who is the only crew.", "Who?", user.real_name)
targetName = targName
var/new_targetName = tgui_input_text(usr, "Please enter the name of the person who is the only crew.", "Who?", user.real_name)
if(!new_targetName)
return
targetName = new_targetName
desc = "A 'one crew' AI module: 'Only [targetName] is crew.'"
/obj/item/aiModule/oneCrewMember/install(obj/machinery/computer/C)
@@ -208,12 +212,15 @@ AI MODULES
/obj/item/aiModule/freeform/attack_self(mob/user as mob)
..()
var/new_lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num
if(new_lawpos < MIN_SUPPLIED_LAW_NUMBER) return
lawpos = min(new_lawpos, MAX_SUPPLIED_LAW_NUMBER)
var/newlaw = ""
var/targName = sanitize(copytext(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw),1,MAX_MESSAGE_LEN))
newFreeFormLaw = targName
var/new_lawpos = tgui_input_number(user, "Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority", lawpos, MAX_SUPPLIED_LAW_NUMBER, MIN_SUPPLIED_LAW_NUMBER)
if(!new_lawpos || new_lawpos == lawpos)
return
lawpos = new_lawpos
var/new_targetName = tgui_input_text(user, "Please enter a new law for the AI.", "Freeform Law Entry")
if(!new_targetName)
return
newFreeFormLaw = new_targetName
desc = "A 'freeform' AI module: ([lawpos]) '[newFreeFormLaw]'"
/obj/item/aiModule/freeform/addAdditionalLaws(mob/living/silicon/ai/target, mob/sender)
@@ -406,10 +413,11 @@ AI MODULES
/obj/item/aiModule/freeformcore/attack_self(mob/user as mob)
..()
var/newlaw = ""
var/targName = stripped_input(usr, "Please enter a new core law for the AI.", "Freeform Law Entry", newlaw)
newFreeFormLaw = targName
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
var/new_targetName = tgui_input_text(usr, "Please enter a new core law for the AI.", "Freeform Law Entry")
if(!new_targetName)
return
newFreeFormLaw = new_targetName
desc = "A 'freeform' Core AI module: '[newFreeFormLaw]'"
/obj/item/aiModule/freeformcore/addAdditionalLaws(mob/living/silicon/ai/target, mob/sender)
..()
@@ -433,10 +441,11 @@ AI MODULES
/obj/item/aiModule/syndicate/attack_self(mob/user as mob)
..()
var/newlaw = ""
var/targName = stripped_input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw,MAX_MESSAGE_LEN)
newFreeFormLaw = targName
desc = "A hacked AI law module: '[newFreeFormLaw]'"
var/new_targetName = tgui_input_text(usr, "Please enter a new law for the AI.", "Freeform Law Entry", max_length = MAX_MESSAGE_LEN)
if(!new_targetName)
return
newFreeFormLaw = new_targetName
desc = "A hacked AI law module: '[newFreeFormLaw]'"
/obj/item/aiModule/syndicate/transmitInstructions(mob/living/silicon/ai/target, mob/sender)
// ..() //We don't want this module reporting to the AI who dun it. --NEO
+22 -24
View File
@@ -366,13 +366,13 @@
/obj/item/card/id/syndicate/attack_self(mob/user as mob)
if(!src.registered_name)
var/t = reject_bad_name(input(user, "What name would you like to use on this card?", "Agent Card name", ishuman(user) ? user.real_name : user.name), TRUE)
var/t = reject_bad_name(tgui_input_text(user, "What name would you like to use on this card?", "Agent Card name", ishuman(user) ? user.real_name : user.name), TRUE)
if(!t)
to_chat(user, "<span class='warning'>Invalid name.</span>")
return
src.registered_name = t
var/u = sanitize(stripped_input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than maintenance.", "Agent Card Job Assignment", "Agent", MAX_MESSAGE_LEN))
var/u = tgui_input_text(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than maintenance.", "Agent Card Job Assignment", "Agent", MAX_MESSAGE_LEN)
if(!u)
to_chat(user, "<span class='warning'>Invalid assignment.</span>")
src.registered_name = ""
@@ -385,14 +385,14 @@
if(!registered_user)
registered_user = user.mind.current
switch(alert(user,"Would you like to display \the [src] or edit it?","Choose","Show","Edit"))
switch(tgui_alert(user, "Would you like to display [src] or edit it?", "Choose", list("Show", "Edit")))
if("Show")
return ..()
if("Edit")
switch(tgui_input_list(user, "What would you like to edit on [src]?", "Agent ID", list("Name", "Photo", "Appearance", "Sex", "Age", "Occupation", "Money Account", "Blood Type", "DNA Hash", "Fingerprint Hash", "Reset Access", "Delete Card Information")))
if("Name")
var/new_name = reject_bad_name(input(user,"What name would you like to put on this card?","Agent Card Name", ishuman(user) ? user.real_name : user.name), TRUE)
if(!Adjacent(user))
var/new_name = reject_bad_name(tgui_input_text(user, "What name would you like to put on this card?", "Agent Card Name", ishuman(user) ? user.real_name : user.name), TRUE)
if(!Adjacent(user) || !new_name)
return
src.registered_name = new_name
UpdateName()
@@ -465,9 +465,7 @@
"ERT_paranormal",
)
var/choice = tgui_input_list(user, "Select the appearance for this card.", "Agent Card Appearance", appearances)
if(!Adjacent(user))
return
if(!choice)
if(!Adjacent(user) || !choice)
return
icon_state = choice
switch(choice)
@@ -488,8 +486,8 @@
to_chat(usr, "<span class='notice'>Appearance changed to [choice].</span>")
if("Sex")
var/new_sex = sanitize(stripped_input(user,"What sex would you like to put on this card?","Agent Card Sex", ishuman(user) ? capitalize(user.gender) : "Male", MAX_MESSAGE_LEN))
if(!Adjacent(user))
var/new_sex = tgui_input_text(user,"What sex would you like to put on this card?", "Agent Card Sex", ishuman(user) ? capitalize(user.gender) : "Male")
if(!Adjacent(user) || !new_sex)
return
sex = new_sex
to_chat(user, "<span class='notice'>Sex changed to [new_sex].</span>")
@@ -500,8 +498,8 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
default = H.age
var/new_age = sanitize(input(user,"What age would you like to be written on this card?","Agent Card Age", default) as text)
if(!Adjacent(user))
var/new_age = tgui_input_number(user, "What age would you like to be written on this card?", "Agent Card Age", default, 300, 17)
if(!Adjacent(user) || !new_age)
return
age = new_age
to_chat(user, "<span class='notice'>Age changed to [new_age].</span>")
@@ -524,11 +522,11 @@
var/new_job = "Assistant"
if(department == "Custom")
new_job = sanitize(stripped_input(user,"Choose a custom job title:","Agent Card Occupation", "Assistant", MAX_MESSAGE_LEN))
new_job = tgui_input_text(user, "Choose a custom job title:", "Agent Card Occupation", "Assistant")
else if(department != "Assistant" && !isnull(departments[department]))
new_job = tgui_input_list(user, "What job would you like to put on this card?\nChanging occupation will not grant or remove any access levels.", "Agent Card Occupation", departments[department])
if(!Adjacent(user))
if(!Adjacent(user) || !new_job)
return
assignment = new_job
to_chat(user, "<span class='notice'>Occupation changed to [new_job].</span>")
@@ -536,8 +534,8 @@
RebuildHTML()
if("Money Account")
var/new_account = input(user,"What money account would you like to link to this card?","Agent Card Account",12345) as num
if(!Adjacent(user))
var/new_account = tgui_input_number(user, "What money account would you like to link to this card?", "Agent Card Account", 12345)
if(!Adjacent(user) || !new_account)
return
associated_account_number = new_account
to_chat(user, "<span class='notice'>Linked money account changed to [new_account].</span>")
@@ -549,8 +547,8 @@
if(H.dna)
default = H.dna.blood_type
var/new_blood_type = sanitize(input(user,"What blood type would you like to be written on this card?","Agent Card Blood Type",default) as text)
if(!Adjacent(user))
var/new_blood_type = tgui_input_text(user, "What blood type would you like to be written on this card?", "Agent Card Blood Type", default)
if(!Adjacent(user) || !new_blood_type)
return
blood_type = new_blood_type
to_chat(user, "<span class='notice'>Blood type changed to [new_blood_type].</span>")
@@ -563,8 +561,8 @@
if(H.dna)
default = H.dna.unique_enzymes
var/new_dna_hash = sanitize(input(user,"What DNA hash would you like to be written on this card?","Agent Card DNA Hash",default) as text)
if(!Adjacent(user))
var/new_dna_hash = tgui_input_text(user, "What DNA hash would you like to be written on this card?", "Agent Card DNA Hash", default)
if(!Adjacent(user) || !new_dna_hash)
return
dna_hash = new_dna_hash
to_chat(user, "<span class='notice'>DNA hash changed to [new_dna_hash].</span>")
@@ -577,21 +575,21 @@
if(H.dna)
default = md5(H.dna.uni_identity)
var/new_fingerprint_hash = sanitize(input(user,"What fingerprint hash would you like to be written on this card?","Agent Card Fingerprint Hash",default) as text)
if(!Adjacent(user))
var/new_fingerprint_hash = tgui_input_text(user, "What fingerprint hash would you like to be written on this card?", "Agent Card Fingerprint Hash", default)
if(!Adjacent(user) || !new_fingerprint_hash)
return
fingerprint_hash = new_fingerprint_hash
to_chat(user, "<span class='notice'>Fingerprint hash changed to [new_fingerprint_hash].</span>")
RebuildHTML()
if("Reset Access")
var/response = alert(user, "Are you sure you want to reset access saved on the card?","Reset Access", "No", "Yes")
var/response = tgui_alert(user, "Are you sure you want to reset access saved on the card?", "Reset Access", list("No", "Yes"))
if(response == "Yes")
access = initial_access.Copy() // Initial() doesn't work on lists
to_chat(user, "<span class='notice'>Card access reset.</span>")
if("Delete Card Information")
var/response = alert(user, "Are you sure you want to delete all information saved on the card?","Delete Card Information", "No", "Yes")
var/response = tgui_alert(user, "Are you sure you want to delete all information saved on the card?", "Delete Card Information", list("No", "Yes"))
if(response == "Yes")
name = initial(name)
registered_name = initial(registered_name)
@@ -305,8 +305,7 @@
S.name = name
S.ckey = theghost.ckey
dust_if_respawnable(theghost)
var/input = stripped_input(S, "What are you named?", null, "", MAX_NAME_LEN)
var/input = tgui_input_text(S, "What are you named?", "Change Name", max_length = MAX_NAME_LEN)
if(src && input)
name = input
S.real_name = input
@@ -14,11 +14,12 @@
/obj/item/picket_sign/attackby(obj/item/W, mob/user, params)
if(is_pen(W) || istype(W, /obj/item/toy/crayon))
var/txt = stripped_input(user, "What would you like to write on the sign?", "Sign Label", null , 30)
if(txt)
label = txt
src.name = "[label] sign"
desc = "It reads: [label]"
var/txt = tgui_input_text(user, "What would you like to write on the sign?", "Sign Label", max_length = 30)
if(!txt)
return
label = txt
src.name = "[label] sign"
desc = "It reads: [label]"
..()
/obj/item/picket_sign/attack_self(mob/living/carbon/human/user)
@@ -65,7 +65,7 @@
/obj/item/storage/backpack/holding/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/storage/backpack/holding))
var/response = alert(user, "This creates a singularity, destroying you and much of the station. Are you SURE?","IMMINENT DEATH!", "No", "Yes")
var/response = tgui_alert(user, "This creates a singularity, destroying you and much of the station. Are you SURE?", "IMMINENT DEATH!", list("No", "Yes"))
if(response == "Yes")
user.visible_message("<span class='warning'>[user] grins as [user.p_they()] begin[user.p_s()] to put a Bag of Holding into a Bag of Holding!</span>", "<span class='warning'>You begin to put the Bag of Holding into the Bag of Holding!</span>")
if(do_after(user, 30, target=src))
@@ -123,7 +123,7 @@
if(isfloorturf(over_object))
if(get_turf(M) != T)
return // Can only empty containers onto the floor under you
if(alert(M, "Empty [src] onto [T]?", "Confirm", "Yes", "No") != "Yes")
if(tgui_alert(M, "Empty [src] onto [T]?", "Confirm", list("Yes", "No")) != "Yes")
return
if(!(M && over_object && length(contents) && loc == M && !M.stat && !M.restrained() && !HAS_TRAIT(M, TRAIT_HANDS_BLOCKED) && get_turf(M) == T))
return // Something happened while the player was thinking
@@ -37,7 +37,7 @@
if(by_hand)
for(var/obj/O in src)
if(O.density)
var/response = alert(usr, "This crate has been packed with bluespace compression, an item inside won't fit back inside. Are you sure you want to open it?","Bluespace Compression Warning", "Yes", "No")
var/response = tgui_alert(usr, "This crate has been packed with bluespace compression, an item inside won't fit back inside. Are you sure you want to open it?", "Bluespace Compression Warning", list("Yes", "No"))
if(response == "No" || !Adjacent(usr))
return FALSE
break
@@ -22,8 +22,7 @@
/obj/structure/ninjatele/attack_hand(mob/user as mob)
if(user.mind.special_role=="Ninja")
switch(alert("Phase Jaunt relay primed, target locked as [station_name()], initiate VOID-shift translocation? (Warning! Internals required!)",,"Yes","No"))
switch(tgui_alert(user, "Phase Jaunt relay primed, target locked as [station_name()], initiate VOID-shift translocation? (Warning! Internals required!)", "Void Shift", list("Yes", "No")))
if("Yes")
if(user.z != src.z)
return
@@ -55,7 +54,7 @@
/obj/structure/respawner/attack_ghost(mob/dead/observer/user)
if(check_rights(R_EVENT))
var/outfit_pick = alert(user, "Do you want to pick an outfit or respawn?", "Pick an Outfit?", "Pick outfit", "Respawn", "Cancel")
var/outfit_pick = tgui_alert(user, "Do you want to pick an outfit or respawn?", "Pick an Outfit?", list("Pick outfit", "Respawn", "Cancel"))
if(outfit_pick == "Cancel")
return
if(outfit_pick == "Pick outfit")
@@ -70,7 +69,7 @@
selected_outfit = new_outfit
return
var/response = alert(user, "Are you sure you want to spawn here?\n(If you do this, you won't be able to be cloned!)", "Respawn?", "Yes", "No")
var/response = tgui_alert(user, "Are you sure you want to spawn here?\n(If you do this, you won't be able to be cloned!)", "Respawn?", list("Yes", "No"))
if(response == "Yes")
var/turf/respawner_location = get_turf(src)
if(!respawner_location) // gotta check it still exists, else you'll get sent to nullspace
+1 -1
View File
@@ -147,7 +147,7 @@ GLOBAL_LIST_EMPTY(safes)
return TRUE
if(drill && !broken)
switch(alert("What would you like to do?", "Thermal Drill", "Turn [drill_timer ? "Off" : "On"]", "Remove Drill", "Cancel"))
switch(tgui_alert(user, "What would you like to do?", "Thermal Drill", list("Turn [drill_timer ? "Off" : "On"]", "Remove Drill", "Cancel")))
if("Turn On")
if(do_after(user, 2 SECONDS, target = src))
drill_timer = addtimer(CALLBACK(src, PROC_REF(drill_open)), time_to_drill, TIMER_STOPPABLE)
+2 -2
View File
@@ -24,7 +24,7 @@
// killing themselves as soon as they're in cuffs
to_chat(src, "<span class='warning'>We refuse to take the coward's way out.</span>")
return
confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
confirm = tgui_alert(src, "Are you sure you want to commit suicide?", "Confirm Suicide", list("Yes", "No"))
if(stat == DEAD || suiciding) //We check again, because alerts sleep until a choice is made
to_chat(src, "You're already dead!")
@@ -32,7 +32,7 @@
if(forced || (confirm == "Yes"))
if(!forced && isAntag(src) && !HAS_TRAIT(src, TRAIT_RESPAWNABLE))
confirm = alert("Are you absolutely sure? If you do this after you got converted/joined as an antagonist, you could face a jobban!", "Confirm Suicide", "Yes", "No")
confirm = tgui_alert(src, "Are you absolutely sure? If you do this after you got converted/joined as an antagonist, you could face a jobban!", "Confirm Suicide", list("Yes", "No"))
if(confirm == "Yes")
suiciding = TRUE
do_suicide()
+1 -1
View File
@@ -6,7 +6,7 @@
to_chat(usr, "<span class='warning'>The current map has no defined webmap. Please file an issue report.</span>")
return
if(alert(usr, "Do you want to open this map's Webmap in your browser?", "Webmap", "Yes", "No") != "Yes")
if(tgui_alert(usr, "Do you want to open this map's Webmap in your browser?", "Webmap", list("Yes", "No")) != "Yes")
return
usr << link(SSmapping.map_datum.webmap_url)
+4 -4
View File
@@ -545,16 +545,16 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list(
if("Big Bomb")
explosion(epicenter, 3, 5, 7, 5)
if("Custom Bomb")
var/devastation_range = input("Devastation range (in tiles):") as null|num
var/devastation_range = tgui_input_number(src, "Devastation range (in tiles):", "Custom Bomb", max_value = 255)
if(devastation_range == null)
return
var/heavy_impact_range = input("Heavy impact range (in tiles):") as null|num
var/heavy_impact_range = tgui_input_number(src, "Heavy impact range (in tiles):", "Custom Bomb", max_value = 255)
if(heavy_impact_range == null)
return
var/light_impact_range = input("Light impact range (in tiles):") as null|num
var/light_impact_range = tgui_input_number(src, "Light impact range (in tiles):", "Custom Bomb", max_value = 255)
if(light_impact_range == null)
return
var/flash_range = input("Flash range (in tiles):") as null|num
var/flash_range = tgui_input_number(src, "Flash range (in tiles):", "Custom Bomb", max_value = 255)
if(flash_range == null)
return
explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, 1, 1)
@@ -12,7 +12,7 @@
category = /datum/changeling_power_category/defence
/datum/action/changeling/headslug/try_to_sting(mob/user, mob/target)
if(alert("Are you sure you wish to do this? This action cannot be undone.",,"Yes","No") == "No")
if(tgui_alert(user, "Are you sure you wish to do this? This action cannot be undone.", "Sting", list("Yes", "No")) == "No")
return
..()
@@ -32,7 +32,7 @@
to_chat(user, "<span class='warning'>We are already regenerating.</span>")
return FALSE
if(!user.stat)//Confirmation for living changelings if they want to fake their death
switch(alert("Are we sure we wish to fake our death?",,"Yes","No"))
switch(tgui_alert(user, "Are we sure we wish to fake our death?", "Fake Death", list("Yes", "No")))
if("No")
return FALSE
// Do the checks again since we had user input
@@ -18,7 +18,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank)
to_chat(user, "<span class='notice'>We feel our consciousness become capable of communion with the hivemind.</span>")
/datum/action/changeling/hivemind_pick/sting_action(mob/user)
var/channel_pick = alert("Upload or Absorb DNA?", "Channel Select", "Upload", "Absorb")
var/channel_pick = tgui_alert(user, "Upload or Absorb DNA?", "Channel Select", list("Upload", "Absorb"))
if(channel_pick == "Upload")
dna_upload(user)
@@ -17,7 +17,7 @@
to_chat(user, "<span class='notice'>We return our vocal glands to their original position.</span>")
return FALSE
var/mimic_voice = stripped_input(user, "Enter a name to mimic.", "Mimic Voice", null, MAX_NAME_LEN)
var/mimic_voice = tgui_input_text(user, "Enter a name to mimic.", "Mimic Voice", max_length = MAX_NAME_LEN)
if(!mimic_voice)
return FALSE
@@ -111,7 +111,7 @@
return T
/obj/effect/proc_holder/spell/vampire/thrall_commune/cast(list/targets, mob/user)
var/input = stripped_input(user, "Enter a message to relay to the other thralls", "Thrall Commune", "")
var/input = tgui_input_text(user, "Enter a message to relay to the other thralls", "Thrall Commune")
if(!input)
revert_cast(user)
return
+2 -2
View File
@@ -189,8 +189,8 @@ th.cost.toomuch {background:maroon;}
if(href_list["buy"])
var/itemID = text2num(href_list["buy"])
var/datum/prize_item/item = GLOB.global_prizes.prizes[itemID]
var/sure = alert(usr,"Are you sure you wish to purchase [item.name] for [item.cost] tickets?","You sure?","Yes","No") in list("Yes","No")
if(sure=="No")
var/sure = tgui_alert(usr,"Are you sure you wish to purchase [item.name] for [item.cost] tickets?", "You sure?", list("Yes","No"))
if(sure == "No")
updateUsrDialog()
return
if(!GLOB.global_prizes.PlaceOrder(src, itemID))
+2 -2
View File
@@ -165,8 +165,8 @@
if(!a_left || !a_right)
to_chat(user, "<span class='warning'>Assembly part missing!</span>")
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"))
if(istype(a_left, a_right.type)) // If they are the same type it causes issues due to window code
switch(tgui_alert(user, "Which side would you like to use?", "Choose", list("Left", "Right")))
if("Left")
a_left.attack_self(user)
if("Right")
@@ -864,14 +864,9 @@
"direction")
var/val = isnum(params["val"]) ? params["val"] : text2num(params["val"])
if(isnull(val))
var/newval = input("Enter new value") as num|null
var/newval = tgui_input_number(usr, "Enter new value", "New Value", ONE_ATMOSPHERE, 1000 + ONE_ATMOSPHERE, 0, round_value = FALSE)
if(isnull(newval))
return
if(params["cmd"] == "set_external_pressure")
if(newval > 1000 + ONE_ATMOSPHERE)
newval = 1000 + ONE_ATMOSPHERE
if(newval < 0)
newval = 0
val = newval
// Figure out what it is
@@ -939,7 +934,7 @@
return
var/datum/tlv/tlv = TLV[env]
var/newval = input("Enter [varname] for [env]", "Alarm triggers", tlv.vars[varname]) as num|null
var/newval = tgui_input_number(usr, "Enter [varname] for [env]", "Alarm triggers", tlv.vars[varname], round_value = FALSE)
if(isnull(newval) || ..()) // No setting if you walked away
return
@@ -987,7 +982,7 @@
var/min_temperature = max(selected.min1, MIN_TEMPERATURE)
var/max_temperature_c = max_temperature - T0C
var/min_temperature_c = min_temperature - T0C
var/input_temperature = input("What temperature would you like the system to maintain? (Capped between [min_temperature_c]C and [max_temperature_c]C)", "Thermostat Controls") as num|null
var/input_temperature = tgui_input_number(usr, "What temperature would you like the system to maintain? (Capped between [min_temperature_c]C and [max_temperature_c]C)", "Thermostat Controls", target_temperature - T0C, max_temperature_c, min_temperature_c)
if(isnull(input_temperature) || ..()) // No temp setting if you walked away
return
input_temperature = input_temperature + T0C
@@ -345,7 +345,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
switch(action)
if("relabel")
if(can_label)
var/T = sanitize(copytext(input("Choose canister label", "Name", name) as text|null, 1, MAX_NAME_LEN))
var/T = tgui_input_text(usr, "Choose canister label", "Name", name, max_length = MAX_NAME_LEN)
if(can_label) //Exploit prevention
if(T)
name = T
@@ -156,7 +156,7 @@
else
has_owner = FALSE
owner = null
var/transfer_choice = alert("Transfer your soul to [src]? (Warning, your old body will die!)",,"Yes","No")
var/transfer_choice = tgui_alert(user, "Transfer your soul to [src]? (Warning, your old body will die!)", "Respawn", list("Yes","No"))
if(transfer_choice != "Yes")
return
if(QDELETED(src) || uses <= 0)
@@ -171,7 +171,7 @@
if(!istype(I, /obj/item/slimepotion/transference))
return ..()
if(iscarbon(user) && can_transfer)
var/human_transfer_choice = alert("Transfer your soul to [src]? (Warning, your old body will die!)", null, "Yes", "No")
var/human_transfer_choice = tgui_alert(user, "Transfer your soul to [src]? (Warning, your old body will die!)", "Respawn", list("Yes", "No"))
if(human_transfer_choice != "Yes")
return
if(QDELETED(src) || uses <= 0 || user.stat >= 1 || QDELETED(I))
+2 -2
View File
@@ -43,7 +43,7 @@
/obj/effect/mob_spawn/attack_ghost(mob/user)
if(!valid_to_spawn(user))
return
var/ghost_role = alert("Become [mob_name]? (Warning, You can no longer be cloned!)",,"Yes","No")
var/ghost_role = tgui_alert(user, "Become [mob_name]? (Warning, You can no longer be cloned!)", "Respawn", list("Yes","No"))
if(ghost_role == "No")
return
if(!species_prompt(user))
@@ -331,7 +331,7 @@
assignedrole = "Space Bar Patron"
/obj/effect/mob_spawn/human/alive/space_bar_patron/attack_hand(mob/user)
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!)", "Leave Bar", list("Yes", "No"))
if(despawn == "No" || !loc || !Adjacent(user))
return
user.visible_message("<span class='notice'>[user.name] climbs back into cryosleep...</span>")
+2 -2
View File
@@ -65,7 +65,7 @@
// If we are here, they just want to change the mode
var/option = alert(usr, "Would you like to change 2FA mode or disable it entirely?", "2FA Mode", "Enable (Always)", "Enable (On IP Change)", "Deactivate")
var/option = tgui_alert(usr, "Would you like to change 2FA mode or disable it entirely?", "2FA Mode", list("Enable (Always)", "Enable (On IP Change)", "Deactivate"))
switch(option)
if("Enable (Always)")
prefs._2fa_status = _2FA_ENABLED_ALWAYS
@@ -76,7 +76,7 @@
prefs.save_preferences(src)
prefs.ShowChoices(usr)
if("Deactivate")
var/confirm = alert(usr, "Are you SURE you want to deactivate 2FA?", "WARNING", "Yes", "No")
var/confirm = tgui_alert(usr, "Are you SURE you want to deactivate 2FA?", "WARNING", list("Yes", "No"))
if(confirm != "Yes")
return
+1 -1
View File
@@ -138,7 +138,7 @@
return // prevents a recursive loop where the ..() 5 lines after this makes the proc endlessly re-call itself
if(href_list["withdraw_consent"])
var/choice = alert(usr, "Are you SURE you want to withdraw your consent to the Terms of Service?\nYou will be instantaneously removed from the server and will have to re-accept the Terms of Service.", "Warning", "Yes", "No")
var/choice = tgui_alert(usr, "Are you SURE you want to withdraw your consent to the Terms of Service?\nYou will be instantaneously removed from the server and will have to re-accept the Terms of Service.", "Warning", list("Yes", "No"))
if(choice == "Yes")
// Update the DB
var/datum/db_query/query = SSdbcore.NewQuery("REPLACE INTO privacy (ckey, datetime, consent) VALUES (:ckey, Now(), 0)", list(
@@ -13,7 +13,7 @@
active_character.SetChoices(user)
if("learnaboutselection")
if(GLOB.configuration.url.wiki_url)
if(alert("Would you like to open the Job selection info in your browser?", "Open Job Selection", "Yes", "No") == "Yes")
if(tgui_alert(user, "Would you like to open the Job selection info in your browser?", "Open Job Selection", list("Yes", "No")) == "Yes")
user << link("[GLOB.configuration.url.wiki_url]/index.php/Job_Selection_and_Assignment")
else
to_chat(user, "<span class='danger'>The Wiki URL is not set in the server configuration.</span>")
@@ -65,7 +65,7 @@
user << browse(null, "window=records")
if(href_list["task"] == "med_record")
var/medmsg = input(usr,"Set your medical notes here.","Medical Records",html_decode(active_character.med_record)) as message
var/medmsg = tgui_input_text(usr, "Set your medical notes here.", "Medical Records", active_character.med_record, multiline = TRUE, encode = FALSE)
if(medmsg != null)
medmsg = copytext(medmsg, 1, MAX_PAPER_MESSAGE_LEN)
@@ -75,7 +75,7 @@
active_character.SetRecords(user)
if(href_list["task"] == "sec_record")
var/secmsg = input(usr,"Set your security notes here.","Security Records",html_decode(active_character.sec_record)) as message
var/secmsg = tgui_input_text(usr, "Set your security notes here.", "Security Records", active_character.sec_record, multiline = TRUE, encode = FALSE)
if(secmsg != null)
secmsg = copytext(secmsg, 1, MAX_PAPER_MESSAGE_LEN)
@@ -85,7 +85,7 @@
active_character.SetRecords(user)
if(href_list["task"] == "gen_record")
var/genmsg = input(usr,"Set your employment notes here.","Employment Records",html_decode(active_character.gen_record)) as message
var/genmsg = tgui_input_text(usr, "Set your employment notes here.", "Employment Records", active_character.gen_record, multiline = TRUE, encode = FALSE)
if(genmsg != null)
genmsg = copytext(genmsg, 1, MAX_PAPER_MESSAGE_LEN)
@@ -212,9 +212,10 @@
to_chat(user, "<font color='red'>Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .</font>")
if("age")
var/new_age = input(user, "Choose your character's age:\n([S.min_age]-[S.max_age])", "Character Preference") as num|null
if(new_age)
active_character.age = max(min(round(text2num(new_age)), S.max_age), S.min_age)
var/new_age = tgui_input_number(user, "Choose your character's age:\n([S.min_age]-[S.max_age])", "Character Preference", active_character.age, S.max_age, S.min_age)
if(!new_age)
return
active_character.age = max(min(round(text2num(new_age)), S.max_age), S.min_age)
if("species")
var/list/new_species = list()
var/prev_species = active_character.species
@@ -326,9 +327,10 @@
active_character.autohiss_mode = autohiss_choice[new_autohiss_pref]
if("metadata")
var/new_metadata = input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , active_character.metadata) as message|null
if(new_metadata)
active_character.metadata = sanitize(copytext(new_metadata,1,MAX_MESSAGE_LEN))
var/new_metadata = tgui_input_text(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference", active_character.metadata, multiline = TRUE, encode = FALSE)
if(!new_metadata)
return
active_character.metadata = new_metadata
if("b_type")
var/new_b_type = tgui_input_list(user, "Choose your character's blood-type", "Character Preference", list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-"))
@@ -388,11 +390,12 @@
if("h_grad_offset")
var/result = input(user, "Enter your character's hair gradient offset as a comma-separated value (x,y). Example:\n0,0 (no offset)\n5,0 (5 pixels to the right)", "Character Preference") as null|text
if(result)
var/list/expl = splittext(result, ",")
if(length(expl) == 2)
active_character.h_grad_offset_x = clamp(text2num(expl[1]) || 0, -16, 16)
active_character.h_grad_offset_y = clamp(text2num(expl[2]) || 0, -16, 16)
if(!result)
return
var/list/expl = splittext(result, ",")
if(length(expl) == 2)
active_character.h_grad_offset_x = clamp(text2num(expl[1]) || 0, -16, 16)
active_character.h_grad_offset_y = clamp(text2num(expl[2]) || 0, -16, 16)
if("h_grad_colour")
var/result = input(user, "Choose your character's hair gradient colour:", "Character Preference", active_character.h_grad_colour) as color|null
@@ -400,9 +403,10 @@
active_character.h_grad_colour = result
if("h_grad_alpha")
var/result = input(user, "Choose your character's hair gradient alpha (0-255):", "Character Preference", active_character.h_grad_alpha) as num|null
if(!isnull(result))
active_character.h_grad_alpha = clamp(result, 0, 255)
var/result = tgui_input_number(user, "Choose your character's hair gradient alpha (0-255):", "Character Preference", active_character.h_grad_alpha, 255)
if(isnull(result))
return
active_character.h_grad_alpha = clamp(result, 0, 255)
if("headaccessory")
if(S.bodyflags & HAS_HEAD_ACCESSORY) //Species with head accessories.
@@ -667,14 +671,16 @@
if("s_tone")
if(S.bodyflags & HAS_SKIN_TONE)
var/new_s_tone = input(user, "Choose your character's skin-tone:\n(Light 1 - 220 Dark)", "Character Preference") as num|null
if(new_s_tone)
active_character.s_tone = 35 - max(min(round(new_s_tone), 220), 1)
if(!new_s_tone)
return
active_character.s_tone = 35 - max(min(round(new_s_tone), 220), 1)
else if(S.bodyflags & HAS_ICON_SKIN_TONE)
var/const/MAX_LINE_ENTRIES = 4
var/prompt = "Choose your character's skin tone: 1-[length(S.icon_skin_tones)]\n(Light to Dark)"
var/skin_c = input(user, prompt, "Character Preference") as num|null
if(isnum(skin_c))
active_character.s_tone = max(min(round(skin_c), S.icon_skin_tones.len), 1)
var/skin_c = tgui_input_number(user, prompt, "Character Preference", active_character.s_tone, length(S.icon_skin_tones), 1)
if(!skin_c)
return
active_character.s_tone = skin_c
if("skin")
if((S.bodyflags & HAS_SKIN_COLOR) || GLOB.body_accessory_by_species[active_character.species] || check_rights(R_ADMIN, 0, user))
@@ -708,7 +714,7 @@
active_character.height = new_height
if("flavor_text")
var/msg = input(usr,"Set the flavor text in your 'examine' verb. The flavor text should be a physical descriptor of your character at a glance. SFW Drawn Art of your character is acceptable.","Flavor Text",html_decode(active_character.flavor_text)) as message
var/msg = tgui_input_text(usr, "Set the flavor text in your 'examine' verb. The flavor text should be a physical descriptor of your character at a glance. SFW Drawn Art of your character is acceptable.", "Flavor Text", active_character.flavor_text, multiline = TRUE, encode = FALSE)
if(msg != null)
msg = copytext(msg, 1, MAX_MESSAGE_LEN)
@@ -875,7 +881,7 @@
version_message = "\nYou need to be using byond version 511 or later to take advantage of this feature, your version of [user.client.byond_version] is too low"
if(world.byond_version < 511)
version_message += "\nThis server does not currently support client side fps. You can set now for when it does."
var/desiredfps = input(user, "Choose your desired fps.[version_message]\n(0 = synced with server tick rate (currently:[world.fps]))", "Character Preference", clientfps) as null|num
var/desiredfps = tgui_input_number(user, "Choose your desired fps.[version_message]\n(Min = synced with server tick rate)", "Character Preference", clientfps, 120, world.fps)
if(!isnull(desiredfps))
clientfps = desiredfps
if(world.byond_version >= 511 && user.client && user.client.byond_version >= 511)
@@ -943,8 +949,14 @@
if("tgui")
toggles2 ^= PREFTOGGLE_2_FANCYUI
if("input_lists")
toggles2 ^= PREFTOGGLE_2_DISABLE_TGUI_LISTS
if("tgui_input")
toggles2 ^= PREFTOGGLE_2_DISABLE_TGUI_INPUT
if("tgui_input_large")
toggles2 ^= PREFTOGGLE_2_LARGE_INPUT_BUTTONS
if("tgui_input_swap")
toggles2 ^= PREFTOGGLE_2_SWAP_INPUT_BUTTONS
if("tgui_say_light_mode")
toggles2 ^= PREFTOGGLE_2_ENABLE_TGUI_SAY_LIGHT_MODE
@@ -1000,8 +1012,8 @@
H.remake_hud()
if("UIalpha")
var/UI_style_alpha_new = input(user, "Select a new alpha(transparence) parameter for UI, between 50 and 255", UI_style_alpha) as num
if(!UI_style_alpha_new || !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50))
var/UI_style_alpha_new = tgui_input_number(user, "Select a new alpha(transparence) parameter for UI, between 50 and 255", "UI Alpha", UI_style_alpha, 255, 50)
if(!UI_style_alpha_new)
return
UI_style_alpha = UI_style_alpha_new
@@ -1115,9 +1127,10 @@
parent.mob?.hud_used?.update_parallax_pref()
if("screentip_mode")
var/desired_screentip_mode = clamp(input(user, "Pick a screentip size, pick 0 to disable screentips. (We suggest a number between 8 and 15):", "Screentip Size") as null|num, 0, 20)
if(!isnull(desired_screentip_mode))
screentip_mode = desired_screentip_mode
var/desired_screentip_mode = tgui_input_number(user, "Pick a screentip size, pick 0 to disable screentips. (We suggest a number between 8 and 15):", "Screentip Size", screentip_mode, 20, 0)
if(!desired_screentip_mode)
return
screentip_mode = desired_screentip_mode
if("screentip_color")
var/screentip_color_new = input(user, "Choose your screentip color", screentip_color) as color|null
@@ -1235,7 +1248,7 @@
keybindings_overrides -= KB.name
else if(href_list["all"])
var/yes = alert(user, "Really [href_list["all"]] all key bindings?", "Confirm", "Yes", "No") == "Yes"
var/yes = tgui_alert(user, "Really [href_list["all"]] all key bindings?", "Confirm", list("Yes", "No")) == "Yes"
if(yes)
switch(href_list["all"])
if("reset")
@@ -1249,7 +1262,7 @@
var/datum/keybinding/custom/custom_emote_keybind = locateUID(href_list["custom_emote_set"])
if(custom_emote_keybind)
var/emote_text = active_character.custom_emotes[custom_emote_keybind.name]
var/desired_emote = stripped_input(user, "Enter your custom emote text, 128 character limit.", "Custom Emote Setter", emote_text, max_length = 128)
var/desired_emote = tgui_input_text(user, "Enter your custom emote text, 128 character limit.", "Custom Emote Setter", emote_text, max_length = 128)
if(desired_emote && (desired_emote != custom_emote_keybind.default_emote_text)) //don't let them save the default custom emote text
active_character.custom_emotes[custom_emote_keybind.name] = desired_emote
active_character.save(user)
@@ -446,7 +446,9 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
dat += " - <b>UI Style:</b> <a href='?_src_=prefs;preference=ui'><b>[UI_style]</b></a><br>"
dat += "<b>TGUI settings:</b><br>"
dat += "<b> - Fancy TGUI:</b> <a href='?_src_=prefs;preference=tgui'>[(toggles2 & PREFTOGGLE_2_FANCYUI) ? "Yes" : "No"]</a><br>"
dat += "<b> - Input Lists:</b> <a href='?_src_=prefs;preference=input_lists'>[(toggles2 & PREFTOGGLE_2_DISABLE_TGUI_LISTS) ? "Default" : "TGUI"]</a><br>"
dat += "<b> - TGUI Input:</b> <a href='?_src_=prefs;preference=tgui_input'>[(toggles2 & PREFTOGGLE_2_DISABLE_TGUI_INPUT) ? "No" : "Yes"]</a><br>"
dat += "<b> - TGUI Input - Large Buttons:</b> <a href='?_src_=prefs;preference=tgui_input_large'>[(toggles2 & PREFTOGGLE_2_LARGE_INPUT_BUTTONS) ? "Yes" : "No"]</a><br>"
dat += "<b> - TGUI Input - Swap Buttons:</b> <a href='?_src_=prefs;preference=tgui_input_swap'>[(toggles2 & PREFTOGGLE_2_SWAP_INPUT_BUTTONS) ? "Yes" : "No"]</a><br>"
dat += "<b> - TGUI Say Theme:</b> <a href='?_src_=prefs;preference=tgui_say_light_mode'>[(toggles2 & PREFTOGGLE_2_ENABLE_TGUI_SAY_LIGHT_MODE) ? "Light" : "Dark"]</a><br>"
dat += "</td></tr></table>"
@@ -227,12 +227,12 @@
SSblackbox.record_feedback("tally", "toggle_verbs", 1, "Toggle Instruments") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/toggle_input()
set name = "Toggle TGUI Input Lists"
set name = "Toggle TGUI Input"
set category = "Preferences"
set desc = "Switches input lists between the TGUI and the standard one"
prefs.toggles2 ^= PREFTOGGLE_2_DISABLE_TGUI_LISTS
set desc = "Switches inputs between the TGUI and the standard one"
prefs.toggles2 ^= PREFTOGGLE_2_DISABLE_TGUI_INPUT
prefs.save_preferences(src)
to_chat(src, "You will [(prefs.toggles2 & PREFTOGGLE_2_DISABLE_TGUI_LISTS) ? "no longer" : "now"] use TGUI Input Lists.")
to_chat(src, "You will [(prefs.toggles2 & PREFTOGGLE_2_DISABLE_TGUI_INPUT) ? "no longer" : "now"] use TGUI Inputs.")
/client/verb/Toggle_disco() //to toggle off the disco machine locally, in case it gets too annoying
set name = "Hear/Silence Dance Machine"
@@ -68,7 +68,7 @@
/obj/item/clothing/gloves/color/black/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/wirecutters))
if(can_be_cut && icon_state == initial(icon_state))//only if not dyed
var/confirm = alert("Do you want to cut off the gloves fingertips? Warning: It might destroy their functionality.","Cut tips?","Yes","No")
var/confirm = tgui_alert(user, "Do you want to cut off the gloves fingertips? Warning: It might destroy their functionality.", "Cut tips?", list("Yes","No"))
if(get_dist(user, src) > 1)
to_chat(user, "You have moved too far away.")
return
+1 -1
View File
@@ -17,7 +17,7 @@
actions_types = list(/datum/action/item_action/print_forensic_report, /datum/action/item_action/clear_records)
/obj/item/detective_scanner/attack_self(mob/user)
var/search = input(user, "Enter name, fingerprint or blood DNA.", "Find record", "")
var/search = tgui_input_text(user, "Enter name, fingerprint or blood DNA.", "Find record")
if(!search || user.stat || user.incapacitated())
return
@@ -93,14 +93,12 @@
switch(action)
if("change_code")
var/attempt_code = input("Re-enter the current EFTPOS access code", "Confirm old EFTPOS code") as num
var/attempt_code = tgui_input_number(user, "Re-enter the current EFTPOS access code:", "Confirm old EFTPOS code", max_value = 9999, min_value = 1000)
if(attempt_code == access_code)
var/trycode = input("Enter a new access code for this device (4 digits, numbers only)", "Enter new EFTPOS code") as num
if(trycode < 1000 || trycode > 9999)
alert("That is not a valid code!")
var/trycode = tgui_input_number(user, "Enter a new access code for this device:", "Enter new EFTPOS code", max_value = 9999, min_value = 1000)
if(!trycode)
return
access_code = trycode
print_reference()
else
to_chat(user, "[bicon(src)]<span class='warning'>Incorrect code entered.</span>")
@@ -108,9 +106,11 @@
if(!account_database)
reconnect_database()
if(account_database)
var/attempt_account_num = input("Enter account number to pay EFTPOS charges into", "New account number") as num
var/attempt_pin = input("Enter pin code", "Account pin") as num
if(!check_user_position(user) || !account_database)
var/attempt_account_num = tgui_input_number(user, "Enter account number to pay EFTPOS charges into:", "New account number", max_value = 9999999, min_value = 1000000)
if(!attempt_account_num)
return
var/attempt_pin = tgui_input_number(user, "Enter pin code", "Account pin", max_value = 99999, min_value = 10000)
if(!check_user_position(user) || !account_database || !attempt_pin)
return
var/datum/money_account/target_account = GLOB.station_money_database.find_user_account(attempt_account_num, include_departments = TRUE)
if(!target_account)
@@ -122,6 +122,7 @@
linked_account = target_account
else
to_chat(user, "[bicon(src)]<span class='warning'>Unable to connect to inputed account.</span>")
return
else
to_chat(user, "[bicon(src)]<span class='warning'>Unable to connect to accounts database.</span>")
return
@@ -133,25 +134,18 @@
linked_account = target_account
to_chat(user, "[bicon(src)]<span class='warning'>Linked account successfully set to [target_account.account_name]</span>")
if("trans_purpose")
var/purpose = clean_input("Enter reason for EFTPOS transaction", "Transaction purpose", transaction_purpose)
if(!check_user_position(user))
var/purpose = tgui_input_text(user, "Enter reason for EFTPOS transaction", "Transaction purpose", transaction_purpose, encode = FALSE)
if(!check_user_position(user) || !purpose)
return
if(purpose)
transaction_purpose = purpose
transaction_purpose = purpose
if("trans_value")
var/try_num = input("Enter amount for EFTPOS transaction", "Transaction amount", transaction_amount) as num
if(!check_user_position(user))
return
if(try_num < 0)
alert("That is not a valid amount!")
return
if(try_num > MAX_EFTPOS_CHARGE)
alert("You cannot charge more than [MAX_EFTPOS_CHARGE] per transaction!")
var/try_num = tgui_input_number(user, "Enter amount for EFTPOS transaction", "Transaction amount", transaction_amount, MAX_EFTPOS_CHARGE)
if(!check_user_position(user) || !try_num)
return
transaction_amount = try_num
if("toggle_lock")
if(transaction_locked)
var/attempt_code = input("Enter EFTPOS access code", "Reset Transaction") as num
var/attempt_code = tgui_input_number(user, "Enter EFTPOS access code", "Reset Transaction", max_value = 9999, min_value = 1000)
if(!check_user_position(user))
return
if(attempt_code == access_code)
@@ -191,14 +185,14 @@
//if security level high enough, prompt for pin
var/attempt_pin
if(D.security_level != ACCOUNT_SECURITY_ID)
attempt_pin = input("Enter pin code", "EFTPOS transaction") as num
attempt_pin = tgui_input_number(user, "Enter pin code", "EFTPOS transaction", max_value = 9999, min_value = 1000)
if(!attempt_pin || !Adjacent(user))
return
//given the credentials, can the associated account be accessed right now?
if(!GLOB.station_money_database.try_authenticate_login(D, attempt_pin, restricted_bypass = FALSE))
to_chat(user, "[bicon(src)]<span class='warning'>Unable to access account, insufficient access.</span>")
return
if(alert("Are you sure you want to pay $[transaction_amount] to: [linked_account.account_name] ", "Confirm transaction", "Yes", "No") != "Yes")
if(tgui_alert(user, "Are you sure you want to pay $[transaction_amount] to: [linked_account.account_name]", "Confirm transaction", list("Yes", "No")) != "Yes")
return
if(!Adjacent(user))
return
+1 -1
View File
@@ -231,7 +231,7 @@
flick("blobbernaut_death", src)
/mob/living/simple_animal/hostile/blob/blobbernaut/proc/blob_talk()
var/message = input(src, "Announce to the overmind", "Blob Telepathy")
var/message = tgui_input_text(usr, "Announce to the overmind", "Blob Telepathy")
var/rendered
var/follow_text
if(message)
@@ -372,7 +372,9 @@
if(is_pen(I))
if(open)
return
var/t = clean_input("Enter what you want to set the tag to:", "Write", null)
var/t = tgui_input_text(usr, "Enter what you want to set the tag to:", "Write")
if(!t)
return
var/obj/item/pizzabox/boxtotagto = src
if(boxes.len > 0)
boxtotagto = boxes[boxes.len]
@@ -458,14 +460,16 @@
desc = "It seems inactive."
icon_state = "pizzabox_bomb"
timer_set = TRUE
timer = (input(user, "Set a timer, from one second to ten seconds.", "Timer", "[timer]") as num) SECONDS
var/new_timer = tgui_input_number(user, "Set a timer, from one second to ten seconds.", "Timer", timer / 10, 10, 1)
if(!new_timer)
return
if(!in_range(src, user) || issilicon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || user.restrained())
timer_set = FALSE
name = "pizza box"
desc = "A box suited for pizzas."
icon_state = "pizzabox1"
return
timer = clamp(timer, 1 SECONDS, 10 SECONDS)
timer = new_timer SECONDS
icon_state = "pizzabox1"
to_chat(user, "<span class='notice'>You set the timer to [timer / 10] before activating the payload and closing [src].")
message_admins("[key_name_admin(usr)] has set a timer on a pizza bomb to [timer/10] seconds at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[loc.x];Y=[loc.y];Z=[loc.z]'>(JMP)</a>.")
+4 -5
View File
@@ -66,7 +66,7 @@
return
if(length(H.cards) > 1)
var/confirm = alert("Are you sure you want to put your [length(H.cards)] cards back into the deck?", "Return Hand", "Yes", "No")
var/confirm = tgui_alert(user, "Are you sure you want to put your [length(H.cards)] cards back into the deck?", "Return Hand", list("Yes", "No"))
if(confirm == "No" || !Adjacent(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
return
for(var/datum/playingcard/P in H.cards)
@@ -191,9 +191,8 @@
for(var/mob/living/player in viewers(3))
if(!player.incapacitated())
players += player
var/maxcards = clamp(length(cards), 1, 10)
var/dcard = input("How many card(s) do you wish to deal? You may deal up to [maxcards] cards.") as num
if(dcard > maxcards)
var/dcard = tgui_input_number(usr, "How many card(s) do you wish to deal? You may deal up to [length(cards)] cards.", "Deal Cards", max_value = length(cards))
if(!dcard)
return
var/mob/living/M = tgui_input_list(usr, "Who do you wish to deal [dcard] card(s)?", "Deal Card", players)
if(!usr || !src || !M || !Adjacent(usr))
@@ -453,7 +452,7 @@
var/mob/living/carbon/user = usr
var/maxcards = min(length(cards), 5)
var/discards = input("How many cards do you want to discard? You may discard up to [maxcards] card(s)") as num
var/discards = tgui_input_number(usr, "How many cards do you want to discard? You may discard up to [maxcards] card(s)", "Discard Cards", max_value = maxcards)
if(discards > maxcards)
return
for(var/i in 1 to discards)
+1 -1
View File
@@ -327,7 +327,7 @@
/obj/item/seeds/proc/variant_prompt(mob/user, obj/item/container = null)
var/prev = variant
var/V = input(user, "Choose variant name:", "Plant Variant Naming", variant) as text|null
var/V = tgui_input_text(user, "Choose variant name:", "Plant Variant Naming", variant, encode = FALSE)
if(isnull(V)) // Did the user cancel?
return
if(container && (loc != container)) // Was the seed removed from the container, if there is a container?
+5 -14
View File
@@ -63,16 +63,9 @@
name = ""
if("import")
var/t = ""
do
t = html_encode(input(usr, "Please paste the entire song, formatted:", "[name]", t) as message)
if(!in_range(parent, usr))
return
if(length_char(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS)
var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no")
if(cont == "no")
break
while(length_char(t) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS)
t = tgui_input_text(usr, "Please paste the entire song, formatted:", parent.name, max_length = (MUSIC_MAXLINECHARS * MUSIC_MAXLINES), multiline = TRUE)
if(!in_range(parent, usr))
return
parse_song(t)
return FALSE
if("help")
@@ -88,11 +81,9 @@
if("play")
INVOKE_ASYNC(src, PROC_REF(start_playing), usr)
if("newline")
var/newline = html_encode(input("Enter your line: ", parent.name) as text|null)
var/newline = tgui_input_text(usr, "Enter your line:", parent.name, max_length = MUSIC_MAXLINECHARS)
if(!newline || !in_range(parent, usr))
return
if(length(lines) > MUSIC_MAXLINES)
return
if(length(newline) > MUSIC_MAXLINECHARS)
newline = copytext(newline, 1, MUSIC_MAXLINECHARS)
lines.Add(newline)
@@ -103,7 +94,7 @@
lines.Cut(num, num + 1)
if("modifyline")
var/num = round(text2num(params["line"]))
var/content = stripped_input(usr, "Enter your line: ", parent.name, lines[num], MUSIC_MAXLINECHARS)
var/content = tgui_input_text(usr, "Enter your line:", parent.name, lines[num], max_length = MUSIC_MAXLINECHARS)
if(!content || !in_range(parent, usr))
return
if(num > length(lines) || num < 1)
+5 -5
View File
@@ -213,7 +213,7 @@
var/choice = tgui_input_list(user, "What would you like to edit?", "Book Edit", list("Title", "Edit Current Page", "Author", "Summary", "Add Page", "Remove Page"))
switch(choice)
if("Title")
var/newtitle = reject_bad_text(stripped_input(user, "Write a new title:"))
var/newtitle = reject_bad_text(tgui_input_text(user, "Write a new title:", "Title", title))
if(!newtitle)
to_chat(user, "<span class='notice'>You change your mind.</span>")
return
@@ -222,13 +222,13 @@
name = "Book: " + newtitle
title = newtitle
if("Author")
var/newauthor = stripped_input(user, "Write the author's name:")
var/newauthor = tgui_input_text(user, "Write the author's name:", "Author", author, MAX_NAME_LEN)
if(!newauthor)
to_chat(user, "<span class='notice'>You change your mind.</span>")
return
author = newauthor
if("Summary")
var/newsummary = strip_html(input(user, "Write the new summary:") as message|null, MAX_SUMMARY_LEN)
var/newsummary = tgui_input_text(user, "Write the new summary:", "Summary", summary, MAX_SUMMARY_LEN, multiline = TRUE)
if(!newsummary)
to_chat(user, "<span class='notice'>You change your mind.</span>")
return
@@ -244,7 +244,7 @@
if(character_space_remaining <= 0)
to_chat(user, "<span class='notice'>There's not enough space left on this page to write anything!</span>")
return
var/content = strip_html(input(user, "Add Text to this page, you have [character_space_remaining] characters of space left:") as message|null, MAX_CHARACTERS_PER_BOOKPAGE)
var/content = tgui_input_text(user, "Add Text to this page, you have [character_space_remaining] characters of space left:", "Edit Current Page", max_length = MAX_CHARACTERS_PER_BOOKPAGE, multiline = TRUE)
if(!content)
to_chat(user, "<span class='notice'>You change your mind.</span>")
return
@@ -267,7 +267,7 @@
if(!length(pages))
to_chat(user, "<span class='notice'>There aren't any pages in this book!</span>")
return
var/page_choice = input(user, "There are [length(pages)] pages, which page number would you like to remove?", "Input Page Number", null) as num|null
var/page_choice = tgui_input_number(user, "There are [length(pages)] pages, which page number would you like to remove?", "Input Page Number", max_value = length(pages))
if(!page_choice)
to_chat(user, "<span class='notice'>You change your mind.</span>")
return
+2 -2
View File
@@ -111,7 +111,7 @@
if("specify_ssid_delete")
if(!answer || !text2num(answer))
return
var/confirm = alert("You are about to delete book [text2num(answer)]", "Confirm Deletion", "Yes", "No")
var/confirm = tgui_alert(usr, "You are about to delete book [text2num(answer)]", "Confirm Deletion", list("Yes", "No"))
if(confirm != "Yes")
return //we don't need to sanitize b/c removeBookyByID uses id=:id instead of like statemetns
if(GLOB.library_catalog.remove_book_by_id(text2num(answer)))
@@ -140,7 +140,7 @@
return
var/sanitized_answer = paranoid_sanitize(answer) //the last thing we want happening is someone deleting every book with "%%"
var/confirm //We want to be absolutely certain an admin wants to do this
confirm = alert("You are about to mass delete potentially up to 10 books", "Confirm Deletion", "Yes", "No")
confirm = tgui_alert(usr, "You are about to mass delete potentially up to 10 books", "Confirm Deletion", list("Yes", "No"))
if(confirm != "Yes")
return
if(GLOB.library_catalog.remove_books_by_ckey(sanitized_answer))
+2 -2
View File
@@ -411,9 +411,9 @@
if(BARCODE_MODE_CHECKOUT)
var/confirm
if(!computer.user_data.patron_account)
confirm = alert("Warning: patron does not have an associated account number! Are you sure you want to checkout [B] to [computer.user_data.patron_name]?", "Confirm Checkout", "Yes", "No")
confirm = tgui_alert(user, "Warning: patron does not have an associated account number! Are you sure you want to checkout [B] to [computer.user_data.patron_name]?", "Confirm Checkout", list("Yes", "No"))
else
confirm = alert("Are you sure you want to checkout [B] to [computer.user_data.patron_name]?", "Confirm Checkout", "Yes", "No")
confirm = tgui_alert(user, "Are you sure you want to checkout [B] to [computer.user_data.patron_name]?", "Confirm Checkout", list("Yes", "No"))
if(confirm == "No")
return
@@ -224,7 +224,7 @@
if(!user.check_ahud_rejoin_eligibility())
to_chat(user, "<span class='warning'>Upon using the antagHUD you forfeited the ability to join the round.</span>")
return
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!)", "Respawn", list("Yes","No"))
if(be_helper == "No")
return
if(!loc || QDELETED(src) || QDELETED(user))
@@ -229,7 +229,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(warningmsg)
var/response
var/alertmsg = "Are you -sure- you want to ghost?\n([warningmsg]. If you ghost now, you probably won't be able to rejoin the round! You can't change your mind, so choose wisely!)"
response = alert(src, alertmsg,"Are you sure you want to ghost?","Stay in body","Ghost")
response = tgui_alert(src, alertmsg, "Ghost", list("Stay in body", "Ghost"))
if(response != "Ghost")
return
@@ -398,7 +398,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
to_chat(src, "<span class='warning'>Your body is still alive!</span>")
return
var/choice = alert(src, "If you enable this, your body will be unrevivable for the remainder of the round.", "Are you sure?", "Yes", "No")
var/choice = tgui_alert(src, "If you enable this, your body will be unrevivable for the remainder of the round.", "Do Not Revive!", list("Yes", "No"))
if(choice == "Yes")
to_chat(src, "<span class='boldnotice'>Do Not Revive state enabled.</span>")
create_log(MISC_LOG, "DNR Enabled")
@@ -764,7 +764,7 @@
if(href_list["secrecordadd"])
if(usr.incapacitated() || !hasHUD(usr, EXAMINE_HUD_SECURITY_WRITE))
return
var/raw_input = input("Add Comment:", "Security records", null, null) as message
var/raw_input = tgui_input_text(usr, "Add Comment:", "Security records", multiline = TRUE, encode = FALSE)
var/sanitized = copytext(trim(sanitize(raw_input)), 1, MAX_MESSAGE_LEN)
if(!sanitized || usr.stat || usr.restrained() || !hasHUD(usr, EXAMINE_HUD_SECURITY_WRITE))
return
@@ -865,7 +865,7 @@
if(href_list["medrecordadd"])
if(usr.incapacitated() || !hasHUD(usr, EXAMINE_HUD_MEDICAL_WRITE))
return
var/raw_input = input("Add Comment:", "Medical records", null, null) as message
var/raw_input = tgui_input_text(usr, "Add Comment:", "Medical records", multiline = TRUE, encode = FALSE)
var/sanitized = copytext(trim(sanitize(raw_input)), 1, MAX_MESSAGE_LEN)
if(!sanitized || usr.stat || usr.restrained() || !hasHUD(usr, EXAMINE_HUD_MEDICAL_WRITE))
return
@@ -1505,7 +1505,7 @@
var/max_length = bloody_hands * 30 //tweeter style
var/message = stripped_input(src,"Write a message. It cannot be longer than [max_length] characters.","Blood writing", "")
var/message = tgui_input_text(src, "Write a message. It cannot be longer than [max_length] characters.", "Blood writing", max_length = max_length)
if(origin != loc)
to_chat(src, "<span class='notice'>Stay still while writing!</span>")
return
@@ -2145,7 +2145,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
if(stat)
return
pose = sanitize(copytext(input(usr, "This is [src]. [p_they(TRUE)]...", "Pose", null) as text, 1, MAX_MESSAGE_LEN))
pose = tgui_input_text(usr, "This is [src]. [p_they(TRUE)]...", "Pose")
/mob/living/carbon/human/verb/set_flavor()
set name = "Set Flavour Text"
+1 -1
View File
@@ -295,7 +295,7 @@
to_chat(src, "<span class='warning'>You are unable to succumb to death! This life continues!</span>")
return
var/last_words = input(src, "Do you have any last words?", "Goodnight, Sweet Prince") as text|null
var/last_words = tgui_input_text(src, "Do you have any last words?", "Goodnight, Sweet Prince", encode = FALSE)
if(stat == DEAD)
// cancel em out if they died while they had the message box up
+2 -2
View File
@@ -416,9 +416,9 @@
to_chat(user, "<span class='boldwarning'>You cannot send IC messages (muted).</span>")
return FALSE
else if(!params)
custom_emote = copytext(sanitize(input("Choose an emote to display.") as text|null), 1, MAX_MESSAGE_LEN)
custom_emote = tgui_input_text(user, "Choose an emote to display.", "Custom Emote")
if(custom_emote && !check_invalid(user, custom_emote))
var/type = input("Is this a visible or hearable emote?") as null|anything in list("Visible", "Hearable")
var/type = tgui_alert(user, "Is this a visible or hearable emote?", "Custom Emote", list("Visible", "Hearable"))
switch(type)
if("Visible")
custom_emote_type = EMOTE_VISIBLE
+10 -11
View File
@@ -571,7 +571,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
to_chat(src, "<span class='warning'>Please allow one minute to pass between announcements.</span>")
return
var/input = input(usr, "Please write a message to announce to the station crew.", "A.I. Announcement") as message|null
var/input = tgui_input_text(usr, "Please write a message to announce to the station crew.", "A.I. Announcement", multiline = TRUE, encode = FALSE)
if(!input)
return
@@ -588,7 +588,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(check_unable(AI_CHECK_WIRELESS))
return
var/input = input("Please enter the reason for calling the shuttle.", "Shuttle Call Reason.") as null|message
var/input = tgui_input_text(src, "Please enter the reason for calling the shuttle.", "Shuttle Call Reason", multiline = TRUE, encode = FALSE)
if(!input || stat)
return
@@ -606,7 +606,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(check_unable(AI_CHECK_WIRELESS))
return
var/confirm = alert("Are you sure you want to recall the shuttle?", "Confirm Shuttle Recall", "Yes", "No")
var/confirm = tgui_alert(src, "Are you sure you want to recall the shuttle?", "Confirm Shuttle Recall", list("Yes", "No"))
if(check_unable(AI_CHECK_WIRELESS))
return
@@ -1007,7 +1007,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
custom_hologram = TRUE
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(usr, "Would you like to select a hologram based on a crew member, an animal, or switch to a unique avatar?", "Change Hologram", list("Crew Member", "Unique", "Animal")))
if("Crew Member")
var/personnel_list[] = list()
@@ -1234,13 +1234,12 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
set desc = "Change the message that's transmitted when a new crew member arrives on station."
set category = "AI Commands"
var/newmsg = clean_input("What would you like the arrival message to be? List of options: $name, $rank, $species, $gender, $age", "Change Arrival Message", arrivalmsg)
if(!newmsg)
var/newmsg = tgui_input_text(usr, "What would you like the arrival message to be? List of options: $name, $rank, $species, $gender, $age", "Change Arrival Message", arrivalmsg, encode = FALSE)
if(!newmsg || newmsg == arrivalmsg)
return
newmsg = html_decode(newmsg) // This feels a bit redundant, but sanitisation is (probably) important.
if(newmsg != arrivalmsg)
arrivalmsg = newmsg
to_chat(usr, "The arrival message has been successfully changed.")
arrivalmsg = newmsg
to_chat(usr, "The arrival message has been successfully changed.")
// Handled camera lighting, when toggled.
// It will get the nearest camera from the eyeobj, lighting it.
@@ -1444,7 +1443,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
A = D
if(istype(A))
switch(alert(src, "Do you want to open \the [A] for [target]?", "Doorknob_v2a.exe", "Yes", "No"))
switch(tgui_alert(src, "Do you want to open \the [A] for [target]?", "Doorknob_v2a.exe", list("Yes", "No")))
if("Yes")
if(!A.density)
to_chat(src, "<span class='notice'>[A] was already opened.</span>")
+1 -1
View File
@@ -109,7 +109,7 @@ GLOBAL_VAR_INIT(announcing_vox, 0) // Stores the time of the last announcement
to_chat(src, "<span class='warning'>Please wait [round((GLOB.announcing_vox - world.time) / 10)] seconds.</span>")
return
var/message = clean_input("WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", last_announcement, src)
var/message = tgui_input_text(src, "WARNING: Misuse of this verb can result in you being job banned. More help is available in 'Announcement Help'", "Announcement", last_announcement)
last_announcement = message
@@ -6,8 +6,7 @@ GLOBAL_LIST_EMPTY(empty_playable_ai_cores)
set desc = "Wipe your core. This is functionally equivalent to cryo or robotic storage, freeing up your job slot."
// Guard against misclicks, this isn't the sort of thing we want happening accidentally
if(alert("WARNING: This will immediately wipe your core and ghost you, removing your character from the round permanently (similar to cryo and robotic storage). Are you entirely sure you want to do this?",
"Wipe Core", "No", "No", "Yes") != "Yes")
if(tgui_alert(usr, "WARNING: This will immediately wipe your core and ghost you, removing your character from the round permanently (similar to cryo and robotic storage). Are you entirely sure you want to do this?", "Wipe Core", list("No", "Yes")) != "Yes")
return
cryo_AI()
+1 -1
View File
@@ -437,7 +437,7 @@
var/mob/living/carbon/human/H = over_object //changed to human to avoid stupid issues like xenos holding pAIs.
if(!istype(H) || !Adjacent(H)) return ..()
if(usr == src)
switch(alert(H, "[src] wants you to pick [p_them()] up. Do it?",,"Yes","No"))
switch(tgui_alert(H, "[src] wants you to pick [p_them()] up. Do it?", "Pick up", list("Yes", "No")))
if("Yes")
if(Adjacent(H))
get_scooped(H)
+23 -14
View File
@@ -69,23 +69,32 @@ GLOBAL_DATUM_INIT(paiController, /datum/paiController, new) // Global handler fo
switch(option)
if("name")
t = input("Enter a name for your pAI", "pAI Name", candidate.pai_name) as text
if(t)
candidate.pai_name = sanitize(copytext(t,1,MAX_NAME_LEN))
t = tgui_input_text(usr, "Enter a name for your pAI", "pAI Name", candidate.pai_name, MAX_NAME_LEN)
if(!t)
return
candidate.pai_name = t
if("desc")
t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message
if(t)
candidate.description = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
t = tgui_input_text(usr, "Enter a description for your pAI", "pAI Description", candidate.description, multiline = TRUE)
if(!t)
return
candidate.description = t
if("role")
t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text
if(t)
candidate.role = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
t = tgui_input_text(usr, "Enter a role for your pAI", "pAI Role", candidate.role)
if(!t)
return
candidate.role = t
if("ooc")
t = input("Enter any OOC comments", "pAI OOC Comments", candidate.ooc_comments) as message
if(t)
candidate.ooc_comments = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
t = tgui_input_text(usr, "Enter any OOC comments", "pAI OOC Comments", candidate.ooc_comments, multiline = TRUE)
if(!t)
return
candidate.ooc_comments = t
if("save")
candidate.save_to_db(usr)
if("reload")
candidate.reload_save(usr)
//In case people have saved unsanitized stuff.
@@ -368,12 +377,12 @@ GLOBAL_DATUM_INIT(paiController, /datum/paiController, new) // Global handler fo
if(!C) return
asked.Add(C.key)
asked[C.key] = world.time
var/response = alert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round")
var/response = tgui_alert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", list("Yes", "No", "Never for this round"))
if(!C) return //handle logouts that happen whilst the alert is waiting for a response.
if(response == "Yes")
recruitWindow(C.mob)
else if(response == "Never for this round")
var/warning = alert(C, "Are you sure? This action will be undoable and you will need to wait until next round.", "You sure?", "Yes", "No")
var/warning = tgui_alert(C, "Are you sure? This action will be undoable and you will need to wait until next round.", "You sure?", list("Yes", "No"))
if(warning == "Yes")
asked[C.key] = INFINITY
else
@@ -136,7 +136,7 @@
return
// Check the carrier
var/answer = alert(M, "[pai_holder] is requesting a DNA sample from you. Will you allow it to confirm your identity?", "[pai_holder] Check DNA", "Yes", "No")
var/answer = tgui_alert(M, "[pai_holder] is requesting a DNA sample from you. Will you allow it to confirm your identity?", "[pai_holder] Check DNA", list("Yes", "No"))
if(answer == "Yes")
M.visible_message("<span class='notice'>[M] presses [M.p_their()] thumb against [pai_holder].</span>", "<span class='notice'>You press your thumb against [pai_holder].</span>")
var/datum/dna/dna = M.dna
@@ -152,7 +152,7 @@
to_chat(usr, "<span class='warning'>You must wait 10 minutes to respawn as a drone!</span>")
return
if(alert("Are you sure you want to respawn as a drone?", "Are you sure?", "Yes", "No") != "Yes")
if(tgui_alert(usr, "Are you sure you want to respawn as a drone?", "Are you sure?", list("Yes", "No")) != "Yes")
return
for(var/obj/machinery/drone_fabricator/DF in GLOB.machines)
@@ -178,7 +178,7 @@
return
else
var/confirm = alert("Using your ID on a Maintenance Drone will shut it down, are you sure you want to do this?", "Disable Drone", "Yes", "No")
var/confirm = tgui_alert(user, "Using your ID on a Maintenance Drone will shut it down, are you sure you want to do this?", "Disable Drone", list("Yes", "No"))
if(confirm == ("Yes") && (user in range(3, src)))
user.visible_message("<span class='warning'>[user] swipes [user.p_their()] ID card through [src], attempting to shut it down.</span>",
"<span class='warning'>You swipe your ID card through [src], attempting to shut it down.</span>")
@@ -311,7 +311,7 @@
spawn(0)
if(!C || !M || jobban_isbanned(M, "nonhumandept") || jobban_isbanned(M, "Drone"))
return
var/response = alert(C, "Someone is attempting to reboot a maintenance drone. Would you like to play as one?", "Maintenance drone reboot", "Yes", "No")
var/response = tgui_alert(C, "Someone is attempting to reboot a maintenance drone. Would you like to play as one?", "Maintenance drone reboot", list("Yes", "No"))
if(!C || ckey)
return
if(response == "Yes")

Some files were not shown because too many files have changed in this diff Show More