From fb2a8d9ac306abf9d12e1da2a9f8a733cdae8b6d Mon Sep 17 00:00:00 2001
From: Aylong <69762909+AyIong@users.noreply.github.com>
Date: Mon, 15 Apr 2024 02:33:54 +0300
Subject: [PATCH] Makes TGchat General settings better (#82652)
## About The Pull Request
Removes dropdowns from General settings tab into TGchat
Replace it with map() and Collapsible
| Before | After |
| - | - |
|

|

|
## Why It's Good For The Game
Dropdowns sucks. At least in TGchat settings, it's not the first time
they've been broken, but now it's trivially extremely inconvenient.
Now, it's faster to change the theme/font, plus a font preview has been
added, as it was before with GoonChat
Video
https://github.com/tgstation/tgstation/assets/69762909/b440db53-e78e-4440-ba33-b8e7ecade00a
## Changelog
:cl:
qol: General settings tab into TGchat, looks better now, and is more
convenient to use. Also, each button has a font written on it.
/:cl:
---
.../tgui-panel/settings/SettingsPanel.jsx | 107 +++++++++++-------
1 file changed, 66 insertions(+), 41 deletions(-)
diff --git a/tgui/packages/tgui-panel/settings/SettingsPanel.jsx b/tgui/packages/tgui-panel/settings/SettingsPanel.jsx
index 130f59d8053..e5691037bba 100644
--- a/tgui/packages/tgui-panel/settings/SettingsPanel.jsx
+++ b/tgui/packages/tgui-panel/settings/SettingsPanel.jsx
@@ -5,14 +5,15 @@
*/
import { toFixed } from 'common/math';
+import { capitalize } from 'common/string';
import { useLocalState } from 'tgui/backend';
import { useDispatch, useSelector } from 'tgui/backend';
import {
Box,
Button,
+ Collapsible,
ColorBox,
Divider,
- Dropdown,
Input,
LabeledList,
NumberInput,
@@ -84,37 +85,62 @@ export const SettingsGeneral = (props) => {
-
- dispatch(
- updateSettings({
- theme: value,
- }),
- )
- }
- />
+ {THEMES.map((THEME) => (
+
-
-
- {(!freeFont && (
-
- dispatch(
- updateSettings({
- fontFamily: value,
- }),
- )
- }
- />
- )) || (
+
+ {(!freeFont && (
+ {
+ setFreeFont(!freeFont);
+ }}
+ />
+ }
+ >
+ {FONTS.map((FONT) => (
+
+ )) || (
+
+ onChange={(value) =>
dispatch(
updateSettings({
fontFamily: value,
@@ -122,19 +148,18 @@ export const SettingsGeneral = (props) => {
)
}
/>
- )}
-
-
-
-
+