Commit Graph

53 Commits

Author SHA1 Message Date
LemonNexus 21c2508842 fix: hotkey parsing and initialization order
- Use pynput format <f12>, <shift>+<f12> etc for hotkey parsing
- Initialize screenshot hotkeys AFTER UI setup (fixes log_output error)
- Clean up hotkey display in help text (remove angle brackets)
2026-02-11 12:37:12 +00:00
LemonNexus 299b1e0fa5 fix: correct screenshot directory path for hotkey manager
ScreenshotCapture doesn't have screenshot_dir attribute - use Path directly
2026-02-11 12:34:13 +00:00
LemonNexus 286d3b4f5c feat: add screenshot hotkey manager for manual game capture
- Add modules/screenshot_hotkey.py with global hotkey listener using pynput
- Default hotkeys: F12=Full, Shift+F12=Region, Ctrl+F12=Loot, Alt+F12=HUD
- Integrate into main_window.py with Settings dialog
- Hotkeys work globally (even when game is focused)
- Add Tools → Screenshot Hotkeys menu (Ctrl+Shift+S)
- Shows status message when screenshot is captured
2026-02-11 12:31:59 +00:00
LemonNexus 786b292fcd fix: import torch before PyQt to fix DLL loading on Windows
- Add early torch import before PyQt6 imports in main_window.py
- This prevents the c10.dll initialization error on Windows
- Solution 3 from user research: import torch before PyQt
2026-02-11 12:12:57 +00:00
LemonNexus 92558d3e49 feat: wire Computer Vision features to UI menu
- Add Computer Vision submenu under Tools menu
- Add Vision Settings, Calibrate Vision, and Test Vision actions
- Add handler methods: on_vision_settings, on_vision_calibrate, on_vision_test
- Features accessible via Tools -> Computer Vision
2026-02-11 11:44:04 +00:00
LemonNexus 1ef6b0c0a1 fix: add QCheckBox import and fix sqlite3.Row access
- Add missing QCheckBox to PyQt6.QtWidgets import
- Fix sqlite3.Row access - use 'in row.keys()' instead of .get()
- Fixes template and session loading errors
2026-02-11 11:36:21 +00:00
LemonNexus f1ac4c22c5 fix: align ActivityType enum with database schema values
- ActivityType enum now uses 'hunt', 'mine', 'craft' to match database CHECK constraint
- Setup wizard activity_combo uses correct database values
- Fixes CHECK constraint failed error when creating projects
2026-02-11 10:39:51 +00:00
LemonNexus c347b5d28e feat: major update - UI redesign, Session History, Gallery, Enhanced Loadout Manager
=== UI REDESIGN ===
- Rename Project Management to Activity History
- Add Setup Wizard for first-run configuration
- Reorganize layout: Activity Setup | Session Control | Recent Sessions
- Add prominent Loadout Manager button
- Add Activity Types (Hunting/Mining/Crafting)

=== SESSION HISTORY & GALLERY ===
- New SessionHistoryDialog (Ctrl+H) - view/export past sessions
- New GalleryDialog (Ctrl+G) - browse screenshots
- Auto-screenshot on globals and HoFs
- Screenshots saved to data/screenshots/

=== ENHANCED LOADOUT MANAGER ===
- Add Weapon Amplifier support
- Add Armor Plating support
- Add Mindforce Implant support
- New AmplifierSelector dialog
- Full cost calculations for all gear types

=== NEW FILES ===
- ui/setup_wizard.py
- ui/session_history.py
- ui/gallery_dialog.py
- ui/amplifier_selector.py
- docs/CODEBASE_AUDIT_REPORT.md

