EU-Utility/memory/2026-02-10.md

74 lines
2.7 KiB
Markdown

# 2026-02-10 - Lemontropia Suite Session
## Session Summary
Intensive debugging session with user testing the new HUD overlay and settings.
## Key Issues Resolved
### 1. Python Cache Hell
- **Problem**: Code changes not taking effect despite git pull
- **Root Cause**: `__pycache__` folders with stale `.pyc` files
- **Solution**: User must run `Remove-Item -Recurse -Force "ui\__pycache__"` after every pull
- **Lesson**: Document this prominently - Python cache is the #1 cause of "changes not showing"
### 2. Settings Dialog Missing Avatar Name
- **Problem**: Settings showed placeholder text, no avatar name field
- **Fix**: Updated `SettingsDialog` class with `player_name_edit` field and `get_player_name()` method
- **Commit**: `90595a8`
### 3. Global Counter Wrong
- **Problem**: Counting all globals, not just user's
- **Fix**: Added player name comparison in `on_personal_global()` handler
- **Commit**: `90595a8`
### 4. Cost Tracking Not Working
- **Problem**: Weapon/Armor/Healing costs stayed at 0.00
- **Root Cause**: Removed calls to non-existent `update_cost()` method
- **Fix**: Added proper calls to `update_weapon_cost()`, `update_armor_cost()`, `update_healing_cost()`
- **Commit**: `e17f7e3`
### 5. Loot Tracking Broken
- **Problem**: Loot events threw "takes 2 positional arguments but 3 were given"
- **Fix**: Updated `on_loot()` to use `update_kills()` and `update_loot()` with correct params
- **Commit**: `e17f7e3`
### 6. Stylesheet Crash
- **Problem**: `Could not parse stylesheet of object QLabel` crash
- **Fix**: Wrapped `_refresh_display()` in try/except, added widget existence checks
- **Commit**: `b8bd462`
### 7. Wrong HUD Used
- **Problem**: App using old `hud_overlay.py` instead of new `hud_overlay_clean.py`
- **Fix**: Changed import in `main_window.py`
- **Commit**: `c0cb42c`
## Code Patterns Established
### Event Handler Pattern
```python
def on_event(event):
from decimal import Decimal
try:
value = event.data.get('key', 0)
if value:
self.hud.method_name(Decimal(str(value)))
# Additional tracking...
except Exception as e:
logger.error(f"Error: {e}")
```
### Cost Tracking via _session_costs
- Store `cost_per_shot`, `cost_per_hit`, `cost_per_heal` in `_session_costs`
- Update HUD on each relevant event
## Git Workflow Reminders
- Always clear `__pycache__` after pull
- Use `git stash` if local changes block pull
- Commit messages: `type(scope): description`
## User Testing Notes
- User name: Roberth Noname Rajala
- Testing live with ArMatrix BP-25, Frontier Adjusted armor
- HUD shows: Cost, Total, S (Shrapnel), R (Regular), Highest loot
- Live DPP calculation was showing 1000+ (fixed by removing bad calc)