Beispiel #1
0
    // Token: 0x06001343 RID: 4931 RVA: 0x0021C67C File Offset: 0x0021A87C
    public override void OnButtonClick(UIButton sender)
    {
        int btnID = sender.m_BtnID1;

        switch (btnID)
        {
        case 0:
            if (UIKVKLBoard.isTopBoard)
            {
                this.door.CloseMenu(false);
                UIKVKLBoard.NewOpen = true;
            }
            else
            {
                UILeaderBoardBase.TopIndex[(int)UIKVKLBoard.SubBoardID] = this.AGS_Panel2.GetTopIdx();
                this.MainBoardChange();
            }
            break;

        default:
            if (btnID == 99)
            {
                GUIManager.Instance.OpenMessageBoxEX(DataManager.Instance.mStringTable.GetStringByID(7028u), DataManager.Instance.mStringTable.GetStringByID(9041u), null, null, 0, 0, true, false);
            }
            break;

        case 3:
        {
            LeaderBoardSubBoardID leaderBoardSubBoardID = (LeaderBoardSubBoardID)sender.m_BtnID2;
            switch (leaderBoardSubBoardID)
            {
            case LeaderBoardSubBoardID.KVKKingdom:
                UIKVKLBoard.isPersonBoard = true;
                break;

            case LeaderBoardSubBoardID.KVKAllianceRank:
                UIKVKLBoard.isPersonBoard = false;
                break;

            case LeaderBoardSubBoardID.KVKAllianceMemberRank:
                if (DataManager.Instance.RoleAlliance.Id == 0u || LeaderBoardManager.Instance.KvKTopBoard.KvKAlliTopPlayerName.Length == 0)
                {
                    return;
                }
                UIKVKLBoard.isPersonBoard = true;
                break;

            default:
                if (leaderBoardSubBoardID == LeaderBoardSubBoardID.KVKPersonRank)
                {
                    UIKVKLBoard.isPersonBoard = true;
                }
                break;
            }
            this.SubBoardChange((byte)sender.m_BtnID2);
            break;
        }

        case 4:
            if (UIKVKLBoard.isPersonBoard)
            {
                UILeaderBoardBase.TopIndex[(int)UIKVKLBoard.SubBoardID] = this.AGS_Panel2.GetTopIdx();
                DataManager.Instance.ShowLordProfile(LeaderBoardManager.Instance.Boards[(int)UIKVKLBoard.SubBoardID][sender.m_BtnID2].Name.ToString());
            }
            else
            {
                UILeaderBoardBase.TopIndex[(int)UIKVKLBoard.SubBoardID] = this.AGS_Panel2.GetTopIdx();
                DataManager.Instance.AllianceView.Id = ((BoardUnitAlliance)LeaderBoardManager.Instance.Boards[(int)UIKVKLBoard.SubBoardID][sender.m_BtnID2]).AllianceID;
                this.door.OpenMenu(EGUIWindow.UIAlliance_publicinfo, 5, 0, false);
            }
            break;
        }
    }
