fix(client): address PR review round 2 — camera tracking, minimap, monologue wiring
- Camera2D now tracks player_position from GameState (D-015) - Add SubViewport child to minimap SubViewportContainer (fixes editor warning) - Wire MonologueDisplay into main loop for D-016 perception data path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
@onready var world_renderer = $World
|
@onready var world_renderer = $World
|
||||||
|
@onready var camera = $Camera2D
|
||||||
@onready var hud = $UILayer/HUD
|
@onready var hud = $UILayer/HUD
|
||||||
|
@onready var monologue_display = $UILayer/MonologueDisplay
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
print("The Settled Reach — client initialized")
|
print("The Settled Reach — client initialized")
|
||||||
@@ -19,12 +21,19 @@ func _process(_delta: float) -> void:
|
|||||||
if world_renderer and world_renderer.has_method("update_from_state"):
|
if world_renderer and world_renderer.has_method("update_from_state"):
|
||||||
world_renderer.update_from_state()
|
world_renderer.update_from_state()
|
||||||
|
|
||||||
|
# Track camera to player position (D-015)
|
||||||
|
camera.position = GameState.player_position * 32 # tile-space to pixel-space
|
||||||
|
|
||||||
# Update HUD
|
# Update HUD
|
||||||
if hud and hud.has_method("update_from_hud_data"):
|
if hud and hud.has_method("update_from_hud_data"):
|
||||||
hud.update_from_hud_data(GameState.hud_data)
|
hud.update_from_hud_data(GameState.hud_data)
|
||||||
if snapshot.has("player") and snapshot.player.has("health"):
|
if snapshot.has("player") and snapshot.player.has("health"):
|
||||||
hud.update_health(snapshot.player.health)
|
hud.update_health(snapshot.player.health)
|
||||||
|
|
||||||
|
# Wire monologue display (D-016 perception data path)
|
||||||
|
if snapshot.has("monologue") and monologue_display:
|
||||||
|
monologue_display.show_monologue(snapshot.monologue)
|
||||||
|
|
||||||
# Send queued input to simulation
|
# Send queued input to simulation
|
||||||
var inputs = InputMapper.flush_queue()
|
var inputs = InputMapper.flush_queue()
|
||||||
for input in inputs:
|
for input in inputs:
|
||||||
|
|||||||
@@ -21,12 +21,14 @@ anchor_bottom = 1.0
|
|||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
|
|
||||||
[node name="Background" type="ColorRect" parent="SubViewportContainer"]
|
[node name="SubViewport" type="SubViewport" parent="SubViewportContainer"]
|
||||||
|
size = Vector2i(200, 200)
|
||||||
|
render_target_update_mode = 4
|
||||||
|
|
||||||
|
[node name="Background" type="ColorRect" parent="SubViewportContainer/SubViewport"]
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
offset_right = 200.0
|
|
||||||
offset_bottom = 200.0
|
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
color = Color(0.1, 0.1, 0.1, 0.7)
|
color = Color(0.1, 0.1, 0.1, 0.7)
|
||||||
|
|||||||
Reference in New Issue
Block a user