[MIRROR] Fixes tgui say flash on load [MDB IGNORE] (#24361)

* Fixes tgui say flash on load (#78879)

## About The Pull Request
Hides the TGUI say window from popping up briefly during load
## Why It's Good For The Game
Just annoying for it to "jump scare" players
Fixes #75716
## Changelog
🆑
fix: TGUI Say should no longer flash during initialization
/🆑

* Fixes tgui say flash on load

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-10-16 11:34:03 -04:00
committed by GitHub
co-authored by Jeremiah
parent 7cb9501370
commit 85a1aeac0a
3 changed files with 8 additions and 22 deletions
+7 -7
View File
@@ -36,6 +36,7 @@
/datum/tgui_say/New(client/client, id)
src.client = client
window = new(client, id)
winset(client, "tgui_say", "size=1,1;is-visible=0;")
window.subscribe(src, PROC_REF(on_message))
window.is_browser = TRUE
@@ -62,11 +63,14 @@
*/
/datum/tgui_say/proc/load()
window_open = FALSE
winshow(client, "tgui_say", FALSE)
winset(client, "tgui_say", "pos=848,500;size=231,30;is-visible=0;")
window.send_message("props", list(
lightMode = client.prefs?.read_preference(/datum/preference/toggle/tgui_say_light_mode),
maxLength = max_length,
))
stop_thinking()
return TRUE
@@ -84,9 +88,7 @@
window_open = TRUE
if(payload["channel"] != OOC_CHANNEL && payload["channel"] != ADMIN_CHANNEL && payload["channel"] != LOOC_CHANNEL) // SKYRAT EDIT CHANGE (Add LOOC_CHANNEL)
start_thinking()
if(client.typing_indicators)
log_speech_indicators("[key_name(client)] started typing at [loc_name(client.mob)], indicators enabled.")
else
if(!client.typing_indicators)
log_speech_indicators("[key_name(client)] started typing at [loc_name(client.mob)], indicators DISABLED.")
return TRUE
@@ -97,9 +99,7 @@
/datum/tgui_say/proc/close()
window_open = FALSE
stop_thinking()
if(client.typing_indicators)
log_speech_indicators("[key_name(client)] stopped typing at [loc_name(client.mob)], indicators enabled.")
else
if(!client.typing_indicators)
log_speech_indicators("[key_name(client)] stopped typing at [loc_name(client.mob)], indicators DISABLED.")
/**
+1 -2
View File
@@ -4,7 +4,7 @@ import { Component, createRef, InfernoKeyboardEvent, RefObject } from 'inferno';
import { LINE_LENGTHS, RADIO_PREFIXES, WINDOW_SIZES } from './constants';
import { byondMessages } from './timers';
import { dragStartHandler } from 'tgui/drag';
import { windowOpen, windowLoad, windowClose, windowSet } from './helpers';
import { windowOpen, windowClose, windowSet } from './helpers';
import { BooleanLike } from 'common/react';
import { KEY } from 'common/keys';
@@ -68,7 +68,6 @@ export class TguiSay extends Component<{}, State> {
Byond.subscribeTo('props', this.handleProps);
Byond.subscribeTo('force', this.handleForceSay);
Byond.subscribeTo('open', this.handleOpen);
windowLoad();
}
handleArrowKeys(direction: KEY.Up | KEY.Down) {
-13
View File
@@ -22,19 +22,6 @@ export const windowClose = () => {
Byond.sendMessage('close');
};
/** Some QoL to hide the window on load. Doesn't log this event */
export const windowLoad = () => {
Byond.winset('tgui_say', {
pos: '848,500',
size: `${WINDOW_SIZES.width}x${WINDOW_SIZES.small}`,
visible: false,
});
Byond.winset('map', {
focus: true,
});
};
/**
* Modifies the window size.
*/