mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 21:19:00 +01:00
More 516 fixes and TGUI improvements (#26617)
* more 516 fixes and tweaks * cleaned build output --------- Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
@@ -269,7 +269,7 @@
|
||||
/client/New(TopicData)
|
||||
// TODO: Remove with 516
|
||||
if(byond_version >= 516) // Enable 516 compat browser storage mechanisms
|
||||
winset(src, "", "browser-options=byondstorage")
|
||||
winset(src, "", "browser-options=byondstorage,find")
|
||||
|
||||
var/tdata = TopicData //save this for later use
|
||||
// Instantiate stat panel
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
// Force show the panel to see if there are any errors
|
||||
winset(src, "output", "is-disabled=1&is-visible=0")
|
||||
winset(src, "chat_panel", "is-disabled=0;is-visible=1")
|
||||
if(byond_version >= 516)
|
||||
winset(src, null, "browser-options=byondstorage,find")
|
||||
|
||||
/client/verb/refresh_tgui()
|
||||
set name = "Refresh TGUI"
|
||||
|
||||
Vendored
-894
File diff suppressed because one or more lines are too long
Vendored
+925
File diff suppressed because one or more lines are too long
+1
-1
@@ -21,4 +21,4 @@ pnpEnableEsmLoader: false
|
||||
|
||||
preferInteractive: true
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.3.1.cjs
|
||||
yarnPath: .yarn/releases/yarn-4.4.1.cjs
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"private": true,
|
||||
"name": "tgui-workspace",
|
||||
"version": "4.5.1-paradise",
|
||||
"packageManager": "yarn@4.3.1",
|
||||
"packageManager": "yarn@4.4.1",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
|
||||
@@ -25,7 +25,8 @@ export enum KEY {
|
||||
Down = 'Down',
|
||||
End = 'End',
|
||||
Enter = 'Enter',
|
||||
Escape = 'Esc',
|
||||
Esc = 'Esc',
|
||||
Escape = 'Escape',
|
||||
Home = 'Home',
|
||||
Insert = 'Insert',
|
||||
Left = 'Left',
|
||||
@@ -37,3 +38,18 @@ export enum KEY {
|
||||
Tab = 'Tab',
|
||||
Up = 'Up',
|
||||
}
|
||||
|
||||
/**
|
||||
* ### isEscape
|
||||
*
|
||||
* Checks if the user has hit the 'ESC' key on their keyboard.
|
||||
* There's a weirdness in BYOND where this could be either the string
|
||||
* 'Escape' or 'Esc' depending on the browser. This function handles
|
||||
* both cases.
|
||||
*
|
||||
* @param key - the key to check, typically from event.key
|
||||
* @returns true if key is Escape or Esc, false otherwise
|
||||
*/
|
||||
export const isEscape = (key: string): boolean => {
|
||||
return key === KEY.Esc || key === KEY.Escape;
|
||||
};
|
||||
|
||||
@@ -69,15 +69,15 @@ class HubStorageBackend {
|
||||
}
|
||||
}
|
||||
|
||||
async set(key, value) {
|
||||
set(key, value) {
|
||||
window.hubStorage.setItem('paradise-' + key, JSON.stringify(value));
|
||||
}
|
||||
|
||||
async remove(key) {
|
||||
remove(key) {
|
||||
window.hubStorage.removeItem('paradise-' + key);
|
||||
}
|
||||
|
||||
async clear() {
|
||||
clear() {
|
||||
window.hubStorage.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import { byondMessages } from './timers';
|
||||
import { dragStartHandler } from 'tgui/drag';
|
||||
import { windowOpen, windowClose, windowSet } from './helpers';
|
||||
import { BooleanLike } from 'common/react';
|
||||
import { KEY } from 'common/keys';
|
||||
import { isEscape, KEY } from 'common/keys';
|
||||
|
||||
type ByondOpen = {
|
||||
channel: Channel;
|
||||
@@ -258,9 +258,10 @@ export class TguiSay extends Component<{}, State> {
|
||||
this.handleIncrementChannel();
|
||||
break;
|
||||
|
||||
case KEY.Escape:
|
||||
this.handleClose();
|
||||
break;
|
||||
default:
|
||||
if (isEscape(event.key)) {
|
||||
this.handleClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KEY } from 'common/keys';
|
||||
import { isEscape, KEY } from 'common/keys';
|
||||
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Autofocus, Box, Button, Section, Stack } from '../components';
|
||||
@@ -77,7 +77,7 @@ export const KeyComboModal = (props, context) => {
|
||||
if (event.key === KEY.Enter) {
|
||||
act('submit', { entry: input });
|
||||
}
|
||||
if (event.key === KEY.Escape) {
|
||||
if (isEscape(event.key)) {
|
||||
act('cancel');
|
||||
}
|
||||
return;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user