1.8 KiB
1.8 KiB
2026-02-09 - Lemontropia Suite Development
Bug Fixes - Armor System Serialization
Issue 1: JSON Serialization Error
Problem: "Decimal is not JSON serializable" when saving loadouts with new armor system.
Root Cause: The to_dict method in LoadoutConfig wasn't handling:
current_armor_protection(ProtectionProfile object)current_armor_pieces(list of ArmorPiece objects)current_armor_decay(Decimal)
Fix: Updated to_dict to properly serialize these fields before JSON serialization.
Commit: 0c843df
Issue 2: Armor Decay Not Loaded Into Session
Problem: Warning "Cost tracking not available for file-based loadouts" and armor decay not showing in HUD.
Root Cause:
_get_current_configwasn't including new armor fields when creating LoadoutConfigfrom_dictwasn't deserializing new armor fields_set_configwasn't restoring new armor fields when loading
Fix:
- Updated
_get_current_configto include new armor fields - Updated
from_dictto deserializecurrent_armor_protection,current_armor_pieces,current_armor_decay - Updated
_set_configto restore new armor fields - Updated
_on_loadout_selected_for_sessionto extract cost data for JSON-based loadouts
Commit: 8308425
Technical Details
Files Modified
ui/loadout_manager.py- Serialization/deserialization fixesui/main_window.py- Cost extraction for session start
Key Changes
to_dictnow handles complex objects manually instead of usingasdict()blindlyfrom_dictconverts Decimals and reconstructs ProtectionProfile/ArmorPiece objects- Session startup now extracts costs from both database and JSON loadouts
Testing Status
- JSON serialization fixed
- Armor decay now flows from LoadoutManager → JSON file → Session
- Need to verify live cost tracking in HUD during gameplay