diff --git a/web/src/App.css b/web/src/App.css index db7e03e..9911798 100644 --- a/web/src/App.css +++ b/web/src/App.css @@ -2295,6 +2295,15 @@ 0 0 0 1px rgba(0, 0, 0, 0.2); } +/* Channel commander as its own lamp (Design -> "Zeige Channel Commander als Lampe"). */ +.ts-app .ts-talk-lamp-commander.ts-talk-lamp-idle { + background: radial-gradient(circle at 32% 28%, #ffe0a8 0%, #e8912d 45%, #8a4a0e 100%); +} + +.ts-app .ts-talk-lamp-commander.ts-talk-lamp-talking { + box-shadow: 0 0 0 2px #e8912d, 0 0 4px rgba(232, 145, 45, 0.6); +} + .ts-talk-lamp-muted { border-radius: 0; background: transparent; @@ -3774,6 +3783,47 @@ font-size: 13px; } +.ts-design-native .ts-design-col { + flex: 1; + min-width: 0; + gap: 0.75rem; +} + +.ts-design-indent { + padding-left: 1.4rem; +} + +.ts-design-indent input[type="number"] { + width: 5em; +} + +.ts-options-disabled { + opacity: 0.5; +} + +.ts-design-back { + margin-bottom: 0.75rem; +} + +.ts-design-manage-heading { + margin: 1.25rem 0 0.5rem; +} + +.ts-design-iconpack-list { + list-style: none; + margin: 0 0 0.5rem; + padding: 0; +} + +.ts-design-iconpack-list li { + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.5rem; + padding: 0.25rem 0; + font-size: 12px; +} + .ts-design-custom-actions { display: flex; gap: 0.5rem; diff --git a/web/src/App.tsx b/web/src/App.tsx index a1a55c9..f6abcc6 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useState, type ReactNode } from "react"; +import { createContext, useContext, useEffect, useMemo, useRef, useState, type ReactNode } from "react"; import { useRegisterSW } from "virtual:pwa-register/react"; import "./App.css"; // After App.css: its :where() base variables have the same (zero) specificity. @@ -141,6 +141,16 @@ import { type SoundEventId, } from "./sounds"; import { parseSoundpack } from "./soundpack"; +import { + iconPackCss, + loadIconPacks, + loadSelectedIconPack, + parseIconPack, + saveIconPacks, + saveSelectedIconPack, + type IconPack, +} from "./iconpack"; +import { StillImg } from "./lib/still"; import { GREENTEASPEAK_THEME_ID, GreenteaSpeakChrome, @@ -608,6 +618,60 @@ const SERVER_BANNER_KEY = "webspeak3:server-banner"; const IDE_PIXEL_FONT_KEY = "webspeak3:ide-pixel-font"; // Off by default: an inline chat image loads from whatever host the sender picked. const CHAT_IMAGES_KEY = "webspeak3:chat-images"; +const TREE_OPTIONS_KEY = "webspeak3:tree-options"; + +/** Design tab -> "Channel Baum" and "GIF Animation" (TS3's options). */ +interface TreeOptions { + expandMode: "all" | "own"; + /** Channel levels to expand with expandMode "all"; 0 = every level. */ + expandDepth: number; + clientsBelow: boolean; + flags: boolean; + groupIconsInMenus: boolean; + commanderLamp: boolean; + awayMessage: boolean; + tooltips: boolean; + animateAvatars: boolean; + animateImages: boolean; +} + +const DEFAULT_TREE_OPTIONS: TreeOptions = { + expandMode: "all", + expandDepth: 0, + clientsBelow: false, + flags: true, + groupIconsInMenus: true, + commanderLamp: false, + awayMessage: true, + tooltips: true, + animateAvatars: true, + animateImages: true, +}; + +function loadTreeOptions(): TreeOptions { + try { + return { ...DEFAULT_TREE_OPTIONS, ...JSON.parse(localStorage.getItem(TREE_OPTIONS_KEY) ?? "{}") }; + } catch { + return DEFAULT_TREE_OPTIONS; + } +} + +/** Display prefs read deep in the tree; a context spares threading them through every level. */ +const DisplayPrefsContext = createContext<{ + tree: TreeOptions; + setTree: (next: TreeOptions) => void; + iconPacks: IconPack[]; + iconPackId: string; + setIconPackId: (id: string) => void; + saveIconPacks: (packs: IconPack[]) => void; +}>({ + tree: DEFAULT_TREE_OPTIONS, + setTree: () => {}, + iconPacks: [], + iconPackId: "", + setIconPackId: () => {}, + saveIconPacks: () => {}, +}); const DISCONNECT_MESSAGE_KEY = "webspeak3:disconnect-message"; const COLLECTED_URLS_KEY = "webspeak3:collected-urls"; @@ -928,7 +992,7 @@ function countryFlag(code: string): string | null { function ChannelIcon() { return ( -