mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-02-08 14:50:05 +01:00
Similar cleanups to the SubZone editor.
This commit is contained in:
parent
1fa6903106
commit
10ee9bb44a
@ -16,9 +16,11 @@ func _ready():
|
|||||||
var szoption_button : OptionButton = $VBoxContainer/SubZoneOptionButton
|
var szoption_button : OptionButton = $VBoxContainer/SubZoneOptionButton
|
||||||
szoption_button.connect("item_selected", self, "on_sub_zone_item_selected")
|
szoption_button.connect("item_selected", self, "on_sub_zone_item_selected")
|
||||||
|
|
||||||
func refresh_continent() -> void:
|
func continent_changed() -> void:
|
||||||
var option_button : OptionButton = $VBoxContainer/ZoneOptionButton
|
var option_button : OptionButton = $VBoxContainer/ZoneOptionButton
|
||||||
option_button.clear()
|
option_button.clear()
|
||||||
|
edited_zone = null
|
||||||
|
edited_sub_zone = null
|
||||||
|
|
||||||
if !edited_continent:
|
if !edited_continent:
|
||||||
return
|
return
|
||||||
@ -33,9 +35,12 @@ func refresh_continent() -> void:
|
|||||||
if !edited_zone:
|
if !edited_zone:
|
||||||
edited_zone = c
|
edited_zone = c
|
||||||
|
|
||||||
func refresh_zone() -> void:
|
zone_changed()
|
||||||
|
|
||||||
|
func zone_changed() -> void:
|
||||||
var option_button : OptionButton = $VBoxContainer/SubZoneOptionButton
|
var option_button : OptionButton = $VBoxContainer/SubZoneOptionButton
|
||||||
option_button.clear()
|
option_button.clear()
|
||||||
|
edited_sub_zone = null
|
||||||
|
|
||||||
if !edited_zone:
|
if !edited_zone:
|
||||||
return
|
return
|
||||||
@ -47,11 +52,13 @@ func refresh_zone() -> void:
|
|||||||
option_button.add_item(c.resource_name)
|
option_button.add_item(c.resource_name)
|
||||||
option_button.set_item_metadata(option_button.get_item_count() - 1, c)
|
option_button.set_item_metadata(option_button.get_item_count() - 1, c)
|
||||||
|
|
||||||
if !edited_zone:
|
if !edited_sub_zone:
|
||||||
edited_zone = c
|
edited_sub_zone = c
|
||||||
|
|
||||||
|
sub_zone_changed()
|
||||||
|
|
||||||
|
|
||||||
func refresh_sub_zone() -> void:
|
func sub_zone_changed() -> void:
|
||||||
$VBoxContainer/HBoxContainer2/ResourcePropertyList.edit_resource(edited_sub_zone)
|
$VBoxContainer/HBoxContainer2/ResourcePropertyList.edit_resource(edited_sub_zone)
|
||||||
|
|
||||||
func refresh() -> void:
|
func refresh() -> void:
|
||||||
@ -71,7 +78,7 @@ func refresh() -> void:
|
|||||||
if !edited_continent:
|
if !edited_continent:
|
||||||
edited_continent = c
|
edited_continent = c
|
||||||
|
|
||||||
refresh_continent()
|
continent_changed()
|
||||||
|
|
||||||
func set_wgworld(wgw : WorldGenWorld) -> void:
|
func set_wgworld(wgw : WorldGenWorld) -> void:
|
||||||
edited_world = wgw
|
edited_world = wgw
|
||||||
@ -84,17 +91,17 @@ func set_continent(continent : Continent) -> void:
|
|||||||
edited_continent = continent
|
edited_continent = continent
|
||||||
edited_zone = null
|
edited_zone = null
|
||||||
|
|
||||||
refresh_continent()
|
continent_changed()
|
||||||
|
|
||||||
func set_zone(zone : Zone) -> void:
|
func set_zone(zone : Zone) -> void:
|
||||||
edited_zone = zone
|
edited_zone = zone
|
||||||
|
|
||||||
refresh_zone()
|
zone_changed()
|
||||||
|
|
||||||
func set_sub_zone(sub_zone : SubZone) -> void:
|
func set_sub_zone(sub_zone : SubZone) -> void:
|
||||||
edited_sub_zone = sub_zone
|
edited_sub_zone = sub_zone
|
||||||
|
|
||||||
refresh_sub_zone()
|
sub_zone_changed()
|
||||||
|
|
||||||
func on_continent_item_selected(idx : int) -> void:
|
func on_continent_item_selected(idx : int) -> void:
|
||||||
var option_button : OptionButton = $VBoxContainer/ContinentOptionButton
|
var option_button : OptionButton = $VBoxContainer/ContinentOptionButton
|
||||||
|
Loading…
Reference in New Issue
Block a user