diff --git a/game/addons/world_generator/ui/DataList.gd b/game/addons/world_generator/ui/DataList.gd index 9e81472f..bef5fcc1 100644 --- a/game/addons/world_generator/ui/DataList.gd +++ b/game/addons/world_generator/ui/DataList.gd @@ -11,7 +11,7 @@ var _ignore_changed_event : bool = false var _plugin : EditorPlugin = null var _undo_redo : UndoRedo = null -signal request_item_edit(world_gen_base_reosurce) +signal request_item_edit(world_gen_base_resource) func _init(): if !is_connected("item_edited", self, "on_item_edited"): diff --git a/game/addons/world_generator/ui/WorldTab.gd b/game/addons/world_generator/ui/WorldTab.gd index ece22128..0198b78c 100644 --- a/game/addons/world_generator/ui/WorldTab.gd +++ b/game/addons/world_generator/ui/WorldTab.gd @@ -3,6 +3,14 @@ extends HBoxContainer var edited_world +signal request_item_edit(world_gen_base_resource) + +func _ready(): + var dl : Control = get_node("VBoxContainer/DataList") + + if !dl.is_connected("request_item_edit", self, "on_request_item_edit"): + dl.connect("request_item_edit", self, "on_request_item_edit") + func set_plugin(plugin : EditorPlugin) -> void: $HSplitContainer/ResourcePropertyList.set_plugin(plugin) $HSplitContainer/RectEditor.set_plugin(plugin) @@ -17,3 +25,6 @@ func set_wgworld(wgw : WorldGenWorld) -> void: edited_world = wgw refresh() + +func on_request_item_edit(resource : WorldGenBaseResource) -> void: + emit_signal("request_item_edit", resource) diff --git a/game/addons/world_generator/ui/tabs/Continent.gd b/game/addons/world_generator/ui/tabs/Continent.gd index c4ec5b04..f8750d66 100644 --- a/game/addons/world_generator/ui/tabs/Continent.gd +++ b/game/addons/world_generator/ui/tabs/Continent.gd @@ -4,9 +4,16 @@ extends HBoxContainer var edited_world : WorldGenWorld = null var edited_continent : Continent = null +signal request_item_edit(world_gen_base_resource) + func _ready(): var option_button : OptionButton = $HSplitContainer/VBoxContainer/OptionButton option_button.connect("item_selected", self, "on_item_selected") + + var dl : Control = get_node("HSplitContainer/VBoxContainer/HBoxContainer2/VBoxContainer/DataList") + if !dl.is_connected("request_item_edit", self, "on_request_item_edit"): + dl.connect("request_item_edit", self, "on_request_item_edit") + func set_plugin(plugin : EditorPlugin) -> void: $HSplitContainer/VBoxContainer/HBoxContainer2/ResourcePropertyList.set_plugin(plugin) @@ -54,3 +61,7 @@ func on_item_selected(idx : int) -> void: var option_button : OptionButton = $HSplitContainer/VBoxContainer/OptionButton set_continent(option_button.get_item_metadata(idx)) + +func on_request_item_edit(resource : WorldGenBaseResource) -> void: + emit_signal("request_item_edit", resource) + diff --git a/game/addons/world_generator/ui/tabs/SubZone.gd b/game/addons/world_generator/ui/tabs/SubZone.gd index 412c4ef6..9e115dcb 100644 --- a/game/addons/world_generator/ui/tabs/SubZone.gd +++ b/game/addons/world_generator/ui/tabs/SubZone.gd @@ -6,6 +6,8 @@ var edited_continent : Continent = null var edited_zone : Zone = null var edited_sub_zone : SubZone = null +signal request_item_edit(world_gen_base_resource) + func _ready(): var coption_button : OptionButton = $HSplitContainer/VBoxContainer/ContinentOptionButton coption_button.connect("item_selected", self, "on_continent_item_selected") @@ -15,6 +17,10 @@ func _ready(): var szoption_button : OptionButton = $HSplitContainer/VBoxContainer/SubZoneOptionButton szoption_button.connect("item_selected", self, "on_sub_zone_item_selected") + + var dl : Control = get_node("HSplitContainer/VBoxContainer/HBoxContainer2/VBoxContainer/DataList") + if !dl.is_connected("request_item_edit", self, "on_request_item_edit"): + dl.connect("request_item_edit", self, "on_request_item_edit") func set_plugin(plugin : EditorPlugin) -> void: $HSplitContainer/VBoxContainer/HBoxContainer2/ResourcePropertyList.set_plugin(plugin) @@ -125,3 +131,7 @@ func on_sub_zone_item_selected(idx : int) -> void: var option_button : OptionButton = $HSplitContainer/VBoxContainer/SubZoneOptionButton set_sub_zone(option_button.get_item_metadata(idx)) + +func on_request_item_edit(resource : WorldGenBaseResource) -> void: + emit_signal("request_item_edit", resource) + diff --git a/game/addons/world_generator/ui/tabs/World.tscn b/game/addons/world_generator/ui/tabs/World.tscn index 25260081..42f0a745 100644 --- a/game/addons/world_generator/ui/tabs/World.tscn +++ b/game/addons/world_generator/ui/tabs/World.tscn @@ -13,9 +13,6 @@ margin_top = 32.0 margin_right = -4.0 margin_bottom = -4.0 script = ExtResource( 5 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="HSplitContainer" type="HSplitContainer" parent="."] margin_right = 839.0 diff --git a/game/addons/world_generator/ui/tabs/Zone.gd b/game/addons/world_generator/ui/tabs/Zone.gd index 7ea49b79..18bb028e 100644 --- a/game/addons/world_generator/ui/tabs/Zone.gd +++ b/game/addons/world_generator/ui/tabs/Zone.gd @@ -5,12 +5,18 @@ var edited_world : WorldGenWorld = null var edited_continent : Continent = null var edited_zone : Zone = null +signal request_item_edit(world_gen_base_resource) + func _ready(): var coption_button : OptionButton = $HSplitContainer/VBoxContainer/ContinentOptionButton coption_button.connect("item_selected", self, "on_continent_item_selected") var zoption_button : OptionButton = $HSplitContainer/VBoxContainer/ZoneOptionButton zoption_button.connect("item_selected", self, "on_zone_item_selected") + + var dl : Control = get_node("HSplitContainer/VBoxContainer/HBoxContainer2/VBoxContainer/DataList") + if !dl.is_connected("request_item_edit", self, "on_request_item_edit"): + dl.connect("request_item_edit", self, "on_request_item_edit") func set_plugin(plugin : EditorPlugin) -> void: $HSplitContainer/VBoxContainer/HBoxContainer2/ResourcePropertyList.set_plugin(plugin) @@ -90,3 +96,7 @@ func on_zone_item_selected(idx : int) -> void: var option_button : OptionButton = $HSplitContainer/VBoxContainer/ZoneOptionButton set_zone(option_button.get_item_metadata(idx)) + +func on_request_item_edit(resource : WorldGenBaseResource) -> void: + emit_signal("request_item_edit", resource) +