mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-21 13:16:49 +01:00
Cleaned up the methods in the Zone editor. Also fixed a few smaller usability issues.
This commit is contained in:
parent
900f402370
commit
1fa6903106
@ -8,13 +8,13 @@
|
|||||||
[sub_resource type="Resource" id=14]
|
[sub_resource type="Resource" id=14]
|
||||||
resource_name = "qwe"
|
resource_name = "qwe"
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
rect = Rect2( 12, 17, 159.14, 87.78 )
|
rect = Rect2( 21, 25, 150, 79 )
|
||||||
locked = false
|
locked = false
|
||||||
|
|
||||||
[sub_resource type="Resource" id=15]
|
[sub_resource type="Resource" id=15]
|
||||||
resource_name = "we"
|
resource_name = "we"
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
rect = Rect2( 0, 0, 19.14, 12.78 )
|
rect = Rect2( 3, -1, 54.14, 32.78 )
|
||||||
locked = false
|
locked = false
|
||||||
|
|
||||||
[sub_resource type="Resource" id=8]
|
[sub_resource type="Resource" id=8]
|
||||||
|
@ -12,31 +12,11 @@ func _ready():
|
|||||||
var zoption_button : OptionButton = $HSplitContainer/VBoxContainer/ZoneOptionButton
|
var zoption_button : OptionButton = $HSplitContainer/VBoxContainer/ZoneOptionButton
|
||||||
zoption_button.connect("item_selected", self, "on_zone_item_selected")
|
zoption_button.connect("item_selected", self, "on_zone_item_selected")
|
||||||
|
|
||||||
func refresh_continent() -> void:
|
|
||||||
var option_button : OptionButton = $HSplitContainer/VBoxContainer/ZoneOptionButton
|
|
||||||
option_button.clear()
|
|
||||||
|
|
||||||
if !edited_continent:
|
|
||||||
return
|
|
||||||
|
|
||||||
var content : Array = edited_continent.get_content()
|
|
||||||
|
|
||||||
for c in content:
|
|
||||||
if c:
|
|
||||||
option_button.add_item(c.resource_name)
|
|
||||||
option_button.set_item_metadata(option_button.get_item_count() - 1, c)
|
|
||||||
|
|
||||||
if !edited_zone:
|
|
||||||
edited_zone = c
|
|
||||||
|
|
||||||
func refresh_zone() -> void:
|
|
||||||
$HSplitContainer/VBoxContainer/HBoxContainer2/ResourcePropertyList.edit_resource(edited_zone)
|
|
||||||
$HSplitContainer/VBoxContainer/HBoxContainer2/VBoxContainer/DataList.set_edited_resource(edited_zone)
|
|
||||||
$HSplitContainer/RectEditor.set_edited_resource(edited_zone)
|
|
||||||
|
|
||||||
func refresh() -> void:
|
func refresh() -> void:
|
||||||
var option_button : OptionButton = $HSplitContainer/VBoxContainer/ContinentOptionButton
|
var option_button : OptionButton = $HSplitContainer/VBoxContainer/ContinentOptionButton
|
||||||
option_button.clear()
|
option_button.clear()
|
||||||
|
edited_continent = null
|
||||||
|
edited_zone = null
|
||||||
|
|
||||||
if !edited_world:
|
if !edited_world:
|
||||||
return
|
return
|
||||||
@ -51,7 +31,43 @@ func refresh() -> void:
|
|||||||
if !edited_continent:
|
if !edited_continent:
|
||||||
edited_continent = c
|
edited_continent = c
|
||||||
|
|
||||||
refresh_continent()
|
continent_changed()
|
||||||
|
|
||||||
|
func continent_changed() -> void:
|
||||||
|
var option_button : OptionButton = $HSplitContainer/VBoxContainer/ZoneOptionButton
|
||||||
|
option_button.clear()
|
||||||
|
edited_zone = null
|
||||||
|
|
||||||
|
if !edited_continent:
|
||||||
|
return
|
||||||
|
|
||||||
|
var content : Array = edited_continent.get_content()
|
||||||
|
|
||||||
|
for c in content:
|
||||||
|
if c:
|
||||||
|
option_button.add_item(c.resource_name)
|
||||||
|
option_button.set_item_metadata(option_button.get_item_count() - 1, c)
|
||||||
|
|
||||||
|
if !edited_zone:
|
||||||
|
edited_zone = c
|
||||||
|
|
||||||
|
zone_changed()
|
||||||
|
|
||||||
|
func zone_changed() -> void:
|
||||||
|
$HSplitContainer/VBoxContainer/HBoxContainer2/ResourcePropertyList.edit_resource(edited_zone)
|
||||||
|
$HSplitContainer/VBoxContainer/HBoxContainer2/VBoxContainer/DataList.set_edited_resource(edited_zone)
|
||||||
|
$HSplitContainer/RectEditor.set_edited_resource(edited_zone)
|
||||||
|
|
||||||
|
func set_continent(continent : Continent) -> void:
|
||||||
|
edited_continent = continent
|
||||||
|
edited_zone = null
|
||||||
|
|
||||||
|
continent_changed()
|
||||||
|
|
||||||
|
func set_zone(zone : Zone) -> void:
|
||||||
|
edited_zone = zone
|
||||||
|
|
||||||
|
zone_changed()
|
||||||
|
|
||||||
func set_wgworld(wgw : WorldGenWorld) -> void:
|
func set_wgworld(wgw : WorldGenWorld) -> void:
|
||||||
edited_world = wgw
|
edited_world = wgw
|
||||||
@ -60,17 +76,6 @@ func set_wgworld(wgw : WorldGenWorld) -> void:
|
|||||||
|
|
||||||
refresh()
|
refresh()
|
||||||
|
|
||||||
func set_continent(continent : Continent) -> void:
|
|
||||||
edited_continent = continent
|
|
||||||
edited_zone = null
|
|
||||||
|
|
||||||
refresh_continent()
|
|
||||||
|
|
||||||
func set_zone(zone : Zone) -> void:
|
|
||||||
edited_zone = zone
|
|
||||||
|
|
||||||
refresh_zone()
|
|
||||||
|
|
||||||
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