diff --git a/client/scripts/main.gd b/client/scripts/main.gd index d1b3373f9..454c5fc44 100644 --- a/client/scripts/main.gd +++ b/client/scripts/main.gd @@ -26,7 +26,7 @@ var _last_dialogue_tick: int = -1 var _last_confrontation_tick: int = -1 # Deduplicate confrontation_monologue signals within same tick var _known_recognition_ids: Dictionary = {} # D-067: entity_ids that have already chimed var _flash_rect: ColorRect = null # #502/#501: ephemeral screen flash overlay (shared: teleport preempts amber) -var _teleport_in_progress: bool = false # #501: defer smoothing re-enable by one frame after teleport +var _teleport_in_progress: bool = false # #501/#117: forces camera snap (not lerp) on next _process frame var _pending_record_inputs: Array = [] # #507: accumulates server-bound inputs across frames; flushed into record_tick() on snapshot arrival var _current_zone: String = "" # D-073 (#529): zone tracking for ambient crossfades @@ -47,7 +47,7 @@ func _ready() -> void: # Camera anchor: snap to player position before the first frame renders. # In test mode poll_snapshot() returns synchronously — position is set # immediately. In live mode the snapshot isn't available yet — _process - # handles it. No reset_smoothing() needed: smoothing is OFF. + # handles it via the lerp block in _process(). var first_snapshot: Variant = SimBridge.poll_snapshot() if first_snapshot != null: GameState.apply_snapshot(first_snapshot) diff --git a/client/scripts/rendering/entity_renderer.gd b/client/scripts/rendering/entity_renderer.gd index 63e596a64..020d93d00 100644 --- a/client/scripts/rendering/entity_renderer.gd +++ b/client/scripts/rendering/entity_renderer.gd @@ -17,7 +17,7 @@ const TILE_SIZE: int = Constants.TILE_SIZE const ENTITY_WIDTH: int = 24 const ENTITY_HEIGHT: int = 32 const ENTITY_OFFSET_X: float = (TILE_SIZE - ENTITY_WIDTH) / 2.0 # center horizontally -const ENTITY_OFFSET_Y: float = (TILE_SIZE - ENTITY_HEIGHT) / 2.0 # center vertically for placeholder. Migration: when real sprites land, switch to bottom-anchor (TILE_SIZE - ENTITY_HEIGHT) for correct y-sort ordering. +const ENTITY_OFFSET_Y: float = (TILE_SIZE - ENTITY_HEIGHT) / 2.0 # center vertically for placeholder. Migration: switch to bottom-anchor (offset = TILE_SIZE - ENTITY_HEIGHT) when real sprites land for correct y-sort ordering. # Lerp speed — framerate-independent exponential smoothing. # At 12.0: ~70% there after 0.1s, ~95% after 0.25s. diff --git a/client/scripts/rendering/tile_renderer.gd b/client/scripts/rendering/tile_renderer.gd index 5f5ede422..d96050006 100644 --- a/client/scripts/rendering/tile_renderer.gd +++ b/client/scripts/rendering/tile_renderer.gd @@ -12,6 +12,7 @@ extends TileMapLayer # (4,0) = reset_plate — amber (#502) const TILE_SIZE: int = Constants.TILE_SIZE +const GROUND_FLOOR: int = 0 # Server floor level for ground — filter target in update_tiles() enum TileType { FLOOR = 0, WALL = 1, DOOR = 2, OBJECT = 3, RESET_PLATE = 4 } @@ -78,10 +79,10 @@ func update_tiles(tiles: Array) -> void: if not tile_data.has("x") or not tile_data.has("y") or not tile_data.has("type"): continue - # Floor-level filter: only render tiles at floor level 0 (ground). - # Floor level 1+ tiles are for upper floors (future multi-floor nodes). + # Floor-level filter: only render tiles at ground floor. + # Upper floor tiles (level 1+) are for future multi-floor nodes. var tile_z: int = tile_data.get("z", 0) - if tile_z != 0: + if tile_z != GROUND_FLOOR: continue var tile_type_str: String = tile_data.type diff --git a/client/tests/test_ui_framework_sprint15.gd b/client/tests/test_ui_framework_sprint15.gd index d7bea54c1..8619616c5 100644 --- a/client/tests/test_ui_framework_sprint15.gd +++ b/client/tests/test_ui_framework_sprint15.gd @@ -25,6 +25,16 @@ func after_test() -> void: _instance = null +# ------------------------------------------------------------------------- +# D-076: Layout constants +# ------------------------------------------------------------------------- + +func test_dialogue_max_width_matches_d076() -> void: + # D-076 (OQ-29): DIALOGUE_MAX_WIDTH must be 640px. Regression guard — was + # incorrectly set to 1200 before review round 1. + assert_that(Constants.DIALOGUE_MAX_WIDTH).is_equal(640) + + # ------------------------------------------------------------------------- # D-049: Z-layer scene hierarchy # -------------------------------------------------------------------------