Esempio n. 1
0
    public void Init(System.Action <string> _onSubmit, System.Action _onCancel, System.Action _onClose = null)
    {
        strTitle             = MyLocalize.GetString("RegisAndLogin/Field_VerifyEmail");
        strFieldEmail        = MyLocalize.GetString("RegisAndLogin/Field_Email");
        strFieldConfirmEmail = MyLocalize.GetString("RegisAndLogin/Field_ConfirmEmail");

        textTitle.text = strTitle;

        inputEmail.gameObject.SetActive(true);
        inputEmail.text           = string.Empty;
        textPlaceHolderEmail.text = strFieldEmail + "...";

        inputConfirmEmail.gameObject.SetActive(true);
        inputConfirmEmail.text           = string.Empty;
        textPlaceHolderConfirmEmail.text = strFieldConfirmEmail + "...";

        textSubmitButton.text = MyLocalize.GetString(MyLocalize.kOk);
        textCancelButton.text = MyLocalize.GetString(MyLocalize.kCancel);

        onClose  = _onClose;
        onSubmit = _onSubmit;
        onCancel = _onCancel;

        CoreGameManager.instance.RegisterNewCallbackPressBackKey(OnButtonNoClicked);

        Show();
    }
Esempio n. 2
0
    public void Init(System.Action <string, string> _onSubmit, System.Action _onCancel, System.Action _onClose = null)
    {
        strTitle               = MyLocalize.GetString("RegisAndLogin/Field_ChangePassword");
        strFieldCurrentPass    = MyLocalize.GetString("RegisAndLogin/Field_CurrentPassword");
        strFieldNewPass        = MyLocalize.GetString("RegisAndLogin/Field_NewPassword");
        strFieldConfirmNewPass = MyLocalize.GetString("RegisAndLogin/Field_ConfirmNewPassword");

        textTitle.text = strTitle;

        fieldCurrentPassword.text    = string.Empty;
        fieldNewPassword.text        = string.Empty;
        fieldConfirmNewPassword.text = string.Empty;

        textPlaceHolderCurrentPassword.text    = strFieldCurrentPass + "...";
        textPlaceHolderNewPassword.text        = strFieldNewPass + "...";
        textPlaceHolderConfirmNewPassword.text = strFieldConfirmNewPass + "...";

        textSubmitButton.text = MyLocalize.GetString(MyLocalize.kOk);
        textCancelButton.text = MyLocalize.GetString(MyLocalize.kCancel);

        onClose  = _onClose;
        onSubmit = _onSubmit;
        onCancel = _onCancel;

        CoreGameManager.instance.RegisterNewCallbackPressBackKey(OnButtonNoClicked);

        Show();
    }
Esempio n. 3
0
    public void CallPopupInfo(int postSpell)
    {
        switch (postSpell)
        {
        case 1:
            PopupManager.Instance.CreatePopupInfo(string.Format(MyLocalize.GetString("BOL/Message_Player_Spell_2")));
            break;

        case 2:
            PopupManager.Instance.CreatePopupInfo(string.Format(MyLocalize.GetString("BOL/Message_Player_Spell_3")));
            break;

        case 3:
            PopupManager.Instance.CreatePopupInfo(string.Format(MyLocalize.GetString("BOL/Message_Player_Spell_4")));
            break;

        case 4:
            PopupManager.Instance.CreatePopupInfo(string.Format(MyLocalize.GetString("BOL/Message_Player_Spell_5")));
            break;

        default:
            PopupManager.Instance.CreatePopupInfo(string.Format(MyLocalize.GetString("BOL/Message_Player_Spell_1")));
            break;
        }
    }
Esempio n. 4
0
    public void ChoiceHero(int position)
    {
        if (BOL_Manager.instance.CanPlayMusicAndSfx())
        {
            MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);
        }
        if (!listLock[position].activeSelf)
        {
            //ListHeroChoice[tmpHero].alpha = 0;
            //ListHeroChoice[position].alpha = 1;
            listHeroChoose[tmpHero]._isChoiceHero  = false;
            listHeroChoose[position]._isChoiceHero = true;
            tmpHero = position;
            SetChoiceHeroAnhSpell(tmpHero, tmpSpell);
#if TEST
            Debug.Log("choice hero " + tmpHero + "  choice spell " + tmpSpell);
#endif
        }
        else
        {
            PopupManager.Instance.CreateToast(string.Format(MyLocalize.GetString("Global/CommingSoon")));
#if TEST
            Debug.Log("comming soon");
#endif
        }
    }
