Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
fixed bug when original mutators were purchasable for 0 nuggets
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmical committed Aug 5, 2020
1 parent aa4b131 commit 751d803
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
Binary file modified .vs/RogueLibs/v16/.suo
Binary file not shown.
Binary file modified RogueLibs.Test/bin/Debug/RogueLibs.dll
Binary file not shown.
Binary file modified RogueLibs.Test/bin/Debug/RogueLibs.pdb
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions RogueLibs/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.2.0")]
[assembly: AssemblyFileVersion("2.0.2.0")]
[assembly: AssemblyVersion("2.0.3.0")]
[assembly: AssemblyFileVersion("2.0.3.0")]
2 changes: 1 addition & 1 deletion RogueLibs/RogueLibs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static class RogueLibs
/// <summary>
/// <para><see cref="RogueLibs"/>' version. Do not use this value in your <see cref="BepInDependency"/> attribute!</para>
/// </summary>
public const string pluginVersion = "2.0.2";
public const string pluginVersion = "2.0.3";

/// <summary>
/// <para>Main <see cref="RogueLibsPlugin"/> instance.</para>
Expand Down
18 changes: 9 additions & 9 deletions RogueLibs/RogueLibsPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ protected static bool ScrollingMenu_Setup(ScrollingMenu __instance, ButtonData m
myButtonData.scrollingHighlighted4 = (__instance.menuType == "Items" || __instance.menuType == "TraitUnlocks") && myUnlock.notActive; // gray 'not active' highlight
myButtonData.highlightedSprite = __instance.solidObjectButton;
}
else if (custom == null || custom.UnlockCost != null)
else if ((custom == null && myUnlock.cost != 0) || custom.UnlockCost != null)
{ // not unlocked, original mutator OR custom and can be purchased
myButtonData.buttonText += " - $" + myUnlock.cost;
myButtonData.scrollingHighlighted2 = true; // blue 'purchasable' highlight
Expand Down Expand Up @@ -559,7 +559,7 @@ protected static bool ScrollingMenu_PushedButton(ScrollingMenu __instance, Butto
__instance.gc.SetDailyRunText();
__instance.UpdateOtherVisibleMenus(__instance.menuType);
}
else if (u.nowAvailable && (custom == null || custom.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
else if (u.nowAvailable && ((custom == null && u.cost != 0) || custom?.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
{ // not unlocked, is a custom mutator, can be purchased and affordable
__instance.gc.unlocks.SubtractNuggets(u.cost);
__instance.gc.unlocks.DoUnlock(u.unlockName, u.unlockType);
Expand Down Expand Up @@ -605,7 +605,7 @@ protected static bool ScrollingMenu_PushedButton(ScrollingMenu __instance, Butto
__instance.gc.unlocks.SaveUnlockData(true);
}
}
else if (u.nowAvailable && (custom == null || custom.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
else if (u.nowAvailable && ((custom == null && u.cost != 0) || custom?.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
{ // not unlocked, can be purchased and affordable
__instance.gc.unlocks.SubtractNuggets(u.cost);
__instance.gc.unlocks.DoUnlock(u.unlockName, u.unlockType);
Expand Down Expand Up @@ -651,7 +651,7 @@ protected static bool ScrollingMenu_PushedButton(ScrollingMenu __instance, Butto
__instance.gc.unlocks.SaveUnlockData(true);
}
}
else if (u.nowAvailable && (custom == null || custom.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
else if (u.nowAvailable && ((custom == null && u.cost != 0) || custom?.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
{ // not unlocked, can be purchased and affordable
__instance.gc.unlocks.SubtractNuggets(u.cost);
__instance.gc.unlocks.DoUnlock(u.unlockName, u.unlockType);
Expand Down Expand Up @@ -693,7 +693,7 @@ protected static bool ScrollingMenu_PushedButton(ScrollingMenu __instance, Butto
}
__instance.agent.inventory.DontPlayPickupSounds(false);
}
else if (u.nowAvailable && (custom == null || custom.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
else if (u.nowAvailable && ((custom == null && u.cost != 0) || custom?.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
{ // not unlocked, can be purchased and affordable
__instance.gc.unlocks.SubtractNuggets(u.cost);
__instance.gc.unlocks.DoUnlock(u.unlockName, u.unlockType);
Expand Down Expand Up @@ -857,7 +857,7 @@ protected static bool CharacterCreation_Setup(CharacterCreation __instance, Butt
myButtonData.scrollingHighlighted4 = false;
myButtonData.highlightedSprite = __instance.solidObjectButton;
}
else if (custom == null || custom.UnlockCost != null) // not unlocked, original mutator OR custom and can be purchased
else if ((custom == null && myUnlock.cost != 0) || custom.UnlockCost != null) // not unlocked, original mutator OR custom and can be purchased
{
myButtonData.buttonText = __instance.gc.nameDB.GetName(myUnlock.unlockName, myUnlock.unlockNameType) + " - $" + myUnlock.cost;
myButtonData.scrollingHighlighted2 = true; // blue 'purchasable' highlight
Expand Down Expand Up @@ -968,7 +968,7 @@ protected static bool CharacterCreation_PushedButton(CharacterCreation __instanc
__instance.gc.audioHandler.PlayMust(__instance.gc.playerAgent, "ClickButtonMenu");
}
}
else if (u.nowAvailable && (custom == null || custom.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
else if (u.nowAvailable && ((custom == null && u.cost != 0) || custom?.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
{ // not unlocked, can be purchased and affordable
__instance.gc.unlocks.SubtractNuggets(u.cost);
__instance.gc.unlocks.DoUnlock(u.unlockName, u.unlockType);
Expand Down Expand Up @@ -1022,7 +1022,7 @@ protected static bool CharacterCreation_PushedButton(CharacterCreation __instanc

__instance.gc.audioHandler.PlayMust(__instance.gc.playerAgent, "ClickButtonMenu");
}
else if (u.nowAvailable && (custom == null || custom.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
else if (u.nowAvailable && ((custom == null && u.cost != 0) || custom?.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
{ // not unlocked, can be purchased and affordable
__instance.gc.unlocks.SubtractNuggets(u.cost);
__instance.gc.unlocks.DoUnlock(u.unlockName, u.unlockType);
Expand Down Expand Up @@ -1080,7 +1080,7 @@ protected static bool CharacterCreation_PushedButton(CharacterCreation __instanc
__instance.gc.audioHandler.PlayMust(__instance.gc.playerAgent, "ClickButtonMenu");
}
}
else if (u.nowAvailable && (custom == null || custom.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
else if (u.nowAvailable && ((custom == null && u.cost != 0) || custom?.UnlockCost != null) && u.cost <= __instance.gc.sessionDataBig.nuggets)
{ // not unlocked, can be purchased and affordable
__instance.gc.unlocks.SubtractNuggets(u.cost);
__instance.gc.unlocks.DoUnlock(u.unlockName, u.unlockType);
Expand Down
Binary file modified RogueLibs/bin/Debug/RogueLibs.dll
Binary file not shown.
Binary file modified RogueLibs/bin/Debug/RogueLibs.pdb
Binary file not shown.
Binary file modified RogueLibs/obj/Debug/RogueLibs.csprojAssemblyReference.cache
Binary file not shown.
Binary file modified RogueLibs/obj/Debug/RogueLibs.dll
Binary file not shown.
Binary file modified RogueLibs/obj/Debug/RogueLibs.pdb
Binary file not shown.

0 comments on commit 751d803

Please sign in to comment.