diff --git a/resources/lang/en.json b/resources/lang/en.json index afc4e8bf0..81a52ebae 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -927,6 +927,9 @@ "colored_names_desc": "Show player names in their player color or in black", "colored": "Colored", "black": "Black", + "section_structure_icons": "Structure Icons", + "classic_icons_label": "Classic icons", + "classic_icons_desc": "Lighter outline with near-black interior", "reset_label": "Reset to defaults", "reset_desc": "Clear all graphics overrides" }, diff --git a/src/client/ClientGameRunner.ts b/src/client/ClientGameRunner.ts index e54ea553b..17f70b31f 100644 --- a/src/client/ClientGameRunner.ts +++ b/src/client/ClientGameRunner.ts @@ -491,6 +491,7 @@ async function createClientGame( ); const live = view.getSettings(); Object.assign(live.name, generated.name); + Object.assign(live.structure, generated.structure); }; applyGraphicsOverrides(); globalThis.addEventListener( diff --git a/src/client/hud/layers/GraphicsSettingsModal.ts b/src/client/hud/layers/GraphicsSettingsModal.ts index 7219e0dde..cf4cb1e55 100644 --- a/src/client/hud/layers/GraphicsSettingsModal.ts +++ b/src/client/hud/layers/GraphicsSettingsModal.ts @@ -127,6 +127,25 @@ export class GraphicsSettingsModal extends LitElement implements Controller { this.requestUpdate(); } + private patchStructure(patch: Partial) { + const current = this.userSettings.graphicsOverrides(); + this.userSettings.setGraphicsOverrides({ + ...current, + structure: { ...current.structure, ...patch }, + }); + this.requestUpdate(); + } + + private currentClassicIcons(): boolean { + return ( + this.userSettings.graphicsOverrides().structure?.classicIcons ?? false + ); + } + + private onToggleClassicIcons() { + this.patchStructure({ classicIcons: !this.currentClassicIcons() }); + } + private onNameScaleChange(event: Event) { const value = parseFloat((event.target as HTMLInputElement).value); this.patchName({ nameScaleFactor: value }); @@ -159,6 +178,7 @@ export class GraphicsSettingsModal extends LitElement implements Controller { const nameScale = this.currentNameScale(); const nameCull = this.currentNameCull(); const namesColored = !this.currentDarkNames(); + const classicIcons = this.currentClassicIcons(); return html`
+
+ ${translateText("graphics_setting.section_structure_icons")} +
+ + +