Esempio n. 5
0
    public void OnButtonBuyClicked()
    {
        if (!GetGoldScreenController.instance.canTouch)
        {
            return;
        }
        if (timeCanPressBuyGold > System.DateTime.Now)
        {
            return;
        }
        timeCanPressBuyGold = System.DateTime.Now.AddSeconds(1f);

        MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);

        if (available)
        {
            if (onBuyClicked != null)
            {
                onBuyClicked(productDetail.productId);
            }
        }
        else
        {
            PopupManager.Instance.CreateToast(MyLocalize.GetString("Global/CommingSoon"));
        }
    }
Esempio n. 6
0
    public void Init(string _textTitle, string _textMessage, string _errorCode, string _textSubmitButton, string _textCancelButton, System.Action _onSubmit, System.Action _onCancel, System.Action _onClose = null)
    {
        textTitle.text    = _textTitle;
        textMessage.text  = _textMessage;
        txtErrorCode.text = _errorCode;
        if (!string.IsNullOrEmpty(_textSubmitButton))
        {
            textSubmitButton.text = _textSubmitButton;
        }
        else
        {
            textSubmitButton.text = MyLocalize.GetString(MyLocalize.kYes);
        }
        if (!string.IsNullOrEmpty(_textCancelButton))
        {
            textCancelButton.text = _textCancelButton;
        }
        else
        {
            textCancelButton.text = MyLocalize.GetString(MyLocalize.kNo);
        }
        onClose  = _onClose;
        onSubmit = _onSubmit;
        onCancel = _onCancel;

        CoreGameManager.instance.RegisterNewCallbackPressBackKey(OnButtonNoClicked);

        Show();
    }
 private void Start()
 {
     if (NetworkGlobal.instance.instanceRealTime != null)
     {
         NetworkGlobal.instance.instanceRealTime.onDisconnect = () => {
             LoadingCanvasController.instance.Hide();
             PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                      , MyLocalize.GetString(MyLocalize.kConnectionError)
                                                      , string.Empty
                                                      , MyLocalize.GetString(MyLocalize.kOk)
                                                      , () =>
             {
                 Debug.LogError("xử lý chuyển scene khi mất kết nối");
                 if (callbackManager != null &&
                     callbackManager.onDestructAllObject != null)
                 {
                     callbackManager.onDestructAllObject();
                 }
                 DataManager.instance.userData.RemoveTotalBetInGameInfo(IMiniGameInfo.Type.AnimalRacing);
                 CoreGameManager.instance.SetUpOutRoomAndBackToChooseTableScreen();
             });
         };
         DataManager.instance.userData.sessionId = NetworkGlobal.instance.instanceRealTime.sessionId;
     }
     StartCoroutine(DoActionRun());
 }
Esempio n. 8
0
    public void InitAsIncognito(UserDataInGame _data, string _txtNameShow = "")      // Init dưới dạng ẩn danh
    {
        myType = MyType.Incognito;
        if (data != null)
        {
            if (!data.IsEqual(_data))
            {
                if (actionLoadAvatar != null)
                {
                    StopCoroutine(actionLoadAvatar);
                    actionLoadAvatar = null;
                }
            }
        }
        data = _data;
        imgAvatar.texture = CoreGameManager.instance.gameInfomation.otherInfo.avatarIncognito;
        txtGold.text      = string.Empty;
        imgIconAcc.gameObject.SetActive(false);

        if (string.IsNullOrEmpty(_txtNameShow))
        {
            txtNameShow.text = MyLocalize.GetString("Global/Wating");
        }
        else
        {
            txtNameShow.text = _txtNameShow;
        }

        if (data != null)
        {
            actionLoadAvatar = data.LoadAvatar(this, imgAvatar.rectTransform.rect.width, imgAvatar.rectTransform.rect.height, (_avatar) => {
                actionLoadAvatar = null;
            });
        }
    }
