mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 08:29:57 +01:00
Adds TGUI say and TGUI input. (#17471)
* i alone am the honoured one * THROUGHOUT HEAVEN AND EARTH I ALONE AM THE HONOURED ONE * hollow point * nanana * ssss * tgsay final touches * stuff * tgui inputs * help * carpal tunnel syndrome * ffff * again and again and again and again * hehehehe * dsada * readd sanitize * whoops * dsad * nah fuck that * sd * fix * ow * remove prefs for testmerging * oops * oops 2 * fix that * f --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
@@ -696,7 +696,7 @@ var/global/enabled_spooking = 0
|
||||
if (!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/message = input("Global message to send:", "Admin Announce", null, null) as message
|
||||
var/message = tgui_input_text(usr, "Enter a global message to send.", "Admin Announce", multiline = TRUE)
|
||||
if(message)
|
||||
if(!check_rights(R_SERVER, 0))
|
||||
message = sanitize(message, 500, extra = 0)
|
||||
@@ -1286,7 +1286,7 @@ var/global/enabled_spooking = 0
|
||||
to_chat(usr, "Mode has not started.")
|
||||
return
|
||||
|
||||
var/antag_type = input("Choose a template.","Force Latespawn") as null|anything in all_antag_types
|
||||
var/antag_type = tgui_input_list(usr, "Choose a template.", "Force Latespawn", all_antag_types)
|
||||
if(!antag_type || !all_antag_types[antag_type])
|
||||
to_chat(usr, "Aborting.")
|
||||
return
|
||||
@@ -1349,16 +1349,16 @@ var/global/enabled_spooking = 0
|
||||
/datum/admins/proc/ccannoucment()
|
||||
set category = "Special Verbs"
|
||||
set name = "Custom sound Command Announcment"
|
||||
set desc = "Emulate announcement that looks and sounds like the real one"
|
||||
set desc = "Emulate announcement that looks and sounds like the real one."
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/title = input("Announcement TITLE:", "CAnnounce", null, null) as text
|
||||
var/title = tgui_input_text(usr, "Input the announcement's title.", "Custom Announcement")
|
||||
if(!title)
|
||||
return
|
||||
if(!check_rights(R_SERVER,0))
|
||||
title = sanitize(title, 255, extra = 0)
|
||||
var/message = input("Announcement content:", "CAnnounce", null, null) as message
|
||||
var/message = tgui_input_text("Input the announcement's content.", "CAnnounce", multiline = TRUE)
|
||||
if(!message)
|
||||
return
|
||||
if(!check_rights(R_SERVER,0))
|
||||
@@ -1370,7 +1370,7 @@ var/global/enabled_spooking = 0
|
||||
sounds += "--LOCAL--"
|
||||
sounds += sounds_cache
|
||||
|
||||
var/melody = input("Select a sound from the server to play", "Server sound list", "--CANCEL--") in sounds
|
||||
var/melody = tgui_input_list(usr, "Select a sound from the server to play.", "Sound Selection", sounds)
|
||||
|
||||
if(melody == "--CANCEL--")
|
||||
return
|
||||
|
||||
@@ -694,7 +694,7 @@ var/list/admin_verbs_cciaa = list(
|
||||
|
||||
var/turf/epicenter = mob.loc
|
||||
var/list/choices = list("Small Bomb", "Medium Bomb", "Big Bomb", "Custom Bomb")
|
||||
var/choice = input("What size explosion would you like to produce?") in choices
|
||||
var/choice = tgui_input_list(usr, "What size explosion would you like to produce?", "Drop Bomb", choices)
|
||||
switch(choice)
|
||||
if(null)
|
||||
return 0
|
||||
@@ -705,10 +705,10 @@ var/list/admin_verbs_cciaa = list(
|
||||
if("Big Bomb")
|
||||
explosion(epicenter, 3, 5, 7, 5)
|
||||
if("Custom Bomb")
|
||||
var/devastation_range = input("Devastation range (in tiles):") as num
|
||||
var/heavy_impact_range = input("Heavy impact range (in tiles):") as num
|
||||
var/light_impact_range = input("Light impact range (in tiles):") as num
|
||||
var/flash_range = input("Flash range (in tiles):") as num
|
||||
var/devastation_range = tgui_input_number(usr, "Set the devastation range (in tiles).", "Devastation")
|
||||
var/heavy_impact_range = tgui_input_number(usr, "Set the heavy impact range (in tiles).", "Heavy")
|
||||
var/light_impact_range = tgui_input_number(usr, "Set the light impact range (in tiles).", "Light")
|
||||
var/flash_range = tgui_input_number(usr, "Set the flash range (in tiles).", "Flash")
|
||||
explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range)
|
||||
message_admins("<span class='notice'>[ckey] creating an admin explosion at [epicenter.loc].</span>")
|
||||
feedback_add_details("admin_verb","DB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -846,7 +846,7 @@ var/list/admin_verbs_cciaa = list(
|
||||
|
||||
if(!check_rights(R_FUN)) return
|
||||
|
||||
var/mob/living/carbon/human/H = input("Select mob.", "Change Mob Appearance - Admin") as null|anything in human_mob_list
|
||||
var/mob/living/carbon/human/H = tgui_input_list(usr, "Select mob.", "Change Mob Appearance - Self", human_mob_list)
|
||||
if(!H) return
|
||||
|
||||
log_and_message_admins("is altering the appearance of [H].")
|
||||
@@ -860,7 +860,7 @@ var/list/admin_verbs_cciaa = list(
|
||||
|
||||
if(!check_rights(R_FUN)) return
|
||||
|
||||
var/mob/living/carbon/human/H = input("Select mob.", "Change Mob Appearance - Self") as null|anything in human_mob_list
|
||||
var/mob/living/carbon/human/H = tgui_input_list(usr, "Select mob.", "Change Mob Appearance - Self", human_mob_list)
|
||||
if(!H) return
|
||||
|
||||
if(!H.client)
|
||||
@@ -881,9 +881,11 @@ var/list/admin_verbs_cciaa = list(
|
||||
set desc = "Sets the station security level"
|
||||
set category = "Admin"
|
||||
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
var sec_level = input(usr, "It's currently code [get_security_level()].", "Select Security Level") as null|anything in (list("green","blue","red", "yellow", "delta")-get_security_level())
|
||||
if(alert("Switch from code [get_security_level()] to code [sec_level]?","Change security level?","Yes","No") == "Yes")
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
var/sec_level = tgui_input_list(usr, "It's currently code [get_security_level()].", "Select Security Level", list("green", "blue", "red", "yellow", "delta") - get_security_level())
|
||||
var/msg = tgui_alert(usr, "Switch from code [get_security_level()] to code [sec_level]?", "Security Level", list("Yes","No"))
|
||||
if(msg == "Yes")
|
||||
set_security_level(sec_level)
|
||||
log_admin("[key_name(usr)] changed the security level to code [sec_level].",admin_key=key_name(usr))
|
||||
|
||||
@@ -980,7 +982,7 @@ var/list/admin_verbs_cciaa = list(
|
||||
if (!jobs.len)
|
||||
to_chat(usr, SPAN_NOTICE("There are no fully staffed jobs."))
|
||||
return
|
||||
var/job = input("Please select job slot to free", "Free job slot") as null|anything in jobs
|
||||
var/job = tgui_input_list(usr, "Please select a job slot to free.", "Free Job Slot", jobs)
|
||||
if (job)
|
||||
var/datum/job/J = SSjobs.GetJob(job)
|
||||
if(istype(J))
|
||||
@@ -1108,7 +1110,7 @@ var/list/admin_verbs_cciaa = list(
|
||||
if (!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/mob/living/silicon/ai/target = input("Choose the AI to force-wipe:", "AI Termination") as null|anything in ai_list
|
||||
var/mob/living/silicon/ai/target = tgui_input_list(usr, "Choose the AI to force-wipe.", "AI Termination", ai_list)
|
||||
|
||||
if (!target || alert("Are you sure you want to wipe [target.name]? They will be ghosted and their job slot freed.", "Confirm AI Termination", "No", "No", "Yes") != "Yes")
|
||||
return
|
||||
|
||||
@@ -249,7 +249,7 @@ Ccomp's first proc.
|
||||
|
||||
for(var/mob/M in mobs)
|
||||
var/name = M.name
|
||||
ghosts[name] = M //get the name of the mob for the popup list
|
||||
ghosts[name] = M //get the name of the mob for the popup list
|
||||
if(what==1)
|
||||
return ghosts
|
||||
else
|
||||
@@ -264,9 +264,9 @@ Ccomp's first proc.
|
||||
to_chat(src, "Only administrators may use this command.")
|
||||
var/list/ghosts = get_ghosts(1,1,src)
|
||||
|
||||
var/target = input("Please, select a ghost!", "COME BACK TO LIFE!", null, null) as null|anything in ghosts
|
||||
var/target = tgui_input_list(src, "Please, select a ghost!", "COME BACK TO LIFE!", ghosts)
|
||||
if(!target)
|
||||
to_chat(src, "Hrm, appears you didn't select a ghost") // Sanity check, if no ghosts in the list we don't want to edit a null variable and cause a runtime error.)
|
||||
to_chat(src, SPAN_WARNING("You didn't select a ghost!")) // Sanity check, if no ghosts in the list we don't want to edit a null variable and cause a runtime error.)
|
||||
return
|
||||
|
||||
var/mob/abstract/observer/G = ghosts[target]
|
||||
@@ -578,27 +578,27 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
to_chat(src, "<span class='notice'>There are no templates in the database.</span>")
|
||||
return
|
||||
|
||||
reporttitle = input(usr, "Please select a command report template.", "Create Command Report") as null|anything in template_names
|
||||
reporttitle = tgui_input_list(usr, "Please select a command report template.", "Create Command Report", template_names)
|
||||
if(!reporttitle)
|
||||
return
|
||||
reportbody = templates[reporttitle]
|
||||
|
||||
if("Custom")
|
||||
reporttitle = sanitizeSafe(input(usr, "Pick a title for the report.", "Title") as text|null)
|
||||
reporttitle = sanitizeSafe(tgui_input_text(usr, "Pick a title for the report.", "Title"))
|
||||
if(!reporttitle)
|
||||
reporttitle = "NanoTrasen Update"
|
||||
reportbody = sanitize(input(usr, "Please enter anything you want. Anything. Serious.", "Body", "") as message|null, extra = 0)
|
||||
reportbody = sanitize(tgui_input_text(usr, "Please enter anything you want. Anything. Serious.", "Body", multiline = TRUE))
|
||||
if(!reportbody)
|
||||
return
|
||||
|
||||
if (reporttype == "Template")
|
||||
reporter = sanitizeSafe(input(usr, "Please enter your CCIA name. (blank for CCIAAMS)", "Name") as text|null)
|
||||
reporter = sanitizeSafe(tgui_input_text(usr, "Please enter your CCIA name. (blank for CCIAAMS)", "Name"))
|
||||
if (reporter)
|
||||
reportbody += "\n\n- [reporter], Central Command Internal Affairs Agent, [commstation_name()]"
|
||||
else
|
||||
reportbody += "\n\n- CCIAAMS, [commstation_name()]"
|
||||
|
||||
switch(alert("Should this be announced to the general population?",,"Yes","No"))
|
||||
switch(tgui_alert("Should this be announced to the general population?", "Announcement", list("Yes","No")))
|
||||
if("Yes")
|
||||
command_announcement.Announce("[reportbody]", reporttitle, new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1);
|
||||
if("No")
|
||||
|
||||
Reference in New Issue
Block a user