mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-18 19:39:53 +01:00
Merge pull request #10575 from Arturlang/TGUIs_Nexties
[TESTMERGE] Properly working TGUI Next
This commit is contained in:
@@ -33,6 +33,37 @@
|
||||
/datum/proc/ui_data(mob/user)
|
||||
return list() // Not implemented.
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Static Data to be sent to the UI.
|
||||
* Static data differs from normal data in that it's large data that should be sent infrequently
|
||||
* This is implemented optionally for heavy uis that would be sending a lot of redundant data
|
||||
* frequently.
|
||||
* Gets squished into one object on the frontend side, but the static part is cached.
|
||||
*
|
||||
* required user mob The mob interacting with the UI.
|
||||
*
|
||||
* return list Statuic Data to be sent to the UI.
|
||||
**/
|
||||
/datum/proc/ui_static_data(mob/user)
|
||||
return list()
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
* Forces an update on static data. Should be done manually whenever something happens to change static data.
|
||||
*
|
||||
* required user the mob currently interacting with the ui
|
||||
* optional ui ui to be updated
|
||||
* optional ui_key ui key of ui to be updated
|
||||
*
|
||||
**/
|
||||
/datum/proc/update_static_data(mob/user, datum/tgui/ui, ui_key = "main")
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui)
|
||||
if(!ui)
|
||||
return //If there was no ui to update, there's no static data to update either.
|
||||
ui.push_data(null, ui_static_data(), TRUE)
|
||||
|
||||
/**
|
||||
* public
|
||||
@@ -80,7 +111,6 @@
|
||||
* Used to track UIs for a mob.
|
||||
**/
|
||||
/mob/var/list/open_uis = list()
|
||||
|
||||
/**
|
||||
* public
|
||||
*
|
||||
@@ -111,4 +141,4 @@
|
||||
ui.close()
|
||||
// Unset machine just to be sure.
|
||||
if(src && src.mob)
|
||||
src.mob.unset_machine()
|
||||
src.mob.unset_machine()
|
||||
|
||||
Reference in New Issue
Block a user