Beispiel #1
0
    // Token: 0x0600130C RID: 4876 RVA: 0x00212AF0 File Offset: 0x00210CF0
    public override void OnButtonClick(UIButton sender)
    {
        int topIdx = this.AGS_Panel2.GetTopIdx();

        if (topIdx > 0)
        {
            UIAlliVSAlliBoard.MemTopIndex = topIdx;
        }
        else
        {
            UIAlliVSAlliBoard.MemTopIndex = 1;
        }
        int btnID = sender.m_BtnID1;

        if (btnID != 0)
        {
            if (btnID != 6)
            {
                if (btnID == 99)
                {
                    GUIManager.Instance.OpenMessageBoxEX(DataManager.Instance.mStringTable.GetStringByID(7028u), DataManager.Instance.mStringTable.GetStringByID(9041u), null, null, 0, 0, true, false);
                }
            }
            else
            {
                AllianceWarManager._RegisterData dataIndex = ActivityManager.Instance.AllianceWarMgr.GetDataIndex(this.RankingTable[sender.m_BtnID2]);
                DataManager.Instance.ShowLordProfile(dataIndex.Name.ToString());
            }
        }
        else
        {
            this.door.CloseMenu(false);
        }
    }
Beispiel #2
0
    // Token: 0x06000107 RID: 263 RVA: 0x00011C4C File Offset: 0x0000FE4C
    public void RecvInsertAllianceWarMemberList(MessagePacket MP)
    {
        if (GUIManager.Instance.FindMenu(EGUIWindow.UI_AllianceWarRegister) == null)
        {
            return;
        }
        byte b = MP.ReadByte(-1);

        if (b == 0 || b >= 100)
        {
            this.SendAllianceWarList();
            return;
        }
        if (this.MyRank > 0 && this.MyRank >= b)
        {
            this.MyRank += 1;
        }
        b -= 1;
        AllianceWarManager._RegisterData registerData = default(AllianceWarManager._RegisterData);
        registerData.Initial();
        MP.ReadStringPlus(13, registerData.Name, -1);
        registerData.Power = MP.ReadULong(-1);
        if (this.RegisterDataCount < 100)
        {
            this.InsertData((int)b, ref registerData);
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_AllianceWarRegister, 1, (int)this.RegisterDataCount);
        }
        else
        {
            registerData.Clear();
        }
    }
Beispiel #3
0
    // Token: 0x060000FE RID: 254 RVA: 0x000116E8 File Offset: 0x0000F8E8
    private void MoveData(int index, int newIndex)
    {
        if (index == newIndex)
        {
            return;
        }
        int num  = 0;
        int num2 = 0;

        AllianceWarManager._RegisterData[] data  = this.GetData(index, ref num);
        AllianceWarManager._RegisterData[] data2 = this.GetData(newIndex, ref num2);
        if (data == data2)
        {
            AllianceWarManager._RegisterData registerData = data[num];
            if (index > newIndex)
            {
                Array.Copy(data, num2, data, num2 + 1, num - num2);
            }
            else
            {
                Array.Copy(data, num + 1, data, num, num2 - num);
            }
            data[num2] = registerData;
        }
        else if (index > newIndex)
        {
            AllianceWarManager._RegisterData registerData2 = data2[(int)(this.RegisterMaxCount - 1)];
            AllianceWarManager._RegisterData registerData  = data[num];
            int num3 = (int)(this.RegisterMaxCount - 1) - num2;
            if (num3 > 0)
            {
                Array.Copy(data2, num2, data2, num2 + 1, num3);
            }
            data2[num2] = registerData;
            if (num > 0)
            {
                Array.Copy(data, 0, data, 1, num);
            }
            data[0] = registerData2;
        }
        else
        {
            AllianceWarManager._RegisterData registerData3 = data2[0];
            AllianceWarManager._RegisterData registerData  = data[num];
            int num3 = (int)this.RegisterMaxCount - num - 1;
            if (num3 > 0)
            {
                Array.Copy(data, num + 1, data, num, num3);
            }
            data[(int)(this.RegisterMaxCount - 1)] = registerData3;
            if (num2 > 0)
            {
                Array.Copy(data2, 1, data2, 0, num2);
            }
            data2[num2] = registerData;
        }
    }
