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

Gum.Kni #167

Merged
merged 11 commits into from
Jun 26, 2024
Merged

Gum.Kni #167

merged 11 commits into from
Jun 26, 2024

Conversation

nkast
Copy link
Contributor

@nkast nkast commented Jun 25, 2024

No description provided.

@nkast nkast marked this pull request as draft June 25, 2024 10:25
catch
{
// WASM ?
return "./";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppContext.BaseDirectory throws in WASM, and I changed ExeLocation to "./".
I am not sure if that is the correct fix here.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's okay, unless we can get a proper #if

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it was Path.GetDirectoryName() that was failing.
Now I skip it when the value is "/", and let the rest of the method to do, whatever it does.
This also fixed the issue we had with /Content/Content/ path!

@nkast
Copy link
Contributor Author

nkast commented Jun 25, 2024

DesktopGL & WindowsDX seems to work.
BlazorGL will run without exceptions, but tries to load content from http://localhost:5259/Content/Content/BearTexture.png
and sprites/textures will not show. The correct address of the file is http://localhost:5259/Content/BearTexture.png

GumKni

</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants);MONOGAME;KNI;USE_GUMCOMMON</DefineConstants>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I define both MONOGAME and KNI. Perhaps it's best to define only KNI and expand all
#if MONOGAME
to
#if MONOGAME || KNI

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya I think that's probably best, even though it's more work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@nkast nkast force-pushed the GumKni branch 3 times, most recently from f8c7e68 to 542719f Compare June 26, 2024 11:22
@nkast
Copy link
Contributor Author

nkast commented Jun 26, 2024

KniGumInCode

Here is the latest KniGumInCode on the web.
The issue with /Content/Content/ disappeared once we have the proper fix for ExeLocation.

@nkast
Copy link
Contributor Author

nkast commented Jun 26, 2024

KniGumFromFile

Here is the latest KniGumFromFile on WindowsDX.

On DesktopGL the .gumx file fails to deserialize.
We can get a working build by setting <PublishAot>False</PublishAot> in KniGumFromFile.DesktopGL.csproj.
This tells be that we need to mark the runtime GUM libraries as non-trimmable.

@@ -422,21 +422,24 @@ private void PopulateElementSavesFromReferences(string projectRootDirectory, Lin
}
}

foreach(var reference in BehaviorReferences)
if (BehaviorReferences != null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried rooting the Gum assemblies from the main project, and setting IsTrimmable on the libraries.
That seems to be XmlSerializer behavior.

@nkast nkast marked this pull request as ready for review June 26, 2024 15:53
@vchelaru vchelaru merged commit 4e04cf7 into vchelaru:master Jun 26, 2024
@nkast nkast deleted the GumKni branch June 26, 2024 16:12
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.

2 participants