From 2b5449abd706d2c9e163589de3259b3f7387bc06 Mon Sep 17 00:00:00 2001 From: itsmeow Date: Mon, 8 Jan 2024 15:34:52 -0600 Subject: [PATCH] Speed up ByondUI mounting (#10427) --- tgui/packages/tgui/components/ByondUi.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tgui/packages/tgui/components/ByondUi.js b/tgui/packages/tgui/components/ByondUi.js index b47d7d9121b2c..7a8766073604c 100644 --- a/tgui/packages/tgui/components/ByondUi.js +++ b/tgui/packages/tgui/components/ByondUi.js @@ -27,6 +27,7 @@ const createByondUiElement = (elementId) => { render: (params) => { logger.log(`rendering '${id}'`); byondUiStack[index] = id; + params['is-visible'] = 'true'; Byond.winset(id, params); Byond.sendMessage('byondui_update', { mounting: true, id: id }); }, @@ -34,7 +35,7 @@ const createByondUiElement = (elementId) => { logger.log(`unmounting '${id}'`); byondUiStack[index] = null; Byond.winset(id, { - parent: '', + 'is-visible': 'false', }); Byond.sendMessage('byondui_update', { mounting: false, id: id }); }, @@ -49,7 +50,7 @@ window.addEventListener('beforeunload', () => { logger.log(`unmounting '${id}' (beforeunload)`); byondUiStack[index] = null; Byond.winset(id, { - parent: '', + 'is-visible': 'false', }); Byond.sendMessage('byondui_update', { mounting: false, id: id }); }