Fixes VueUI not updating (or closing or working properly) when re-opening existing UI (#10541)

This commit is contained in:
Jiří Barouš
2020-11-14 12:21:56 +01:00
committed by GitHub
parent dc97e90855
commit 215a1f3060
3 changed files with 21 additions and 15 deletions

View File

@@ -62,7 +62,6 @@ main ui datum.
if (ntitle)
title = ntitle
SSvueui.ui_opened(src)
windowid = "vueui\ref[src]"
name = "Vueui [object]/[user]"
@@ -74,15 +73,19 @@ main ui datum.
/datum/vueui/proc/open(var/datum/asset/spritesheet/load_asset)
if(QDELETED(object))
return
if(!user.client)
return
if(!data)
data = object.vueui_data_change(null, user, src)
update_status()
if(!status || status == STATUS_CLOSE)
return
SSvueui.ui_opened(src) // this starts processing and adds the UI to the mob and whatnot
var/params = "window=[windowid];file=[windowid];"
if(width && height)
params += "size=[width]x[height];"
@@ -101,7 +104,7 @@ main ui datum.
*/
/datum/vueui/proc/close()
object.vueui_on_close(src)
SSvueui.ui_closed(src)
SSvueui.ui_closed(src) // this stops processing and cleans up references to this UI
user << browse(null, "window=[windowid]")
status = null
@@ -383,4 +386,4 @@ main ui datum.
header = "modular-computer"
/datum/vueui/modularcomputer/get_theme_class()
return "theme-nano dark-theme"
return "theme-nano dark-theme"