diff options
Diffstat (limited to 'client/player/player.gd')
| -rw-r--r-- | client/player/player.gd | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/player/player.gd b/client/player/player.gd index ef977ce6..1b82b90e 100644 --- a/client/player/player.gd +++ b/client/player/player.gd @@ -26,6 +26,7 @@ var rotation_ = 0. var rotation_anim = 0. var position_ = Vector2(0, 0) var position_anim = Vector2(0, 0) +var username: String var character: Character = preload("res://player/character/character.tscn").instantiate() var chat_bubble: ChatBubble = preload("res://player/chat_bubble.tscn").instantiate() @@ -48,6 +49,7 @@ func _init(_id: int, new_name: String, pos: Vector2, new_character_idx: int, new position_anim = pos name = new_name game = new_game + username = new_name hand_base.position = HAND_BASE_POSITION add_child(hand_base) @@ -65,11 +67,19 @@ func _init(_id: int, new_name: String, pos: Vector2, new_character_idx: int, new func _ready(): character.select_hairstyle(character_idx) clear_timer.timeout.connect(clear_message) + + update_username_tag() + Global.settings_changed.connect(update_username_tag) func update_position(new_position: Vector2, new_rotation: float): position_ = new_position rotation_ = new_rotation +func update_username_tag(): + var tag: Label3D = character.username_tag + tag.text = username + tag.visible = Global.get_setting("usernames") + func set_item(i: Item): i.owned_by = hand_base if hand != null: |