style(client): gdformat all 52 GDScript files — zero format warnings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,15 +20,23 @@ static func apply(snapshot: Dictionary) -> void:
|
||||
GameState.visible_entities = snapshot.entities
|
||||
var found_player := false
|
||||
for entity in GameState.visible_entities:
|
||||
if entity.has("kind") and entity.kind is Dictionary and entity.kind.get("variant") == "Player":
|
||||
if (
|
||||
entity.has("kind")
|
||||
and entity.kind is Dictionary
|
||||
and entity.kind.get("variant") == "Player"
|
||||
):
|
||||
GameState.player_position = Vector2(entity.x, entity.y)
|
||||
if entity.has("entity_id"):
|
||||
GameState.player_entity_id = entity.entity_id
|
||||
found_player = true
|
||||
break
|
||||
if not found_player and GameState.visible_entities.size() > 0:
|
||||
push_warning("GameState: no Player entity found in %d entities" % [
|
||||
GameState.visible_entities.size()])
|
||||
push_warning(
|
||||
(
|
||||
"GameState: no Player entity found in %d entities"
|
||||
% [GameState.visible_entities.size()]
|
||||
)
|
||||
)
|
||||
|
||||
# D-020/D-071 (#530): Server-authoritative stationary_ticks for ListeningFocus boost.
|
||||
if snapshot.has("stationary_ticks") and snapshot.stationary_ticks is int:
|
||||
@@ -44,7 +52,11 @@ static func apply(snapshot: Dictionary) -> void:
|
||||
# Tiles for rendering: test mode sends "tiles", live server sends "visible_tiles"
|
||||
if snapshot.has("tiles"):
|
||||
GameState.visible_tiles = snapshot.tiles
|
||||
elif snapshot.has("visible_tiles") and snapshot.visible_tiles is Array and snapshot.visible_tiles.size() > 0:
|
||||
elif (
|
||||
snapshot.has("visible_tiles")
|
||||
and snapshot.visible_tiles is Array
|
||||
and snapshot.visible_tiles.size() > 0
|
||||
):
|
||||
var has_type := false
|
||||
if snapshot.visible_tiles.size() > 0 and snapshot.visible_tiles[0] is Dictionary:
|
||||
has_type = snapshot.visible_tiles[0].has("type")
|
||||
@@ -195,12 +207,17 @@ static func apply(snapshot: Dictionary) -> void:
|
||||
if entry.get("key") == "ai_dialogue.enabled":
|
||||
var val: Variant = entry.get("value")
|
||||
if val != null:
|
||||
GameState.ai_enhanced_dialogue_enabled = _extract_bool_setting("ai_dialogue.enabled", val)
|
||||
GameState.ai_enhanced_dialogue_enabled = _extract_bool_setting(
|
||||
"ai_dialogue.enabled", val
|
||||
)
|
||||
else:
|
||||
GameState.settings_response = null
|
||||
|
||||
# #718: character_visual_descriptor — restored from server snapshot on save/load.
|
||||
if snapshot.has("character_visual_descriptor") and snapshot.character_visual_descriptor is Dictionary:
|
||||
if (
|
||||
snapshot.has("character_visual_descriptor")
|
||||
and snapshot.character_visual_descriptor is Dictionary
|
||||
):
|
||||
var CVD := load("res://scripts/rendering/character_visual_descriptor.gd")
|
||||
if CVD != null:
|
||||
var restored = CVD.from_dict(snapshot.character_visual_descriptor)
|
||||
@@ -220,12 +237,18 @@ static func apply(snapshot: Dictionary) -> void:
|
||||
for vtile in GameState.visible_tiles:
|
||||
if vtile is Dictionary and vtile.has("x") and vtile.has("y"):
|
||||
tile_by_coord[Vector2i(vtile.x, vtile.y)] = vtile
|
||||
var player_pos_key := Vector2i(int(GameState.player_position.x), int(GameState.player_position.y))
|
||||
var player_pos_key := Vector2i(
|
||||
int(GameState.player_position.x), int(GameState.player_position.y)
|
||||
)
|
||||
var player_tile = tile_by_coord.get(player_pos_key, null)
|
||||
GameState.current_zone_id = player_tile.get("zone_id", "") if player_tile else ""
|
||||
|
||||
# v2: visible_tiles with visibility sectors
|
||||
if snapshot.has("visible_tiles") and snapshot.visible_tiles is Array and snapshot.visible_tiles.size() > 0:
|
||||
if (
|
||||
snapshot.has("visible_tiles")
|
||||
and snapshot.visible_tiles is Array
|
||||
and snapshot.visible_tiles.size() > 0
|
||||
):
|
||||
GameState.visibility_sectors.clear()
|
||||
var has_explicit_positions := snapshot.has("visible_positions")
|
||||
if not has_explicit_positions:
|
||||
|
||||
Reference in New Issue
Block a user