Esempio n. 9
0
    public override void InitData()
    {
        panelLoginState                      = PanelLoginState.Show;
        canvasGroupPanelLogin.alpha          = 1f;
        canvasGroupPanelLogin.blocksRaycasts = true;
        login_fieldUserName.text             = string.Empty;
        login_fieldPass.text                 = string.Empty;

        bgOriginal.gameObject.SetActive(true);
        bgCaptured.gameObject.SetActive(false);
        canvasGroupBgCaptured.alpha = 0f;

        panelRegisterState                      = PanelRegisterState.Hide;
        canvasGroupPanelRegister.alpha          = 0f;
        canvasGroupPanelRegister.blocksRaycasts = false;
        register_fieldUserName.text             = string.Empty;
        register_fieldPass.text                 = string.Empty;
        register_fieldConfirmPass.text          = string.Empty;
        register_toggleAgreePolicy.isOn         = true;

        onPressBack = () => {
            PopupManager.Instance.CreatePopupDialog(MyLocalize.GetString(MyLocalize.kWarning)
                                                    , MyLocalize.GetString(MyLocalize.kAskForQuit)
                                                    , string.Empty
                                                    , MyLocalize.GetString(MyLocalize.kYes)
                                                    , MyLocalize.GetString(MyLocalize.kNo)
                                                    , () => {
                Application.Quit();
            }, null);
        };
        if (onPressBack != null)
        {
            CoreGameManager.instance.RegisterNewCallbackPressBackKey(onPressBack);
        }
    }
Esempio n. 10
0
    public void InitiatePurchase(string _productId, System.Action _onInitiatePurchaseSuccess = null)
    {
        purchasingProductId = _productId;
        if (!IsInitialized())
        {
            InitializePurchasing(false);
            return;
        }

        if (m_StoreController.products.WithID(_productId) == null)
        {
            PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                     , MyLocalize.GetString("Error/IAP_CanNotFindPackage")
                                                     , string.Empty
                                                     , MyLocalize.GetString(MyLocalize.kOk));
            return;
        }

        m_StoreController.InitiatePurchase(_productId);

        if (_onInitiatePurchaseSuccess != null)
        {
            _onInitiatePurchaseSuccess();
        }
    }
Esempio n. 11
0
    void Start()
    {
#if TEST
        Debugs.LogRed(">>> vào scene");
#endif

        if (NetworkGlobal.instance != null && NetworkGlobal.instance.instanceRealTime != null)
        {
            NetworkGlobal.instance.instanceRealTime.onDisconnect = () =>
            {
                LoadingCanvasController.instance.Hide();
                PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                         , MyLocalize.GetString(MyLocalize.kConnectionError)
                                                         , string.Empty
                                                         , MyLocalize.GetString(MyLocalize.kOk)
                                                         , () =>
                {
                    Debug.LogError("xử lý chuyển scene khi mất kết nối");
                    CoreGameManager.instance.SetUpOutRoomAndBackToChooseTableScreen();
                });
            };
            DataManager.instance.userData.sessionId = NetworkGlobal.instance.instanceRealTime.sessionId;
        }
        StartCoroutine(DoActionRun());
        //StartControlMatrix();
        //StartCurrentMatrix();
    }
Esempio n. 12
0
    public void OnButtonSelectClicked()
    {
        MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);

        if (myMiniGameInfo == null)
        {
                        #if TEST
            Debug.LogError(">>> myMiniGameInfo is null");
                #endif
            return;
        }
        if (!myMiniGameInfo.canEnable)
        {
            PopupManager.Instance.CreateToast(MyLocalize.GetString("Global/CommingSoon"));
            return;
        }
        #if TEST
        Debug.Log(">>> Chọn gameType: " + myMiniGameInfo.gameType);
        #endif

        DataManager.instance.miniGameData.SetCurrentMiniGameDetail(gameId);

        if (DataManager.instance.miniGameData.currentMiniGameDetail == null)
        {
                        #if TEST
            Debug.LogError(">>> currentMiniGameDetail is null: ");
                #endif
            return;
        }

        DataManager.instance.miniGameData.currentMiniGameDetail.SortListServerDetailAgain();

        SetCurrentRoomDetailAndChangeScreen();
    }
