Add standalone win64 release packaging, Forgejo release script, and borderless/focus UX
This commit is contained in:
parent
42b17c168e
commit
385275f130
12 changed files with 698 additions and 84 deletions
42
client/ClientAssets.cs
Normal file
42
client/ClientAssets.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Godot;
|
||||
using RustToDust.Core;
|
||||
|
||||
namespace RustToDust.Client;
|
||||
|
||||
internal static class ClientAssets
|
||||
{
|
||||
private static bool _registered;
|
||||
|
||||
internal static void EnsureAssetsRootRegistered()
|
||||
{
|
||||
if (_registered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_registered = true;
|
||||
|
||||
if (OS.HasFeature("template"))
|
||||
{
|
||||
string exeAssets = Path.Combine(OS.GetExecutablePath().GetBaseDir(), "assets");
|
||||
if (Directory.Exists(exeAssets))
|
||||
{
|
||||
AssetPathResolver.RegisterAssetsRoot(exeAssets);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
string baseAssets = Path.Combine(AppContext.BaseDirectory, "assets");
|
||||
if (Directory.Exists(baseAssets))
|
||||
{
|
||||
AssetPathResolver.RegisterAssetsRoot(baseAssets);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string LocateAssetsDirectory()
|
||||
{
|
||||
EnsureAssetsRootRegistered();
|
||||
return AssetPathResolver.LocateAssetsRoot();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue