First commit 🎉
This commit is contained in:
commit
43ea213f9b
728 changed files with 37080 additions and 0 deletions
37
game/gui/components/sierra_bar/sierra_bar.gd
Normal file
37
game/gui/components/sierra_bar/sierra_bar.gd
Normal file
|
@ -0,0 +1,37 @@
|
|||
extends Control
|
||||
|
||||
@export var score := 0
|
||||
@export var max_score := 100
|
||||
|
||||
@onready var lbl_game_name: Label = %LblGameName
|
||||
@onready var lbl_score: Label = %LblScore
|
||||
|
||||
|
||||
#region Public #####################################################################################
|
||||
func set_game_name(game_name: String) -> void:
|
||||
lbl_game_name.text = game_name
|
||||
|
||||
|
||||
func reset_score() -> void:
|
||||
score = 0
|
||||
_update_text()
|
||||
|
||||
|
||||
func add_score(value: int) -> void:
|
||||
score += value
|
||||
_update_text()
|
||||
|
||||
|
||||
func subtract_score(value: int) -> void:
|
||||
score -= value
|
||||
_update_text()
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private ####################################################################################
|
||||
func _update_text() -> void:
|
||||
lbl_score.text = "%d/%d" % [score, max_score]
|
||||
|
||||
|
||||
#endregion
|
1
game/gui/components/sierra_bar/sierra_bar.gd.uid
Normal file
1
game/gui/components/sierra_bar/sierra_bar.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://cnnpvj3tgrsyy
|
42
game/gui/components/sierra_bar/sierra_bar.tscn
Normal file
42
game/gui/components/sierra_bar/sierra_bar.tscn
Normal file
|
@ -0,0 +1,42 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://16tq4pfptkuh"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://djl1xk7jgyvpp" path="res://game/gui/resources/gui_theme.tres" id="1_j5rt6"]
|
||||
[ext_resource type="Script" uid="uid://dp4w7xf6ofa53" path="res://game/gui/components/sierra_bar/sierra_bar_custom.gd" id="2_l561w"]
|
||||
[ext_resource type="PackedScene" uid="uid://b71fus0srl1s6" path="res://game/gui/components/hover_text/hover_text.tscn" id="3_q6hqu"]
|
||||
|
||||
[node name="SierraBar" type="Control" groups=["popochiu_gui_component"]]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme = ExtResource("1_j5rt6")
|
||||
script = ExtResource("2_l561w")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 15.0
|
||||
grow_horizontal = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="LblGameName" type="Label" parent="PanelContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Sierra GUI"
|
||||
|
||||
[node name="HoverText" parent="PanelContainer/HBoxContainer" instance=ExtResource("3_q6hqu")]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme = null
|
||||
|
||||
[node name="LblScore" type="Label" parent="PanelContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Score: 0"
|
1
game/gui/components/sierra_bar/sierra_bar_custom.gd
Normal file
1
game/gui/components/sierra_bar/sierra_bar_custom.gd
Normal file
|
@ -0,0 +1 @@
|
|||
extends "sierra_bar.gd"
|
1
game/gui/components/sierra_bar/sierra_bar_custom.gd.uid
Normal file
1
game/gui/components/sierra_bar/sierra_bar_custom.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://dp4w7xf6ofa53
|
Loading…
Add table
Add a link
Reference in a new issue