Esempio n. 13
0
    public void Init(System.Action <string, string, string> _onSubmit, System.Action _onCancel, System.Action _onClose = null)
    {
        strTitle                   = MyLocalize.GetString("RegisAndLogin/Field_ForgotPassword");
        strFieldEmail              = MyLocalize.GetString("RegisAndLogin/Field_Email");
        strFieldUserName           = MyLocalize.GetString("RegisAndLogin/Field_UserName");
        strFieldNewPassword        = MyLocalize.GetString("RegisAndLogin/Field_NewPassword");
        strFieldConfirmNewPassword = MyLocalize.GetString("RegisAndLogin/Field_ConfirmNewPassword");

        textTitle.text = strTitle;

        inputEmail.text              = string.Empty;
        inputUserName.text           = string.Empty;
        inputNewPassword.text        = string.Empty;
        inputConfirmNewPassword.text = string.Empty;

        textPlaceHolderEmail.text              = strFieldEmail + "...";
        textPlaceHolderUserName.text           = strFieldUserName + "...";
        textPlaceHolderNewPassword.text        = strFieldNewPassword + "...";
        textPlaceHolderConfirmNewPassword.text = strFieldConfirmNewPassword + "...";

        textSubmitButton.text = MyLocalize.GetString(MyLocalize.kOk);
        textCancelButton.text = MyLocalize.GetString(MyLocalize.kCancel);

        onClose  = _onClose;
        onSubmit = _onSubmit;
        onCancel = _onCancel;

        CoreGameManager.instance.RegisterNewCallbackPressBackKey(OnButtonNoClicked);

        Show();
    }
Esempio n. 14
0
    public override void InitData()
    {
        txtTitleLeaderboard.text = MyLocalize.GetString("Global/Leaderboard_TopGold");
        System.DateTime _lastTimeUpdatedTop = DataManager.instance.leaderboardData.lastTimeUpdateTop;
        txtLastTimeUpdated.text = "Updated at: " + string.Format("{0:00}/{1:00}/{2} - {3:00}:{4:00}", _lastTimeUpdatedTop.Day, _lastTimeUpdatedTop.Month, _lastTimeUpdatedTop.Year, _lastTimeUpdatedTop.Hour, _lastTimeUpdatedTop.Minute);
        // txtTitleRank.text = MyLocalize.GetString("Global/Rank");
        // txtTitleInfo.text = MyLocalize.GetString("Global/Info");
        // txtTitleGold.text = MyLocalize.GetString("Global/Gold");

        optionInfoPoolManager = new MySimplePoolManager();

        if (System.DateTime.Now < DataManager.instance.leaderboardData.nextTimeToGetNewList)
        {
            canLoadDataFromSv = false;
            if (DataManager.instance.leaderboardData.topGold.Count > 0)
            {
                CreatePanels();
            }
            else
            {
                txtEmpty.gameObject.SetActive(true);
            }
        }
        else
        {
            canLoadDataFromSv = true;
        }

        onPressBack = () => {
            HomeManager.instance.ChangeScreen(myLastType);
        };
        CoreGameManager.instance.RegisterNewCallbackPressBackKey(onPressBack);
    }
