mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-20 20:54:35 +01:00
The One Where I Port Modals
This commit is contained in:
+23
-23
@@ -665,7 +665,7 @@ var/global/floorIsLava = 0
|
||||
set desc="Restarts the world"
|
||||
if (!usr.client.holder)
|
||||
return
|
||||
var/confirm = alert("Restart the game world?", "Restart", "Yes", "Cancel")
|
||||
var/confirm = alert(usr, "Restart the game world?", "Restart", "Yes", "Cancel") // Not tgui_alert for safety
|
||||
if(confirm == "Cancel")
|
||||
return
|
||||
if(confirm == "Yes")
|
||||
@@ -688,7 +688,7 @@ var/global/floorIsLava = 0
|
||||
set desc="Announce your desires to the world"
|
||||
if(!check_rights(0)) return
|
||||
|
||||
var/message = input("Global message to send:", "Admin Announce", null, null) as message//todo: sanitize for all?
|
||||
var/message = input(usr, "Global message to send:", "Admin Announce", null, null) as message//todo: sanitize for all?
|
||||
if(message)
|
||||
if(!check_rights(R_SERVER,0))
|
||||
message = sanitize(message, 500, extra = 0)
|
||||
@@ -706,14 +706,14 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
set desc = "Send an intercom message, like an arrivals announcement."
|
||||
if(!check_rights(0)) return
|
||||
|
||||
var/channel = input("Channel for message:","Channel", null) as null|anything in radiochannels
|
||||
var/channel = tgui_input_list(usr, "Channel for message:","Channel", radiochannels)
|
||||
|
||||
if(channel) //They picked a channel
|
||||
var/sender = input("Name of sender (max 75):", "Announcement", "Announcement Computer") as null|text
|
||||
var/sender = input(usr, "Name of sender (max 75):", "Announcement", "Announcement Computer") as null|text
|
||||
|
||||
if(sender) //They put a sender
|
||||
sender = sanitize(sender, 75, extra = 0)
|
||||
var/message = input("Message content (max 500):", "Contents", "This is a test of the announcement system.") as null|message
|
||||
var/message = input(usr, "Message content (max 500):", "Contents", "This is a test of the announcement system.") as null|message
|
||||
|
||||
if(message) //They put a message
|
||||
message = sanitize(message, 500, extra = 0)
|
||||
@@ -729,7 +729,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
set waitfor = FALSE //Why bother? We have some sleeps. You can leave tho!
|
||||
if(!check_rights(0)) return
|
||||
|
||||
var/channel = input("Channel for message:","Channel", null) as null|anything in radiochannels
|
||||
var/channel = tgui_input_list(usr, "Channel for message:","Channel", radiochannels)
|
||||
|
||||
if(!channel) //They picked a channel
|
||||
return
|
||||
@@ -1012,7 +1012,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
SSticker.delay_end = !SSticker.delay_end
|
||||
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
||||
message_admins("<font color='blue'>[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].</font>", 1)
|
||||
return //alert("Round end delayed", null, null, null, null, null)
|
||||
return
|
||||
round_progressing = !round_progressing
|
||||
if (!round_progressing)
|
||||
to_world("<b>The game start has been delayed.</b>")
|
||||
@@ -1051,7 +1051,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
set desc="Reboots the server post haste"
|
||||
set name="Immediate Reboot"
|
||||
if(!usr.client.holder) return
|
||||
if( alert("Reboot server?",,"Yes","No") == "No")
|
||||
if(alert(usr, "Reboot server?","Reboot!","Yes","No") == "No") // Not tgui_alert for safety
|
||||
return
|
||||
to_world("<font color='red'><b>Rebooting world!</b></font> <font color='blue'>Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!</font>")
|
||||
log_admin("[key_name(usr)] initiated an immediate reboot.")
|
||||
@@ -1073,9 +1073,9 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
message_admins("[key_name_admin(usr)] has unprisoned [key_name_admin(M)]", 1)
|
||||
log_admin("[key_name(usr)] has unprisoned [key_name(M)]")
|
||||
else
|
||||
alert("Admin jumping disabled")
|
||||
tgui_alert_async(usr, "Admin jumping disabled")
|
||||
else
|
||||
alert("[M.name] is not prisoned.")
|
||||
tgui_alert_async(usr, "[M.name] is not prisoned.")
|
||||
feedback_add_details("admin_verb","UP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////ADMIN HELPER PROCS
|
||||
@@ -1114,7 +1114,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
|
||||
if(!seedtype || !SSplants.seeds[seedtype])
|
||||
return
|
||||
var/amount = input("Amount of fruit to spawn", "Fruit Amount", 1) as null|num
|
||||
var/amount = input(usr, "Amount of fruit to spawn", "Fruit Amount", 1) as null|num
|
||||
if(!isnull(amount))
|
||||
var/datum/seed/S = SSplants.seeds[seedtype]
|
||||
S.harvest(usr,0,0,amount)
|
||||
@@ -1127,12 +1127,12 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
|
||||
var/owner = input("Select a ckey.", "Spawn Custom Item") as null|anything in custom_items
|
||||
var/owner = tgui_input_list(usr, "Select a ckey.", "Spawn Custom Item", custom_items)
|
||||
if(!owner|| !custom_items[owner])
|
||||
return
|
||||
|
||||
var/list/possible_items = custom_items[owner]
|
||||
var/datum/custom_item/item_to_spawn = input("Select an item to spawn.", "Spawn Custom Item") as null|anything in possible_items
|
||||
var/datum/custom_item/item_to_spawn = tgui_input_list(usr, "Select an item to spawn.", "Spawn Custom Item", possible_items)
|
||||
if(!item_to_spawn)
|
||||
return
|
||||
|
||||
@@ -1193,7 +1193,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
if(matches.len==1)
|
||||
chosen = matches[1]
|
||||
else
|
||||
chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
|
||||
chosen = tgui_input_list(usr, "Select an atom type", "Spawn Atom", matches)
|
||||
if(!chosen)
|
||||
return
|
||||
|
||||
@@ -1228,7 +1228,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
set name = "Show Game Mode"
|
||||
|
||||
if(!ticker || !ticker.mode)
|
||||
alert("Not before roundstart!", "Alert")
|
||||
tgui_alert_async(usr, "Not before roundstart!", "Alert")
|
||||
return
|
||||
|
||||
var/out = "<font size=3><b>Current mode: [ticker.mode.name] (<a href='?src=\ref[ticker.mode];debug_antag=self'>[ticker.mode.config_tag]</a>)</b></font><br/>"
|
||||
@@ -1353,7 +1353,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
to_chat(usr, "Error: you are not an admin!")
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/M = input("Select mob.", "Select mob.") as null|anything in human_mob_list
|
||||
var/mob/living/carbon/human/M = tgui_input_list(usr, "Select mob.", "Select mob.", human_mob_list)
|
||||
if(!M) return
|
||||
|
||||
show_skill_window(usr, M)
|
||||
@@ -1440,7 +1440,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
if (tomob.ckey)
|
||||
question = "This mob already has a user ([tomob.key]) in control of it! "
|
||||
question += "Are you sure you want to place [frommob.name]([frommob.key]) in control of [tomob.name]?"
|
||||
var/ask = alert(question, "Place ghost in control of mob?", "Yes", "No")
|
||||
var/ask = tgui_alert(usr, question, "Place ghost in control of mob?", list("Yes", "No"))
|
||||
if (ask != "Yes")
|
||||
return 1
|
||||
if (!frommob || !tomob) //make sure the mobs don't go away while we waited for a response
|
||||
@@ -1474,7 +1474,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
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
|
||||
@@ -1514,7 +1514,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
msg = "has paralyzed [key_name(H)]."
|
||||
log_and_message_admins(msg)
|
||||
else
|
||||
if(alert(src, "[key_name(H)] is paralyzed, would you like to unparalyze them?",,"Yes","No") == "Yes")
|
||||
if(tgui_alert(src, "[key_name(H)] is paralyzed, would you like to unparalyze them?","Paralyze Mob",list("Yes","No")) == "Yes")
|
||||
H.SetParalysis(0)
|
||||
msg = "has unparalyzed [key_name(H)]."
|
||||
log_and_message_admins(msg)
|
||||
@@ -1527,7 +1527,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
var/crystals
|
||||
|
||||
if(check_rights(R_ADMIN|R_EVENT))
|
||||
crystals = input("Amount of telecrystals for [H.ckey], currently [H.mind.tcrystals].", crystals) as null|num
|
||||
crystals = input(usr, "Amount of telecrystals for [H.ckey], currently [H.mind.tcrystals].", crystals) as null|num
|
||||
if (!isnull(crystals))
|
||||
H.mind.tcrystals = crystals
|
||||
var/msg = "[key_name(usr)] has modified [H.ckey]'s telecrystals to [crystals]."
|
||||
@@ -1543,7 +1543,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
var/crystals
|
||||
|
||||
if(check_rights(R_ADMIN|R_EVENT))
|
||||
crystals = input("Amount of telecrystals to give to [H.ckey], currently [H.mind.tcrystals].", crystals) as null|num
|
||||
crystals = input(usr, "Amount of telecrystals to give to [H.ckey], currently [H.mind.tcrystals].", crystals) as null|num
|
||||
if (!isnull(crystals))
|
||||
H.mind.tcrystals += crystals
|
||||
var/msg = "[key_name(usr)] has added [crystals] to [H.ckey]'s telecrystals."
|
||||
@@ -1556,7 +1556,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
set category = "Special Verbs"
|
||||
set name = "Send Fax"
|
||||
set desc = "Sends a fax to this machine"
|
||||
var/department = input("Choose a fax", "Fax") as null|anything in alldepartments
|
||||
var/department = tgui_input_list(usr, "Choose a fax", "Fax", alldepartments)
|
||||
for(var/obj/machinery/photocopier/faxmachine/sendto in allfaxes)
|
||||
if(sendto.department == department)
|
||||
|
||||
@@ -1588,7 +1588,7 @@ var/datum/announcement/minor/admin_min_announcer = new
|
||||
|
||||
var/shouldStamp = 1
|
||||
if(!P.sender) // admin initiated
|
||||
switch(alert("Would you like the fax stamped?",, "Yes", "No"))
|
||||
switch(tgui_alert(usr, "Would you like the fax stamped?","Stamped?", list("Yes", "No")))
|
||||
if("No")
|
||||
shouldStamp = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user