From 25659f6a92ef897a56b94d25a93a633cfe31168b Mon Sep 17 00:00:00 2001 From: Michele Rossi Date: Sat, 25 Apr 2026 12:26:27 +0200 Subject: [PATCH] Improve currency panel --- core/currency/currency.gd | 1 + currency_label.gd | 1 + docs/gyms/tiny_sword/currencies/gold.tres | 1 + docs/gyms/tiny_sword/tiny_sword.tscn | 14 +++++--------- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/core/currency/currency.gd b/core/currency/currency.gd index 31f81e8..bb8da2f 100644 --- a/core/currency/currency.gd +++ b/core/currency/currency.gd @@ -4,3 +4,4 @@ extends Resource @export var id: StringName = &"" @export var display_name: String = "" @export var icon: Texture2D +@export var always_visible: bool = false diff --git a/currency_label.gd b/currency_label.gd index 3b997d6..dd50cf0 100644 --- a/currency_label.gd +++ b/currency_label.gd @@ -37,6 +37,7 @@ func _on_currency_changed(changed_currency_id: StringName, amount: BigNumber) -> if changed_currency_id != _currency_id: return _currency_label.text = amount.to_string_suffix(2) + visible = currency.always_visible or not amount.is_equal_to(BigNumber.from_float(0.0)) func _on_debug_income_button_pressed() -> void: if currency == null: diff --git a/docs/gyms/tiny_sword/currencies/gold.tres b/docs/gyms/tiny_sword/currencies/gold.tres index b983709..b075373 100644 --- a/docs/gyms/tiny_sword/currencies/gold.tres +++ b/docs/gyms/tiny_sword/currencies/gold.tres @@ -8,3 +8,4 @@ script = ExtResource("2_vohw6") id = &"gold" display_name = "Gold" icon = ExtResource("1_n656e") +always_visible = true diff --git a/docs/gyms/tiny_sword/tiny_sword.tscn b/docs/gyms/tiny_sword/tiny_sword.tscn index fac7e99..c1bc9fb 100644 --- a/docs/gyms/tiny_sword/tiny_sword.tscn +++ b/docs/gyms/tiny_sword/tiny_sword.tscn @@ -9,13 +9,13 @@ [ext_resource type="Resource" uid="uid://umi37hotcq8m" path="res://docs/gyms/tiny_sword/research/ts_research_catalogue.tres" id="5_v0pty"] [ext_resource type="Script" uid="uid://srkiu4qe8s2m" path="res://core/prestige/prestige_manager.gd" id="5_x77df"] [ext_resource type="Resource" uid="uid://dwmfvmusfskk6" path="res://docs/gyms/tiny_sword/prestige/primary_prestige.tres" id="6_xnhlc"] -[ext_resource type="PackedScene" uid="uid://rejxvjwybkll" path="res://sandbox/tiny_swords/Terrain/Resources/Wood/Trees/tree_1.tscn" id="14_0cs5o"] -[ext_resource type="PackedScene" uid="uid://bp5ng4vu4ot4a" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower.tscn" id="14_hum8s"] +[ext_resource type="PackedScene" path="res://docs/gyms/tiny_sword/currency_panel.tscn" id="9_cpnl"] [ext_resource type="PackedScene" uid="uid://djedqovgngrx5" path="res://docs/gyms/tiny_sword/buildings/farm/farm.tscn" id="10_1lv5i"] +[ext_resource type="PackedScene" uid="uid://dirvi76rkoowf" path="res://goals_debug_ui.tscn" id="10_qifrv"] [ext_resource type="PackedScene" uid="uid://cf01wvy3f17i" path="res://docs/gyms/tiny_sword/buildings/forestry/forestry.tscn" id="11_pyqyw"] [ext_resource type="PackedScene" uid="uid://bf8lqbexvnx6e" path="res://docs/gyms/tiny_sword/buildings/monastery/monastery.tscn" id="13_no27p"] -[ext_resource type="PackedScene" uid="uid://dirvi76rkoowf" path="res://goals_debug_ui.tscn" id="10_qifrv"] -[ext_resource type="PackedScene" uid="uid://cur_panel_scene_uid" path="res://docs/gyms/tiny_sword/currency_panel.tscn" id="9_cpnl"] +[ext_resource type="PackedScene" uid="uid://rejxvjwybkll" path="res://sandbox/tiny_swords/Terrain/Resources/Wood/Trees/tree_1.tscn" id="14_0cs5o"] +[ext_resource type="PackedScene" uid="uid://bp5ng4vu4ot4a" path="res://docs/gyms/tiny_sword/buildings/alchemy_tower/alchemy_tower.tscn" id="14_hum8s"] [node name="TinySwords" type="Node" unique_id=498237642] @@ -80,14 +80,10 @@ offset_bottom = 40.0 [node name="CurrencyPanel" parent="LevelGameState/UI" unique_id=2000000001 instance=ExtResource("9_cpnl")] layout_mode = 1 -offset_left = 5.0 -offset_top = 5.0 -offset_right = 255.0 -offset_bottom = 345.0 [node name="GoalsDebugUI" parent="LevelGameState/UI" unique_id=1494700185 instance=ExtResource("10_qifrv")] layout_mode = 1 -offset_left = 265.0 +offset_left = 1433.0 offset_top = 5.0 offset_right = 1913.0 offset_bottom = 263.0