Revert "TGUI alerts, lists, inputs"

This commit is contained in:
Letter N
2021-10-28 12:17:29 +08:00
committed by GitHub
parent 853ff1d8ad
commit bcdf96f274
362 changed files with 1149 additions and 1570 deletions
+4 -4
View File
@@ -201,7 +201,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1)
else if (href_list["no_stacking"])
GLOB.dynamic_no_stacking = !GLOB.dynamic_no_stacking
else if (href_list["adjustthreat"])
var/threatadd = tgui_input_num(usr, "Specify how much threat to add (negative to subtract). This can inflate the threat level.", "Adjust Threat", 0)
var/threatadd = input("Specify how much threat to add (negative to subtract). This can inflate the threat level.", "Adjust Threat", 0) as null|num
if(!threatadd)
return
if(threatadd > 0)
@@ -221,9 +221,9 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1)
else if (href_list["threatlog"])
show_threatlog(usr)
else if (href_list["stacking_limit"])
GLOB.dynamic_stacking_limit = tgui_input_num(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null)
GLOB.dynamic_stacking_limit = input(usr,"Change the threat limit at which round-endings rulesets will start to stack.", "Change stacking limit", null) as num
else if(href_list["force_latejoin_rule"])
var/added_rule = tgui_input_list(usr,"What ruleset do you want to force upon the next latejoiner? This will bypass threat level and population restrictions.", "Rigging Latejoin", sortNames(init_rulesets(/datum/dynamic_ruleset/latejoin)))
var/added_rule = input(usr,"What ruleset do you want to force upon the next latejoiner? This will bypass threat level and population restrictions.", "Rigging Latejoin", null) as null|anything in sortNames(init_rulesets(/datum/dynamic_ruleset/latejoin))
if (!added_rule)
return
forced_latejoin_rule = added_rule
@@ -234,7 +234,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1)
log_admin("[key_name(usr)] cleared the forced latejoin ruleset.")
message_admins("[key_name(usr)] cleared the forced latejoin ruleset.")
else if(href_list["force_midround_rule"])
var/added_rule = tgui_input_list(usr,"What ruleset do you want to force right now? This will bypass threat level and population restrictions.", "Execute Ruleset", sortNames(init_rulesets(/datum/dynamic_ruleset/midround)))
var/added_rule = input(usr,"What ruleset do you want to force right now? This will bypass threat level and population restrictions.", "Execute Ruleset", null) as null|anything in sortNames(init_rulesets(/datum/dynamic_ruleset/midround))
if (!added_rule)
return
log_admin("[key_name(usr)] executed the [added_rule] ruleset.")
@@ -72,9 +72,9 @@
set name = "Run Dynamic Simulations"
set category = "Debug"
var/simulations = tgui_input_num(usr, "Enter number of simulations")
var/roundstart_players = tgui_input_num(usr, "Enter number of round start players")
var/forced_threat_level = tgui_input_num(usr, "Enter forced threat level, if you want one")
var/simulations = input(usr, "Enter number of simulations") as num
var/roundstart_players = input(usr, "Enter number of round start players") as num
var/forced_threat_level = input(usr, "Enter forced threat level, if you want one") as num | null
SSticker.mode = new /datum/game_mode/dynamic
message_admins("Running dynamic simulations...")
+1 -1
View File
@@ -176,7 +176,7 @@
return
var/time = round(tempgang.determine_domination_time()/60,0.1)
if(tgui_alert(user,"A takeover will require [time] minutes.\nYour gang will be unable to gain influence while it is active.\nThe entire station will likely be alerted to it once it starts.\nYou have [tempgang.dom_attempts] attempt(s) remaining. Are you ready?","Confirm",list("Ready","Later")) == "Ready")
if(alert(user,"A takeover will require [time] minutes.\nYour gang will be unable to gain influence while it is active.\nThe entire station will likely be alerted to it once it starts.\nYou have [tempgang.dom_attempts] attempt(s) remaining. Are you ready?","Confirm","Ready","Later") == "Ready")
if((tempgang.domination_time != NOT_DOMINATING) || !tempgang.dom_attempts || !in_range(src, user) || !isturf(loc))
return 0
+5 -5
View File
@@ -108,11 +108,11 @@
.["Set domination time left"] = CALLBACK(src, .proc/set_dom_time_left)
/datum/antagonist/gang/admin_add(datum/mind/new_owner,mob/admin)
var/new_or_existing = tgui_input_list(admin, "Which gang do you want to be assigned to the user?", "Gangs", list("New","Existing"))
var/new_or_existing = input(admin, "Which gang do you want to be assigned to the user?", "Gangs") as null|anything in list("New","Existing")
if(isnull(new_or_existing))
return
else if(new_or_existing == "New")
var/newgang = tgui_input_list(admin, "Select a gang, or select random to pick a random one.", "New gang", GLOB.possible_gangs + "Random")
var/newgang = input(admin, "Select a gang, or select random to pick a random one.", "New gang") as null|anything in GLOB.possible_gangs + "Random"
if(isnull(newgang))
return
else if(newgang == "Random")
@@ -125,7 +125,7 @@
if(!GLOB.gangs.len) // no gangs exist
to_chat(admin, "<span class='danger'>No gangs exist, please create a new one instead.</span>")
return
var/existinggang = tgui_input_list(admin, "Select a gang, or select random to pick a random one.", "Existing gang", GLOB.gangs + "Random")
var/existinggang = input(admin, "Select a gang, or select random to pick a random one.", "Existing gang") as null|anything in GLOB.gangs + "Random"
if(isnull(existinggang))
return
else if(existinggang == "Random")
@@ -141,7 +141,7 @@
promote()
/datum/antagonist/gang/proc/admin_adjust_influence()
var/inf = tgui_input_num(usr, "Influence for [gang.name]","Gang influence", gang.influence)
var/inf = input("Influence for [gang.name]","Gang influence", gang.influence) as null | num
if(!isnull(inf))
gang.influence = inf
message_admins("[key_name_admin(usr)] changed [gang.name]'s influence to [inf].")
@@ -158,7 +158,7 @@
/datum/antagonist/gang/proc/set_dom_time_left(mob/admin)
if(gang.domination_time == NOT_DOMINATING)
return // an admin shouldn't need this
var/seconds = tgui_input_num(admin, "Set the time left for the gang to win, in seconds", "Domination time left", (gang.domination_time - world.time) * 0.1)
var/seconds = input(admin, "Set the time left for the gang to win, in seconds", "Domination time left") as null|num
if(seconds && seconds > 0)
gang.domination_time = world.time + seconds*10
gang.message_gangtools("Takeover shortened to [gang.domination_time_remaining()] seconds by your Syndicate benefactors.")
+12 -7
View File
@@ -39,11 +39,16 @@ GLOBAL_LIST_EMPTY(objectives)
//Shared by few objective types
/datum/objective/proc/admin_simple_target_pick(mob/admin)
var/list/possible_targets = list("Free objective")
var/def_value
for(var/datum/mind/possible_target in SSticker.minds)
if ((possible_target != src) && ishuman(possible_target.current))
possible_targets += possible_target.current
var/mob/new_target = tgui_input_list(admin,"Select target:", "Objective target", possible_targets)
if(target && target.current)
def_value = target.current
var/mob/new_target = input(admin,"Select target:", "Objective target", def_value) as null|anything in possible_targets
if (!new_target)
return
@@ -600,12 +605,12 @@ GLOBAL_LIST_EMPTY(possible_items)
/datum/objective/steal/admin_edit(mob/admin)
var/list/possible_items_all = GLOB.possible_items+"custom"
var/new_target = tgui_input_list(admin,"Select target:", "Objective target", possible_items_all)
var/new_target = input(admin,"Select target:", "Objective target", steal_target) as null|anything in possible_items_all
if (!new_target)
return
if (new_target == "custom") //Can set custom items.
var/custom_path = tgui_input_text(admin,"Search for target item type:","Type")
var/custom_path = input(admin,"Search for target item type:","Type") as null|text
if (!custom_path)
return
var/obj/item/custom_target = pick_closest_path(custom_path, make_types_fancy(subtypesof(/obj/item)))
@@ -722,7 +727,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
return checking.researched_nodes.len >= target_amount
/datum/objective/download/admin_edit(mob/admin)
var/count = tgui_input_num(admin,"How many nodes ?","Nodes",target_amount)
var/count = input(admin,"How many nodes ?","Nodes",target_amount) as num|null
if(count)
target_amount = count
update_explanation_text()
@@ -768,7 +773,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
return captured_amount >= target_amount
/datum/objective/capture/admin_edit(mob/admin)
var/count = tgui_input_num(admin,"How many mobs to capture ?","capture",target_amount)
var/count = input(admin,"How many mobs to capture ?","capture",target_amount) as num|null
if(count)
target_amount = count
update_explanation_text()
@@ -800,7 +805,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
explanation_text = "Extract [target_amount] compatible genome\s."
/datum/objective/absorb/admin_edit(mob/admin)
var/count = tgui_input_num(admin,"How many people to absorb?","absorb",target_amount)
var/count = input(admin,"How many people to absorb?","absorb",target_amount) as num|null
if(count)
target_amount = count
update_explanation_text()
@@ -890,7 +895,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
/datum/objective/destroy/admin_edit(mob/admin)
var/list/possible_targets = active_ais(1)
if(possible_targets.len)
var/mob/new_target = tgui_input_list(admin,"Select target:", "Objective target", possible_targets)
var/mob/new_target = input(admin,"Select target:", "Objective target") as null|anything in possible_targets
target = new_target.mind
else
to_chat(admin, "No active AIs with minds")