Beispiel #4
0
    // Token: 0x060000FD RID: 253 RVA: 0x000115D4 File Offset: 0x0000F7D4
    public void InsertData(int index, ref AllianceWarManager._RegisterData Data)
    {
        int num = 0;

        AllianceWarManager._RegisterData[] data = this.GetData(index, ref num);
        if (this.RegisterDataCount < this.RegisterMaxCount)
        {
            int num2 = (int)this.RegisterDataCount - num;
            if (num2 > 0)
            {
                Array.Copy(data, num, data, num + 1, (int)this.RegisterDataCount - num);
            }
        }
        else if (index < (int)this.RegisterMaxCount)
        {
            AllianceWarManager._RegisterData registerData = data[(int)(this.RegisterMaxCount - 1)];
            int num2 = (int)this.RegisterMaxCount - num - 1;
            if (num2 > 0)
            {
                Array.Copy(data, num, data, num + 1, num2);
            }
            num2 = (int)(this.RegisterDataCount - this.RegisterMaxCount);
            if (num2 > 0)
            {
                Array.Copy(this.WaitData, 0, this.WaitData, 1, num2);
            }
            this.WaitData[0] = registerData;
        }
        else
        {
            int num2 = (int)(this.RegisterDataCount - this.RegisterMaxCount) - num;
            if (num2 > 0)
            {
                Array.Copy(data, num, data, num + 1, num2);
            }
        }
        data[num] = Data;
        this.RegisterDataCount += 1;
    }
Beispiel #5
0
        // Token: 0x06000D47 RID: 3399 RVA: 0x0013B360 File Offset: 0x00139560
        public void SetData(int DataIndex)
        {
            if (this.transform == null)
            {
                return;
            }
            this.DataIndex = DataIndex;
            AllianceWarManager._RegisterData dataIndex = this.AWD.GetDataIndex(DataIndex);
            this.AWD.FormatRank(DataIndex, ref this.RankStr);
            this.RankText.text = this.RankStr.ToString();
            this.RankText.SetAllDirty();
            this.RankText.cachedTextGenerator.Invalidate();
            this.NameStr.ClearString();
            this.NameStr.Append(dataIndex.Name);
            this.NameText.fontSize = this.DefNameFontSize;
            this.NameText.text     = this.NameStr.ToString();
            this.NameText.SetAllDirty();
            this.NameText.cachedTextGenerator.Invalidate();
            this.NameText.cachedTextGeneratorForLayout.Invalidate();
            this.PowerStr.ClearString();
            this.PowerStr.IntToFormat((long)dataIndex.Power, 1, true);
            this.PowerStr.AppendFormat("{0}");
            this.PowerText.text = this.PowerStr.ToString();
            this.PowerText.SetAllDirty();
            this.PowerText.cachedTextGenerator.Invalidate();
            float num;

            for (num = this.NameText.preferredWidth; num > 209f; num = this.NameText.preferredWidth)
            {
                this.NameText.fontSize--;
                if (this.NameText.fontSize < 8)
                {
                    num = 209f;
                    break;
                }
                this.NameText.SetLayoutDirty();
                this.NameText.cachedTextGeneratorForLayout.Invalidate();
            }
            this.UnderLineRect.sizeDelta = new Vector2(num, 3f);
            this.HintRangeRect.sizeDelta = new Vector2(num, 45f);
            if (GUIManager.Instance.IsArabic)
            {
                this.UnderLineRect.anchoredPosition = new Vector2(this.NameText.rectTransform.rect.width - num, this.UnderLineRect.anchoredPosition.y);
            }
            int num2 = (int)this.AWD.GetRegisterMaxCount();

            if (num2 > (int)this.AWD.GetRegisterCount())
            {
                num2 = (int)this.AWD.GetRegisterCount();
            }
            if ((int)this.AWD.GetRegisterMaxCount() > DataIndex)
            {
                Graphic rankText = this.RankText;
                Color   color    = this.OriTextColor;
                this.PowerText.color = color;
                color = color;
                this.NameText.color     = color;
                rankText.color          = color;
                this.UnderLineImg.color = Color.white;
                this.Hint.Parm1         = (ushort)(num2 - DataIndex);
            }
            else
            {
                Graphic rankText2 = this.RankText;
                Color   color     = new Color(0.443f, 0.816f, 0.953f);
                this.UnderLineImg.color = color;
                color = color;
                this.PowerText.color = color;
                color = color;
                this.NameText.color = color;
                rankText2.color     = color;
                this.Hint.Parm1     = (ushort)(DataIndex + 1);
            }
            int spriteIndex = 0;

            if ((DataIndex & 1) > 0)
            {
                spriteIndex = 1;
            }
            if (this.AWD.MyRank > 0)
            {
                if (num2 > (int)(this.AWD.MyRank - 1))
                {
                    if (num2 - DataIndex == (int)this.AWD.MyRank)
                    {
                        spriteIndex = 2;
                    }
                }
                else if (this.AWD.MyRank > 0 && DataIndex == (int)(this.AWD.MyRank - 1))
                {
                    spriteIndex = 2;
                }
            }
            for (int i = 0; i < this.BGFrame.Length; i++)
            {
                this.BGFrame[i].SetSpriteIndex(spriteIndex);
            }
        }
