1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 23:54:23 +00:00

tbh GoldDisplay is a better name

This commit is contained in:
Steffo 2024-04-24 04:56:44 +02:00
parent f8f9fa6984
commit 70894db948
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
5 changed files with 10 additions and 9 deletions

View file

@ -9,7 +9,7 @@ signal dropped(node: Draggable)
@onready var game: MainGame = MainGame.get_via_group(self)
@onready var gold_counter: GoldCounter = %"GoldCounter"
@onready var gold_display: GoldDisplay = %"GoldDisplay"
var dragging: Draggable = null

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://col1q3elvkfwk"]
[ext_resource type="Script" path="res://scenes/game/cursor.gd" id="1_1og6v"]
[ext_resource type="PackedScene" uid="uid://cu750c7yd57qa" path="res://scenes/game/gold_counter.tscn" id="2_ofjhi"]
[ext_resource type="PackedScene" uid="uid://cu750c7yd57qa" path="res://scenes/game/gold_display.tscn" id="2_5c4iq"]
[sub_resource type="CircleShape2D" id="CircleShape2D_j2mj5"]
radius = 4.0
@ -16,5 +16,5 @@ script = ExtResource("1_1og6v")
shape = SubResource("CircleShape2D_j2mj5")
debug_color = Color(1, 1, 1, 1)
[node name="GoldCounter" parent="." instance=ExtResource("2_ofjhi")]
[node name="GoldDisplay" parent="." instance=ExtResource("2_5c4iq")]
unique_name_in_owner = true

View file

@ -1,5 +1,5 @@
extends PanelContainer
class_name GoldCounter
class_name GoldDisplay
@onready var label: Label = %"Label"

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://cu750c7yd57qa"]
[ext_resource type="Script" path="res://scenes/game/gold_counter.gd" id="1_koxhc"]
[ext_resource type="Script" path="res://scenes/game/gold_display.gd" id="1_yhouw"]
[sub_resource type="Animation" id="Animation_3gb4u"]
resource_name = "RESET"
@ -40,12 +40,12 @@ _data = {
[sub_resource type="LabelSettings" id="LabelSettings_1jb4h"]
[node name="GoldCounter" type="PanelContainer"]
[node name="GoldDisplay" type="PanelContainer"]
offset_left = 16.0
offset_top = 24.0
offset_right = 56.0
offset_bottom = 51.0
script = ExtResource("1_koxhc")
script = ExtResource("1_yhouw")
[node name="Animator" type="AnimationPlayer" parent="."]
unique_name_in_owner = true

View file

@ -16,6 +16,7 @@ static func get_via_group(node: Node) -> MainGame:
func _ready():
# Set up the gold display
var gold_counter = inventory.get_counter(&"Gold")
gold_counter.changed.connect(cursor.gold_counter.display.unbind(1))
cursor.gold_counter.set_text(gold_counter.value)
gold_counter.changed.connect(cursor.gold_display.display.unbind(1))
cursor.gold_display.set_text(gold_counter.value)