[MIRROR] default tgui alert input handling (#8891)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: Kashargul <KashL@t-online.de>
This commit is contained in:
CHOMPStation2
2024-09-01 15:28:35 -07:00
committed by GitHub
parent ec8834f9e5
commit 9f42148ab1
106 changed files with 675 additions and 178 deletions

View File

@@ -116,6 +116,8 @@
var/unique
if (varsvars && varsvars.len)
unique = tgui_alert(usr, "Process vars unique to each instance, or same for all?", "Variable Association", list("Unique", "Same"))
if(!unique)
return
if(unique == "Unique")
unique = TRUE
else
@@ -143,7 +145,7 @@
if (VV_NEW_TYPE)
var/many = tgui_alert(src, "Create only one [value["type"]] and assign each or a new one for each thing", "How Many", list("One", "Many", "Cancel"))
if (many == "Cancel")
if (!many || many == "Cancel")
return
if (many == "Many")
many = TRUE

View File

@@ -181,7 +181,7 @@ GLOBAL_PROTECT(VVpixelmovement)
var/assoc = 0
if(IS_VALID_ASSOC_KEY(L[index]))
var/prompt = tgui_alert(src, "Do you want to edit the key or its assigned value?", "Associated List", list("Key", "Assigned Value", "Cancel"))
if (prompt == "Cancel")
if (!prompt || prompt == "Cancel")
return
if (prompt == "Assigned Value")
assoc = 1
@@ -194,7 +194,7 @@ GLOBAL_PROTECT(VVpixelmovement)
else
variable = L[index]
//EXPERIMENTAL - Keep old associated value while modifying key, if any
if(IS_VALID_ASSOC_KEY(variable))
if(IS_VALID_ASSOC_KEY(variable))
var/found = L[variable]
if(!isnull(found))
old_assoc_value = found