Esempio n. 1
0
 private void OnClickShareFacebook(GameObject go)
 {
     SocialService.GetAccessToken(SocialType.Facebook, (status, token) =>
     {
         if (status)
         {
             APIGeneric.PostFacebook(token, data.title, null, delegate(bool status1, string message)
             {
                 if (status == false)
                 {
                     DialogService.Instance.ShowDialog(new DialogMessage("Lỗi", "Gặp lỗi khi post facebook", null));
                 }
                 if (gameObject != null)
                 {
                     GameObject.Destroy(gameObject);
                 }
             });
         }
         else
         {
             DialogService.Instance.ShowDialog(new DialogMessage("Lỗi", "Không thể đăng nhập Facebook.", null));
             if (gameObject != null)
             {
                 GameObject.Destroy(gameObject);
             }
         }
     });
 }
Esempio n. 2
0
 public void QuitGame()
 {
     APIGeneric.BackScene((status, message) =>
     {
         if (status)
         {
             _instance = null;
         }
     });
 }
Esempio n. 3
0
    private void showInfoGame()
    {
        PokerGameDetails gameDetails = PokerObserver.Game.gameDetails;
        RoomInfo         roomInfo    = APIGeneric.SelectedRoomJoin();

        if (gameDetails != null)
        {
            double smallBind = gameDetails.customConfiguration.SmallBlind;
            lbTitle.text = "Phòng : " + roomInfo.roomId + " - $" + smallBind + "/" + gameDetails.customConfiguration.MaxBlind;
        }
    }
Esempio n. 4
0
 void onButtonSubmitCardClickListener(GameObject go)
 {
     if (txtSerial.value.Length > 0 && txtPassword.value.Length > 0)
     {
         APIGeneric.RechargeCard(txtPassword.value, txtSerial.value, Utility.ReadData.GetTrackId(), currentCard.provider, (status, message) =>
         {
             panelInputCard.SetActive(false);
             panelScrollCardAndSMS.SetActive(true);
             DialogService.Instance.ShowDialog(new DialogMessage("Thông báo", message, null));
         });
     }
 }
Esempio n. 5
0
 public void ShowDialogRecharge()
 {
     LoadingView.Instance.Show();
     APIGeneric.GetInfoRecharge((status, message, dataRecharge) =>
     {
         LoadingView.Instance.Show(false);
         if (status)
         {
             DialogRecharge recharge = new DialogRecharge(dataRecharge);
             DialogService.Instance.ShowDialog(recharge);
         }
         else
         {
             DialogService.Instance.ShowDialog(new DialogMessage("Thông báo", message));
         }
     });
 }
Esempio n. 6
0
    void onClickSubmit(GameObject go)
    {
        totalChange = 0;
        if (ValidateField())
        {
            int      gender   = toggleMale.value == true ? 0 : 1;
            DataUser userInfo = data.info.info;

            string emailChange    = email.value.Trim();
            string phoneChange    = phoneNumber.value.Trim();
            string fullNameChange = fullName.value.Trim();
            string addressChange  = address.value.Trim();

            if (!fullNameChange.Equals(userInfo.firstName) || userInfo.gender != gender || !address.value.Trim().Equals(userInfo.address))
            {
                totalChange++;
                APIUser.ChangeUseInformation(fullNameChange, "", "", gender, addressChange, "", OnSubmitChangeInfoCallBack);
            }

            if ((!string.IsNullOrEmpty(emailChange) && !emailChange.Equals(userInfo.email)) ||
                (!string.IsNullOrEmpty(phoneChange) && !phoneChange.Equals(userInfo.mobile)))
            {
                totalChange++;
                APIUser.ChangeUseInformationSpecial(emailChange, phoneChange, OnSubmitChangeInfoCallBack);
            }

            if (isChangedAvatar)
            {
                totalChange++;

                if (string.IsNullOrEmpty(defaultAvatar))
                {
                    HttpAPI.ChangeUseAvatar(this, ((Texture2D)avatar.mainTexture).EncodeToPNG(), OnSubmitChangeInfoCallBack);
                }
                else
                {
                    APIGeneric.SaveDefaultAvatar(defaultAvatar, OnSubmitChangeInfoCallBack);
                }
            }

            if (totalChange == 0)
            {
                DialogService.Instance.ShowDialog(new DialogMessage("Thông báo", "Không có thông tin gì thay đổi."));
            }
        }
    }
Esempio n. 7
0
    public void initView()
    {
        userName.value = data.info.info.userName.Trim();
        fullName.value = string.Format("{0} {1} {2}",
                                       data.info.info.firstName != null ? data.info.info.firstName.Trim() : string.Empty,
                                       data.info.info.middleName != null ? data.info.info.middleName.Trim() : string.Empty,
                                       data.info.info.lastName != null ? data.info.info.lastName.Trim() : string.Empty
                                       ).Trim();
        email.value = data.info.info.email != null?data.info.info.email.Trim() : string.Empty;

        phoneNumber.value = data.info.info.mobile != null?data.info.info.mobile.Trim() : string.Empty;

        toggleMale.value   = data.info.info.gender != null ? data.info.info.gender == 0 : true;
        toggleFemale.value = data.info.info.gender != null ? data.info.info.gender == 1 : false;
        address.value      = data.info.info.address != null?data.info.info.address.Trim() : string.Empty;

        PuApp.Instance.GetImage(data.info.info.avatar, (texture) => avatar.mainTexture = texture);

        APIGeneric.GetDefaultAvatar((status, message, listAvatar) =>
        {
            if (status && listAvatar.Count > 0)
            {
                foreach (string avatarPath in listAvatar)
                {
                    GameObject obj              = (GameObject)GameObject.Instantiate(prefabAvatarChangeInfo);
                    obj.transform.parent        = avatarTableView.transform;
                    obj.transform.localScale    = Vector3.one;
                    obj.transform.localPosition = Vector3.zero;
                    avatarTableView.Reposition();
                    obj.GetComponent <UIDragScrollView>().scrollView = avatarScrollView;
                    obj.AddComponent <ComponentData>().dataString    = avatarPath;

                    PuApp.Instance.GetImage(AppConfig.HttpUrl + "/static/" + avatarPath, (img) =>
                    {
                        obj.GetComponentInChildren <UITexture>().mainTexture = img;
                    });

                    UIEventListener.Get(obj).onClick += onClickToDefaultAvatar;
                }
            }
            else if (!status)
            {
                DialogService.Instance.ShowDialog(new DialogMessage("Thông báo", "Không thể lấy thông tin các biểu tượng mặc định."));
            }
        });
    }