Beispiel #6
0
    // Token: 0x06001307 RID: 4871 RVA: 0x00211D10 File Offset: 0x0020FF10
    private void CreateAlliVSAlliBoard()
    {
        this.SPHeight.Clear();
        this.SPHeight.Add(38f);
        for (ushort num = 0; num < (ushort)ActivityManager.Instance.AllianceWarMgr.GetRegisterCount(); num += 1)
        {
            this.SPHeight.Add(53f);
        }
        UIText component = this.AGS_Form.GetChild(1).GetChild(0).GetComponent <UIText>();

        component.text = DataManager.Instance.mStringTable.GetStringByID(17012u);
        this.AGS_Form.GetChild(2).gameObject.SetActive(true);
        this.AGS_Form.GetChild(5).gameObject.SetActive(false);
        this.AGS_Form.GetChild(3).gameObject.SetActive(true);
        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);
        if (ActivityManager.Instance.AllianceWarMgr.MyRank > 0)
        {
            int num2;
            if (ActivityManager.Instance.AllianceWarMgr.GetRegisterCount() >= ActivityManager.Instance.AW_MemberCount)
            {
                if (ActivityManager.Instance.AllianceWarMgr.MyRank <= ActivityManager.Instance.AW_MemberCount)
                {
                    num2 = (int)(ActivityManager.Instance.AW_MemberCount - ActivityManager.Instance.AllianceWarMgr.MyRank + 1);
                }
                else
                {
                    num2 = (int)(ActivityManager.Instance.AW_MemberCount - ActivityManager.Instance.AllianceWarMgr.MyRank);
                }
            }
            else
            {
                num2 = ActivityManager.Instance.AllianceWarMgr.getMyRankIndex();
            }
            component = this.AGS_Form.GetChild(3).GetChild(2).GetComponent <UIText>();
            this.Ranking.ClearString();
            if (num2 < 0)
            {
                this.Ranking.IntToFormat((long)(num2 * -1), 1, false);
                this.Ranking.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(17017u));
            }
            else
            {
                this.Ranking.IntToFormat((long)num2, 1, false);
                this.Ranking.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(17036u));
            }
            component.text = this.Ranking.ToString();
            component.SetAllDirty();
            component.cachedTextGenerator.Invalidate();
            component = this.AGS_Form.GetChild(3).GetChild(3).GetComponent <UIText>();
            this.RankValue.ClearString();
            AllianceWarManager._RegisterData myDataIdx = ActivityManager.Instance.AllianceWarMgr.GetMyDataIdx((int)ActivityManager.Instance.AllianceWarMgr.MyRank);
            this.RankValue.uLongToFormat(myDataIdx.Power, 1, true);
            this.RankValue.AppendFormat(DataManager.Instance.mStringTable.GetStringByID(7061u));
            component.text = this.RankValue.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>();
            this.Ranking.ClearString();
            this.Ranking.Append(DataManager.Instance.mStringTable.GetStringByID(17216u));
            component.text = this.Ranking.ToString();
            component.SetAllDirty();
            component.cachedTextGenerator.Invalidate();
        }
        this.RankingTable.Clear();
        this.RankingTable.Add(UIAlliVSAlliBoard.SPtab);
        for (int i = 0; i < (int)ActivityManager.Instance.AllianceWarMgr.GetRegisterCount(); i++)
        {
            this.RankingTable.Add(i);
        }
        if (ActivityManager.Instance.AllianceWarMgr.GetRegisterCount() == 0)
        {
            this.AGS_Form.GetChild(13).gameObject.SetActive(true);
            component      = this.AGS_Form.GetChild(13).GetChild(0).GetComponent <UIText>();
            component.text = DataManager.Instance.mStringTable.GetStringByID(17075u);
        }
        else
        {
            this.AGS_Form.GetChild(13).gameObject.SetActive(false);
        }
    }
