fix(calculator): save() überschreibt Game-Mode Sub-States nicht mehr

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 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 22:16:19 +02:00
parent 11419bd589
commit 2e691b8b51
+8 -9
View File
@@ -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);
},