Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions .github/workflows/deploy-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
permissions:
contents: write
id-token: write

steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -26,7 +26,7 @@ jobs:

- name: Restore .NET dependencies
run: dotnet restore

# Install Node.js and semantic-release
- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -56,12 +56,11 @@ jobs:
sed -i "s/{VERSION_NUMBER}/${{ steps.semantic-release.outputs.new_release_version }}/" ./S1API/S1API.cs
sed -i "s/{VERSION_NUMBER}/${{ steps.semantic-release.outputs.new_release_version }}/" ./S1APILoader/S1APILoader.cs

# TODO (@MaxtorCoder): Temporarily disabling until BepInEx is building properly locally.
# - name: Run .NET build for MonoBepInEx
# run: dotnet build ./S1API.sln -c MonoBepInEx -f netstandard2.1
#
# - name: Run .NET build for Il2CppBepInEx
# run: dotnet build ./S1API.sln -c Il2CppBepInEx -f net6.0
- name: Run .NET build for MonoBepInEx
run: dotnet build ./S1API.sln -c MonoBepInEx -f netstandard2.1

- name: Run .NET build for Il2CppBepInEx
run: dotnet build ./S1API.sln -c Il2CppBepInEx -f net6.0

- name: Run .NET build for MonoMelon
run: dotnet build ./S1API.sln -c MonoMelon -f netstandard2.1
Expand All @@ -73,12 +72,12 @@ jobs:
run: |
mkdir -p ./artifacts/thunderstore/Plugins/S1API
cp ./S1APILoader/bin/MonoMelon/netstandard2.1/S1APILoader.dll ./artifacts/thunderstore/Plugins/S1APILoader.MelonLoader.dll
# cp ./S1APILoader/bin/MonoBepInEx/netstandard2.1/S1APILoader.dll ./artifacts/thunderstore/Plugins/S1APILoader.BepInEx.dll
cp ./S1APILoader/bin/MonoBepInEx/netstandard2.1/S1APILoader.dll ./artifacts/thunderstore/Plugins/S1APILoader.BepInEx.dll
cp ./S1API/bin/Il2CppMelon/net6.0/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Il2Cpp.MelonLoader.dll
cp ./S1API/bin/MonoMelon/netstandard2.1/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Mono.MelonLoader.dll
# cp ./S1API/bin/Il2CppMelon/net6.0/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Il2Cpp.BepInEx.dll
# cp ./S1API/bin/MonoMelon/netstandard2.1/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Mono.BepInEx.dll
cp ./S1API/bin/Il2CppMelon/net6.0/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Il2Cpp.BepInEx.dll
cp ./S1API/bin/MonoMelon/netstandard2.1/S1API.dll ./artifacts/thunderstore/Plugins/S1API/S1API.Mono.BepInEx.dll

- name: Publish artifact to Thunderstore
uses: GreenTF/upload-thunderstore-package@v4.3
with:
Expand All @@ -97,9 +96,9 @@ jobs:
mono
il2cpp
libraries

- name: Pack NuGet package
run: dotnet pack ./S1API/S1API.csproj -c Mono --no-build --output ./nupkg /p:PackageVersion=${{ steps.semantic-release.outputs.new_release_version }}

- name: Push to NuGet Gallery
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
23 changes: 11 additions & 12 deletions .github/workflows/verify-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,29 @@ jobs:
build:
name: Verify Successful Build
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Clone Game Assemblies
run: |
git clone https://x-access-token:${{ secrets.GH_PAT }}@github.com/KaBooMa/ScheduleOneAssemblies.git ./ScheduleOneAssemblies

- name: Setup .NET
uses: actions/setup-dotnet@v4

- name: Restore .NET Dependencies
run: dotnet restore

# TODO (@MaxtorCoder): Temporarily disabling until BepInEx is building properly locally.
# - name: Run .NET build for MonoBepInEx
# run: dotnet build ./S1API.sln -c MonoBepInEx -f netstandard2.1
#
# - name: Run .NET build for Il2CppBepInEx
# run: dotnet build ./S1API.sln -c Il2CppBepInEx -f net6.0

- name: Run .NET build for MonoBepInEx
run: dotnet build ./S1API.sln -c MonoBepInEx -f netstandard2.1

- name: Run .NET build for Il2CppBepInEx
run: dotnet build ./S1API.sln -c Il2CppBepInEx -f net6.0

- name: Run .NET build for MonoMelon
run: dotnet build ./S1API.sln -c MonoMelon -f netstandard2.1

