phr00t / FocusEngine

Focus Game Engine. This is Stride/Xenko fast-tracked for Phr00t's Software games. Improvements over the original Focus on Vulkan support, PC platforms, VR, performance & ease. Cherry-picks commits from other forks as needed.
MIT License
98 stars 11 forks source link

Copying a UI Library doesn't update "public UI element" Guids #85

Closed phr00t closed 5 years ago

phr00t commented 5 years ago

When you copy a UI library to make another similar one, the Guid isn't updated in the saved file under the "public UI elements" list. The new Guid is set in the content of the UI library, but not in the "public UI elements" list. This causes a mismatch in Guids, so when trying to find and instantiate an element from the library, it will fail. When copying UI libraries, the list of public UI elements should be rebuilt with new Guids so the UI library is saved properly.

This is relatively easily fixed outside of Xenko by opening up the UI library file and copy/pasting the correct Guid from the root element to the corresponding public UI element entry. Developers shouldn't have to do this, though.

phr00t commented 5 years ago

Mostly fixed with this commit: https://github.com/phr00t/xenko/commit/e2e481648d877a155f1d756c7ae89eb887aaa220

When opening up a copy/pasted UI library, Xenko's gamestudio editor will fix it for you. If you never open up the copied UI library and save it, it will remain in a semi-broken state -- so this isn't completely fixed, but worked around enough for this to be closed.