Example #1
0
        public void OnTransferDartRefreshBtnClick()
        {
            //var dartData = AlliancesManager.Instance.DartData;
            //if (dartData.State == eAllianceDartCurrentState.Transfer || dartData.State == eAllianceDartCurrentState.Transfering)
            //{
            //	return;
            //}

            if (mRotating)
            {
                return;
            }

            if (AllianceEscortUtil.GetResidueTransferDartNum() <= 0)
            {
                MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_AllianceEscortHudController_8870"));
                return;
            }

            var cur = AlliancesManager.Instance.TransferDartInfo.GetCurrentSelectDart();

            if (AllianceEscortUtil.GetResidueTransferRefreshNum() > 0 || mTicketNum > 0)
            {
                if (cur != null && cur.DartName.CompareTo("tian") == 0)
                {
                    MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_AllianceEscortHudController_9174"), null);
                    return;
                }

                mIsRefresh = true;
                //LTUIUtil.SetGreyButtonEnable(controller.CoolTriggers["TransferDartRefreshBtn"], false);
                controller.CoolTriggers["TransferDartRefreshBtn"].GetComponent <UISprite>().color = new Color(1, 0, 1, 1);
                LTUIUtil.SetGreyButtonEnable(controller.UiButtons["StartTransferBtn"], false);
                AlliancesManager.Instance.Refresh();
            }
            else
            {
                if (BalanceResourceUtil.GetUserDiamond() >= refreshCostHC)
                {
                    if (cur != null && cur.DartName.CompareTo("tian") == 0)
                    {
                        MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_AllianceEscortHudController_9174"), null);
                        return;
                    }

                    mIsRefresh = true;
                    //LTUIUtil.SetGreyButtonEnable(controller.CoolTriggers["TransferDartRefreshBtn"], false);
                    controller.CoolTriggers["TransferDartRefreshBtn"].GetComponent <UISprite>().color = new Color(1, 0, 1, 1);
                    LTUIUtil.SetGreyButtonEnable(controller.UiButtons["StartTransferBtn"], false);
                    AlliancesManager.Instance.Refresh();
                }
                else
                {
                    BalanceResourceUtil.HcLessMessage();
                }
            }
        }
Example #2
0
        private void SetTransferDartResidueRefreshCount()
        {
            if (AlliancesManager.Instance.TransferDartInfo.Members.Count <= 0)
            {
                EB.Debug.LogError("TransferDartInfo not init");
                return;
            }

            int residueFreeRefreshNum = AllianceEscortUtil.GetResidueTransferRefreshNum();

            if (residueFreeRefreshNum < 0)
            {
                EB.Debug.LogError("residueFreeRefreshNum < 0 num={0}", residueFreeRefreshNum);
                residueFreeRefreshNum = 0;
            }
            //int totalFreeRefreshNum = VIPTemplateManager.Instance.GetTotalNum(VIPPrivilegeKey.EscortRefreshTimes);

            if (residueFreeRefreshNum > 0)
            {
                LTUIUtil.SetText(controller.UiLabels["ResidueTransferDartFreeRefreshNumLabel"], residueFreeRefreshNum.ToString());
            }
            else
            {
                mTicketNum = GameItemUtil.GetInventoryItemNum(Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("escortRefreshItem").ToString());
                if (mTicketNum > 0)
                {
                    LTUIUtil.SetText(controller.UiLabels["TransferDartRefreshTicketNumLabel"], mTicketNum.ToString());
                    controller.UiLabels["TransferDartRefreshTicketNumLabel"].transform.parent.gameObject.SetActive(true);
                    controller.UiLabels["ResidueTransferDartFreeRefreshNumLabel"].transform.parent.gameObject.CustomSetActive(false);
                    controller.UiLabels["TransferDartRefreshCostHCLabel"].transform.parent.gameObject.CustomSetActive(false);
                }
                else
                {
                    controller.UiLabels["TransferDartRefreshTicketNumLabel"].transform.parent.gameObject.SetActive(false);
                    controller.UiLabels["ResidueTransferDartFreeRefreshNumLabel"].transform.parent.gameObject.CustomSetActive(false);
                    controller.UiLabels["TransferDartRefreshCostHCLabel"].transform.parent.gameObject.CustomSetActive(true);
                    if (BalanceResourceUtil.GetUserDiamond() >= refreshCostHC)
                    {
                        controller.UiLabels["TransferDartRefreshCostHCLabel"].color = LT.Hotfix.Utility.ColorUtility.GreenColor;
                    }
                    else
                    {
                        controller.UiLabels["TransferDartRefreshCostHCLabel"].color = LT.Hotfix.Utility.ColorUtility.RedColor;
                    }
                }
            }
        }