default tgui alert input handling (#16241)

* default handling

* do not push that

* fix

* .

* .
This commit is contained in:
Kashargul
2024-09-02 04:27:26 +10:00
committed by GitHub
parent 6d0077890c
commit 2f19f66cc5
99 changed files with 248 additions and 173 deletions
+5 -2
View File
@@ -163,7 +163,10 @@
if(!spawn_path)
return
if(tgui_alert(usr, "Do you wish the mob to have a player?","Assign Player?",list("No","Yes")) == "No")
var/input = tgui_alert(usr, "Do you wish the mob to have a player?","Assign Player?",list("No","Yes"))
if(!input)
return
if(input == "No")
var/spawn_count = tgui_input_number(usr, "How many mobs do you wish the pod to contain?", "Drop Pod Selection", null, min_value=1)
if(spawn_count <= 0)
return
@@ -197,7 +200,7 @@
var/datum/antagonist/A = all_antag_types[antag_type]
A.equip(spawned_mob)
if(tgui_alert(usr, "Are you SURE you wish to deploy this drop pod? It will cause a sizable explosion and gib anyone underneath it.","Danger!",list("No","Yes")) == "No")
if(tgui_alert(usr, "Are you SURE you wish to deploy this drop pod? It will cause a sizable explosion and gib anyone underneath it.","Danger!",list("No","Yes")) != "Yes")
if(spawned_mob)
qdel(spawned_mob)
if(spawned_mobs.len)
+6 -2
View File
@@ -42,6 +42,8 @@
var/chosen_loot_type
var/list/chosen_loot_types
var/choice = tgui_alert(usr, "Do you wish to supply a custom loot list?","Supply Drop",list("No","Yes"))
if(!choice)
return
if(choice == "Yes")
chosen_loot_types = list()
@@ -83,11 +85,13 @@
chosen_loot_types |= adding_loot_type
else
choice = tgui_alert(usr, "Do you wish to specify a loot type?","Supply Drop",list("No","Yes"))
if(!choice)
return
if(choice == "Yes")
chosen_loot_type = tgui_input_list(usr, "Select a loot type.", "Loot Selection", supply_drop_random_loot_types())
choice = tgui_alert(usr, "Are you SURE you wish to deploy this supply drop? It will cause a sizable explosion and gib anyone underneath it.","Supply Drop",list("No","Yes"))
if(choice == "No")
if(choice != "Yes")
return
log_admin("[key_name(usr)] dropped supplies at ([usr.x],[usr.y],[usr.z])")
new /datum/random_map/droppod/supply(null, usr.x-2, usr.y-2, usr.z, supplied_drops = chosen_loot_types, supplied_drop = chosen_loot_type)
new /datum/random_map/droppod/supply(null, usr.x-2, usr.y-2, usr.z, supplied_drops = chosen_loot_types, supplied_drop = chosen_loot_type)