Skip to content

Commit 1601275

Browse files
committed
[+] eventBlackList
1 parent 0c24500 commit 1601275

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

AquaMai.Mods/GameSystem/Unlock.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,29 @@ string dataManagerMethod
323323
en: "Enable all events.",
324324
zh: "启用所有的 “Events”"
325325
)]
326-
private static readonly bool events = true;
326+
private static readonly bool events = false;
327+
328+
[ConfigEntry(
329+
en: "Do not unlock the following events. Leave it enabled if you don't know what this is.",
330+
zh: "不解锁以下 Event。如果你不知道这是什么,请勿修改"
331+
)]
332+
private static readonly string eventBlackList = "0,250926121";
333+
private static HashSet<int> eventBlackListSet = null;
327334

328335
[EnableIf(nameof(events))]
329336
[HarmonyPrefix]
330337
[HarmonyPatch(typeof(EventManager), "IsOpenEvent")]
331338
private static bool EnableAllEvent(ref bool __result, int eventId)
332339
{
333-
if (eventId > 0)
334-
__result = true;
340+
eventBlackListSet ??= eventBlackList
341+
.Split(',')
342+
.Select(s => s.Trim())
343+
.Where(s => int.TryParse(s, out _))
344+
.Select(int.Parse)
345+
.ToHashSet();
346+
if (eventBlackListSet.Contains(eventId))
347+
return true;
348+
__result = true;
335349
return false;
336350
}
337351

build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ $env:DOTNET_NOLOGO = '1'
99
dotnet tool restore
1010
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
1111

12+
taskkill.exe /f /im dotnet.exe
13+
1214
dotnet cake @args
1315
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

0 commit comments

Comments
 (0)