Improve currency panel
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -8,3 +8,4 @@ script = ExtResource("2_vohw6")
|
||||
id = &"gold"
|
||||
display_name = "Gold"
|
||||
icon = ExtResource("1_n656e")
|
||||
always_visible = true
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user