Skip to content

Commit

Permalink
Update players screen for demo project
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Ibáñez Sánchez <jacobibanez@jacobibanez.com>
  • Loading branch information
Iakobs committed Dec 28, 2023
1 parent 90181f7 commit e22dd99
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 180 deletions.
27 changes: 0 additions & 27 deletions plugin/demo/scenes/players/FriendDisplay.gd

This file was deleted.

148 changes: 0 additions & 148 deletions plugin/demo/scenes/players/FriendDisplay.tscn

This file was deleted.

5 changes: 4 additions & 1 deletion plugin/demo/scenes/players/PlayerDisplay.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ extends Control
@onready var level_label: Label = %LevelLabel
@onready var xp_label: Label = %XpLabel

@onready var compare_holder: VBoxContainer = %CompareHolder
@onready var compare_button: Button = %CompareButton

var player: PlayersClient.Player
var is_comparable = false

func _ready() -> void:
if player:
_set_up_display.call_deferred()
_set_up_display()
compare_button.pressed.connect(func():
PlayersClient.compare_profile(player.player_id)
)
Expand All @@ -32,6 +34,7 @@ func _set_up_display() -> void:
status_label.text = PlayersClient.PlayerFriendStatus.find_key(player.friend_status)
level_label.text = str(player.level_info.current_level.level_number)
xp_label.text = str(player.level_info.current_xp_total)
compare_holder.visible = is_comparable

func _load_and_retry(image_uri: String) -> Image:
var image = Image.new()
Expand Down
10 changes: 6 additions & 4 deletions plugin/demo/scenes/players/PlayerDisplay.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ text = "XP:"
unique_name_in_owner = true
layout_mode = 2

[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer"]
[node name="CompareHolder" type="VBoxContainer" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
theme_override_constants/separation = 25

[node name="Compare" type="VBoxContainer" parent="MarginContainer/VBoxContainer"]
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer/CompareHolder"]
layout_mode = 2
theme_override_constants/separation = 25

[node name="CompareButton" type="Button" parent="MarginContainer/VBoxContainer/Compare"]
[node name="CompareButton" type="Button" parent="MarginContainer/VBoxContainer/CompareHolder"]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("1_uv4o5")
Expand Down
1 change: 1 addition & 0 deletions plugin/demo/scenes/players/Players.gd
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func _ready() -> void:
child.queue_free()
var container := _player_display.instantiate() as Control
container.player = player
container.is_comparable = true
search_display.add_child(container)
)

Expand Down

0 comments on commit e22dd99

Please sign in to comment.