diff --git a/core/prestige/prestige_buff_connection_overlay.gd b/core/prestige/prestige_buff_connection_overlay.gd index e4d1860..b7428ec 100644 --- a/core/prestige/prestige_buff_connection_overlay.gd +++ b/core/prestige/prestige_buff_connection_overlay.gd @@ -10,7 +10,6 @@ var _connections: Array = [] func _ready() -> void: mouse_filter = Control.MOUSE_FILTER_IGNORE - ## Replace all connections and redraw. func set_connections(connections: Array) -> void: _connections = connections diff --git a/core/prestige/prestige_buff_graph_panel.gd b/core/prestige/prestige_buff_graph_panel.gd index 2f45af8..af93cde 100644 --- a/core/prestige/prestige_buff_graph_panel.gd +++ b/core/prestige/prestige_buff_graph_panel.gd @@ -52,13 +52,13 @@ func _refresh_connections() -> void: _connection_overlay.set_connections(connections) -## Recursively collects all PrestigeBuffGraphTile nodes from a container. +## Collects all PrestigeBuffGraphTile nodes rooted at `from`, recursing into every child. func _collect_tiles(from: Node, out_tiles: Array[PrestigeBuffGraphTile]) -> void: - for child in from.get_children(): - if child is PrestigeBuffGraphTile: - out_tiles.append(child) - elif child is Container: - _collect_tiles(child, out_tiles) + var found: Array[Node] = from.find_children("*", "PrestigeBuffGraphTile", true, false) + for node in found: + var tile := node as PrestigeBuffGraphTile + if tile: + out_tiles.append(tile) func _refresh_balance() -> void: if _game_state == null: diff --git a/docs/gyms/tiny_sword/prestige/prestige_buff_farm_boost.tres b/docs/gyms/tiny_sword/prestige/prestige_buff_farm_boost.tres index 267f104..d9bd1e2 100644 --- a/docs/gyms/tiny_sword/prestige/prestige_buff_farm_boost.tres +++ b/docs/gyms/tiny_sword/prestige/prestige_buff_farm_boost.tres @@ -7,6 +7,7 @@ script = ExtResource("1_script") id = &"farm_boost" display_name = "Fertile Grounds" description = "Permanently increases farm food production." -effect_value = 1.5 +parent_ids = Array[StringName]([&"gold_boost"]) +effect_value = 2.0 target_id = &"farm" x_position = 1.0 diff --git a/docs/gyms/tiny_sword/prestige/prestige_buff_gold_boost.tres b/docs/gyms/tiny_sword/prestige/prestige_buff_gold_boost.tres index 93646b1..9fab50b 100644 --- a/docs/gyms/tiny_sword/prestige/prestige_buff_gold_boost.tres +++ b/docs/gyms/tiny_sword/prestige/prestige_buff_gold_boost.tres @@ -7,5 +7,5 @@ script = ExtResource("1_script") id = &"gold_boost" display_name = "Golden Touch" description = "Permanently increases gold mine production." -effect_value = 1.5 +effect_value = 2.0 target_id = &"goldmine" diff --git a/docs/gyms/tiny_sword/prestige/prestige_buff_graph_panel.tscn b/docs/gyms/tiny_sword/prestige/prestige_buff_graph_panel.tscn index 7568cfa..f05637f 100644 --- a/docs/gyms/tiny_sword/prestige/prestige_buff_graph_panel.tscn +++ b/docs/gyms/tiny_sword/prestige/prestige_buff_graph_panel.tscn @@ -1,13 +1,12 @@ [gd_scene format=3 uid="uid://dprbgokqitaav"] -[ext_resource type="Script" path="res://core/prestige/prestige_buff_graph_panel.gd" id="1_panel"] -[ext_resource type="Script" path="res://core/prestige/prestige_buff_connection_overlay.gd" id="2_overlay"] -[ext_resource type="PackedScene" path="res://core/prestige/prestige_buff_graph_tile.tscn" id="3_tile"] -[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/prestige/prestige_buff_gold_boost.tres" id="4_gold"] -[ext_resource type="Resource" path="res://docs/gyms/tiny_sword/prestige/prestige_buff_farm_boost.tres" id="5_farm"] +[ext_resource type="Script" uid="uid://n01pkakxllnj" path="res://core/prestige/prestige_buff_graph_panel.gd" id="1_panel"] +[ext_resource type="Script" uid="uid://uv5lxj6hmpk" path="res://core/prestige/prestige_buff_connection_overlay.gd" id="2_overlay"] +[ext_resource type="PackedScene" uid="uid://bqk8rwia7lpbg" path="res://core/prestige/prestige_buff_graph_tile.tscn" id="3_tile"] +[ext_resource type="Resource" uid="uid://vl3ot4t876pc" path="res://docs/gyms/tiny_sword/prestige/prestige_buff_gold_boost.tres" id="4_gold"] +[ext_resource type="Resource" uid="uid://cvogxo0msis2w" path="res://docs/gyms/tiny_sword/prestige/prestige_buff_farm_boost.tres" id="5_farm"] [node name="PrestigeBuffGraphPanel" type="PanelContainer" unique_id=947835716] -visible = false custom_minimum_size = Vector2(600, 400) script = ExtResource("1_panel") @@ -26,19 +25,19 @@ layout_mode = 2 [node name="TitleLabel" type="Label" parent="MarginContainer/VBoxContainer/Header" unique_id=518293746] layout_mode = 2 -text = "Prestige Buffs" theme_override_font_sizes/font_size = 20 +text = "Prestige Buffs" [node name="CloseButton" type="Button" parent="MarginContainer/VBoxContainer/Header" unique_id=184756392] layout_mode = 2 size_flags_horizontal = 10 -text = "✕" theme_override_font_sizes/font_size = 16 +text = "✕" [node name="BalanceLabel" type="Label" parent="MarginContainer/VBoxContainer" unique_id=293847561] layout_mode = 2 -text = "Prestige Currency: 0" theme_override_font_sizes/font_size = 14 +text = "Prestige Currency: 0" [node name="TilesArea" type="Control" parent="MarginContainer/VBoxContainer" unique_id=847291034] layout_mode = 2 @@ -50,27 +49,21 @@ layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -grow_horizontal = 1 -grow_vertical = 1 +grow_horizontal = 2 +grow_vertical = 2 mouse_filter = 2 script = ExtResource("2_overlay") -[node name="TiersContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/TilesArea" unique_id=129384756] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 1 -grow_vertical = 1 - -[node name="Tier0" type="HBoxContainer" parent="MarginContainer/VBoxContainer/TilesArea/TiersContainer" unique_id=384756192] -layout_mode = 2 -theme_override_constants/separation = 8 - -[node name="GoldBoostTile" parent="MarginContainer/VBoxContainer/TilesArea/TiersContainer/Tier0" unique_id=756192834 instance=ExtResource("3_tile")] -layout_mode = 2 +[node name="GoldBoostTile" parent="MarginContainer/VBoxContainer/TilesArea" unique_id=756192834 instance=ExtResource("3_tile")] +layout_mode = 0 +offset_right = 220.0 +offset_bottom = 100.0 prestige_buff = ExtResource("4_gold") -[node name="FarmBoostTile" parent="MarginContainer/VBoxContainer/TilesArea/TiersContainer/Tier0" unique_id=619283475 instance=ExtResource("3_tile")] -layout_mode = 2 +[node name="FarmBoostTile" parent="MarginContainer/VBoxContainer/TilesArea" unique_id=619283475 instance=ExtResource("3_tile")] +layout_mode = 0 +offset_left = 3.0 +offset_top = 121.0 +offset_right = 223.0 +offset_bottom = 221.0 prestige_buff = ExtResource("5_farm") diff --git a/docs/gyms/tiny_sword/prestige/prestige_buff_wood_boost.tres b/docs/gyms/tiny_sword/prestige/prestige_buff_wood_boost.tres index b8670e7..7a07a44 100644 --- a/docs/gyms/tiny_sword/prestige/prestige_buff_wood_boost.tres +++ b/docs/gyms/tiny_sword/prestige/prestige_buff_wood_boost.tres @@ -7,5 +7,6 @@ script = ExtResource("1_42hk5") id = &"wood_boost" display_name = "Wood Touch" description = "Permanently increases forestry production." -effect_value = 1.5 +parent_ids = Array[StringName]([&"farm_boost"]) +effect_value = 2.0 target_id = &"forestry" diff --git a/docs/gyms/tiny_sword/tiny_sword.tscn b/docs/gyms/tiny_sword/tiny_sword.tscn index 2bc5cfe..91b15d9 100644 --- a/docs/gyms/tiny_sword/tiny_sword.tscn +++ b/docs/gyms/tiny_sword/tiny_sword.tscn @@ -67,6 +67,7 @@ toggle_mode = true text = "Prestige Buffs" [node name="PrestigeBuffGraphPanel" parent="LevelGameState/CanvasLayer/UI" unique_id=847291035 instance=ExtResource("18_pnl")] +visible = false layout_mode = 1 offset_left = 400.0 offset_top = 200.0