=== MODIFIED FILES ===
- ui/main_window.py - major restructuring
- ui/loadout_manager_simple.py - enhanced gear support
- gui_main.py - first-run wizard check
2026-02-11 10:23:21 +00:00
LemonNexus c93b57aec4 fix: count weapon cost when target evades/dodges your attack
- Check evade type for 'target Evaded' or 'target Dodged'
- Count weapon cost on those events (you fired but missed)
- Armor decay still only counted on actual damage taken
- Fixes: weapon cost now accurate for all shots including misses
2026-02-11 09:52:11 +00:00
LemonNexus 48bd83dade fix: adjust armor decay formula to ~0.025 PEC per damage
- Changed from 0.0005 to 0.00025 PED per damage (0.025 PEC)
- Based on user feedback: 504 damage should give ~0.14 PED decay
- Removed complex fallback logic, using simple accurate formula
- Formula: damage * 0.00025 = armor decay in PED
2026-02-11 09:44:52 +00:00
LemonNexus 6e425f2c06 fix: move _load_settings() after setup_ui() to fix AttributeError
- log_info() needs log_output which is created in setup_ui()
- Move _load_settings() call to after UI initialization
- Fixes 'MainWindow' object has no attribute 'log_output' error
2026-02-11 09:15:57 +00:00
LemonNexus 5837333d69 feat: add persistent settings for avatar name
- Add QSettings import from PyQt6.QtCore
- Add _load_settings() method to load player name on startup
- Add _save_settings() method to save player name when settings change
- Settings stored in Lemontropia/Suite registry/file
- Player name now persists between app launches
2026-02-11 09:08:04 +00:00
LemonNexus a216afde2d fix: calculate armor decay based on actual damage absorbed
- Use formula: Decay (PED) = damage * 0.0005 (approx 0.05 PEC per damage)
- This matches EU armor decay formula better than flat cost per hit
- 1966 damage would give ~0.98 PED decay (not 22 PED)
- Falls back to cost_per_hit if armor stats not available
2026-02-10 15:29:50 +00:00
LemonNexus e4fd75e2a7 fix: save HUD costs to database on session end
- Save weapon_cost_total, armor_cost_total, healing_cost_total to decay_events
- This ensures core profit calculation matches HUD display
- Insert decay events before calling end_session
- Log the saved costs for verification
2026-02-10 14:52:32 +00:00
LemonNexus 6d99d357ab fix: pause/resume now stops HUD tracking
- Set hud.session_active = False when paused
- Set hud.session_active = True when resumed
- Update HUD status label to show paused state (orange)
- Prevents loot/costs from being tracked during breaks
2026-02-10 14:49:31 +00:00
LemonNexus fe0858ebfa fix: correct kill counting logic
- Remove separate update_kills() call from on_loot handler
- Let update_loot() handle kill counting internally
- Only increment kills when >2 second gap since last loot
- Add is_new_kill flag to track new mobs vs multi-item drops
- Add debug logging for kill counting
2026-02-10 14:37:46 +00:00
LemonNexus b14888dc97 feat: add total skill gained tracking to HUD
- Add show_skills config option to HUDConfig
- Add total_skill_gained and skill_gains fields to HUDStats
- Add skills display section in HUD UI (purple box)
- Add update_skill() method to track skill gains
- Update on_skill handler in main_window.py to call update_skill()
- Add skills checkbox to HUD settings dialog
- Fix duplicate code in _refresh_display method
- Update to_dict/from_dict for skills config persistence
2026-02-10 14:19:56 +00:00
LemonNexus ecf27a504c fix: add missing logger import at top of main_window.py
- Import logging module
- Create logger instance for use in event handlers
- Fixes 'name logger is not defined' errors
2026-02-10 14:15:44 +00:00
LemonNexus 818d0f98f3 fix: add missing _session_costs initialization and verbose debug logging
- Initialize _session_costs and _session_display in __init__ (was causing crashes)
- Add [EVENT], [HUD], [DEBUG], [ERROR] prefix logging to all event handlers
- Add traceback logging for better debugging
- Add debug logging to all HUD update methods
- Log session_active state in HUD methods
2026-02-10 14:11:05 +00:00
LemonNexus e17f7e3565 fix: properly wire cost tracking and loot tracking to new HUD
- Add weapon cost tracking on damage_dealt using session_costs
- Add armor cost tracking on damage_taken using session_costs
- Fix on_loot to use update_kills() and update_loot() with proper params
- Fix on_heal to use update_healing_cost() and on_heal_event() with proper params
- All cost tracking now uses _session_costs from loadout selection
2026-02-10 13:57:41 +00:00
LemonNexus c0cb42cd54 fix: use new clean HUD overlay (hud_overlay_clean.py)
- Change import from hud_overlay to hud_overlay_clean
- New HUD has better layout, customizable sections, Cost/Loot/Highest display
2026-02-10 13:51:13 +00:00
LemonNexus 303bb3b538 fix: remove calls to non-existent methods and add error handling
- Remove update_cost calls (method doesn't exist in new HUD)
- Remove update_stats with shots_add (not implemented)
- Add try/except to all event handlers to prevent crashes
- Simplify damage tracking to just update_damage methods
2026-02-10 13:50:24 +00:00
LemonNexus 90595a8ebe feat: add player name setting for accurate global tracking
- Settings dialog now has Avatar Name field
- Store player_name in MainWindow
- Filter personal globals to only count if player name matches
- Warn user if no player name is configured
- Log other players' globals separately
2026-02-10 13:40:42 +00:00
LemonNexus 675bf981db fix: resolve type errors and global counting issues in HUD event handlers
- Fix float/Decimal type errors in damage event handlers
- Fix global counter counting other players' globals
- on_personal_global() only counts your globals, not on_global()
- on_global() now only logs but doesn't increment counter
- Add on_loot_event() and on_heal_event() handlers
- Convert damage values to Decimal in main_window callbacks
2026-02-10 13:29:05 +00:00
LemonNexus cdc9f5b825 refactor: simplified cost-focused Loadout Manager
- New LoadoutManagerSimple with clean cost-focused design
- LoadoutConfig now stores only: cost_per_shot/hit/heal + display names
- Legacy format support for backward compatibility
- Simplified LoadoutSelectionDialog with clear cost preview
- Updated MainWindow to use new simplified structure
- Removed 3 overlapping armor systems, replaced with single decay value
- JSON serialization is now simple and reliable

Key principle: Only store what's needed for cost tracking.
2026-02-09 21:41:55 +00:00
LemonNexus 83084252cc fix: save and load new armor system fields properly
- _get_current_config now includes new armor fields
- to_dict properly serializes current_armor_decay as string
- from_dict properly deserializes new armor fields
- _set_config restores new armor fields when loading
- Armor decay now flows from LoadoutManager to session
2026-02-09 21:21:32 +00:00
LemonNexus ca8f9f8eb3 fix: pass full loadout info to session and display gear names in HUD
- Updated loadout_selected signal to emit dict with full loadout info
- _on_loadout_selected_for_session now extracts weapon/armor/healing names
- HUD now shows gear names from selected loadout
- Cost tracker skipped for JSON-based loadouts (need DB save first)
2026-02-09 20:50:26 +00:00
LemonNexus d7f1e61533 feat: connect loadout selection to session cost tracking
- start_session now uses _session_loadout_name for HUD display
- Added _setup_session_cost_tracker to initialize SessionCostTracker
- Added _on_cost_update callback to update HUD with live costs
- Loadout name now appears in HUD instead of 'Default'
2026-02-09 20:44:28 +00:00
LemonNexus c71f6a8647 feat: add loadout selection dialog when starting session
- Modified on_start_session to show LoadoutSelectionDialog first
- Added _on_loadout_selected_for_session callback
- User can now select a loadout or skip before session starts
- Selected loadout info is logged and stored for session
2026-02-09 20:26:51 +00:00
LemonNexus c8128e954f fix(ui): correct signal name loadout_saved (not loadout_selected) 2026-02-09 10:46:11 +00:00
LemonNexus ae182f408b feat(armor): implement official decay formula (VU 15.15)
- Formula: Decay = damage * 0.05 * (1 - durability/100000)
- Added armor_decay.py with complete calculation module
- Database of 30+ armors with durability values
- Economy comparison: Ghost (20.41) → Perseus L (23.53) hp/pec
- Example: 15 dmg on Ghost = 0.00735 PED decay
2026-02-09 10:27:05 +00:00
LemonNexus 08aec368a9 docs: add official armor guide from PlanetCalypsoForum 2020 edition
- Loot 2.0 armor changes (June 2017)
- Correct decay mechanics (plate/armor independent)
- Armor progression guide (Gremlin → Ghost → Adj Nemesis)
- 20 hp/pec base economy standard
- Damage absorption flow and formulas
2026-02-09 10:21:57 +00:00
LemonNexus d24d5e149e feat(swarm): Agent swarm - Loadout Manager v2.0, Armor Decay, Attachments
- Loadout Manager v2.0 with full Nexus API integration (3,099 weapons, 1,985 armors)
- Attachment system: Amplifiers, Scopes, Absorbers, Armor Platings
- Weapon/Armor/Attachment selectors with real data
- Armor decay tracking when hit (cost added to HUD)
- Complete cost calculations (weapon + armor + attachments + healing)
- NEW: ui/attachment_selector.py standalone module
- Updated core/nexus_api.py with decay fields
- DPP display in HUD overlay
2026-02-09 09:28:41 +00:00
LemonNexus 8014b63e75 feat(hud): estimated kills - each loot event = 1 kill
- Every loot batch (You received [item]) = 1 estimated kill
- Label shows 'EST. KILLS' to indicate estimated value
- Simple and consistent kill tracking
2026-02-08 23:54:54 +00:00
LemonNexus b3d257a42d fix(hud): simplify kill tracking - only count non-Shrapnel loot
- Shrapnel-only mobs undercounted, but no overcounting
- Better to undercount than overcount for profit analysis
- Removes complex Shrapnel heuristic
2026-02-08 23:52:33 +00:00
LemonNexus 31ead88886 fix(hud): reset Shrapnel counter on non-Shrapnel loot
- Non-Shrapnel loot = 1 kill AND reset Shrapnel counter
- Prevents overcounting when mob drops Shrapnel + Oil
- Shrapnel counted as 1 kill per 2 pieces
2026-02-08 23:51:02 +00:00
LemonNexus ff7b304c78 fix(hud): improved kill tracking with Shrapnel heuristic
- Non-Shrapnel loot = definite kill
- Shrapnel: every 2 Shrapnel = 1 kill (since mobs drop 1-2 Shrapnel)
- This handles mobs that drop only Shrapnel
- Reset Shrapnel counter on session start
2026-02-08 23:47:37 +00:00
LemonNexus 647728a1d4 feat(hud): add shots fired counter and fix kill tracking
- Add shots_fired counter to HUDStats
- Display SHOTS in HUD next to DAMAGE DEALT/TAKEN
- Track 1 shot per damage event
- Fix kills: count when non-Shrapnel loot is received
- Shrapnel excluded from kill count (every mob drops it)
2026-02-08 23:43:37 +00:00
LemonNexus 3a3e389f05 fix(hud): correct cost calculation using weapon decay from Nexus API
- Use actual weapon decay (PEC) from API instead of broken DPP calculation
- Add decay and ammo_burn to weapon stats passed from Gear Selector
- Cost per shot = decay (in PEC) / 100 = PED
2026-02-08 23:34:02 +00:00
LemonNexus 0a12b22498 fix(hud): fix Decimal/float division error in cost calculation
- Convert both damage and dpp to Decimal before division
- Proper Decimal arithmetic for precision
2026-02-08 23:28:44 +00:00
LemonNexus 7c38b398f3 feat(hud): cost tracking and profit/loss calculation
- HUD now shows: LOOT, COST, and PROFIT/LOSS (P/L)
- Profit/Loss color-coded: Green=profit, Red=loss, White=break-even
- Cost estimated from weapon DPP and damage dealt
- Weapon stats (DPP, cost/hour) passed when starting session
- Tracks cost per shot based on damage output
- All stats persisted in HUDStats dataclass
2026-02-08 23:22:13 +00:00
LemonNexus 3cd0613e10 feat(gui): full gear selection - weapons, armors, and finders
- Gear Selector now supports: Weapons, Armors, Finders
- Weapons: 3,099 items with DPP, cost/hour, damage
- Armors: 1,985 items with protection values
- Finders: 106 items with depth/radius
- Menu: Tools → Select Gear → Weapon/Armor/Finder
- Shortcuts: Ctrl+W (weapon), Ctrl+Shift+A (armor), Ctrl+Shift+F (finder)
- Sync API for simpler code
2026-02-08 23:11:07 +00:00
LemonNexus b8e7a892ff feat(gui): add Gear Selector and fix kill counting
- Remove auto-kill counting on loot (was overcounting)
- Add GearSelectorDialog to select weapons/armor/tools from Nexus API
- Add Tools → Select Gear menu (Ctrl+G)
- Selected weapon now shows in HUD during session
- Uses mock data from nexus_api.py for now
2026-02-08 22:42:55 +00:00
LemonNexus 0f4d1271f8 fix(gui): ProjectStatsDialog uses correct ProjectData fields
- Remove references to non-existent description, session_count, last_session
- Use project.type, project.status, project.metadata for description
- Fixes AttributeError when viewing project stats
2026-02-08 22:34:00 +00:00
LemonNexus 59094ee469 fix(gui): SQLite thread safety - use queue for cross-thread database access
- LogWatcher callbacks now queue events instead of direct DB access
- Main thread processes queue every 100ms
- Fixes 'SQLite objects created in a thread can only be used in that same thread' error
- Loot will now be properly recorded to database
2026-02-08 22:33:08 +00:00
LemonNexus e1316076bf fix(gui): logging methods don't depend on log_watcher
- log_debug/info/warning/error now use _append_log directly
- Avoids AttributeError when log_watcher is None during init
- LogWatcher is only used for game events, not UI logging
2026-02-08 22:14:52 +00:00
LemonNexus e2388dadaf fix(gui): correct create_project call - use metadata not description
- ProjectManager.create_project signature: (name, project_type, metadata=None)
- GUI was incorrectly passing description as 3rd arg
- Now passes metadata={'description': description}
- Add test_gui_simple.py for quick integration testing
2026-02-08 22:11:05 +00:00
LemonNexus d283de84ee fix(gui): remove session_count from project list - ProjectData doesn't have this field
Show Type and Status columns instead of Sessions
2026-02-08 22:08:13 +00:00
LemonNexus a0dd7f8cad fix(gui): correct ProjectManager method names
- get_all_projects() → list_projects()
- get_project() → load_project()
- create_project() now includes project_type='hunt' parameter

Fixes AttributeError on startup
2026-02-08 22:06:07 +00:00
LemonNexus 25a25d031e fix(gui): integrate real LogWatcher and ProjectManager into MainWindow
- Replace placeholder classes with real core.database, core.project_manager, core.log_watcher
- Add LogWatcher lifecycle management (start/stop in background thread)
- Connect log events to HUD updates (loot, damage, globals, etc.)
- Add database session tracking
- Fix session stop to properly end database session and stop LogWatcher

This enables real-time log parsing in the GUI!
2026-02-08 22:03:06 +00:00