Implement Godot grid viewport rendering

This commit is contained in:
2026-05-13 03:43:05 +02:00
parent b939246ba4
commit 4a3fd37ab4
7 changed files with 819 additions and 32 deletions

View File

@@ -45,7 +45,7 @@ The Godot frontend (src/ReactorMaintenance.Godot) has a complete UX scaffold (sp
**Goal:** Replace the grid placeholder with a functional, interactive tile-based viewport.
- [ ] **Task 2.1: Create GridViewport control**
- [x] **Task 2.1: Create GridViewport control**
- Location: src/ReactorMaintenance.Godot/Controls/GridViewport.cs
- Custom Control that renders the level grid via CanvasItem._draw()
- Supports configurable tile size (default 48px)
@@ -53,35 +53,35 @@ The Godot frontend (src/ReactorMaintenance.Godot) has a complete UX scaffold (sp
- Exposes SelectedCell, RobotPosition, HoveredCell properties
- Fires OnCellSelected, OnCellHovered, OnGridClicked signals
- [ ] **Task 2.2: Implement terrain rendering**
- [x] **Task 2.2: Implement terrain rendering**
- Draw floor tiles with graphite/steel palette per ART.md
- Draw wall tiles with darker steel, reinforced silhouettes
- Apply subtle hue shifts between adjacent floor plates (no checkerboard)
- Support layer opacity rules (surface full / underground 25% or 50%)
- [ ] **Task 2.3: Implement prop rendering**
- [x] **Task 2.3: Implement prop rendering**
- Draw props at cell centers with semantic colors
- Show state indicators (enabled/disabled, producing/starved)
- Use generated asset textures where available, fall back to procedural badges
- Support prop highlight for selected cell
- [ ] **Task 2.4: Implement robot marker**
- [x] **Task 2.4: Implement robot marker**
- Draw robot sprite at current RobotPosition
- Show direction indicator
- Use maintenance_robot.png from Assets/Characters
- Animate on position change (optional, low priority)
- [ ] **Task 2.5: Implement hazard rendering**
- [x] **Task 2.5: Implement hazard rendering**
- Draw surface hazards on affected floor cells
- Use semantic colors: fuel (red slicks), coolant (blue-cyan), electricity (yellow arcs), heat (orange-white)
- Show hazard intensity via saturation/opacity
- [ ] **Task 2.6: Implement cell selection highlight**
- [x] **Task 2.6: Implement cell selection highlight**
- Draw selection rectangle around selected cell
- Draw reachable/actionable hints on valid move targets
- Support hover highlight on non-selected cells
- [ ] **Task 2.7: Implement underground network visualization**
- [x] **Task 2.7: Implement underground network visualization**
- Draw carrier-colored network lines between adjacent cells with positive flow
- Fuel = red, Coolant = blue, Electricity = yellow
- Render sources as large centered dots