Skip to content

FEATURE: Add Infrastructure Hub Upgrade Tracking System#204

Merged
Slazanger merged 11 commits intoSlazanger:masterfrom
coresync2k:rebuild-sov-upgrades
Dec 7, 2025
Merged

FEATURE: Add Infrastructure Hub Upgrade Tracking System#204
Slazanger merged 11 commits intoSlazanger:masterfrom
coresync2k:rebuild-sov-upgrades

Conversation

@coresync2k
Copy link

@coresync2k coresync2k commented Dec 6, 2025

Add Infrastructure Hub Upgrade Tracking System

Summary

This PR introduces a comprehensive system for tracking Sovereignty Infrastructure Hub upgrades in EVE Online systems. Players can now manage, view, and track IHub upgrades with visual indicators on the map and a dedicated management interface.

Features Added

Core Data Model

  • InfrastructureUpgrade class - New data structure for storing upgrade information
    • Slot number tracking
    • Upgrade name and level
    • Online/offline status
    • Display formatting
  • Extended System class - Added InfrastructureUpgrades list property to track upgrades per system
  • Persistence Layer - Auto-load/save functionality with backward compatibility
    • Supports simplified format: system name followed by upgrade data
    • Auto-loads on startup from InfrastructureUpgrades.txt

Visual Map Indicators

  • Green Circle Indicators - Systems with infrastructure upgrades display a small green circle (6px) on the map
    • Positioned to the left of the system name
    • Only shown for in-region systems (not border systems)
    • Persists correctly during map redraws via 2-second timer
    • Fixed positioning issue that caused indicators to appear at region locations