Beispiel #7
0
 // Token: 0x0600130B RID: 4875 RVA: 0x00212420 File Offset: 0x00210620
 public override void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
 {
     if (dataIdx == 0)
     {
         item.transform.GetChild(0).gameObject.SetActive(true);
         item.transform.GetChild(1).gameObject.SetActive(false);
         UIText component = item.transform.GetChild(0).GetChild(4).GetComponent <UIText>();
         component.text = DataManager.Instance.mStringTable.GetStringByID(17013u);
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         component      = item.transform.GetChild(0).GetChild(5).GetComponent <UIText>();
         component.text = DataManager.Instance.mStringTable.GetStringByID(17012u);
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         component      = item.transform.GetChild(0).GetChild(6).GetComponent <UIText>();
         component.text = DataManager.Instance.mStringTable.GetStringByID(1560u);
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
     }
     else if (this.RankingTable[dataIdx] == UIAlliVSAlliBoard.SPtab)
     {
         item.transform.GetChild(0).gameObject.SetActive(false);
         item.transform.GetChild(1).gameObject.SetActive(true);
         item.transform.GetChild(1).GetChild(11).gameObject.SetActive(false);
         this.SortTextArray[0, panelObjectIdx].ClearString();
         this.SortTextArray[0, panelObjectIdx].IntToFormat((long)dataIdx, 1, false);
         this.SortTextArray[0, panelObjectIdx].AppendFormat("{0}");
         UIText component = item.transform.GetChild(1).GetChild(4).GetComponent <UIText>();
         component.text = this.SortTextArray[0, panelObjectIdx].ToString();
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         this.SortTextArray[1, panelObjectIdx].ClearString();
         this.SortTextArray[1, panelObjectIdx].Append(string.Empty);
         component      = item.transform.GetChild(1).GetChild(5).GetComponent <UIText>();
         component.text = this.SortTextArray[1, panelObjectIdx].ToString();
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         this.SortTextArray[2, panelObjectIdx].ClearString();
         this.SortTextArray[2, panelObjectIdx].Append(string.Empty);
         component      = item.transform.GetChild(1).GetChild(6).GetComponent <UIText>();
         component.text = this.SortTextArray[2, panelObjectIdx].ToString();
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         UISpritesArray component2 = item.transform.GetChild(1).GetChild(0).GetComponent <UISpritesArray>();
         component2.SetSpriteIndex(0);
         component2 = item.transform.GetChild(1).GetChild(1).GetComponent <UISpritesArray>();
         component2.SetSpriteIndex(0);
         component2 = item.transform.GetChild(1).GetChild(2).GetComponent <UISpritesArray>();
         component2.SetSpriteIndex(0);
     }
     else
     {
         AllianceWarManager._RegisterData dataIndex = ActivityManager.Instance.AllianceWarMgr.GetDataIndex(this.RankingTable[dataIdx]);
         item.transform.GetChild(0).gameObject.SetActive(false);
         item.transform.GetChild(1).gameObject.SetActive(true);
         item.transform.GetChild(1).GetChild(11).gameObject.SetActive(false);
         this.SortTextArray[0, panelObjectIdx].ClearString();
         if (dataIdx > (int)ActivityManager.Instance.AW_MemberCount)
         {
             this.SortTextArray[0, panelObjectIdx].IntToFormat((long)(dataIdx - (int)ActivityManager.Instance.AW_MemberCount), 1, false);
             this.SortTextArray[0, panelObjectIdx].AppendFormat("~{0}");
         }
         else
         {
             this.SortTextArray[0, panelObjectIdx].IntToFormat((long)dataIdx, 1, false);
             this.SortTextArray[0, panelObjectIdx].AppendFormat("{0}");
         }
         UIText component = item.transform.GetChild(1).GetChild(4).GetComponent <UIText>();
         component.text = this.SortTextArray[0, panelObjectIdx].ToString();
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         this.SortTextArray[1, panelObjectIdx].ClearString();
         this.SortTextArray[1, panelObjectIdx].Append(dataIndex.Name);
         component      = item.transform.GetChild(1).GetChild(5).GetComponent <UIText>();
         component.text = this.SortTextArray[1, panelObjectIdx].ToString();
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         this.SortTextArray[2, panelObjectIdx].ClearString();
         this.SortTextArray[2, panelObjectIdx].uLongToFormat(dataIndex.Power, 1, true);
         this.SortTextArray[2, panelObjectIdx].AppendFormat("{0}");
         component      = item.transform.GetChild(1).GetChild(6).GetComponent <UIText>();
         component.text = this.SortTextArray[2, panelObjectIdx].ToString();
         component.SetAllDirty();
         component.cachedTextGenerator.Invalidate();
         UIButton component3 = item.transform.GetChild(1).GetChild(10).GetComponent <UIButton>();
         component3.m_Handler = this;
         component3.m_BtnID1  = 6;
         component3.m_BtnID2  = dataIdx;
         if (ActivityManager.Instance.AllianceWarMgr.getMyRankIndex() == dataIdx)
         {
             UISpritesArray component4 = item.transform.GetChild(1).GetChild(0).GetComponent <UISpritesArray>();
             component4.SetSpriteIndex(2);
             component4 = item.transform.GetChild(1).GetChild(1).GetComponent <UISpritesArray>();
             component4.SetSpriteIndex(2);
             component4 = item.transform.GetChild(1).GetChild(2).GetComponent <UISpritesArray>();
             component4.SetSpriteIndex(2);
         }
         else if (dataIdx % 2 == 0)
         {
             UISpritesArray component4 = item.transform.GetChild(1).GetChild(0).GetComponent <UISpritesArray>();
             component4.SetSpriteIndex(1);
             component4 = item.transform.GetChild(1).GetChild(1).GetComponent <UISpritesArray>();
             component4.SetSpriteIndex(1);
             component4 = item.transform.GetChild(1).GetChild(2).GetComponent <UISpritesArray>();
             component4.SetSpriteIndex(1);
         }
         else
         {
             UISpritesArray component4 = item.transform.GetChild(1).GetChild(0).GetComponent <UISpritesArray>();
             component4.SetSpriteIndex(0);
             component4 = item.transform.GetChild(1).GetChild(1).GetComponent <UISpritesArray>();
             component4.SetSpriteIndex(0);
             component4 = item.transform.GetChild(1).GetChild(2).GetComponent <UISpritesArray>();
             component4.SetSpriteIndex(0);
         }
     }
 }