Skip to content

Commit

Permalink
[+] SelfMadeChartsWhiteListUsers
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Sep 7, 2024
1 parent 9ca7949 commit 1ad4ac2
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions AquaMai/UX/HideSelfMadeCharts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ public static void MusicSelectProcessOnUpdate(ref MusicSelectProcess __instance)
[HarmonyPatch(typeof(MusicSelectProcess), "OnStart")]
public static void MusicSelectProcessOnStart(ref MusicSelectProcess __instance)
{
if (File.Exists(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "DisableSelfMadeCharts.txt")))
{
isForceDisable = true;
return;
}

if (File.Exists(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "SelfMadeChartsDenyUsers.txt")))
{
var userIds = File.ReadAllLines(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "SelfMadeChartsDenyUsers.txt"));
Expand All @@ -105,6 +99,19 @@ public static void MusicSelectProcessOnStart(ref MusicSelectProcess __instance)
}
}

if (File.Exists(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "SelfMadeChartsWhiteListUsers.txt")))
{
var userIds = File.ReadAllLines(Path.Combine(Environment.CurrentDirectory, "LocalAssets", "SelfMadeChartsWhiteListUsers.txt"));
for (var i = 0; i < 2; i++)
{
var user = Singleton<UserDataManager>.Instance.GetUserData(i);
if (!user.IsEntry) continue;
if (userIds.Contains(user.Detail.UserID.ToString())) continue;
isForceDisable = true;
return;
}
}

isForceDisable = false;
}

Expand Down

0 comments on commit 1ad4ac2

Please sign in to comment.