Management UI (InfrastructureUpgradeWindow)

  • Full-featured management interface for adding, editing, and deleting upgrades
  • System Selection - Searchable ComboBox with all EVE systems
  • Upgrades DataGrid - Shows all upgrades for selected system
    • Slot number, upgrade name, level, and online status
    • Dark theme with alternating row colors (#2A2A2A / #333333)
    • Excellent readability with white text
  • Add/Edit Form - Compact 2-row layout
    • Row 1: Slot number and upgrade type selection
    • Row 2: Level and online status
    • Pre-populated upgrade types (15 common IHub upgrades)
  • Auto-save - Changes automatically saved after every operation
  • Auto-refresh - Map immediately updates after save to show green indicators

UI/UX Improvements

  • Consistent Dark Theme - Applied SMT's dark theme throughout
    • GroupBox borders (#555555) and headers (LightGray)
    • DataGrid with dark background and white text
    • ComboBox styling matching DataGrid theme
    • Hover effects (#404040) and selection states (#505050)
  • System Info Panel - Upgrades displayed when clicking a system on the map
    • Shows upgrade slot, name, level
    • Color-coded status (LightGreen = Online, Gray = Offline)

File Operations

  • Menu Integration - Added to MainWindow Data menu:
    • "Manage Infrastructure Upgrades..." - Opens management window
    • "Load Infrastructure Upgrades..." - Load from custom file
    • "Save Infrastructure Upgrades..." - Save to custom file
  • File Format - Simple text format:

Technical Details

Files Modified

  • EVEData/InfrastructureUpgrade.cs - New class (created)
  • EVEData/System.cs - Added InfrastructureUpgrades property
  • EVEData/EveManager.cs - Added load/save/set/remove methods
  • SMT/RegionControl.xaml.cs - Added visual indicators and system info display
  • SMT/MainWindow.xaml - Added menu items
  • SMT/MainWindow.xaml.cs - Added event handlers
  • SMT/InfrastructureUpgradeWindow.xaml - New management UI (created)
  • SMT/InfrastructureUpgradeWindow.xaml.cs - New management logic (created)

Bug Fixes

  • Fixed indicator disappearance - Moved drawing logic from AddSystemsToMap() to AddDataToMap() to ensure indicators persist during timer-based redraws
  • Fixed positioning - Added !isSystemOOR check to prevent indicators from appearing at wrong locations
  • Fixed variable naming - Changed EM to EVEManager for consistency

Supported Upgrade Types

Major Threat Detection Array, Minor Threat Detection Array, Power Monitoring Division, Pyerite/Nocxium/Mexallon/Isogen/Zydrine/Megacyte/Morphite Prospecting Arrays, Advanced Logistics Network, Cynosural Navigation, Cynosural Suppression, Supercapital Construction Facilities, Clone Vat Bay

claude and others added 11 commits December 6, 2025 12:58
This commit implements a comprehensive system for tracking and displaying
Infrastructure Hub upgrades in null-sec systems.

Features:
- New InfrastructureUpgrade class to store upgrade data (name, level, status)
- Extended System class with InfrastructureUpgrades list
- Load/Save functionality in EveManager for importing upgrade data from text files
- UI integration in RegionControl to display upgrades in system info panel
- Menu items in MainWindow for loading and saving upgrade data
- Example data file showing the expected format

The system supports all infrastructure upgrade types including:
- Major/Minor Threat Detection Arrays
- Prospecting Arrays (Nocxium, Pyerite, etc.)
- Advanced Logistics Network
- Cynosural Navigation
- Power Monitoring Division
- Supercapital Construction Facilities

Upgrades are displayed with their slot number, name, level (if applicable),
and online/offline status in the system information panel.
- Fixed reference to EVEManager property (was incorrectly using EM)
- Fixes build error 'EM does not exist in the current context'
Major improvements to the Infrastructure Hub Upgrade tracking system:

**Data Format Improvements:**
- Simplified file format: now just "SYSTEMNAME" instead of "Sovereignty Hub SYSTEMNAME"
- Backward compatible with old format
- Updated example file with new simpler format

**Visual Enhancements:**
- Added green circle indicator on map for systems with upgrades
- Positioned left of system (6x6px LimeGreen ellipse)
- Always visible, similar to Cyno Beacon indicator

**New Management UI:**
- Added "Manage Infrastructure Upgrades" menu item
- Full-featured upgrade manager window with:
  - System selection dropdown (all null-sec systems)
  - DataGrid showing current upgrades for selected system
  - Add/Edit form with dropdown for upgrade types
  - Delete functionality for existing upgrades
  - Support for all upgrade types (Threat Detection, Prospecting, Logistics, etc.)
  - Online/Offline status toggle
  - Slot number and level configuration (0-3)

**Supported Upgrade Types:**
- Major/Minor Threat Detection Arrays
- Power Monitoring Division
- All Prospecting Arrays (Pyerite, Nocxium, Mexallon, Isogen, Zydrine, Megacyte, Morphite)
- Advanced Logistics Network
- Cynosural Navigation/Suppression
- Supercapital Construction Facilities
- Clone Vat Bay

Map automatically refreshes after changes to show updated indicators.
**Fixes:**
1. Auto-load upgrades on startup
   - Automatically loads InfrastructureUpgrades.txt from storage folder on startup
   - No need to manually load file each time SMT starts
   - File location: %APPDATA%/SMT/InfrastructureUpgrades.txt

2. Improved Management Window UI
   - Reorganized form layout to be more compact and user-friendly
   - Slot and Upgrade Type now on same row
   - Level and Online checkbox on same row
   - Better use of horizontal space
   - Cleaner, more professional appearance

3. Better default file paths
   - Load dialog defaults to auto-load file location
   - Save dialog defaults to auto-load file location
   - Easier workflow for users

**How to use:**
- Save your upgrades using "Save Infrastructure Upgrades"
- Save to default location (InfrastructureUpgrades.txt)
- Upgrades will automatically load on next startup
- Green circle indicator will appear on map for systems with upgrades
**Fixed Issues:**

1. Green upgrade indicators appearing in wrong location
   - Added check to skip out-of-region systems (!isSystemOOR)
   - Added indicators to DynamicMapElements for proper cleanup
   - Ensures indicators only appear on systems actually in the region view

2. Management window using white theme
   - Applied SMT dark theme: Background="{DynamicResource ListBackground}"
   - Window now matches the rest of SMT's dark interface
   - Consistent look and feel across the application

**Technical Details:**
- Indicators are now properly added to DynamicMapElements collection
- This ensures they're removed when the map is redrawn
- Out-of-region systems (like border systems) no longer show indicators
- Theme resources are inherited from SMT's global theme
**Fixed Issues:**

1. Upgrades not persisting after adding them
   - Upgrades were only stored in RAM, not saved to disk
   - Closing the window or restarting SMT would lose all data

2. Green indicators disappearing after map refresh
   - Map redraws would reload from disk, but nothing was saved
   - Indicators would appear briefly then vanish

**Solution - Automatic Persistence:**

- Auto-save after EVERY change:
  - After adding an upgrade → AutoSave()
  - After deleting an upgrade → AutoSave()
  - When closing the window → AutoSave()

- Saves to: %APPDATA%\SMT\InfrastructureUpgrades.txt
- This is the same file that auto-loads on startup
- Changes are now immediately persistent

**Workflow:**
1. Add upgrade via manager → Automatically saved
2. Close window → Map refreshes with saved data
3. Green indicators appear and STAY
4. Restart SMT → Upgrades still there

No more manual "Save" step required!
After saving infrastructure upgrades, immediately trigger a map redraw
to ensure green indicators persist visibly on the map. This fixes the
issue where indicators would appear briefly then disappear.
PROBLEM: Green indicators were only drawn in AddSystemsToMap(), which is
only called during full map redraws (ReDrawMap(true)). When the map
refreshes every 2 seconds via timer (ReDrawMap(false)), AddSystemsToMap()
is not called, causing indicators to be cleared from DynamicMapElements
but never redrawn.

SOLUTION: Moved infrastructure upgrade indicator drawing logic from
AddSystemsToMap() to AddDataToMap(). AddDataToMap() is called on every
map redraw, ensuring green indicators persist correctly.

This fixes the issue where green circles would appear briefly when adding
an upgrade, then disappear after the next timer tick despite the upgrade
data still being present in memory.
Enhanced visibility and readability while maintaining SMT theme:

- Added visible borders to all GroupBoxes (#555555)
- Set GroupBox headers to LightGray for better contrast
- Made all Labels white (Foreground="White") for clarity
- Improved DataGrid visibility:
  - Dark background (#2A2A2A) with alternating rows (#333333)
  - White foreground for all text columns
  - Proper margins for better spacing
  - Horizontal gridlines for easier row reading
- Set CheckBox foreground to white

The window now has much better contrast and readability while staying
consistent with SMT's dark theme aesthetic.
Applied consistent dark theme styling to both ComboBoxes:
- System selection ComboBox
- Upgrade Type ComboBox

Changes:
- Created DarkComboBoxStyle with #2A2A2A background (matching DataGrid)
- White foreground text for better readability
- #555555 border to match GroupBoxes
- Created DarkComboBoxItemStyle for dropdown items
- Hover effect (#404040) for highlighted items
- Selected item background (#505050)

Now all dropdowns match the DataGrid theme and have excellent contrast
and readability while staying consistent with SMT's dark theme.
@Slazanger Slazanger merged commit e6ef13a into Slazanger:master Dec 7, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments