Merge pull request #105624 from dsnopek/openxr-action-map-uid-error

OpenXR: Fix saving action map when UID is used in project settings
This commit is contained in:
Thaddeus Crews
2025-04-22 18:25:51 -05:00

View File

@ -288,13 +288,12 @@ void OpenXRActionMapEditor::_load_action_map(const String p_path, bool p_create_
} else if (p_create_new_if_missing) {
action_map.instantiate();
action_map->create_default_action_sets();
action_map->set_path(p_path);
// Save it immediately
err = ResourceSaver::save(action_map, p_path);
if (err != OK) {
// Show warning but continue.
EditorNode::get_singleton()->show_warning(vformat(TTR("Error saving file %s: %s"), edited_path, error_names[err]));
EditorNode::get_singleton()->show_warning(vformat(TTR("Error saving file %s: %s"), p_path, error_names[err]));
}
}
@ -495,5 +494,5 @@ OpenXRActionMapEditor::OpenXRActionMapEditor() {
// Our Action map editor is only shown if openxr is enabled in project settings
// So load our action map and if it doesn't exist, create it right away.
_load_action_map(GLOBAL_GET("xr/openxr/default_action_map"), true);
_load_action_map(ResourceUID::ensure_path(GLOBAL_GET("xr/openxr/default_action_map")), true);
}