mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-22 02:17:18 +01:00
The edit buttons now work in Continent aswell.
This commit is contained in:
parent
f6eb7b0720
commit
8a3ac51e86
@ -8,6 +8,10 @@ func _ready():
|
|||||||
if !world.is_connected("request_item_edit", self, "on_world_request_item_edit"):
|
if !world.is_connected("request_item_edit", self, "on_world_request_item_edit"):
|
||||||
world.connect("request_item_edit", self, "on_world_request_item_edit")
|
world.connect("request_item_edit", self, "on_world_request_item_edit")
|
||||||
|
|
||||||
|
var continent : Control = get_node("TabContainer/Continent")
|
||||||
|
if !continent.is_connected("request_item_edit", self, "on_continent_request_item_edit"):
|
||||||
|
continent.connect("request_item_edit", self, "on_continent_request_item_edit")
|
||||||
|
|
||||||
func set_plugin(plugin : EditorPlugin) -> void:
|
func set_plugin(plugin : EditorPlugin) -> void:
|
||||||
$TabContainer/World.set_plugin(plugin)
|
$TabContainer/World.set_plugin(plugin)
|
||||||
$TabContainer/Continent.set_plugin(plugin)
|
$TabContainer/Continent.set_plugin(plugin)
|
||||||
@ -34,3 +38,11 @@ func on_world_request_item_edit(resource : WorldGenBaseResource) -> void:
|
|||||||
tc.current_tab = cont.get_position_in_parent()
|
tc.current_tab = cont.get_position_in_parent()
|
||||||
|
|
||||||
cont.switch_to(resource)
|
cont.switch_to(resource)
|
||||||
|
|
||||||
|
func on_continent_request_item_edit(continent : WorldGenBaseResource, resource : WorldGenBaseResource) -> void:
|
||||||
|
var zone : Control = get_node("TabContainer/Zone")
|
||||||
|
|
||||||
|
var tc : TabContainer = get_node("TabContainer")
|
||||||
|
tc.current_tab = zone.get_position_in_parent()
|
||||||
|
|
||||||
|
zone.switch_to(continent, resource)
|
||||||
|
@ -4,7 +4,7 @@ extends HBoxContainer
|
|||||||
var edited_world : WorldGenWorld = null
|
var edited_world : WorldGenWorld = null
|
||||||
var edited_continent : Continent = null
|
var edited_continent : Continent = null
|
||||||
|
|
||||||
signal request_item_edit(world_gen_base_resource)
|
signal request_item_edit(continent, world_gen_base_resource)
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
var option_button : OptionButton = $HSplitContainer/VBoxContainer/OptionButton
|
var option_button : OptionButton = $HSplitContainer/VBoxContainer/OptionButton
|
||||||
@ -74,5 +74,5 @@ func on_item_selected(idx : int) -> void:
|
|||||||
set_continent(option_button.get_item_metadata(idx))
|
set_continent(option_button.get_item_metadata(idx))
|
||||||
|
|
||||||
func on_request_item_edit(resource : WorldGenBaseResource) -> void:
|
func on_request_item_edit(resource : WorldGenBaseResource) -> void:
|
||||||
emit_signal("request_item_edit", resource)
|
emit_signal("request_item_edit", edited_continent, resource)
|
||||||
|
|
||||||
|
@ -87,6 +87,27 @@ func set_wgworld(wgw : WorldGenWorld) -> void:
|
|||||||
|
|
||||||
refresh()
|
refresh()
|
||||||
|
|
||||||
|
func switch_to(continent : WorldGenBaseResource, resource : WorldGenBaseResource) -> void:
|
||||||
|
var contob : OptionButton = $HSplitContainer/VBoxContainer/ContinentOptionButton
|
||||||
|
|
||||||
|
for i in range(contob.get_item_count()):
|
||||||
|
var ccont : Continent = contob.get_item_metadata(i)
|
||||||
|
|
||||||
|
if (ccont == continent):
|
||||||
|
contob.select(i)
|
||||||
|
on_continent_item_selected(i)
|
||||||
|
break
|
||||||
|
|
||||||
|
var zoneob : OptionButton = $HSplitContainer/VBoxContainer/ZoneOptionButton
|
||||||
|
|
||||||
|
for i in range(zoneob.get_item_count()):
|
||||||
|
var czone : Zone = zoneob.get_item_metadata(i)
|
||||||
|
|
||||||
|
if (czone == resource):
|
||||||
|
zoneob.select(i)
|
||||||
|
on_zone_item_selected(i)
|
||||||
|
return
|
||||||
|
|
||||||
func on_continent_item_selected(idx : int) -> void:
|
func on_continent_item_selected(idx : int) -> void:
|
||||||
var option_button : OptionButton = $HSplitContainer/VBoxContainer/ContinentOptionButton
|
var option_button : OptionButton = $HSplitContainer/VBoxContainer/ContinentOptionButton
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user