- name: Run .NET build for Il2CppMelon
run: dotnet build ./S1API.sln -c Il2CppMelon -f net6.0
run: dotnet build ./S1API.sln -c Il2CppMelon -f net6.0
12 changes: 6 additions & 6 deletions S1API/Conditionals/SystemTriggerEntry.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#if (IL2CPPMELON || IL2CPPBEPINEX)
#if (IL2CPPMELON)
using S1Quests = Il2CppScheduleOne.Quests;
using S1Variables = Il2CppScheduleOne.Variables;
using static Il2CppScheduleOne.Quests.QuestManager;
#elif (MONOMELON || MONOBEPINEX)
#elif (MONOMELON || MONOBEPINEX || IL2CPPBEPINEX)
using S1Quests = ScheduleOne.Quests;
using S1Variables = ScheduleOne.Variables;
using static ScheduleOne.Quests.QuestManager;
Expand Down Expand Up @@ -82,10 +82,10 @@ public void AddVariableSetter(EvaluationType evaluation, string variableName, st
switch (evaluation)
{
case EvaluationType.PassOnTrue:
ArrayUtils.Add(ref S1SystemTrigger.onEvaluateTrueVariableSetters, variableSetter);
S1SystemTrigger.onEvaluateTrueVariableSetters = S1SystemTrigger.onEvaluateTrueVariableSetters.AddItemToArray(variableSetter);
break;
case EvaluationType.PassOnFalse:
ArrayUtils.Add(ref S1SystemTrigger.onEvaluateFalseVariableSetters, variableSetter);
S1SystemTrigger.onEvaluateFalseVariableSetters = S1SystemTrigger.onEvaluateFalseVariableSetters.AddItemToArray(variableSetter);
break;
}
}
Expand Down Expand Up @@ -121,10 +121,10 @@ public void AddQuestSetter(EvaluationType evaluation, Quest questData,
switch (evaluation)
{
case EvaluationType.PassOnTrue:
ArrayUtils.Add(ref S1SystemTrigger.onEvaluateTrueQuestSetters, questStateSetter);
S1SystemTrigger.onEvaluateTrueQuestSetters = S1SystemTrigger.onEvaluateTrueQuestSetters.AddItemToArray(questStateSetter);
break;
case EvaluationType.PassOnFalse:
ArrayUtils.Add(ref S1SystemTrigger.onEvaluateFalseQuestSetters, questStateSetter);
S1SystemTrigger.onEvaluateFalseQuestSetters = S1SystemTrigger.onEvaluateFalseQuestSetters.AddItemToArray(questStateSetter);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions S1API/Console/ConsoleHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if (IL2CPPMELON || IL2CPPBEPINEX)
#if (IL2CPPMELON)
using Il2CppSystem.Collections.Generic;
using static Il2CppScheduleOne.Console;
#else
Expand Down Expand Up @@ -31,4 +31,4 @@ public static void RunCashCommand(int amount)
command.Execute(args);
}
}
}
}
22 changes: 11 additions & 11 deletions S1API/DeadDrops/DeadDropInstance.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#if (IL2CPPMELON || IL2CPPBEPINEX)
#if (IL2CPPMELON)
using S1Economy = Il2CppScheduleOne.Economy;
#elif (MONOMELON || MONOBEPINEX)
#elif (MONOMELON || MONOBEPINEX || IL2CPPBEPINEX)
using S1Economy = ScheduleOne.Economy;
#endif

Expand All @@ -20,43 +20,43 @@ public class DeadDropInstance : IGUIDReference
/// INTERNAL: Stores a reference to the game dead drop instance.
/// </summary>
internal readonly S1Economy.DeadDrop S1DeadDrop;

/// <summary>
/// The cached storage instance.
/// </summary>
private StorageInstance? _cachedStorage;

/// <summary>
/// INTERNAL: Instances a new dead drop from the game dead drop instance.
/// </summary>
/// <param name="deadDrop">The game dead drop instance.</param>
internal DeadDropInstance(S1Economy.DeadDrop deadDrop) =>
internal DeadDropInstance(S1Economy.DeadDrop deadDrop) =>
S1DeadDrop = deadDrop;

/// <summary>
/// INTERNAL: Gets a dead drop from a GUID value.
/// </summary>
/// <param name="guid"></param>
/// <returns></returns>
internal static DeadDropInstance? GetFromGUID(string guid) =>
DeadDropManager.All.FirstOrDefault(deadDrop => deadDrop.GUID == guid);

/// <summary>
/// The unique identifier assigned for this dead drop.
/// </summary>
public string GUID =>
public string GUID =>
S1DeadDrop.GUID.ToString();

/// <summary>
/// The storage container associated with this dead drop.
/// </summary>
public StorageInstance Storage =>
public StorageInstance Storage =>
_cachedStorage ??= new StorageInstance(S1DeadDrop.Storage);

/// <summary>
/// The world position of the dead drop.
/// </summary>
public Vector3 Position =>
public Vector3 Position =>
S1DeadDrop.transform.position;
}
}
6 changes: 3 additions & 3 deletions S1API/DeadDrops/DeadDropManager.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#if (IL2CPPMELON || IL2CPPBEPINEX)
#if (IL2CPPMELON)
using S1Economy = Il2CppScheduleOne.Economy;
#elif (MONOMELON || MONOBEPINEX)
#elif (MONOMELON || MONOBEPINEX || IL2CPPBEPINEX)
using S1Economy = ScheduleOne.Economy;
#endif

Expand All @@ -16,7 +16,7 @@ public class DeadDropManager
/// <summary>
/// Gets all dead drops in the scene.
/// </summary>
public static DeadDropInstance[] All =>
public static DeadDropInstance[] All =>
S1Economy.DeadDrop.DeadDrops.ToArray()
.Select(deadDrop => new DeadDropInstance(deadDrop)).ToArray(); }
}
Loading