generated from m4gr3d/Godot-Android-Plugin-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add search player method to demo project
Signed-off-by: Jacob Ibáñez Sánchez <jacobibanez@jacobibanez.com>
- Loading branch information
Showing
5 changed files
with
231 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
extends Control | ||
|
||
@onready var id_label: Label = %IdLabel | ||
@onready var name_label: Label = %NameLabel | ||
@onready var title_label: Label = %TitleLabel | ||
@onready var status_label: Label = %StatusLabel | ||
@onready var level_label: Label = %LevelLabel | ||
@onready var xp_label: Label = %XpLabel | ||
|
||
@onready var compare_button: Button = %CompareButton | ||
|
||
var player: PlayersClient.Player | ||
|
||
func _ready() -> void: | ||
if player: | ||
_set_up_display() | ||
compare_button.pressed.connect(func(): | ||
PlayersClient.compare_profile(player.player_id) | ||
) | ||
|
||
func _set_up_display() -> void: | ||
id_label.text = player.player_id | ||
name_label.text = player.display_name | ||
title_label.text = player.title | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://cipu5ch2lo1ne"] | ||
|
||
[ext_resource type="Theme" uid="uid://bmm3mvq11y045" path="res://theme.tres" id="1_uv4o5"] | ||
[ext_resource type="Script" path="res://scenes/players/PlayerDisplay.gd" id="2_87phy"] | ||
|
||
[node name="FriendDisplay" type="PanelContainer"] | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
mouse_filter = 1 | ||
theme = ExtResource("1_uv4o5") | ||
script = ExtResource("2_87phy") | ||
|
||
[node name="MarginContainer" type="MarginContainer" parent="."] | ||
layout_mode = 2 | ||
theme_override_constants/margin_left = 25 | ||
theme_override_constants/margin_top = 25 | ||
theme_override_constants/margin_right = 25 | ||
theme_override_constants/margin_bottom = 25 | ||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] | ||
layout_mode = 2 | ||
theme_override_constants/separation = 25 | ||
|
||
[node name="Id" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/Id"] | ||
layout_mode = 2 | ||
text = "ID:" | ||
|
||
[node name="IdLabel" type="Label" parent="MarginContainer/VBoxContainer/Id"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
text_overrun_behavior = 3 | ||
|
||
[node name="Name" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/Name"] | ||
layout_mode = 2 | ||
text = "Name:" | ||
|
||
[node name="NameLabel" type="Label" parent="MarginContainer/VBoxContainer/Name"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
text_overrun_behavior = 3 | ||
|
||
[node name="Title" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/Title"] | ||
layout_mode = 2 | ||
text = "Title:" | ||
|
||
[node name="TitleLabel" type="Label" parent="MarginContainer/VBoxContainer/Title"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
|
||
[node name="Status" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/Status"] | ||
layout_mode = 2 | ||
text = "Status:" | ||
|
||
[node name="StatusLabel" type="Label" parent="MarginContainer/VBoxContainer/Status"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
|
||
[node name="Level" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/Level"] | ||
layout_mode = 2 | ||
text = "Level:" | ||
|
||
[node name="LevelLabel" type="Label" parent="MarginContainer/VBoxContainer/Level"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
|
||
[node name="Xp" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/Xp"] | ||
layout_mode = 2 | ||
text = "XP:" | ||
|
||
[node name="XpLabel" type="Label" parent="MarginContainer/VBoxContainer/Xp"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
|
||
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer"] | ||
layout_mode = 2 | ||
|
||
[node name="Compare" type="VBoxContainer" parent="MarginContainer/VBoxContainer"] | ||
layout_mode = 2 | ||
theme_override_constants/separation = 25 | ||
|
||
[node name="CompareButton" type="Button" parent="MarginContainer/VBoxContainer/Compare"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
theme = ExtResource("1_uv4o5") | ||
text = "Compare" | ||
text_overrun_behavior = 3 | ||
|
||
[node name="HSeparator2" type="HSeparator" parent="MarginContainer/VBoxContainer"] | ||
visible = false | ||
layout_mode = 2 | ||
|
||
[node name="Variants" type="VBoxContainer" parent="MarginContainer/VBoxContainer"] | ||
visible = false | ||
layout_mode = 2 | ||
theme_override_constants/separation = 25 | ||
|
||
[node name="TimeSpan" type="VBoxContainer" parent="MarginContainer/VBoxContainer/Variants"] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/Variants/TimeSpan"] | ||
layout_mode = 2 | ||
text = "Time Span" | ||
|
||
[node name="TimeSpan" type="OptionButton" parent="MarginContainer/VBoxContainer/Variants/TimeSpan"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
|
||
[node name="Collection" type="VBoxContainer" parent="MarginContainer/VBoxContainer/Variants"] | ||
layout_mode = 2 | ||
|
||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/Variants/Collection"] | ||
layout_mode = 2 | ||
text = "Collection" | ||
|
||
[node name="Collection" type="OptionButton" parent="MarginContainer/VBoxContainer/Variants/Collection"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
|
||
[node name="ShowVariant" type="Button" parent="MarginContainer/VBoxContainer/Variants"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
theme = ExtResource("1_uv4o5") | ||
disabled = true | ||
text = "Show Leaderboard Variant" | ||
text_overrun_behavior = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters