Skip to content

Commit

Permalink
Fix base layers when creating styles
Browse files Browse the repository at this point in the history
How did I miss this. I'm so dumb.
  • Loading branch information
Jowan-Spooner committed Nov 12, 2024
1 parent 5ddcf9b commit 3139364
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 2 additions & 3 deletions addons/dialogic/Resources/dialogic_style.gd
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ func move_layer(from_index:int, to_index:int) -> void:
func set_layer_scene(layer_id:String, scene:String) -> void:
if not has_layer(layer_id):
return

layer_info[layer_id].scene = load(scene)
changed.emit()

Expand Down Expand Up @@ -247,8 +246,8 @@ func clone() -> DialogicStyle:
style.inherits = inherits

var base_info := get_layer_info("")
set_layer_scene("", base_info.path)
set_layer_overrides("", base_info.overrides)
style.set_layer_scene("", base_info.path)
style.set_layer_overrides("", base_info.overrides)

for id in layer_list:
var info := get_layer_info(id)
Expand Down
7 changes: 7 additions & 0 deletions addons/dialogic/Resources/dialogic_style_layer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ func _init(scene_path:Variant=null, scene_overrides:Dictionary={}):
elif scene_path is String and ResourceLoader.exists(scene_path):
scene = load(scene_path)
overrides = scene_overrides


func _to_string() -> String:
if scene:
return "<Layer:" + scene.resource_path + " {" + str(len(overrides)) + " overrides} >"
else:
return "<Layer:no-scene>"

0 comments on commit 3139364

Please sign in to comment.