Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix base layers when creating styles #2474

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>"