Ejemplo n.º 1
0
        public void SetData(LegionData legionData, long choiceUid)
        {
            if (choiceUid == 0)
            {
                return;
            }

            uid = choiceUid;

            mData = null;
            for (int i = 0; i < legionData.listMember.Count; i++)
            {
                if (legionData.listMember[i].uid == uid)
                {
                    mData = legionData.listMember[i];
                    break;
                }
            }

            if (mData == null)
            {
                return;
            }

            nameLab.text         = mData.memberName;
            levelLab.text        = mData.level.ToString();
            headIcon.spriteName  = string.Format("{0}{1}", mData.portrait, (mData.skin > 0) ? "_" + mData.skin : string.Empty);// "Partner_Head_Sidatuila"; // 暂时默认
            headFrame.spriteName = EconemyTemplateManager.Instance.GetHeadFrame(mData.headFrame).iconId;
            contentLab.text      = EB.Localizer.GetString("ID_uifont_in_LTLegionMainMenu_Label_41");
        }
Ejemplo n.º 2
0
        public void SetData(LegionData legionData, long choiceUid, List <OtherPlayerPartnerData> partnerList = null)
        {
            if (legionData == null || legionData.userMemberData == null)
            {
                return;
            }

            this.legionData = legionData;

            if (legionData.userMemberData.dutyType == eAllianceMemberRole.Owner)
            {
                bg.height = bgFullHeight;
                hideButtonObj.SetActive(true);
                UpdateAnchors();
            }
            else if (legionData.userMemberData.dutyType == eAllianceMemberRole.ExtraOwner)
            {
                bg.height = bgFullHeight;
                hideButtonObj.SetActive(true);
                UpdateAnchors();
            }
            else
            {
                bg.height = bgSmallHeight;
                hideButtonObj.SetActive(false);
                UpdateAnchors();
            }

            if (choiceUid == 0)
            {
                if (isthisInit)
                {
                    SetBtnView();
                }
                return;
            }

            formationInfo.Init(choiceUid, partnerList);

            _choiceUid = choiceUid;

            mData = null;
            for (int i = 0; i < legionData.listMember.Count; i++)
            {
                if (legionData.listMember[i].uid == _choiceUid)
                {
                    mData = legionData.listMember[i];
                    break;
                }
            }

            if (mData == null)
            {
                return;
            }

            ShowPersonage();
        }
Ejemplo n.º 3
0
        public void SetData(LegionData legionData)
        {
            if (legionData == null || legionData.userMemberData == null)
            {
                return;
            }

            if (!legionData.legionIconSptName.Equals(""))
            {
                legionIconSp.spriteName = legionData.legionIconSptName;
            }

            if (!legionData.legionIconBGSptName.Equals(""))
            {
                legioinIconBGSp.spriteName = legionData.legionIconBGSptName;
            }

            nameLab.text     = legionData.legionName;
            levelLab.text    = legionData.legionLevel.ToString();
            curLevelLab.text = legionData.legionLevel.ToString();
            levelUpLab.text  = (legionData.legionLevel + 1).ToString();

            if (legionData.legionLevel >= AlliancesManager.Instance.Config.MaxAllianceLevel)
            {
                curMemberNumLab.text     = legionData.maxPeopleNum.ToString();
                curTechMaxLevel.text     = legionData.legionLevel.ToString();
                levelUpMemberNumLab.text = "";
                NextTechMaxLevel.text    = "";
                newLevelObj.CustomSetActive(false);
                peoplevelup.CustomSetActive(false);
                techlevelup.CustomSetActive(false);
            }
            else
            {
                curMemberNumLab.text     = legionData.maxPeopleNum.ToString();
                levelUpMemberNumLab.text = string.Format("[42FE79]{0}[-]", legionData.growupMaxPeopleNum);
                curTechMaxLevel.text     = legionData.legionLevel.ToString();
                NextTechMaxLevel.text    = string.Format("[42FE79]{0}[-]", legionData.legionLevel + 1);
                newLevelObj.CustomSetActive(true);
                peoplevelup.CustomSetActive(true);
                techlevelup.CustomSetActive(true);
            }
            //levelUpMemberNumLab.text = "+" + (legionData.growupMaxPeopleNum - legionData.maxPeopleNum);

            float value = ((float)legionData.currentExp) / legionData.growupExp;

            expProgress.value = value > 1 ? 1 : value;

            progressLab.text = string.Format("{0}/{1}", legionData.currentExp, legionData.growupExp);

            //lessDonateTips.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LegionPageDonate_2747"), (AlliancesManager.Instance.Config.DonateMaxTimes - legionData.userMemberData.todayDonateTimes).ToString(), AlliancesManager.Instance.Config.DonateMaxTimes);

            //LegionLogic.GetInstance().HaveDonateRP();
            SetDonateChest();
        }