Esempio n. 15
0
    public void InitData(UserData _userData, string _textSubmitButton, string _textCancelButton, System.Action _onSubmit, System.Action _onCancel, System.Action _onClose = null)
    {
        textTitle.text = MyLocalize.GetString("InviteFriend/TitleConfirm");
        txtName.text   = MyConstant.ConvertString(_userData.nameShowInGame, maxLengthOfUserName);
        if (!string.IsNullOrEmpty(_textSubmitButton))
        {
            textSubmitButton.text = _textSubmitButton;
        }
        else
        {
            textSubmitButton.text = MyLocalize.GetString(MyLocalize.kYes);
        }
        if (!string.IsNullOrEmpty(_textCancelButton))
        {
            textCancelButton.text = _textCancelButton;
        }
        else
        {
            textCancelButton.text = MyLocalize.GetString(MyLocalize.kNo);
        }

        Sprite _iconDatabaseID = DataManager.instance.userData.GetIconDatabaseID();

        if (_iconDatabaseID != null)
        {
            imgDatabaseType.gameObject.SetActive(true);
            imgDatabaseType.sprite = _iconDatabaseID;
        }
        else
        {
            imgDatabaseType.gameObject.SetActive(false);
        }

        if (actionLoadAvatar != null)
        {
            StopCoroutine(actionLoadAvatar);
            actionLoadAvatar = null;
        }

        actionLoadAvatar = _userData.LoadAvatar(this, imgAvatar.rectTransform.rect.width, imgAvatar.rectTransform.rect.height,
                                                (_avatar) =>
        {
            try{
                if (_avatar != null)
                {
                    imgAvatar.texture = _avatar;
                }
            }catch {}
            actionLoadAvatar = null;
        });

        onClose  = _onClose;
        onSubmit = _onSubmit;
        onCancel = _onCancel;

        CoreGameManager.instance.RegisterNewCallbackPressBackKey(OnButtonNoClicked);

        Show();
    }
Esempio n. 16
0
 void OnCreateConnectionError(int _error)
 {
     LoadingCanvasController.instance.Hide();
     PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                              , MyLocalize.GetString(MyLocalize.kConnectionError)
                                              , _error.ToString()
                                              , MyLocalize.GetString(MyLocalize.kOk));
 }
Esempio n. 17
0
    void RefreshEmailInfo()
    {
        if (!panelContainEmail.gameObject.activeSelf)
        {
            return;
        }
        string _tmpContent = MyLocalize.GetString("RegisAndLogin/Field_Email") + ": " + DataManager.instance.userData.emailShow;

        _tmpContent   = MyConstant.ConvertString(_tmpContent, 25);
        txtEmail.text = _tmpContent;
    }
Esempio n. 18
0
 void OnServerFull()
 {
     // #if TEST
     // Debug.LogError("Server đầy");
     // #endif
     LoadingCanvasController.instance.Hide();
     PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kWarning)
                                              , MyLocalize.GetString(MyLocalize.kServerFull)
                                              , string.Empty
                                              , MyLocalize.GetString(MyLocalize.kOk));
 }
Esempio n. 19
0
 public void HideAndClear()
 {
     panelPlayerInfo.InitAsIncognito(null, MyLocalize.GetString("Global/Empty"));
     panelPlayerInfo.SetShadow(true);
     panelPlayerInfo.Show();
     effCallUno.Hide();
     effForbiden.Hide();
     btnAtkUno.Hide();
     ClearAllCards();
     isInitialized = false;
 }
Esempio n. 20
0
    void CallBackLoginFb()
    {
        Debug.Log("Login FB successful!");
        // AccessToken class will have session details
        var aToken = Facebook.Unity.AccessToken.CurrentAccessToken;

        Debug.Log("UserID: " + aToken.UserId);

        LoadingCanvasController.instance.Show(-1, true);
        OneHitAPI.LoginWithFacebookAccount(DataManager.instance.userData.userId, aToken.TokenString,
                                           (_messageReceiving, _error) => {
            LoadingCanvasController.instance.Hide();
            if (_messageReceiving != null)
            {
                sbyte _caseCheck = _messageReceiving.readByte();
                switch (_caseCheck)
                {
                case -1:                         // Lỗi kết nối đến database.
                    PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                             , MyLocalize.GetString(MyLocalize.kSystemError)
                                                             , _caseCheck.ToString()
                                                             , MyLocalize.GetString(MyLocalize.kOk));
                    break;

                case 1:                         // thành công
                    DataManager.instance.userData.GetMoreUserData(_messageReceiving);

                                                #if TEST
                    Debug.Log(">>> ReceiveLogin (Thành công) : " + DataManager.instance.userData.userId + " - " + DataManager.instance.userData.gold);
                                                #endif
                    SetUpChangeScreenChooseGame();
                    break;

                default:
                                                #if TEST
                    Debug.LogError(">>> Trả caseCheck tào lao: " + _caseCheck);
                                                #endif
                    PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                             , MyLocalize.GetString(MyLocalize.kSystemError)
                                                             , _caseCheck.ToString()
                                                             , MyLocalize.GetString(MyLocalize.kOk));
                    break;
                }
            }
            else
            {
                PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                         , MyLocalize.GetString(MyLocalize.kConnectionError)
                                                         , _error.ToString()
                                                         , MyLocalize.GetString(MyLocalize.kOk));
            }
        });
    }
