qa report v2
This commit is contained in:
@@ -108,7 +108,11 @@ public class MainMenuManager : MonoBehaviour
|
||||
inputCryptoAddress.onValueChanged.AddListener(OnCryptoAddressChanged);
|
||||
}
|
||||
|
||||
UpdateWithdrawalStatus();
|
||||
if (txtWithdrawStatus != null)
|
||||
txtWithdrawStatus.gameObject.SetActive(false);
|
||||
|
||||
if (btnWithdrawal != null)
|
||||
btnWithdrawal.onClick.AddListener(OnWithdrawalPressed);
|
||||
|
||||
if (btnPaste != null)
|
||||
btnPaste.onClick.AddListener(OnPasteFromClipboard);
|
||||
@@ -138,6 +142,8 @@ public class MainMenuManager : MonoBehaviour
|
||||
btnTutorial.onClick.RemoveListener(OnPlayTutorial);
|
||||
if (btnLogout != null)
|
||||
btnLogout.onClick.RemoveListener(OnLogout);
|
||||
if (btnWithdrawal != null)
|
||||
btnWithdrawal.onClick.RemoveListener(OnWithdrawalPressed);
|
||||
}
|
||||
|
||||
void OnLogout()
|
||||
@@ -160,8 +166,7 @@ public class MainMenuManager : MonoBehaviour
|
||||
|
||||
void ConfirmLogout()
|
||||
{
|
||||
LoginManager.Logout();
|
||||
SceneManager.LoadScene(0);
|
||||
LoginManager.LogoutAndReturnToLogin();
|
||||
}
|
||||
|
||||
void OnToggleSfx(bool isOn)
|
||||
@@ -234,33 +239,52 @@ public class MainMenuManager : MonoBehaviour
|
||||
{
|
||||
PlayerPrefs.SetString(CryptoAddressPrefsKey, value ?? string.Empty);
|
||||
PlayerPrefs.Save();
|
||||
UpdateWithdrawalStatus();
|
||||
}
|
||||
|
||||
void UpdateWithdrawalStatus(UserData user = null)
|
||||
void OnWithdrawalPressed()
|
||||
{
|
||||
if (txtWithdrawStatus == null)
|
||||
return;
|
||||
UserData u = user ?? LoginManager.CurrentUser;
|
||||
if (u == null)
|
||||
UserData user = LoginManager.CurrentUser;
|
||||
if (user == null)
|
||||
{
|
||||
ShowWithdrawalMessage("Could not load your profile. Try again.", false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (inputCryptoAddress != null && string.IsNullOrWhiteSpace(inputCryptoAddress.text))
|
||||
{
|
||||
txtWithdrawStatus.text = "Enter a valid wallet address to withdraw safely.";
|
||||
ShowWithdrawalMessage("Enter a valid wallet address to withdraw safely.", true);
|
||||
return;
|
||||
}
|
||||
if (u.rc < MinimumWithdrawalRcCoins)
|
||||
|
||||
if (user.rc < MinimumWithdrawalRcCoins)
|
||||
{
|
||||
txtWithdrawStatus.text = "Your RC balance is below the minimum withdrawal amount ($20 USD / 20.0 RC).";
|
||||
ShowWithdrawalMessage("Your RC balance is below the minimum withdrawal amount ($20 USD / 20.0 RC).", false);
|
||||
return;
|
||||
}
|
||||
if (u.cc < WithdrawalFeeCc)
|
||||
|
||||
if (user.cc < WithdrawalFeeCc)
|
||||
{
|
||||
txtWithdrawStatus.text = "Withdrawal costs 500 CC. Your CC balance is below 500 CC.";
|
||||
ShowWithdrawalMessage("Withdrawal costs 500 CC. Your CC balance is below 500 CC.", false);
|
||||
return;
|
||||
}
|
||||
txtWithdrawStatus.text = string.Empty;
|
||||
}
|
||||
|
||||
void ShowWithdrawalMessage(string message, bool basic)
|
||||
{
|
||||
if (MessageBoxDialog.IsAvailable)
|
||||
{
|
||||
if (basic)
|
||||
MessageBoxDialog.ShowBasic(message);
|
||||
else
|
||||
MessageBoxDialog.Show("Can't withdraw", message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (txtWithdrawStatus != null)
|
||||
{
|
||||
txtWithdrawStatus.gameObject.SetActive(true);
|
||||
txtWithdrawStatus.text = message;
|
||||
}
|
||||
}
|
||||
|
||||
void OnPasteFromClipboard()
|
||||
@@ -317,8 +341,6 @@ public class MainMenuManager : MonoBehaviour
|
||||
rcPlayText.text = "";
|
||||
if (btnPlay != null)
|
||||
btnPlay.interactable = true;
|
||||
|
||||
UpdateWithdrawalStatus(user);
|
||||
}
|
||||
|
||||
/// <summary>Called by <see cref="LevelLoadManager"/> so the loading overlay stays until matchmaker settings are refreshed.</summary>
|
||||
@@ -422,7 +444,6 @@ public class MainMenuManager : MonoBehaviour
|
||||
dummyBuyScreen.SetActive(false);
|
||||
withdrawalScreen.SetActive(true);
|
||||
settingsScreen.SetActive(false);
|
||||
UpdateWithdrawalStatus();
|
||||
}
|
||||
|
||||
public void ShowSettingsScreen(){
|
||||
|
||||
Reference in New Issue
Block a user