Moves UIs to TGUI core (#16940)

* up to modify robot

* also version up here

* Switch tgui-dev-server to edge mode

* Folders through Sleeper

* finish the folders

* move all uis, some will likely have errors

* Remove size={} on table cells

* Change a bunch of <Flex>

* chat to tgui core and typescript

* chat Flex to Stack

* Update APC.tsx

* Update APC.tsx

* Make ICAssembly wires all work

* More Flex to Stack

* some html

* this half was easy...

* some more

* some more

* fix those up

* few more

* few more

* this should be fine

* convert those, mark the anys to be reaplced

* Down to 118 Flex results

* Down to 104

* Down to 75

* bunch of fixes

* few more

* all except power monitor

* push for now, tgui core issue

* component props

* 32 only

* grow

* those need a param now

* function imports

* dependencies up

* finish those

* finish up

* this

* also those for now

* typescript up

* proper typing

* convert all chat files

* keys

* oups

* Update package.json

* massively improve color picker perf

* this needs to update

* Tgui core

* add those to the panel jsut in case

* dependencies up

* Rename colorpicker.tsx to colorpicker.ts

---------

Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
This commit is contained in:
Kashargul
2025-01-28 15:23:29 +01:00
committed by GitHub
co-authored by ShadowLarkens
parent db33c253b3
commit a9a045a741
739 changed files with 20167 additions and 15997 deletions
+19 -15
View File
@@ -49,6 +49,8 @@
var/autofocus
/// Boolean field describing if the tgui_color_picker was closed by the user.
var/closed
/// The user's presets
var/preset_colors
/datum/tgui_color_picker/New(mob/user, message, title, default, timeout, autofocus)
src.autofocus = autofocus
@@ -59,6 +61,8 @@
src.timeout = timeout
start_time = world.time
QDEL_IN(src, timeout)
if(user)
src.preset_colors = user.read_preference(/datum/preference/text/preset_colors)
/datum/tgui_color_picker/Destroy(force)
SStgui.close_uis(src)
@@ -80,6 +84,8 @@
ui.set_autoupdate(timeout > 0)
/datum/tgui_color_picker/tgui_close(mob/user)
if(user)
user.write_preference_directly(/datum/preference/text/preset_colors, preset_colors)
. = ..()
closed = TRUE
@@ -99,7 +105,7 @@
. = list()
if(timeout)
.["timeout"] = CLAMP01((timeout - (world.time - start_time) - 1 SECONDS) / (timeout - 1 SECONDS))
.["presets"] = user.read_preference(/datum/preference/text/preset_colors)
.["presets"] = preset_colors
/datum/tgui_color_picker/tgui_act(action, list/params, datum/tgui/ui)
. = ..()
@@ -124,20 +130,18 @@
SStgui.close_uis(src)
return TRUE
if("preset")
if(ui.user)
var/raw_data = lowertext(params["color"])
var/index = lowertext(params["index"])
var/colors = ui.user.read_preference(/datum/preference/text/preset_colors)
var/list/entries = splittext(colors, ";")
while(LAZYLEN(entries) < 20)
entries += "#FFFFFF"
if(LAZYLEN(entries) > 20)
entries.Cut(21)
var/hex = sanitize_hexcolor(raw_data)
if (!hex || !isnum(index) || entries[index] == hex)
return
entries[index] = hex
ui.user.write_preference_directly(/datum/preference/text/preset_colors, entries.Join(";"))
var/raw_data = lowertext(params["color"])
var/index = lowertext(params["index"])
var/list/entries = splittext(preset_colors, ";")
while(LAZYLEN(entries) < 20)
entries += "#FFFFFF"
if(LAZYLEN(entries) > 20)
entries.Cut(21)
var/hex = sanitize_hexcolor(raw_data)
if (!hex || !isnum(index) || entries[index] == hex)
return
entries[index] = hex
preset_colors = entries.Join(";")
return TRUE
/datum/tgui_color_picker/proc/set_choice(choice)