Beispiel #2
0
    // Token: 0x0600133A RID: 4922 RVA: 0x0021A0E0 File Offset: 0x002182E0
    public void CreateSubBoard()
    {
        this.AGS_Form.GetChild(5).gameObject.SetActive(false);
        this.AGS_Form.GetChild(12).gameObject.SetActive(false);
        this.SPHeight.Clear();
        this.SPHeight.Add(38f);
        byte subBoardID = UIKVKLBoard.SubBoardID;

        switch (subBoardID)
        {
        case 5:
            for (int i = 0; i < LeaderBoardManager.Instance.Boards[(int)UIKVKLBoard.SubBoardID].Count; i++)
            {
                if (((BoardUnitKingdom)LeaderBoardManager.Instance.Boards[(int)UIKVKLBoard.SubBoardID][i]).KingdomID > 0)
                {
                    this.SPHeight.Add(53f);
                }
            }
            goto IL_16D;

        case 6:
            break;

        case 7:
            for (int j = 0; j < LeaderBoardManager.Instance.Boards[(int)UIKVKLBoard.SubBoardID].Count; j++)
            {
                this.SPHeight.Add(53f);
            }
            goto IL_16D;

        default:
            if (subBoardID != 15)
            {
                goto IL_16D;
            }
            break;
        }
        for (int k = 0; k < LeaderBoardManager.Instance.Boards[(int)UIKVKLBoard.SubBoardID].Count; k++)
        {
            if (LeaderBoardManager.Instance.Boards[(int)UIKVKLBoard.SubBoardID][k].Value > 0UL)
            {
                this.SPHeight.Add(53f);
            }
        }
IL_16D:
        UIText component = this.AGS_Form.GetChild(1).GetChild(0).GetComponent <UIText>();
        LeaderBoardSubBoardID subBoardID2 = (LeaderBoardSubBoardID)UIKVKLBoard.SubBoardID;

        switch (subBoardID2)
        {
        case LeaderBoardSubBoardID.KVKKingdom:
            component.text = DataManager.Instance.mStringTable.GetStringByID(9588u);
            break;

        case LeaderBoardSubBoardID.KVKAllianceRank:
            component.text = DataManager.Instance.mStringTable.GetStringByID(9589u);
            break;

        case LeaderBoardSubBoardID.KVKAllianceMemberRank:
            component.text = DataManager.Instance.mStringTable.GetStringByID(9855u);
            break;

        default:
            if (subBoardID2 == LeaderBoardSubBoardID.KVKPersonRank)
            {
                component.text = DataManager.Instance.mStringTable.GetStringByID(9590u);
            }
            break;
        }
        this.AGS_Form.GetChild(3).gameObject.SetActive(true);
        if (UIKVKLBoard.isPersonBoard)
        {
            this.AGS_Form.GetChild(3).GetChild(0).gameObject.SetActive(true);
            this.AGS_Form.GetChild(3).GetChild(1).gameObject.SetActive(false);
            Transform child = this.AGS_Form.GetChild(3).GetChild(0);
            child.gameObject.SetActive(true);
            GUIManager.Instance.ChangeHeroItemImg(child, eHeroOrItem.Hero, DataManager.Instance.RoleAttr.Head, 11, 0, 0);
        }
        else
        {
            this.AGS_Form.GetChild(3).GetChild(0).gameObject.SetActive(false);
            this.AGS_Form.GetChild(3).GetChild(1).gameObject.SetActive(true);
            Transform child = this.AGS_Form.GetChild(3).GetChild(1);
            GUIManager.Instance.SetBadgeTotemImg(child, DataManager.Instance.RoleAlliance.Emblem);
        }
        if (UIKVKLBoard.SubBoardID == 5 && LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID] != 0)
        {
            this.AGS_Form.GetChild(3).gameObject.SetActive(false);
            this.AGS_Form.GetChild(5).gameObject.SetActive(true);
            this.AGS_Form.GetChild(2).gameObject.SetActive(true);
            component = this.AGS_Form.GetChild(5).GetComponent <UIText>();
            this.Ranking.ClearString();
            this.Ranking.IntToFormat((long)LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID], 1, true);
            this.Ranking.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(9849u));
            component.text = this.Ranking.ToString();
            component.SetAllDirty();
            component.cachedTextGenerator.Invalidate();
        }
        if (UIKVKLBoard.SubBoardID == 7)
        {
            this.Ranking.ClearString();
            if (LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID] != 0)
            {
                component = this.AGS_Form.GetChild(3).GetChild(2).GetComponent <UIText>();
                this.Ranking.IntToFormat((long)LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID], 1, true);
                this.Ranking.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(7060u));
            }
            else
            {
                this.AGS_Form.GetChild(3).gameObject.SetActive(false);
                this.AGS_Form.GetChild(5).gameObject.SetActive(true);
                component = this.AGS_Form.GetChild(5).GetComponent <UIText>();
                this.Ranking.Append(DataManager.Instance.mStringTable.GetStringByID(8414u));
            }
            component.text = this.Ranking.ToString();
            component.SetAllDirty();
            component.cachedTextGenerator.Invalidate();
        }
        else if (UIKVKLBoard.isPersonBoard)
        {
            this.Ranking.ClearString();
            if (LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID] != 0)
            {
                component = this.AGS_Form.GetChild(3).GetChild(2).GetComponent <UIText>();
                this.Ranking.IntToFormat((long)LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID], 1, true);
                this.Ranking.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(7060u));
            }
            else
            {
                this.AGS_Form.GetChild(3).gameObject.SetActive(false);
                this.AGS_Form.GetChild(5).gameObject.SetActive(true);
                component = this.AGS_Form.GetChild(5).GetComponent <UIText>();
                this.Ranking.Append(DataManager.Instance.mStringTable.GetStringByID(8414u));
            }
            component.text = this.Ranking.ToString();
            component.SetAllDirty();
            component.cachedTextGenerator.Invalidate();
        }
        else if (DataManager.Instance.RoleAlliance.Id != 0u)
        {
            this.AGS_Form.GetChild(3).gameObject.SetActive(false);
            this.AGS_Form.GetChild(5).gameObject.SetActive(true);
            component = this.AGS_Form.GetChild(5).GetComponent <UIText>();
            this.Ranking.ClearString();
            if (LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID] != 0)
            {
                this.Ranking.IntToFormat((long)LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID], 1, false);
                this.Ranking.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(9856u));
            }
            else
            {
                this.Ranking.Append(DataManager.Instance.mStringTable.GetStringByID(8414u));
            }
            component.text = this.Ranking.ToString();
            component.SetAllDirty();
            component.cachedTextGenerator.Invalidate();
        }
        else
        {
            this.AGS_Form.GetChild(3).gameObject.SetActive(false);
            this.AGS_Form.GetChild(5).gameObject.SetActive(true);
            component      = this.AGS_Form.GetChild(5).GetComponent <UIText>();
            component.text = DataManager.Instance.mStringTable.GetStringByID(7095u);
        }
        if (UIKVKLBoard.SubBoardID == 7 && LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID] != 0 && (int)LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID] <= LeaderBoardManager.Instance.Boards[(int)UIKVKLBoard.SubBoardID].Count)
        {
            component = this.AGS_Form.GetChild(3).GetChild(3).GetComponent <UIText>();
            this.RankValue.ClearString();
            this.RankValue.uLongToFormat(LeaderBoardManager.Instance.Boards[(int)UIKVKLBoard.SubBoardID][(int)(LeaderBoardManager.Instance.MyRank[(int)UIKVKLBoard.SubBoardID] - 1)].Value, 1, true);
            this.RankValue.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(8121u));
            component.text = this.RankValue.ToString();
            component.SetAllDirty();
            component.cachedTextGenerator.Invalidate();
        }
        else
        {
            component      = this.AGS_Form.GetChild(3).GetChild(3).GetComponent <UIText>();
            component.text = string.Empty;
            component.SetAllDirty();
            component.cachedTextGenerator.Invalidate();
        }
    }