Ejemplo n.º 4
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);

            LegionData data = param as LegionData;

            if (data != null)
            {
                SetData(data);
            }
        }
Ejemplo n.º 5
0
        //void Update()
        //{
        //    waitFrame--;
        //    if(waitFrame <=0)
        //    {
        //        waitFrame = 30;
        //    }
        //    else
        //    {
        //        return;
        //    }

        //    if(inputTitleLabel != null&& inputContentLabel!=null)
        //    {
        //        if(!inputTitleLabel.text.Equals(noInputTitleStr)&& !inputContentLabel.text.Equals(noInputContentStr))
        //        {
        //            if(!sendMailBtn.enabled)
        //            {
        //                LTUIUtil.SetGreyButtonEnable(sendMailBtn, true);
        //            }
        //        }
        //        else if(sendMailBtn.enabled == true)
        //        {
        //            LTUIUtil.SetGreyButtonEnable(sendMailBtn, false);
        //        }
        //    }
        //}

        public void SetData(LegionData data)
        {
            if (data.userMemberData == null)
            {
                return;
            }

            lessMailTimes      = AlliancesManager.Instance.Config.MaxMailTimes - data.mailTimes;
            LessTipsLabel.text = string.Format(EB.Localizer.GetString("ID_codefont_in_LegionMailView_2088"), LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal, lessMailTimes);
            NameLabel.text     = string.Format("【{0}】", data.userMemberData.memberName);
        }
Ejemplo n.º 6
0
        public void SetData(LegionData data)
        {
            if (!data.legionIconSptName.Equals(""))
            {
                legionIconSpt.spriteName = data.legionIconSptName;
            }
            iconBGSp.spriteName = data.legionIconBGSptName;

            LTUIUtil.SetText(legionNameLabel, data.legionName);
            LTUIUtil.SetText(legionLevelLabel, data.legionLevel.ToString());
            LTUIUtil.SetText(expLabel, string.Format("{0}/{1}", data.currentExp, data.growupExp));
            LTUIUtil.SetText(peopleNumLabel, string.Format("{0}/{1}", data.currentPeopleNum, data.maxPeopleNum));
            LTUIUtil.SetText(bossNameLabel, data.ownerName);
            if (data.notice != null)
            {
                LTUIUtil.SetText(logLabel, data.notice.Equals("") ? logLabel.text : data.notice);
            }
            if (isShow)
            {
                memberItemScroll.SetItemDatas(data.listMember.ToArray());
            }
            //权限
            if (data.userMemberData != null)
            {
                editNameBtn.gameObject.CustomSetActive(data.userMemberData.dutyType == eAllianceMemberRole.Owner);
                switch (data.userMemberData.dutyType)
                {
                case eAllianceMemberRole.Member:
                    PageMemberState = State.Member;
                    ChangeOpen(false, false, false);
                    break;

                case eAllianceMemberRole.Admin:
                    PageMemberState = State.Admin;
                    ChangeOpen(true, false, false);
                    break;

                case eAllianceMemberRole.ExtraOwner:
                    PageMemberState = State.Admin;
                    ChangeOpen(true, true, false);
                    break;

                case eAllianceMemberRole.Owner:
                    PageMemberState = State.Admin;
                    ChangeOpen(true, true, true);
                    break;
                }
            }

            if (scrollView != null)
            {
                scrollView.RestrictWithinBounds(true);
            }
        }
