This commit is contained in:
2026-05-14 19:11:10 +02:00
parent 2d4002bd3f
commit 52ad83a96d
15 changed files with 169 additions and 31 deletions

View File

@@ -35,6 +35,7 @@ func _ready() -> void:
if stats_resource == null:
stats_resource = PlayerStats.new()
Stats.register(self, stats_resource)
Stats.restore_player(peer_id, self)
Stats.set_stat(self, "role", role)
name_label.text = Net.player_names.get(peer_id, "P%d" % peer_id)
EventBus.entity_died.connect(_on_entity_died_clear_target)
@@ -63,6 +64,7 @@ func _request_target(path_str: String) -> void:
current_target = t
func _exit_tree() -> void:
Stats.cache_player(peer_id, self)
Stats.deregister(self)
func _input(event: InputEvent) -> void:
@@ -85,6 +87,8 @@ func _unhandled_input(event: InputEvent) -> void:
return
if build_mode:
return
if ui_capturing:
return
if event.is_action_pressed("class_tank"):
_request_role(GameState.ROLE_TANK)
elif event.is_action_pressed("class_damage"):