Skip to content

Use copied resources in customized scenes - #2823

Open
upalvstavai wants to merge 1 commit into
dialogic-godot:mainfrom
upalvstavai:codex/fix-layered-portrait-script-copy
Open

upalvstavai wants to merge 1 commit into
dialogic-godot:mainfrom
upalvstavai:codex/fix-layered-portrait-script-copy

Conversation

@upalvstavai

Copy link
Copy Markdown

Fixes #2820.

When make_file_custom() copied a scene and its neighboring resources, it changed each resource path but left the original resource UID in the scene. Godot resolves the UID first, so a newly created layered portrait still loaded the template script from the Dialogic addon even though the saved scene text pointed at the copied script.

This change replaces the complete resource reference while customizing a scene, removing the stale UID and writing the copied path. A regression test checks both the saved scene text and the script actually loaded by an instantiated customized portrait.

Validation:

  • Before the fix, the customized scene text pointed to user://.../custom_layered_portrait.gd, but the instantiated scene loaded res://addons/dialogic/Modules/LayeredPortrait/custom_layered_portrait.gd.
  • After the fix, the instantiated scene loads its copied user:// script.
  • The focused GdUnit4 regression passes with zero errors, failures, or orphan nodes.
  • The complete Tests/Unit suite passes: 17 cases, zero errors, failures, flaky tests, skipped tests, or orphan nodes.
  • Tested with Godot 4.7.2 and GdUnit4 6.2.1. The repository CI also covers its configured Godot 4.5.1 environment.

The fix was prepared with the assistance of an AI coding tool and reviewed and behavior-tested before submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Incorrect script assignment when creating a new layered portrait (Godot 4.7.2, Dialogic 2.0 Alpha 20)

1 participant