Ejemplo n.º 7
0
        public void SetData(LegionData legionData)
        {
            data = legionData;
            ShowUI(true);

            iconID            = data.legionIconID;
            BtInput.value     = data.legionName;
            Icon.spriteName   = data.legionIconSptName;
            IconBG.spriteName = data.legionIconBGSptName;
            string colorStr = BalanceResourceUtil.GetUserDiamond() >= AlliancesManager.Instance.Config.RenameCost ? LT.Hotfix.Utility.ColorUtility.WhiteColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal;

            CoinNumLab.text = string.Format("[{0}]{1}[-]", colorStr, AlliancesManager.Instance.Config.RenameCost);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 打开后传参
        /// </summary>
        /// <param name="param"></param>
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);
            Hashtable table = param as Hashtable;

            if (table == null)
            {
                LegionData data = param as LegionData;

                if (data == null)
                {
                    return;
                }
                SetData(data);
                MainChoiceState = ChoiceState.Member;
                titleCtrl.SetTitleBtn((int)MainChoiceState);
            }
            else
            {
                if (table["legionData"] != null)
                {
                    LegionData data = (LegionData)table["legionData"];
                    if (data == null)
                    {
                        return;
                    }
                    SetData(data);
                }
                if (table["choiceState"] != null)
                {
                    ChoiceState state = (ChoiceState)table["choiceState"];
                    titleCtrl.SetTitleBtn((int)state);
                    MainChoiceState = state;
                }
            }

            //刷新军团被雇佣次数
            LegionLogic.GetInstance().OnSendGetCurDonateInfo((ha) =>
            {
                DataLookupsCache.Instance.CacheData(ha);
            });
        }
Ejemplo n.º 9
0
        private void SetData(LegionData data)
        {
            if (data == null)
            {
                EB.Debug.LogWarning("LegionData == null");
                return;
            }

            if (MemberPage != null)
            {
                MemberPage.SetData(data);
            }

            if (DonatePage != null)
            {
                DonatePage.SetData(data);
            }

            if (MessagePage != null)
            {
                MessagePage.SetMessageData(data.listMessageItem);
            }

            if (MemberInfoView != null)
            {
                MemberInfoView.SetData(data, 0);
            }

            if (MailView != null)
            {
                MailView.SetData(data);
            }

            if (MedalPage != null && MainChoiceState == ChoiceState.Medal)
            {
                MedalPage.SetLegionMemberData(data.listMember);
                MedalPage.ShowUI(true);
            }

            legionData = data;
        }
Ejemplo n.º 10
0
        public void SetAllianceAccount(AllianceAccount data)
        {
            if (data.State == eAllianceState.Joined)
            {
                isJoinedLegion = true;
            }
            else
            {
                if (isJoinedLegion) //如果之前是在军团的 重置军团
                {
                    legionData = new LegionData();
                }
                isJoinedLegion = false;
            }

            legionData.legionID = data.AllianceId;
            //legionData.legionLevel = data.

            if (LegionEvent.NotifyLegionAccount != null)
            {
                LegionEvent.NotifyLegionAccount(data);
            }
        }
Ejemplo n.º 11
0
        public void SetData(LegionData data)
        {
            limitLevelLabel.text = data.conditionLevel.ToString();
            requestNumLabel.text = data.listRequestJoin.Count.ToString();

            IsOpenApprove = data.isNeedApprove;

            //int num = data.listRequestJoin.Count;
            //LTUIUtil.SetNumTemplate(approveItemTemplate, listApproveItem, num, itemBehind);

            if (data.listRequestJoin.Count > listApproveItem.Count)
            {
                int length = data.listRequestJoin.Count;
                int index  = listApproveItem.Count;

                for (int i = index; i < length; i++)
                {
                    GameObject go = Object.Instantiate(approveItemTemplate.mDMono.gameObject);
                    go.transform.parent     = grid.transform;
                    go.transform.localScale = approveItemTemplate.mDMono.transform.localScale;
                    LegionApproveItem item = go.GetMonoILRComponent <LegionApproveItem>();
                    listApproveItem.Add(item);
                }
                grid.Reposition();
            }

            for (int i = 0; i < listApproveItem.Count; i++)
            {
                if (i < data.listRequestJoin.Count)
                {
                    RequestJoinData   joinData = data.listRequestJoin[i];
                    LegionApproveItem item     = listApproveItem[i];
                    item.SetData(joinData);
                    item.SetAction(OnClickConsentApprove, OnClickRefuseApprove);
                }
                else
                {
                    listApproveItem[i].ShowUI(false);
                }
            }

            //权限
            if (data.userMemberData != null)
            {
                switch (data.userMemberData.dutyType)
                {
                case eAllianceMemberRole.Member:
                case eAllianceMemberRole.Admin:
                    ChangeOpen(false);
                    break;

                case eAllianceMemberRole.ExtraOwner:
                case eAllianceMemberRole.Owner:
                    ChangeOpen(true);
                    break;
                }
            }

            if (scrollView != null)
            {
                scrollView.RestrictWithinBounds(true);
            }
        }
Ejemplo n.º 12
0
 private LegionModel()
 {
     legionData = new LegionData();
     InitLegionIcon();
     defaultSpriteKey = 0;
 }