mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-07-20 20:52:52 +01:00
TGUI Fix verb, TGUI AI state fix, TGUI focus fix
This commit is contained in:
@@ -133,13 +133,19 @@
|
||||
*
|
||||
* optional can_be_suspended bool
|
||||
*/
|
||||
/datum/tgui_window/proc/close(can_be_suspended = TRUE)
|
||||
/datum/tgui_window/proc/close(can_be_suspended = TRUE, logout = FALSE)
|
||||
if(!client)
|
||||
return
|
||||
if(can_be_suspended && can_be_suspended())
|
||||
log_tgui(client, "[id]/close: suspending")
|
||||
status = TGUI_WINDOW_READY
|
||||
send_message("suspend")
|
||||
// You would think that BYOND would null out client or make it stop passing istypes or, y'know, ANYTHING during
|
||||
// logout, but nope! It appears to be perfectly valid to call winset by every means we can measure in Logout,
|
||||
// and yet it causes a bad client runtime. To avoid that happening, we just have to know if we're in Logout or
|
||||
// not.
|
||||
if(!logout && client)
|
||||
winset(client, null, "mapwindow.map.focus=true")
|
||||
return
|
||||
log_tgui(client, "[id]/close")
|
||||
release_lock()
|
||||
@@ -149,7 +155,8 @@
|
||||
// to read the error message.
|
||||
if(!fatally_errored)
|
||||
client << browse(null, "window=[id]")
|
||||
|
||||
if(!logout && client)
|
||||
winset(client, null, "mapwindow.map.focus=true")
|
||||
/**
|
||||
* public
|
||||
*
|
||||
@@ -189,9 +196,9 @@
|
||||
/datum/tgui_window/proc/send_asset(datum/asset/asset)
|
||||
if(!client || !asset)
|
||||
return
|
||||
// if(istype(asset, /datum/asset/spritesheet))
|
||||
// var/datum/asset/spritesheet/spritesheet = asset
|
||||
// send_message("asset/stylesheet", spritesheet.css_filename())
|
||||
if(istype(asset, /datum/asset/spritesheet))
|
||||
var/datum/asset/spritesheet/spritesheet = asset
|
||||
send_message("asset/stylesheet", spritesheet.css_filename())
|
||||
send_message("asset/mappings", asset.get_url_mappings())
|
||||
sent_assets += list(asset)
|
||||
asset.send(client)
|
||||
|
||||
Reference in New Issue
Block a user