feat(city): ✨ add merge buildings panel toggle
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
69881756e2
commit
63565d1d31
3 changed files with 26 additions and 3 deletions
|
|
@ -64,7 +64,7 @@ var _placement_building_id: String = ""
|
|||
@onready var _tiles_title: Label = %TilesTitle
|
||||
@onready var _building_panel: PanelContainer = %BuildingPanel
|
||||
@onready var _merge_btn: Button = %MergeBuildingsBtn
|
||||
@onready var _merge_panel: PanelContainer = %MergePanel
|
||||
@onready var _merge_panel: Node = %MergePanel
|
||||
|
||||
|
||||
func _apply_vocab() -> void:
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cityscreen001"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cityscreen001"]
|
||||
|
||||
[ext_resource type="Script" path="res://engine/scenes/city/city_screen.gd" id="1"]
|
||||
[ext_resource type="Theme" path="res://public/games/age-of-dwarves/ui_theme.tres" id="2_theme"]
|
||||
[ext_resource type="PackedScene" path="res://engine/scenes/city/building_panel.tscn" id="3_bpanel"]
|
||||
[ext_resource type="PackedScene" path="res://engine/scenes/city/merge_panel.tscn" id="4_mpanel"]
|
||||
|
||||
[node name="CityScreen" type="CanvasLayer"]
|
||||
layer = 5
|
||||
|
|
@ -571,7 +572,27 @@ layout_mode = 2
|
|||
[node name="FooterRow" type="HBoxContainer" parent="Panel/Margin/VBox"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MergeBuildingsBtn" type="Button" parent="Panel/Margin/VBox/FooterRow"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
visible = false
|
||||
theme_override_colors/font_color = Color(0.9, 0.75, 0.3, 1)
|
||||
text = "Merge Buildings"
|
||||
|
||||
[node name="CloseButton" type="Button" parent="Panel/Margin/VBox/FooterRow"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
|
||||
[node name="MergePanel" parent="." instance=ExtResource("4_mpanel")]
|
||||
unique_name_in_owner = true
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -200.0
|
||||
offset_top = -180.0
|
||||
offset_right = 200.0
|
||||
offset_bottom = 180.0
|
||||
|
|
|
|||
|
|
@ -44,9 +44,11 @@ func load_vocabulary(theme_id: String) -> void:
|
|||
_vocabulary = parsed
|
||||
|
||||
|
||||
func lookup(engine_key: String) -> String:
|
||||
func lookup(engine_key: String, fallback: String = "") -> String:
|
||||
if _vocabulary.has(engine_key):
|
||||
return _vocabulary[engine_key]
|
||||
if fallback != "":
|
||||
return fallback
|
||||
return _key_to_title_case(engine_key)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue