Skip to content

Commit

Permalink
use TitleContainer on Browser/WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast committed Jun 25, 2024
1 parent f7d04d7 commit f8c7e68
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion RenderingLibrary/SystemManagers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ public void Initialize(GraphicsDevice graphicsDevice, bool fullInstantiation = f
{
#if NET6_0_OR_GREATER
var usesTitleContainer = System.OperatingSystem.IsAndroid() ||
System.OperatingSystem.IsIOS();
System.OperatingSystem.IsIOS() ||
System.OperatingSystem.IsBrowser();

if(usesTitleContainer)
{
Expand Down
25 changes: 19 additions & 6 deletions ToolsUtilities/FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,29 @@ public static partial class FileManager
public const char DefaultSlash = '\\';
#region Fields

public static string ExeLocation =>
public static string ExeLocation
{
get
{
#if UWP
"./";
return "./";
#elif ANDROID || IOS
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).ToLower().Replace("/", "\\") + "\\";
return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).ToLower().Replace("/", "\\") + "\\";
#else
Path.GetDirectoryName(AppContext.BaseDirectory)
.Replace('/', Path.DirectorySeparatorChar)
.Replace('\\', Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
try
{
return Path.GetDirectoryName(AppContext.BaseDirectory)
.Replace('/', Path.DirectorySeparatorChar)
.Replace('\\', Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
}
catch
{
// WASM ?
return "./";
}
#endif
}
}

static string mRelativeDirectory = ExeLocation;

Expand Down

0 comments on commit f8c7e68

Please sign in to comment.