Skip to content

Commit

Permalink
[F] unused lockCredits
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Nov 25, 2024
1 parent da36ef4 commit 07210a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions AquaMai/AquaMai.Config/Migration/ConfigMigration_V1_0_V2_0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public IConfigView Migrate(IConfigView src)
if (src.GetValueOrDefault<bool>("Fix.ForcePaidPlay"))
{
dst.SetValue("GameSettings.CreditConfig.IsFreePlay", false);
dst.SetValue("GameSettings.CreditConfig.LockCredits", 24);
dst.SetValue("GameSettings.CreditConfig.LockCredits", 24u);
}
MapValueToEntryValueIfNonNullOrDefault(src, dst, "Fix.ExtendNotesPool", "Fancy.GamePlay.ExtendNotesPool.Count", 0);
MapBooleanTrueToSectionEnable(src, dst, "Fix.FrameRateLock", "Tweaks.LockFrameRate");
Expand All @@ -159,7 +159,7 @@ public IConfigView Migrate(IConfigView src)
MapBooleanTrueToSectionEnable(src, dst, "Utils.LogUserId", "Utils.LogUserId");
MapValueToEntryValueIfNonNullOrDefault<double>(src, dst, "Utils.JudgeAdjustA", "GameSettings.JudgeAdjust.A", 0);
MapValueToEntryValueIfNonNullOrDefault<double>(src, dst, "Utils.JudgeAdjustB", "GameSettings.JudgeAdjust.B", 0);
MapValueToEntryValueIfNonNullOrDefault(src, dst, "Utils.TouchDelay", "GameSettings.JudgeAdjust.TouchDelay", 0);
MapValueToEntryValueIfNonNullOrDefault(src, dst, "Utils.TouchDelay", "GameSettings.JudgeAdjust.TouchDelay", 0u);
MapBooleanTrueToSectionEnable(src, dst, "Utils.SelectionDetail", "UX.SelectionDetail");
MapBooleanTrueToSectionEnable(src, dst, "Utils.ShowNetErrorDetail", "Utils.ShowNetErrorDetail");
MapBooleanTrueToSectionEnable(src, dst, "Utils.ShowErrorLog", "Utils.ShowErrorLog");
Expand Down
4 changes: 2 additions & 2 deletions AquaMai/AquaMai.Mods/GameSettings/CreditConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private static bool PreIsFreePlay(ref bool __result)
[ConfigEntry(
en: "Lock credits amount (only valid in Paid Play). Set to 0 to disable.",
zh: "锁定可用点数数量(仅在付费游玩时有效),设为 0 以禁用")]
private static readonly uint lockCredits = 24;
private static readonly uint lockCredits = 24u;

private static bool ShouldLockCredits => !isFreePlay && lockCredits > 0;

Expand All @@ -43,7 +43,7 @@ private static bool PreIsGameCostEnough(ref bool __result)
[HarmonyPatch(typeof(AMDaemon.CreditUnit), "Credit", MethodType.Getter)]
private static bool PreCredit(ref uint __result)
{
__result = 24;
__result = lockCredits;
return false;
}
}

0 comments on commit 07210a2

Please sign in to comment.