Skip to content

Commit cfd43d4

Browse files
authored
feat: Starlight support (#105)
1 parent 77d805a commit cfd43d4

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/AUnlocker.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ namespace AUnlocker;
1111

1212
[BepInAutoPlugin]
1313
[BepInProcess("Among Us.exe")]
14+
#pragma warning disable BepInEx002
1415
public partial class AUnlocker : BasePlugin
16+
#pragma warning restore BepInEx002
1517
{
1618
public Harmony Harmony { get; } = new(Id);
1719
public new static ManualLogSource Log;

src/CosmeticsPatches.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using HarmonyLib;
23

34
namespace AUnlocker;
@@ -7,6 +8,17 @@ public static class UnlockCosmetics_HatManager_Initialize_Postfix
78
{
89
// https://github.com/scp222thj/MalumMenu/blob/main/src/Cheats/CosmeticsUnlocker.cs
910

11+
/// <summary>
12+
/// Ensure the patch is not applied on Android.
13+
/// </summary>
14+
/// <returns>True if the patch should be applied; otherwise, false.</returns>
15+
#pragma warning disable HARMONIZE004
16+
public static bool Prepare()
17+
#pragma warning restore HARMONIZE004
18+
{
19+
return !OperatingSystem.IsAndroid();
20+
}
21+
1022
/// <summary>
1123
/// Unlock all cosmetics by setting their price to 0 and marking them as free.
1224
/// </summary>
@@ -68,6 +80,17 @@ public static void Postfix(PlayerControl __instance)
6880
[HarmonyPatch(typeof(PlayerPurchasesData), nameof(PlayerPurchasesData.GetPurchase))]
6981
public static class UnlockCosmetics_PlayerPurchasesData_GetPurchase_Prefix
7082
{
83+
/// <summary>
84+
/// Ensure the patch is not applied on Android.
85+
/// </summary>
86+
/// <returns>True if the patch should be applied; otherwise, false.</returns>
87+
#pragma warning disable HARMONIZE004
88+
public static bool Prepare()
89+
#pragma warning restore HARMONIZE004
90+
{
91+
return !OperatingSystem.IsAndroid();
92+
}
93+
7194
public static bool Prefix(PlayerPurchasesData __instance, string itemKey, string bundleKey, ref bool __result)
7295
{
7396
if (!AUnlocker.UnlockCosmetics.Value) return true;

0 commit comments

Comments
 (0)