Esempio n. 21
0
 public void OnChooseGame(IMiniGameInfo _gameInfo)
 {
     if (!canTouch)
     {
         return;
     }
     if (myCurrentState != MyState.ChooseGame)
     {
         return;
     }
             #if TEST
     Debug.Log("Chọn game: " + _gameInfo.gameType.ToString());
             #endif
     if (_gameInfo.gameType != IMiniGameInfo.Type.DragonTigerCasino &&
         _gameInfo.gameType != IMiniGameInfo.Type.Koprok)
     {
                     #if TEST
         Debug.LogError("Game chưa setup");
                     #endif
         PopupManager.Instance.CreateToast(MyLocalize.GetString("Global/CommingSoon"));
         return;
     }
     if (DataManager.instance.miniGameData.currentSubGameDetail != null)
     {
         if (DataManager.instance.miniGameData.currentSubGameDetail.gameType == _gameInfo.gameType)
         {
             return;
         }
     }
     currentSubGameDetail = DataManager.instance.miniGameData.GetMiniGameDetail(_gameInfo.gameType);
     if (currentSubGameDetail == null)
     {
                     #if TEST
         Debug.LogError("currentGameDetail is null");
                     #endif
         return;
     }
     if (NetworkGlobal.instance.instanceRealTime == null || !NetworkGlobal.instance.instanceRealTime.isRunning)
     {
         StartCoroutine(DoActionChooseServer());
     }
     else
     {
         if (CoreGameManager.instance.currentSceneManager.mySceneType == IMySceneManager.Type.SubGamePlayScene)
         {
             StartCoroutine(DoActionOpenAnotherGamePlay());
         }
         else
         {
             StartCoroutine(DoActionOpenPopupGamePlay());
         }
     }
 }
Esempio n. 22
0
 void RegisterActionAlertUpdateServer()
 {
     NetworkGlobal.instance.SetProcessRealTime(CMD_REALTIME.S_ALERT_UPDATE_SERVER, (_mess) =>
     {
         if (koprokData != null)
         {
             MyGamePlayData.AlertUpdateServer_Data _data = new MyGamePlayData.AlertUpdateServer_Data(_mess);
             System.TimeSpan _timeSpanRemain             = _data.timeToUpdateServer - System.DateTime.Now;
             PopupManager.Instance.CreateToast(string.Format(MyLocalize.GetString("System/Message_ServerMaintenance"), _timeSpanRemain.Minutes, _timeSpanRemain.Seconds));
         }
     });
 }
Esempio n. 23
0
    public void Init(RewardDetail _rewardDetail, System.Action _onClose = null)
    {
        rewardDetail            = _rewardDetail;
        imgReward.sprite        = rewardDetail.itemInfo.icon;
        textRewardQuantity.text = "+" + MyConstant.GetMoneyString(_rewardDetail.quantity, 999999);
        textSubmitButton.text   = MyLocalize.GetString("Global/Claim");
        textTitle.text          = MyLocalize.GetString("Global/Congratulations");
        onClose = _onClose;
        CoreGameManager.instance.RegisterNewCallbackPressBackKey(Close);

        Show();
    }
