diff options
| author | nokoe <nokoe@mailbox.org> | 2024-10-03 16:43:37 +0200 |
|---|---|---|
| committer | nokoe <nokoe@mailbox.org> | 2024-10-03 16:43:37 +0200 |
| commit | 43390237a6dacaeff59826c1f6951afa13ab2d7f (patch) | |
| tree | ab3dd6022596edbee3f5706b657311e22b6f3fd2 /client/player | |
| parent | 0c789a627e1f0357c2e14523782a253c80c50560 (diff) | |
| download | hurrycurry-43390237a6dacaeff59826c1f6951afa13ab2d7f.tar hurrycurry-43390237a6dacaeff59826c1f6951afa13ab2d7f.tar.bz2 hurrycurry-43390237a6dacaeff59826c1f6951afa13ab2d7f.tar.zst | |
chat messages show user color; align vertically; fixes #207
Diffstat (limited to 'client/player')
| -rw-r--r-- | client/player/character/character.gd | 4 | ||||
| -rw-r--r-- | client/player/player.gd | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/client/player/character/character.gd b/client/player/character/character.gd index cd41e7ff..82e5c849 100644 --- a/client/player/character/character.gd +++ b/client/player/character/character.gd @@ -44,7 +44,7 @@ var current_animation := "idle" const NUM_COLORS = 5; const NUM_HAIRS = 3; @onready var hairstyles := [$Main/HeadDefault/Hair, $Main/HeadDefault/Hair2, $Main/HeadDefault/Hair3] -var colors = [ +const COLORS: Array[Color] = [ Color(0.204, 0.361, 0.624), Color(0.568, 0.256, 0.602), Color(0.575, 0.341, 0.117), @@ -111,7 +111,7 @@ func set_style(id: int): head_default.visible = not p.robot for h in hairstyles: h.hide() hairstyles[p.hair].show() - $Main.get_active_material(0).albedo_color = Color(0.349, 0.349, 0.349) if p.robot else colors[p.color] + $Main.get_active_material(0).albedo_color = Color(0.349, 0.349, 0.349) if p.robot else COLORS[p.color] func play_animation(name_: String): current_animation = name_ diff --git a/client/player/player.gd b/client/player/player.gd index 2c8cabf3..1ca7a37f 100644 --- a/client/player/player.gd +++ b/client/player/player.gd @@ -157,9 +157,9 @@ func item_message(item_name: String, timeout_initial: float, timeout_remaining: clear_timer.start(timeout_remaining) current_item_message = item_name -func text_message(m: String, _timeout_initial: float, timeout_remaining: float): - chat_bubble.set_text(m) - clear_timer.start(timeout_remaining) +func text_message(message: Game.TextMessage): + chat_bubble.set_text(message.text) + clear_timer.start(message.timeout_remaining) func effect_message(effect_name: String): effect.set_effect(effect_name) |