aboutsummaryrefslogtreecommitdiff
path: root/client/player/player.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/player/player.gd')
-rw-r--r--client/player/player.gd20
1 files changed, 11 insertions, 9 deletions
diff --git a/client/player/player.gd b/client/player/player.gd
index 031cba29..b483c31d 100644
--- a/client/player/player.gd
+++ b/client/player/player.gd
@@ -43,7 +43,8 @@ var clear_timer: Timer = Timer.new()
var hand = [null, null]
var hand_base
-var character_idx: int
+var character_style: Dictionary
+var player_class: String
var is_customer: bool
var current_item_message = null
@@ -53,15 +54,15 @@ const DEFAULT_HAND_BASE_POSITION_CENTER: Vector3 = Vector3(0, .425, .4)
const DEFAULT_HAND_BASE_POSITION_LEFT: Vector3 = Vector3(.3, .425, .4)
const DEFAULT_HAND_BASE_POSITION_RIGHT: Vector3 = Vector3(-.3, .425, .4)
-func _init(_id: int, new_name: String, pos: Vector2, new_character_idx: int, new_game: Game):
+func _init(_id: int, name_: String, pos: Vector2, character_style: Dictionary, player_class: String, game: Game):
add_child(movement_base)
movement_base.add_child(character)
position_ = pos
position_anim = pos
- if new_name != "":
- name = new_name
- game = new_game
- username = new_name
+ if name_ != "":
+ name = name_
+ self.game = game
+ username = name_
if game.hand_count == 1:
var center = Node3D.new()
@@ -89,13 +90,14 @@ func _init(_id: int, new_name: String, pos: Vector2, new_character_idx: int, new
marker.visible = false
add_child(marker)
- character_idx = new_character_idx
- is_customer = character_idx < 0
+ self.character_style = character_style
+ self.player_class = player_class
+ is_customer = player_class == "customer"
movement_base.scale = Vector3.ONE * 0.0001
func _ready():
- character.set_style(character_idx)
+ character.set_style(character_style, player_class)
clear_timer.timeout.connect(clear_message)
Settings.hook_changed_init("gameplay.usernames", false, update_username_tag)