Esempio n. 24
0
    public void OnButtonYesClicked()
    {
        MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);

        string _currentPass = fieldCurrentPassword.text.Trim();
        string _newPass     = fieldNewPassword.text.Trim();

        if (string.IsNullOrEmpty(_currentPass))
        {
            PopupManager.Instance.CreateToast(
                string.Format(MyLocalize.GetString("RegisAndLogin/Message_PlsTypeYourField"), fieldCurrentPassword));
            return;
        }

        if (_newPass.Length < 3 || _newPass.Length > 25)
        {
            PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kWarning)
                                                     , MyLocalize.GetString("RegisAndLogin/Password_Error_0")
                                                     , string.Empty
                                                     , MyLocalize.GetString(MyLocalize.kOk));
            return;
        }
        if (!_newPass.IsAvailableUserNameAndPass())
        {
            PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kWarning)
                                                     , MyLocalize.GetString(MyLocalize.kPassIsInvalid_01)
                                                     , string.Empty
                                                     , MyLocalize.GetString(MyLocalize.kOk));
            return;
        }

        string _confirmNewPass = fieldConfirmNewPassword.text.Trim();

        if (!_newPass.Equals(_confirmNewPass))
        {
            PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kWarning)
                                                     , MyLocalize.GetString("RegisAndLogin/ConfirmPwNotMatch")
                                                     , string.Empty
                                                     , MyLocalize.GetString(MyLocalize.kOk));
            return;
        }

        Hide(() => {
            if (onSubmit != null)
            {
                onSubmit(_currentPass, _newPass);
                onSubmit = null;
            }
            Close();
        });
    }
Esempio n. 25
0
 public void RestoreTransactions()
 {
     LoadingCanvasController.instance.Show(-1f, true);
     m_AppleExtensions.RestoreTransactions((bool success) => {
         LoadingCanvasController.instance.Hide();
         if (!success)
         {
             PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                      , MyLocalize.GetString("Error/IAP_FailedToRestore")
                                                      , string.Empty
                                                      , MyLocalize.GetString(MyLocalize.kOk));
         }
     });
 }
Esempio n. 26
0
    public void Login_OnButtonPlayAsGuestClicked()
    {
        MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);

        LoadingCanvasController.instance.Show(-1, true);
        OneHitAPI.LoginWithDeviceID(DataManager.instance.userData.userId,
                                    (_messageReceiving, _error) => {
            LoadingCanvasController.instance.Hide();
            if (_messageReceiving != null)
            {
                sbyte _caseCheck = _messageReceiving.readByte();
                switch (_caseCheck)
                {
                case -1:                         // Lỗi kết nối đến database.
                    PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                             , MyLocalize.GetString(MyLocalize.kSystemError)
                                                             , _caseCheck.ToString()
                                                             , MyLocalize.GetString(MyLocalize.kOk));
                    break;

                case 1:                         // thành công
                    DataManager.instance.userData.GetMoreUserData(_messageReceiving);

                                                #if TEST
                    Debug.Log(">>> ReceiveLogin (Thành công) : " + DataManager.instance.userData.userId + " - " + DataManager.instance.userData.gold);
                                                #endif
                    SetUpChangeScreenChooseGame();
                    break;

                default:
                                                #if TEST
                    Debug.LogError(">>> Trả caseCheck tào lao: " + _caseCheck);
                                                #endif
                    PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                             , MyLocalize.GetString(MyLocalize.kSystemError)
                                                             , _caseCheck.ToString()
                                                             , MyLocalize.GetString(MyLocalize.kOk));
                    break;
                }
            }
            else
            {
                PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                         , MyLocalize.GetString(MyLocalize.kConnectionError)
                                                         , _error.ToString()
                                                         , MyLocalize.GetString(MyLocalize.kOk));
            }
        });
    }
