what if the tgui actualy recives it's topic?

This commit is contained in:
Letter N
2020-08-05 09:21:19 +08:00
parent 07c02e1c99
commit ed67801590
5 changed files with 24 additions and 12 deletions

View File

@@ -201,9 +201,18 @@
WRITE_LOG(log, "Starting up round ID [GLOB.round_id].\n-------------------------")
/* ui logging */
/proc/log_tgui(text)
WRITE_LOG(GLOB.tgui_log, text)
/proc/log_tgui(user_or_client, text)
var/entry = ""
if(!user_or_client)
entry += "no user"
else if(istype(user_or_client, /mob))
var/mob/user = user_or_client
entry += "[user.ckey] (as [user])"
else if(istype(user_or_client, /client))
var/client/client = user_or_client
entry += "[client.ckey]"
entry += ":\n[text]"
WRITE_LOG(GLOB.tgui_log, entry)
/* Close open log handles. This should be called as late as possible, and no logging should hapen after. */
/proc/shutdown_logging()

View File

@@ -10,7 +10,7 @@
/obj/item/implant/radio/activate()
. = ..()
// needs to be GLOB.deep_inventory_state otherwise it won't open
radio.ui_interact(usr, "main", null, FALSE, null, GLOB.deep_inventory_state)
radio.ui_interact(usr, state = GLOB.deep_inventory_state)
/obj/item/implant/radio/implant(mob/living/target, mob/user, silent = FALSE)
. = ..()

View File

@@ -255,10 +255,8 @@
else
return null //error text handled tgui side. should not cause BSOD
/obj/item/clockwork/slab/ui_state(mob/user)
return GLOB.hands_state
/obj/item/clockwork/slab/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "ClockworkSlab", name)
ui.open()
@@ -330,8 +328,6 @@
"requirement" = "Unlock powerful equipment and structures by converting five servants or if [DisplayPower(JUDGEMENT_UNLOCK_THRESHOLD)] of power is reached..",
"ready" = SSticker.scripture_states[SCRIPTURE_JUDGEMENT]
)
generate_all_scripture()
.["recollection_categories"] = list()
if(GLOB.ratvar_awakens)
return
@@ -345,6 +341,8 @@
list("name" = "Conversion", "desc" = "Converting the crew, cyborgs, and very walls to your cause.")
)
.["rec_section"] = get_recollection(recollection_category)
generate_all_scripture()
//needs a new place to live, preferably when clockcult unlocks/downgrades a tier. Smart enough to earlyreturn.
/obj/item/clockwork/slab/ui_act(action, params)
switch(action)

View File

@@ -41,6 +41,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if(!asset_cache_job)
return
// Rate limiting
var/mtl = CONFIG_GET(number/minute_topic_limit)
if (!holder && mtl)
var/minute = round(world.time, 600)
@@ -98,6 +99,10 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
keyUp(keycode)
return
// Tgui Topic middleware
if(!tgui_Topic(href_list))
return
// Admin PM
if(href_list["priv_msg"])
cmd_admin_pm(href_list["priv_msg"],null)

View File

@@ -199,13 +199,13 @@
"key" = window_key,
"size" = window_size,
"fancy" = user.client.prefs.tgui_fancy,
"locked" = user.client.prefs.tgui_lock,
"locked" = user.client.prefs.tgui_lock
),
"user" = list(
"name" = "[user]",
"ckey" = "[user.ckey]",
"observer" = isobserver(user),
),
"observer" = isobserver(user)
)
)
var/data = custom_data || with_data && src_object.ui_data(user)
if(data)