Fix issues with custom mode
This commit is contained in:
@@ -26,7 +26,7 @@ public class PlayMenu : MonoBehaviour
|
|||||||
|
|
||||||
[SerializeField] private TMP_Text validateTotalText;
|
[SerializeField] private TMP_Text validateTotalText;
|
||||||
|
|
||||||
private readonly float defaultNormalBerryChance = 32.5f;
|
private readonly float defaultNormalBerryChance = 42.5f;
|
||||||
private readonly float defaultPoisonBerryChance = 12.5f;
|
private readonly float defaultPoisonBerryChance = 12.5f;
|
||||||
private readonly float defaultSlowBerryChance = 10f;
|
private readonly float defaultSlowBerryChance = 10f;
|
||||||
private readonly float defaultUltraBerryChance = 10f;
|
private readonly float defaultUltraBerryChance = 10f;
|
||||||
@@ -50,15 +50,15 @@ public class PlayMenu : MonoBehaviour
|
|||||||
customMenu.SetActive(false);
|
customMenu.SetActive(false);
|
||||||
selectionMenu.SetActive(true);
|
selectionMenu.SetActive(true);
|
||||||
|
|
||||||
normalBerryChance.text = defaultNormalBerryChance.ToString();
|
normalBerryChance.text = defaultNormalBerryChance.ToString() + "%";
|
||||||
poisonBerryChance.text = defaultPoisonBerryChance.ToString();
|
poisonBerryChance.text = defaultPoisonBerryChance.ToString() + "%";
|
||||||
slowBerryChance.text = defaultSlowBerryChance.ToString();
|
slowBerryChance.text = defaultSlowBerryChance.ToString() + "%";
|
||||||
ultraBerryChance.text = defaultUltraBerryChance.ToString();
|
ultraBerryChance.text = defaultUltraBerryChance.ToString() + "%";
|
||||||
speedyBerryChance.text = defaultSpeedyBerryChance.ToString();
|
speedyBerryChance.text = defaultSpeedyBerryChance.ToString() + "%";
|
||||||
randomBerryChance.text = defaultRandomBerryChance.ToString();
|
randomBerryChance.text = defaultRandomBerryChance.ToString() + "%";
|
||||||
antiBerryChance.text = defaultAntiBerryChance.ToString();
|
antiBerryChance.text = defaultAntiBerryChance.ToString() + "%";
|
||||||
goldenBerryChance.text = defaultGoldenBerryChance.ToString();
|
goldenBerryChance.text = defaultGoldenBerryChance.ToString() + "%";
|
||||||
nothingBerryChance.text = defaultNothingBerryChance.ToString();
|
nothingBerryChance.text = defaultNothingBerryChance.ToString() + "%";
|
||||||
ValidateTotal();
|
ValidateTotal();
|
||||||
if (DiscordRPCHandler.Instance != null)
|
if (DiscordRPCHandler.Instance != null)
|
||||||
DiscordRPCHandler.Instance.UpdateRPC("Picking what mode they want to play", "");
|
DiscordRPCHandler.Instance.UpdateRPC("Picking what mode they want to play", "");
|
||||||
@@ -228,6 +228,7 @@ public class PlayMenu : MonoBehaviour
|
|||||||
total += GetValueFrom(speedyBerryChance);
|
total += GetValueFrom(speedyBerryChance);
|
||||||
total += GetValueFrom(randomBerryChance);
|
total += GetValueFrom(randomBerryChance);
|
||||||
total += GetValueFrom(antiBerryChance);
|
total += GetValueFrom(antiBerryChance);
|
||||||
|
total += GetValueFrom(goldenBerryChance);
|
||||||
total += GetValueFrom(nothingBerryChance);
|
total += GetValueFrom(nothingBerryChance);
|
||||||
if (total == 100f)
|
if (total == 100f)
|
||||||
{
|
{
|
||||||
@@ -302,7 +303,7 @@ public class PlayMenu : MonoBehaviour
|
|||||||
|
|
||||||
async void Update()
|
async void Update()
|
||||||
{
|
{
|
||||||
if (Keyboard.current.escapeKey.wasPressedThisFrame)
|
if (Keyboard.current.escapeKey.wasPressedThisFrame && customBackButton.interactable)
|
||||||
{
|
{
|
||||||
if (customMenu.activeSelf) customBackButton.onClick.Invoke();
|
if (customMenu.activeSelf) customBackButton.onClick.Invoke();
|
||||||
else await SceneManager.LoadSceneAsync("MainMenu");
|
else await SceneManager.LoadSceneAsync("MainMenu");
|
||||||
|
|||||||
Reference in New Issue
Block a user