Skip to content

Commit

Permalink
Refactor code, update classdata.tpk & bump AssetsTools.NET to 3.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Bayu Satiyo <itsyuukunz@gmail.com>
  • Loading branch information
kiraio-moe committed Aug 31, 2024
1 parent 6f71507 commit e6ef7c1
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 197 deletions.
8 changes: 8 additions & 0 deletions Enums/AssetTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace USSR.Enums
{
public enum AssetTypes
{
Asset,
Bundle
}
}
9 changes: 9 additions & 0 deletions Enums/WebCompressionTypes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace USSR.Enums
{
public enum WebCompressionTypes
{
None,
Brotli,
GZip
}
}
357 changes: 163 additions & 194 deletions USSR.cs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion USSR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<PackageReference Include="KaitaiStruct.Runtime.CSharp" Version="0.10.0" />
<PackageReference Include="Kiraio.UnityWebTools.NET" Version="1.0.0" />
<PackageReference Include="NativeFileDialogSharp" Version="0.6.0-alpha" />
<PackageReference Include="Spectre.Console" Version="0.47.0" />
<PackageReference Include="Spectre.Console" Version="0.49.1" />
<PackageReference Include="Spectre.Console.Cli" Version="0.49.1" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions Utils/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace USSR.Utilities
internal class Utility
{
const string LAST_OPEN_FILE = "last_open.txt";
const string VERSION_FILE = "version.txt";

/// <summary>
/// Check the file signature if it's a valid file.
Expand Down Expand Up @@ -169,5 +170,14 @@ internal static string GetLastOpenedFile()

return lastOpenedDirectory;
}

internal static string? GetVersion()
{
if (!File.Exists(VERSION_FILE))
return "UNKNOWN";

using StreamReader reader = new(VERSION_FILE);
return reader.ReadLine();
}
}
}
7 changes: 5 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

VERSION="1.1.7"
VERSION=$(<version.txt)

echo "Building USSR..."
echo "Building USSR v${VERSION}..."
# Define the target operating systems and architectures
TARGET_OS_ARCHITECTURES=("win-x64" "win-arm64" "linux-x64" "linux-arm64" "osx-x64" "osx-arm64")
TARGET_FRAMEWORKS=("net6.0" "net7.0" "net8.0")
Expand Down Expand Up @@ -39,6 +39,9 @@ do
mkdir -p "${PUBLISH_PATH}"
cp "classdata.tpk" "${PUBLISH_PATH}"

# Copy version.txt
cp "version.txt" "${PUBLISH_PATH}"

# Make a zip file for every architecture to be distributed
cd "${PUBLISH_PATH}"
zip -r "../../../${ZIP_OUTPUT}" *
Expand Down
Binary file modified classdata.tpk
Binary file not shown.
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.8

0 comments on commit e6ef7c1

Please sign in to comment.