Esempio n. 27
0
    public void Init(System.Action _onSubmit, System.Action _onCancel, System.Action _onClose = null)
    {
        textTitle.text   = MyLocalize.GetString("System/Message_RemindRating_00");
        textMessage.text = MyLocalize.GetString("System/Message_RemindRating_01");

        textSubmitButton.text = MyLocalize.GetString("Global/RateUs");
        textCancelButton.text = MyLocalize.GetString(MyLocalize.kCancel);

        onClose  = _onClose;
        onSubmit = _onSubmit;
        onCancel = _onCancel;

        CoreGameManager.instance.RegisterNewCallbackPressBackKey(OnButtonNoClicked);

        Show();
    }
 /// <summary>
 /// Đặt cược
 /// </summary>
 /// <param name="long"> value = 1</param>
 /// <param name="hòa"> value = 0</param>
 /// <param name="hổ"> value = -1</param>
 public void AddBet(sbyte _indexBet)
 {
     if (!this.CanAddBet())
     {
         return;
     }
     if (panelListChip == null || panelListChip.currentChip == null)
     {
         if (panelListChip.currentChip == null)
         {
             PopupManager.Instance.CreateToast(MyLocalize.GetString("Global/PlsSelectChip"));
         }
         return;
     }
     DragonTiger_RealTimeAPI.instance.SendMessageAddBet((byte)_indexBet, (short)panelListChip.currentChip.index, panelListChip.currentChip.chipInfo.value);
 }
Esempio n. 29
0
    public void OnButtonYesClicked()
    {
        MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);

        string _email        = inputEmail.text.Trim();
        string _confirmEmail = inputConfirmEmail.text.Trim();

        if (string.IsNullOrEmpty(_email))
        {
            PopupManager.Instance.CreateToast(
                string.Format(MyLocalize.GetString("RegisAndLogin/Message_PlsTypeYourField"), strFieldEmail));
            return;
        }
        if (_email.Length < 9)
        {
            PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kWarning)
                                                     , MyLocalize.GetString("RegisAndLogin/EmailIsTooShort")
                                                     , string.Empty
                                                     , MyLocalize.GetString(MyLocalize.kOk));
            return;
        }
        if (!_email.IsAvailableEmail())
        {
            PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kWarning)
                                                     , MyLocalize.GetString("RegisAndLogin/EmailIsInvalid")
                                                     , string.Empty
                                                     , MyLocalize.GetString(MyLocalize.kOk));
            return;
        }
        if (!_email.Equals(_confirmEmail))
        {
            PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kWarning)
                                                     , MyLocalize.GetString("RegisAndLogin/ConfirmEmailNotMatch")
                                                     , string.Empty
                                                     , MyLocalize.GetString(MyLocalize.kOk));
            return;
        }

        Hide(() => {
            if (onSubmit != null)
            {
                onSubmit(_email);
                onSubmit = null;
            }
            Close();
        });
    }
Esempio n. 30
0
    public void OnBtnChangePasswordClicked()
    {
        MyAudioManager.instance.PlaySfx(GameInformation.instance.globalAudioInfo.sfx_Click);

        PopupManager.Instance.CreatePopupChangePassword(
            (_currentPass, _newPass) => {
            // byte caseCheck (1 : đổi thành công)
            LoadingCanvasController.instance.Show(-1, true);
            OneHitAPI.BigxuAccount_ChangePassword(_currentPass, _newPass, (_messageReceiving, _error) => {
                LoadingCanvasController.instance.Hide();
                if (_messageReceiving != null)
                {
                    sbyte _caseCheck = _messageReceiving.readByte();
                    if (_caseCheck == 1)
                    {
                        // #if TEST
                        // Debug.Log (">>> Đổi pass thành công");
                        // #endif
                        DataManager.instance.userData.password = _newPass;

                        PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kMessage)
                                                                 , MyLocalize.GetString("RegisAndLogin/ChangePasswordSuccessful")
                                                                 , _caseCheck.ToString()
                                                                 , MyLocalize.GetString(MyLocalize.kOk));
                    }
                    else
                    {
                        // #if TEST
                        // Debug.LogError (">>> Đổi pass thất bại: " + _caseCheck);
                        // #endif
                        PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kMessage)
                                                                 , MyLocalize.GetString("RegisAndLogin/ChangePasswordFailed")
                                                                 , _caseCheck.ToString()
                                                                 , MyLocalize.GetString(MyLocalize.kOk));
                    }
                }
                else
                {
                    PopupManager.Instance.CreatePopupMessage(MyLocalize.GetString(MyLocalize.kError)
                                                             , MyLocalize.GetString(MyLocalize.kConnectionError)
                                                             , _error.ToString()
                                                             , MyLocalize.GetString(MyLocalize.kOk));
                }
            });
        }, null);
    }