mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 14:08:31 +01:00
TGUI list conversions + bug fixes (#63354)
About The Pull Request
Converts more inputs to TGUI. Possibly all user-facing input lists in the game.
Did any surrounding text/number inputs as well
Added null choice support so users can press cancel.
Added some misc TGUI input fixes
Fixed custom vendors while I was there
I refactored a lot of code while just poking around.
Primarily, usage of .len in files where I was already working on lists.
Some code was just awful - look at guardian.dm and its non use of early returns
If there are any disputes, I can revert it just fine, those changes are not integral to the PR.
Why It's Good For The Game
Fixes #63629
Fixes #63307
Fixes custom vendors /again/
Text input is more performant.
Part of a long series of TGUI conversion to make the game more visually appealing
Changelog
cl
refactor: The majority of user facing input lists have been converted to TGUI.
refactor: Tgui text inputs now scale with entered input.
fix: Many inputs now properly accept cancelling out of the menu.
fix: Fixes an edge case where users could not press enter on number inputs.
fix: Custom vendor bluescreen.
fix: You can now press ENTER on text inputs without an entry to cancel.
/cl
This commit is contained in:
@@ -51,7 +51,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
. += "Players: [SSticker.totalPlayers]"
|
||||
if(client.holder)
|
||||
. += "Players Ready: [SSticker.totalPlayersReady]"
|
||||
. += "Admins Ready: [SSticker.total_admins_ready] / [GLOB.admins.len]"
|
||||
. += "Admins Ready: [SSticker.total_admins_ready] / [length(GLOB.admins)]"
|
||||
|
||||
/mob/dead/proc/server_hop()
|
||||
set category = "OOC"
|
||||
@@ -62,7 +62,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
var/list/our_id = CONFIG_GET(string/cross_comms_name)
|
||||
var/list/csa = CONFIG_GET(keyed_list/cross_server) - our_id
|
||||
var/pick
|
||||
switch(csa.len)
|
||||
switch(length(csa))
|
||||
if(0)
|
||||
remove_verb(src, /mob/dead/proc/server_hop)
|
||||
to_chat(src, span_notice("Server Hop has been disabled."))
|
||||
@@ -71,7 +71,7 @@ INITIALIZE_IMMEDIATE(/mob/dead)
|
||||
else
|
||||
pick = tgui_input_list(src, "Server to jump to", "Server Hop", csa)
|
||||
|
||||
if(!pick)
|
||||
if(isnull(pick))
|
||||
return
|
||||
|
||||
var/addr = csa[pick]
|
||||
|
||||
@@ -118,7 +118,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
|
||||
if(!T || is_secret_level(T.z))
|
||||
var/list/turfs = get_area_turfs(/area/shuttle/arrival)
|
||||
if(turfs.len)
|
||||
if(length(turfs))
|
||||
T = pick(turfs)
|
||||
else
|
||||
T = SSmapping.get_station_center()
|
||||
@@ -441,14 +441,17 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
filtered += A
|
||||
var/area/thearea = tgui_input_list(usr, "Area to jump to", "BOOYEA", filtered)
|
||||
|
||||
if(!thearea)
|
||||
if(isnull(thearea))
|
||||
return
|
||||
if(!isobserver(usr))
|
||||
to_chat(usr, span_warning("Not when you're not dead!"))
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
for(var/turf/T in get_area_turfs(thearea.type))
|
||||
L+=T
|
||||
|
||||
if(!L || !L.len)
|
||||
if(!L || !length(L))
|
||||
to_chat(usr, span_warning("No area available."))
|
||||
return
|
||||
|
||||
@@ -510,8 +513,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/target = null
|
||||
|
||||
target = tgui_input_list(usr, "Please, select a player!", "Jump to Mob", possible_destinations)
|
||||
|
||||
if (!target || !isobserver(usr))
|
||||
if(isnull(target))
|
||||
return
|
||||
if (!isobserver(usr))
|
||||
return
|
||||
|
||||
var/mob/destination_mob = possible_destinations[target] //Destination mob
|
||||
@@ -879,8 +883,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/target = null
|
||||
|
||||
target = tgui_input_list(usr, "Please, select a player!", "Jump to Mob", possible_destinations)
|
||||
|
||||
if (!target || !isobserver(usr))
|
||||
if(isnull(target))
|
||||
return
|
||||
if (!isobserver(usr))
|
||||
return
|
||||
|
||||
var/mob/chosen_target = possible_destinations[target]
|
||||
@@ -1032,7 +1037,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
I.appearance = MA
|
||||
t_ray_images += I
|
||||
stored_t_ray_images += t_ray_images
|
||||
if(t_ray_images.len)
|
||||
if(length(t_ray_images))
|
||||
if(t_ray_view)
|
||||
client.images += t_ray_images
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user