From 2e691b8b51a38a8c05f4e260a2b4a16246a1bbe3 Mon Sep 17 00:00:00 2001 From: JonKazama-Hellion Date: Thu, 16 Apr 2026 22:16:19 +0200 Subject: [PATCH] =?UTF-8?q?fix(calculator):=20save()=20=C3=BCberschreibt?= =?UTF-8?q?=20Game-Mode=20Sub-States=20nicht=20mehr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit data.calculator wurde bei jedem save() komplett ersetzt, wodurch factorio/satisfactory Sub-Mode-Präferenzen verloren gingen. Jetzt werden nur die Core-Properties einzeln gesetzt. Co-Authored-By: Claude Opus 4.6 --- src/js/calculator.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/js/calculator.js b/src/js/calculator.js index 6a33f72..ff0e83c 100644 --- a/src/js/calculator.js +++ b/src/js/calculator.js @@ -58,15 +58,14 @@ const Calculator = { // Widget-Position aus WidgetManager holen const widgetState = WidgetManager.getState(this.WIDGET_ID); - data.calculator = { - x: widgetState ? widgetState.x : 400, - y: widgetState ? widgetState.y : 120, - width: widgetState ? widgetState.width : 280, - height: widgetState ? widgetState.height : 400, - open: this._isOpen, - activeMode: this._activeMode, - history: this._history.slice(0, this.MAX_HISTORY) - }; + if (!data.calculator) data.calculator = {}; + data.calculator.x = widgetState ? widgetState.x : 400; + data.calculator.y = widgetState ? widgetState.y : 120; + data.calculator.width = widgetState ? widgetState.width : 280; + data.calculator.height = widgetState ? widgetState.height : 400; + data.calculator.open = this._isOpen; + data.calculator.activeMode = this._activeMode; + data.calculator.history = this._history.slice(0, this.MAX_HISTORY); await Store.set(this.STORAGE_KEY, data); },