| | |
| | | [SerializeField] RectTransform m_ContainerNeedVip0;
|
| | | [SerializeField] RectTransform m_ContainerNeedVip;
|
| | | [SerializeField] Text m_NeedRecharge;
|
| | | [SerializeField] Text m_NeedVipLv;
|
| | | [SerializeField] Button m_DredgeBtn;
|
| | | [SerializeField] Text m_DredgeBtnText;
|
| | | [SerializeField] Image m_VipBG;
|
| | | [SerializeField] Text m_VipLvTxt;
|
| | | [SerializeField] Image m_VipNoOpenTip;
|
| | | [SerializeField] Text m_VipExperienceTimeTxt;
|
| | | [SerializeField] Text m_JadeTxt;
|
| | | [SerializeField] Text m_TargetVipLevel;
|
| | | [SerializeField] Button m_Func;
|
| | | [SerializeField] Text m_FuncBtnTxt;
|
| | | [SerializeField] Text m_VipLevel;
|
| | | [SerializeField] Image m_NoneVipSign;
|
| | | [SerializeField] Text m_VipExperienceTime;
|
| | | [SerializeField] Text m_Jade;
|
| | | [SerializeField] Slider m_VipExpSlider;
|
| | | [SerializeField] Text m_VipExpTxt;
|
| | | [SerializeField] Text m_VipLevelTxt;
|
| | | [SerializeField] Text m_FightPowerTxt;
|
| | | [SerializeField] Text m_VipTitleLvTxt;
|
| | | [SerializeField] Text m_VipGiftLvTxt;
|
| | | [SerializeField] Image m_VipTitleImg;
|
| | | [SerializeField] List<Button> itemList;
|
| | | [SerializeField] Image m_SpecialGiftName;
|
| | | [SerializeField] Text m_VipGiftOldTxt;
|
| | | [SerializeField] Text m_VipGiftNewTxt;
|
| | | [SerializeField] Button m_BuyGiftBtn;
|
| | | [SerializeField] GameObject m_VipGiftBuyImg;
|
| | | [SerializeField] Button m_LeftBtn;
|
| | | [SerializeField] Button m_RightBtn;
|
| | | [SerializeField] Text m_VipExp;
|
| | | [SerializeField] Text m_NextTarget;
|
| | |
|
| | | [SerializeField] Button m_ViewPrivilege;
|
| | | [SerializeField] Text m_AddFightPower;
|
| | | [SerializeField] Text m_SelectVipLevel;
|
| | | [SerializeField] Image m_GainTitle;
|
| | | [SerializeField] Image m_LeftPrivilegeIcon;
|
| | | [SerializeField] Image m_RightPrivilegeIcon;
|
| | | [SerializeField] ItemCell[] m_Items;
|
| | | [SerializeField] Image m_SpecialGiftType;
|
| | | [SerializeField] Text m_GiftOriginalPrice;
|
| | | [SerializeField] Text m_GiftNowPrice;
|
| | | [SerializeField] Button m_BuyGift;
|
| | | [SerializeField] Image m_HasBuySign;
|
| | | [SerializeField] Button m_Left;
|
| | | [SerializeField] Button m_Right;
|
| | | [SerializeField] Image m_VipLeftRed;
|
| | | [SerializeField] Image m_VipRightRed;
|
| | |
|
| | | [SerializeField] ScrollerController m_VipPrivilegeCtrl;
|
| | |
|
| | | private int vipSurplusTime = 0;
|
| | | private static StringBuilder textBuilder = new StringBuilder();
|
| | |
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_DredgeBtn.onClick.AddListener(OnDredgeBtn);
|
| | | m_BuyGiftBtn.onClick.AddListener(OnBuyGiftBtn);
|
| | | m_LeftBtn.onClick.AddListener(OnLeftBtn);
|
| | | m_RightBtn.onClick.AddListener(OnRightBtn);
|
| | | m_Func.onClick.AddListener(OnFunc);
|
| | | m_BuyGift.onClick.AddListener(OnBuyGift);
|
| | | m_Left.onClick.AddListener(OnLeft);
|
| | | m_Right.onClick.AddListener(OnRight);
|
| | | m_ViewPrivilege.onClick.AddListener(ViewPrivilege);
|
| | | }
|
| | |
|
| | | protected override void BindController()
|
| | |
| | | RefreshJadeData();
|
| | | InitVipData();
|
| | |
|
| | |
|
| | | WindowCenter.Instance.windowBeforeOpenEvent += WindowBeforeOpenEvent;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnRightBtn()
|
| | | private void OnRight()
|
| | | {
|
| | | if (model.presentSelectVip < model.vipMaxLv)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnLeftBtn()
|
| | | private void OnLeft()
|
| | | {
|
| | | if (model.presentSelectVip > 1)
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnDredgeBtn()
|
| | | private void OnFunc()
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | |
| | | {
|
| | | RefreshVipProgress();
|
| | | }
|
| | | m_DredgeBtnText.text = _hasVip ? Language.Get("VipWin_7") : Language.Get("VipWin_8");
|
| | | m_FuncBtnTxt.text = _hasVip ? Language.Get("VipWin_7") : Language.Get("VipWin_8");
|
| | | bool _isVipActive = model.IsVipActive();
|
| | | bool _isVipExperience = model.IsVipExperience();
|
| | | RefreshVipNextExp();
|
| | | RefreshVipNextJade();
|
| | | m_VipNoOpenTip.gameObject.SetActive(PlayerDatas.Instance.baseData.VIPLv == 0 && !_isVipExperience);
|
| | | m_VipLvTxt.gameObject.SetActive(PlayerDatas.Instance.baseData.VIPLv > 0 || _isVipExperience);
|
| | | m_VipLvTxt.text = _isVipExperience ? "1" : PlayerDatas.Instance.baseData.VIPLv.ToString();
|
| | | m_NoneVipSign.gameObject.SetActive(PlayerDatas.Instance.baseData.VIPLv == 0 && !_isVipExperience);
|
| | | m_VipLevel.gameObject.SetActive(PlayerDatas.Instance.baseData.VIPLv > 0 || _isVipExperience);
|
| | | m_VipLevel.text = _isVipExperience ? "1" : PlayerDatas.Instance.baseData.VIPLv.ToString();
|
| | | }
|
| | |
|
| | | void RefreshVipNextExp()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.VIPLv >= model.vipMaxLv)
|
| | | {
|
| | | m_VipLevelTxt.text = Language.Get("VipWin_11");
|
| | | m_NextTarget.text = Language.Get("VipWin_11");
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | _nextVip = PlayerDatas.Instance.baseData.VIPLv + 1;
|
| | | }
|
| | | m_VipLevelTxt.text = Language.Get("VipWin_10", model.GetVipPreExp(_nextVip) - model.vipTotalExp, _nextVip);
|
| | | m_NextTarget.text = Language.Get("VipWin_10", model.GetVipPreExp(_nextVip) - model.vipTotalExp, _nextVip);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (model.presentSelectVip > 1)
|
| | | {
|
| | | m_NeedRecharge.text = (model.GetVipPreExp(model.presentSelectVip) - model.vipTotalExp).ToString();
|
| | | m_NeedVipLv.text = model.presentSelectVip.ToString();
|
| | | m_TargetVipLevel.text = model.presentSelectVip.ToString();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (vipSurplusTime == 0)
|
| | | {
|
| | | m_VipExperienceTimeTxt.text = Language.Get("VipWin_6");
|
| | | m_VipExperienceTime.text = Language.Get("VipWin_6");
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | textBuilder.Append(StringUtility.Contact(1, Language.Get("L1073")));
|
| | | }
|
| | | textBuilder.Append("</color>");
|
| | | m_VipExperienceTimeTxt.text = textBuilder.ToString();
|
| | | m_VipExperienceTime.text = textBuilder.ToString();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_VipExpSlider.maxValue = 1;
|
| | | m_VipExpSlider.value = 1;
|
| | | m_VipExpTxt.text = model.vipExp.ToString();
|
| | | m_VipExp.text = model.vipExp.ToString();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_VipExpSlider.maxValue = model.GetVipLevelUpExp(PlayerDatas.Instance.baseData.VIPLv);
|
| | | m_VipExpSlider.value = model.vipExp;
|
| | | m_VipExpTxt.text = StringUtility.Contact(m_VipExpSlider.value, "/", m_VipExpSlider.maxValue);
|
| | | m_VipExp.text = StringUtility.Contact(m_VipExpSlider.value, "/", m_VipExpSlider.maxValue);
|
| | | }
|
| | | }
|
| | |
|
| | | void RefreshJadeData()
|
| | | {
|
| | | m_JadeTxt.text = PlayerDatas.Instance.baseData.Gold.ToString();
|
| | | m_Jade.text = PlayerDatas.Instance.baseData.Gold.ToString();
|
| | | }
|
| | |
|
| | | private void OnBuyGiftBtn()
|
| | | private void OnBuyGift()
|
| | | {
|
| | | model.SendBuyVipGift(model.presentSelectVip);
|
| | | }
|
| | |
| | | private void InitVipGiftBtn()
|
| | | {
|
| | | VipGiftData data = model.GetVipGift(model.presentSelectVip);
|
| | | m_BuyGiftBtn.gameObject.SetActive(true);
|
| | | m_VipGiftBuyImg.SetActive(false);
|
| | | m_BuyGift.gameObject.SetActive(true);
|
| | | m_HasBuySign.gameObject.SetActive(false);
|
| | | if (PlayerDatas.Instance.baseData.VIPLv < model.presentSelectVip)
|
| | | {
|
| | | m_BuyGiftBtn.interactable = false;
|
| | | m_BuyGift.interactable = false;
|
| | | }
|
| | | else if (data.hasBuy)
|
| | | {
|
| | | m_VipGiftBuyImg.SetActive(true);
|
| | | m_BuyGiftBtn.gameObject.SetActive(false);
|
| | | m_HasBuySign.gameObject.SetActive(true);
|
| | | m_BuyGift.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_BuyGiftBtn.interactable = true;
|
| | | m_BuyGift.interactable = true;
|
| | | }
|
| | | }
|
| | |
|
| | | private void InitVipData()
|
| | | {
|
| | | m_VipTitleLvTxt.text = model.presentSelectVip.ToString();
|
| | | m_VipGiftLvTxt.text = model.presentSelectVip.ToString();
|
| | | m_SelectVipLevel.text = model.presentSelectVip.ToString();
|
| | | VipGiftData data = model.GetVipGift(model.presentSelectVip);
|
| | | int index = 0;
|
| | | if (data != null)
|
| | |
| | | var _list = data.giftItems.GetAwardItem(_job);
|
| | | foreach (var award in _list)
|
| | | {
|
| | | if (index < itemList.Count)
|
| | | if (index < m_Items.Length)
|
| | | {
|
| | | ItemCellModel cellModel = new ItemCellModel(award.item.id, false, (ulong)award.item.count, award.isBind);
|
| | | itemList[index].GetComponent<ItemCell>().Init(cellModel);
|
| | | itemList[index].onClick.RemoveAllListeners();
|
| | | itemList[index].onClick.AddListener(() =>
|
| | | m_Items[index].Init(cellModel);
|
| | | m_Items[index].cellBtn.RemoveAllListeners();
|
| | | m_Items[index].cellBtn.AddListener(() =>
|
| | | {
|
| | | TreasureEffectModel effectModel = ModelCenter.Instance.GetModel<TreasureEffectModel>();
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(award.item.id);
|
| | |
| | | }
|
| | | index++;
|
| | | }
|
| | | m_VipGiftOldTxt.text = data.giftOldPrice.ToString();
|
| | | m_VipGiftNewTxt.text = data.giftNowPrice.ToString();
|
| | | m_GiftOriginalPrice.text = data.giftOldPrice.ToString();
|
| | | m_GiftNowPrice.text = data.giftNowPrice.ToString();
|
| | | var config = Config.Instance.Get<VIPAwardConfig>(model.presentSelectVip);
|
| | | m_SpecialGiftName.gameObject.SetActive(!config.specialGiftIcon.Equals(string.Empty));
|
| | | m_LeftPrivilegeIcon.SetSprite(config.privilegeIcon1);
|
| | | m_RightPrivilegeIcon.SetSprite(config.privilegeIcon2);
|
| | | m_SpecialGiftType.gameObject.SetActive(!config.specialGiftIcon.Equals(string.Empty));
|
| | | if (!config.specialGiftIcon.Equals(string.Empty))
|
| | | {
|
| | | m_SpecialGiftName.SetSprite(config.specialGiftIcon);
|
| | | m_SpecialGiftName.SetNativeSize();
|
| | | m_SpecialGiftType.SetSprite(config.specialGiftIcon);
|
| | | m_SpecialGiftType.SetNativeSize();
|
| | | }
|
| | | }
|
| | | for (int i = itemList.Count - 1; i >= index; i--)
|
| | | for (int i = m_Items.Length - 1; i >= index; i--)
|
| | | {
|
| | | itemList[i].gameObject.SetActive(false);
|
| | | m_Items[i].gameObject.SetActive(false);
|
| | | }
|
| | | InitVipGiftBtn();
|
| | |
|
| | | m_FightPowerTxt.text = model.GetTitlePower(model.presentSelectVip).ToString();
|
| | | m_AddFightPower.text = model.GetTitlePower(model.presentSelectVip).ToString();
|
| | | DienstgradConfig title = model.GetVipTitle(model.presentSelectVip);
|
| | | if (title != null)
|
| | | {
|
| | | m_VipTitleImg.SetSprite(title.Image);
|
| | | m_VipTitleImg.SetNativeSize();
|
| | | m_GainTitle.SetSprite(title.Image);
|
| | | m_GainTitle.SetNativeSize();
|
| | | }
|
| | |
|
| | | m_VipPrivilegeCtrl.Refresh();
|
| | | if (model.m_VipPrivilegeDict.ContainsKey(model.presentSelectVip))
|
| | | {
|
| | | var _list = model.m_VipPrivilegeDict[model.presentSelectVip];
|
| | | for (int i = 0; i < _list.Count; i++)
|
| | | {
|
| | | m_VipPrivilegeCtrl.AddCell(ScrollerDataType.Header, i);
|
| | | }
|
| | | }
|
| | | m_VipPrivilegeCtrl.Restart();
|
| | | OnVipGiftRedpointChange();
|
| | | }
|
| | |
|
| | |
| | | RefreshVipProgress();
|
| | | RefreshVipNextExp();
|
| | | }
|
| | |
|
| | | private void ViewPrivilege()
|
| | | {
|
| | | VipPrivilegeWin.selectVipLevel = model.presentSelectVip;
|
| | | WindowCenter.Instance.Open<VipPrivilegeWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|