UltravioletFramework / ultraviolet

The Ultraviolet Framework is a .NET game development framework written in C#.
https://github.com/UltravioletFramework/ultraviolet/wiki
MIT License
542 stars 46 forks source link

Content folder in parent directory #36

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hello

I'm trying to setup a shared content folder, it's in the root of my solution

MySolution/Assets/Data ......................./GameProject ....................../EditorProject

But i'm having a problem with Presentation

I can correctly setup the content folder like this:

Content = ContentManager.Create("../../../Assets/Data");

But the problem comes with Presentation, he doesn't seems to correctly handle `../..

        private void LoadPresentation()
        {
            var upf = Ultraviolet.GetUI().GetPresentationFoundation();

            var globalStylesheet = Content.Load<UvssDocument>("UI/DefaultUIStyles"); // Works
            upf.SetGlobalStyleSheet(globalStylesheet);

// if "Data", it will complain about not finding the folder
// if("../../../Assets/Data") compiler will complains about the ../..
            upf.CompileExpressionsIfSupported("../../../Assets/Data"); 
            upf.LoadCompiledExpressions();
        }
ghost commented 8 years ago

As a workaround i can put a simlink so it's not big deal, just wanted to let you know about the error since it's pretty common to setup shared content folder

tlgkccampbell commented 8 years ago

I know what's causing this and I should have a fix for you in 1.3.14.

tlgkccampbell commented 8 years ago

This should be fixed in the 1.3.14 release that I just pushed. Let me know if you still have trouble.

ghost commented 8 years ago

Yes works perfectly fine, awesome job! and thanks :)