Ejemplo n.º 1
0
 // Token: 0x06001953 RID: 6483 RVA: 0x002AA81C File Offset: 0x002A8A1C
 public override void UpdateUI(int arg1, int arg2)
 {
     if (this.baseBuild == null)
     {
         return;
     }
     if (arg1 != 1)
     {
         if (arg1 == 2)
         {
             int num = (int)(this.DM.SoldierKind * 4 + this.DM.SoldierRank);
             this.tmpString.Length = 0;
             GameConstants.FormatResourceValue(this.tmpString, this.DM.RoleAttr.m_Soldier[num]);
             for (int i = 0; i < 3; i++)
             {
                 if (this.tmpItem[i].m_BtnID1 == (int)this.DM.SoldierRank)
                 {
                     this.tmpItemtextNum[i * 4 + (int)this.DM.SoldierKind].text = this.tmpString.ToString();
                 }
             }
             this.Cstr_Total.ClearString();
             this.Cstr_Total.IntToFormat(this.DM.SoldierTotal, 1, true);
             this.Cstr_Total.AppendFormat(this.DM.mStringTable.GetStringByID(3873u));
             this.text_Total.text = this.Cstr_Total.ToString();
             this.text_Total.SetAllDirty();
             this.text_Total.cachedTextGenerator.Invalidate();
         }
     }
     else if (this.DM.queueBarData[10].bActive)
     {
         long startTime  = this.DM.queueBarData[10].StartTime;
         long target     = startTime + (long)((ulong)this.DM.queueBarData[10].TotalTime);
         long notifyTime = 0L;
         int  num2       = (int)(this.DM.SoldierKind * 4 + this.DM.SoldierRank);
         this.tmpSD = this.DM.SoldierDataTable.GetRecordByKey((ushort)(num2 + 1));
         CString cstring = StringManager.Instance.StaticString1024();
         StringManager.IntToStr(cstring, (long)((ulong)this.DM.SoldierTrainingQty), 1, true);
         this.tmpString.Length = 0;
         this.tmpString.AppendFormat(this.DM.mStringTable.GetStringByID(4048u), this.DM.mStringTable.GetStringByID((uint)this.tmpSD.Name), cstring.ToString());
         this.GUIM.SetTimerBar(this.timeBar, startTime, target, notifyTime, eTimeBarType.CancelType, this.DM.mStringTable.GetStringByID(4047u), this.tmpString.ToString());
         this.timeBar.gameObject.SetActive(true);
         this.text_Training.gameObject.SetActive(false);
         this.bTraining = true;
     }
     else
     {
         this.GUIM.RemoverTimeBaarToList(this.timeBar);
         this.timeBar.gameObject.SetActive(false);
         this.text_Training.gameObject.SetActive(true);
         this.bTraining = false;
     }
 }
Ejemplo n.º 2
0
 // Token: 0x06002088 RID: 8328 RVA: 0x003DBBD0 File Offset: 0x003D9DD0
 public override void UpdateUI(int arg1, int arg2)
 {
     if (arg1 != 1)
     {
         if (arg1 == 2)
         {
             int num = (int)(this.DM.TrapKind * 4 + this.DM.TrapRank);
             this.tmpString.Length = 0;
             GameConstants.FormatResourceValue(this.tmpString, this.DM.mTrapQty[num]);
             for (int i = 0; i < 3; i++)
             {
                 if (this.tmpItem[i].m_BtnID2 == (int)this.DM.TrapRank && i == (int)this.DM.TrapKind)
                 {
                     this.tmpItemtextNum[i * 3 + (int)this.DM.TrapKind].text = this.tmpString.ToString();
                 }
             }
             this.UnitMax = this.DM.GetMaxTrapValue();
             this.Cstr_TrapValue.ClearString();
             this.Cstr_TrapValue.IntToFormat((long)((ulong)this.DM.TrapTotal), 1, true);
             this.Cstr_TrapValue.IntToFormat((long)((ulong)this.UnitMax), 1, true);
             this.Cstr_TrapValue.AppendFormat(this.DM.mStringTable.GetStringByID(3762u));
             this.text_TrapValue.text = this.Cstr_TrapValue.ToString();
             this.text_TrapValue.SetAllDirty();
             this.text_TrapValue.cachedTextGenerator.Invalidate();
         }
     }
     else if (this.DM.queueBarData[14].bActive)
     {
         long startTime  = this.DM.queueBarData[14].StartTime;
         long num2       = startTime + (long)((ulong)this.DM.queueBarData[14].TotalTime);
         long notifyTime = 0L;
         int  num3       = (int)(this.DM.TrapKind * 4 + this.DM.TrapRank);
         this.tmpSD = this.DM.SoldierDataTable.GetRecordByKey((ushort)(num3 + 17));
         this.Cstr_TimeBar.ClearString();
         this.Cstr_TimeBar.StringToFormat(this.DM.mStringTable.GetStringByID((uint)this.tmpSD.Name));
         this.Cstr_TimeBar.IntToFormat((long)((ulong)this.DM.TrapQuantity), 1, true);
         this.Cstr_TimeBar.AppendFormat(this.DM.mStringTable.GetStringByID(4048u));
         this.GUIM.SetTimerBar(this.timeBar, startTime, num2, notifyTime, eTimeBarType.CancelType, this.DM.mStringTable.GetStringByID(3764u), this.Cstr_TimeBar.ToString());
         this.timeBar.gameObject.SetActive(true);
         this.text_Manufacturing.gameObject.SetActive(false);
     }
     else
     {
         this.GUIM.RemoverTimeBaarToList(this.timeBar);
         this.timeBar.gameObject.SetActive(false);
         this.text_Manufacturing.gameObject.SetActive(true);
     }
 }
Ejemplo n.º 3
0
    // Token: 0x06002086 RID: 8326 RVA: 0x003DB80C File Offset: 0x003D9A0C
    public override void UpdateNetwork(byte[] meg)
    {
        NetworkNews networkNews = (NetworkNews)meg[0];

        switch (networkNews)
        {
        case NetworkNews.Login:
        case NetworkNews.Refresh:
            break;

        default:
            if (networkNews != NetworkNews.Refresh_Trap)
            {
                if (networkNews == NetworkNews.Refresh_FontTextureRebuilt)
                {
                    this.Refresh_FontTexture();
                    if (this.timeBar != null && this.timeBar.enabled)
                    {
                        this.timeBar.Refresh_FontTexture();
                    }
                }
            }
            else
            {
                for (int i = 0; i < 3; i++)
                {
                    for (int j = 0; j < 3; j++)
                    {
                        int num = j * 4 + this.tmpItem[i].m_BtnID1;
                        this.tmpString.Length = 0;
                        GameConstants.FormatResourceValue(this.tmpString, this.DM.mTrapQty[num]);
                        this.tmpItemtextNum[i * 3 + j].text = this.tmpString.ToString();
                    }
                }
                this.UnitMax = this.DM.GetMaxTrapValue();
                this.Cstr_TrapValue.ClearString();
                this.Cstr_TrapValue.IntToFormat((long)((ulong)this.DM.TrapTotal), 1, true);
                this.Cstr_TrapValue.IntToFormat((long)((ulong)this.UnitMax), 1, true);
                this.Cstr_TrapValue.AppendFormat(this.DM.mStringTable.GetStringByID(3762u));
                this.text_TrapValue.text = this.Cstr_TrapValue.ToString();
                this.text_TrapValue.SetAllDirty();
                this.text_TrapValue.cachedTextGenerator.Invalidate();
            }
            break;
        }
    }
Ejemplo n.º 4
0
    // Token: 0x06002B71 RID: 11121 RVA: 0x0047D108 File Offset: 0x0047B308
    public void UpdateResourceData()
    {
        DataManager instance = DataManager.Instance;

        if (this.Type == UIResourceFilter.ResourceFilterType.Single)
        {
            this.ResourceStr[0].ClearString();
            if (this.CurFilterTag == UIResourceFilter.ClickType.PetResource)
            {
                if ((long)this.RequireResource > (long)((ulong)instance.PetResource.Stock))
                {
                    this.ResourceStr[0].StringToFormat("<color=#e5004fff>");
                }
                else
                {
                    this.ResourceStr[0].StringToFormat("<color=#ffffffff>");
                }
            }
            else if ((long)this.RequireResource > (long)((ulong)instance.Resource[(int)this.CurFilterTag].Stock))
            {
                this.ResourceStr[0].StringToFormat("<color=#e5004fff>");
            }
            else
            {
                this.ResourceStr[0].StringToFormat("<color=#ffffffff>");
            }
            switch (this.CurFilterTag)
            {
            case UIResourceFilter.ClickType.Grain:
                this.CurResource = instance.Resource[0].Stock;
                break;

            case UIResourceFilter.ClickType.Rock:
                this.CurResource = instance.Resource[1].Stock;
                break;

            case UIResourceFilter.ClickType.Wood:
                this.CurResource = instance.Resource[2].Stock;
                break;

            case UIResourceFilter.ClickType.Steel:
                this.CurResource = instance.Resource[3].Stock;
                break;

            case UIResourceFilter.ClickType.Money:
                this.CurResource = instance.Resource[4].Stock;
                break;

            case UIResourceFilter.ClickType.PetResource:
                this.CurResource = instance.PetResource.Stock;
                break;
            }
            this.ResourceStr[0].IntToFormat((long)((ulong)this.CurResource), 1, true);
            this.ResourceStr[0].IntToFormat((long)this.RequireResource, 1, true);
            this.ResourceStr[0].StringToFormat("</color>");
            if (GUIManager.Instance.IsArabic)
            {
                this.ResourceStr[0].AppendFormat("{2}/{0}{1}{3}");
            }
            else
            {
                this.ResourceStr[0].AppendFormat("{0}{1}{3}/{2}");
            }
            this.ResourceNum.text = this.ResourceStr[0].ToString();
            this.ResourceNum.SetAllDirty();
            this.ResourceNum.cachedTextGenerator.Invalidate();
            this.ResourceNum.cachedTextGeneratorForLayout.Invalidate();
            Vector2 anchoredPosition = this.SingleResourceImg.rectTransform.anchoredPosition;
            anchoredPosition.Set(-this.ResourceNum.preferredWidth * 0.5f - this.SingleResource.rect.size.x * 0.5f, 0f);
            this.SingleResourceImg.rectTransform.anchoredPosition = anchoredPosition;
        }
        else
        {
            this.ResourceStr[0].ClearString();
            if (instance.Resource[0].Stock < 10000u)
            {
                this.ResourceStr[0].IntToFormat((long)((ulong)instance.Resource[0].Stock), 1, true);
                this.ResourceStr[0].AppendFormat("{0}");
            }
            else
            {
                GameConstants.FormatResourceValue(this.ResourceStr[0], instance.Resource[0].Stock);
            }
            this.ResourceText[0].text = this.ResourceStr[0].ToString();
            this.ResourceStr[1].ClearString();
            if (instance.Resource[2].Stock < 10000u)
            {
                this.ResourceStr[1].IntToFormat((long)((ulong)instance.Resource[2].Stock), 1, true);
                this.ResourceStr[1].AppendFormat("{0}");
            }
            else
            {
                GameConstants.FormatResourceValue(this.ResourceStr[1], instance.Resource[2].Stock);
            }
            this.ResourceText[2].text = this.ResourceStr[1].ToString();
            this.ResourceStr[2].ClearString();
            if (instance.Resource[1].Stock < 10000u)
            {
                this.ResourceStr[2].IntToFormat((long)((ulong)instance.Resource[1].Stock), 1, true);
                this.ResourceStr[2].AppendFormat("{0}");
            }
            else
            {
                GameConstants.FormatResourceValue(this.ResourceStr[2], instance.Resource[1].Stock);
            }
            this.ResourceText[1].text = this.ResourceStr[2].ToString();
            this.ResourceStr[3].ClearString();
            if (instance.Resource[3].Stock < 10000u)
            {
                this.ResourceStr[3].IntToFormat((long)((ulong)instance.Resource[3].Stock), 1, true);
                this.ResourceStr[3].AppendFormat("{0}");
            }
            else
            {
                GameConstants.FormatResourceValue(this.ResourceStr[3], instance.Resource[3].Stock);
            }
            this.ResourceText[3].text = this.ResourceStr[3].ToString();
            this.ResourceStr[4].ClearString();
            if (instance.Resource[4].Stock < 10000u)
            {
                this.ResourceStr[4].IntToFormat((long)((ulong)instance.Resource[4].Stock), 1, true);
                this.ResourceStr[4].AppendFormat("{0}");
            }
            else
            {
                GameConstants.FormatResourceValue(this.ResourceStr[4], instance.Resource[4].Stock);
            }
            this.ResourceText[4].text = this.ResourceStr[4].ToString();
            for (int i = 0; i < this.ResourceText.Length; i++)
            {
                this.ResourceText[i].SetAllDirty();
                this.ResourceText[i].cachedTextGenerator.Invalidate();
            }
        }
    }
Ejemplo n.º 5
0
 // Token: 0x0600207E RID: 8318 RVA: 0x003DB1C8 File Offset: 0x003D93C8
 public void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
 {
     if (panelId == 1)
     {
         if (this.tmpItem[panelObjectIdx] == null)
         {
             this.tmpItem[panelObjectIdx]          = item.GetComponent <ScrollPanelItem>();
             this.tmpItem[panelObjectIdx].m_BtnID2 = panelObjectIdx;
             Transform child;
             for (int i = 0; i < 3; i++)
             {
                 int num  = panelObjectIdx * 3 + i;
                 int num2 = this.tmpItem[panelObjectIdx].m_BtnID1 + i * 4 + 16;
                 this.tmpSD                          = this.DM.SoldierDataTable.GetRecordByKey((ushort)(num2 + 1));
                 child                               = item.transform.GetChild(i);
                 this.tmpItemBtn[num]                = child.GetComponent <UIButton>();
                 this.tmpItemBtn[num].m_Handler      = this;
                 this.tmpItemBtn[num].image.material = this.m_Arms;
                 Transform child2 = child.GetChild(0);
                 this.tmpItemImg_Soldier[num]          = child2.GetComponent <Image>();
                 this.tmpItemImg_Soldier[num].material = this.m_Arms;
                 child2 = child.GetChild(1).GetChild(0);
                 this.tmpItemtextName[num] = child2.GetComponent <UIText>();
                 child2 = child.GetChild(1).GetChild(1);
                 this.tmpItemIcon[num] = child2.GetComponent <Image>();
                 if (num2 / 4 - 4 < 3)
                 {
                     this.tmpItemIcon[num].sprite = this.mIcon[num2 / 4 - 4];
                 }
                 this.tmpItemIcon[num].gameObject.SetActive(true);
                 this.tmpItemtextName[num].rectTransform.anchoredPosition = new Vector2(-52f, this.tmpItemtextName[num].rectTransform.anchoredPosition.y);
                 this.tmpItemtextName[num].rectTransform.sizeDelta        = new Vector2(139f, this.tmpItemtextName[num].rectTransform.sizeDelta.y);
                 child2 = child.GetChild(2).GetChild(0);
                 this.tmpItemtextNum[num] = child2.GetComponent <UIText>();
                 child2 = child.GetChild(3);
                 this.tmpItemImg[num] = child2.GetComponent <Image>();
             }
             child = this.tmpItem[panelObjectIdx].transform.GetChild(3);
             this.tmpItemtextTitle[panelObjectIdx]      = child.GetComponent <UIText>();
             this.tmpItemtextTitle[panelObjectIdx].font = this.TTFont;
         }
         for (int j = 0; j < 3; j++)
         {
             int num  = panelObjectIdx * 3 + j;
             int num2 = this.tmpItem[panelObjectIdx].m_BtnID1 + j * 4 + 16;
             this.tmpSD = this.DM.SoldierDataTable.GetRecordByKey((ushort)(num2 + 1));
             this.tmpItemBtn[num].image.sprite   = this.msprite[num2 - 16];
             this.tmpItemImg_Soldier[num].sprite = this.msprite[num2 - 16];
             this.tmpItemtextName[num].text      = this.DM.mStringTable.GetStringByID((uint)this.tmpSD.Name);
             this.Cstr_Num[num].ClearString();
             GameConstants.FormatResourceValue(this.Cstr_Num[num], this.DM.mTrapQty[num2 - 16]);
             this.tmpItemtextNum[num].text = this.Cstr_Num[num].ToString();
             if (this.tmpSD.Science != 0 && this.DM.GetTechLevel(this.tmpSD.Science) == 0)
             {
                 this.tmpItemImg_Soldier[num].color = Color.gray;
                 this.tmpItemImg[num].gameObject.SetActive(true);
             }
             else
             {
                 this.tmpItemImg_Soldier[num].color = Color.white;
                 this.tmpItemImg[num].gameObject.SetActive(false);
             }
         }
         this.tmpItemtextTitle[panelObjectIdx].text = this.DM.mStringTable.GetStringByID((uint)(3767 + item.GetComponent <ScrollPanelItem>().m_BtnID1));
     }
     else if (dataIdx == (int)((this.GuideSoldierID - 17) % 4))
     {
         item.transform.GetChild(0).gameObject.SetActive(true);
     }
     else
     {
         item.transform.GetChild(0).gameObject.SetActive(false);
     }
 }
Ejemplo n.º 6
0
    // Token: 0x06001DA3 RID: 7587 RVA: 0x0036EA48 File Offset: 0x0036CC48
    public void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
    {
        if (dataIdx > 0)
        {
            this.tmpCR = this.DM.ResourceReportGet(this.mResourcesMax - dataIdx);
        }
        if (this.ItemT[panelObjectIdx] == null)
        {
            this.ItemT[panelObjectIdx]                      = item.GetComponent <Transform>();
            this.mScrollItem[panelObjectIdx]                = item.GetComponent <ScrollPanelItem>();
            this.Itme_PT1[panelObjectIdx]                   = this.ItemT[panelObjectIdx].GetChild(0);
            this.Itme_PT2[panelObjectIdx]                   = this.ItemT[panelObjectIdx].GetChild(1);
            this.Img_ItemTitle[panelObjectIdx]              = this.Itme_PT2[panelObjectIdx].GetChild(0).GetComponent <Image>();
            this.Img_ItemNew[panelObjectIdx]                = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(0).GetComponent <Image>();
            this.text_ItemNew[panelObjectIdx]               = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(0).GetChild(0).GetComponent <UIText>();
            this.text_ItemTitle[panelObjectIdx]             = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(1).GetComponent <UIText>();
            this.Item_textTitleT[panelObjectIdx]            = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(1).GetComponent <RectTransform>();
            this.text_ItemTime[panelObjectIdx]              = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(2).GetComponent <UIText>();
            this.text_ItemTitle2[panelObjectIdx]            = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(3).GetComponent <UIText>();
            this.btn_Hero_Porfile[panelObjectIdx]           = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(4).GetComponent <UIButton>();
            this.btn_Hero_Porfile[panelObjectIdx].m_Handler = this;
            this.btn_Hero_Porfile[panelObjectIdx].m_BtnID2  = this.mResourcesMax - dataIdx;
            this.Item_btnPorfileT[panelObjectIdx]           = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(4).GetComponent <RectTransform>();
            this.Img_ItemPorfile[panelObjectIdx]            = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(4).GetChild(0).GetComponent <Image>();
            this.text_ItemPorfile[panelObjectIdx]           = this.Itme_PT2[panelObjectIdx].GetChild(0).GetChild(4).GetChild(1).GetComponent <UIText>();
            this.Img_ItemBG[panelObjectIdx]                 = this.Itme_PT2[panelObjectIdx].GetChild(1).GetComponent <Image>();
            this.ItemResT[panelObjectIdx]                   = this.Itme_PT2[panelObjectIdx].GetChild(1).GetChild(0);
            this.text_ItemRes_1[panelObjectIdx]             = this.ItemResT[panelObjectIdx].GetChild(0).GetChild(0).GetComponent <UIText>();
            this.text_ItemRes_2[panelObjectIdx]             = this.ItemResT[panelObjectIdx].GetChild(1).GetChild(0).GetComponent <UIText>();
            this.text_ItemRes_3[panelObjectIdx]             = this.ItemResT[panelObjectIdx].GetChild(2).GetChild(0).GetComponent <UIText>();
            this.text_ItemRes_4[panelObjectIdx]             = this.ItemResT[panelObjectIdx].GetChild(3).GetChild(0).GetComponent <UIText>();
            this.text_ItemRes_5[panelObjectIdx]             = this.ItemResT[panelObjectIdx].GetChild(4).GetChild(0).GetComponent <UIText>();
            this.text_Item[panelObjectIdx]                  = this.Itme_PT2[panelObjectIdx].GetChild(1).GetChild(1).GetComponent <UIText>();
            this.Img_ItemIcon1[panelObjectIdx]              = this.Itme_PT2[panelObjectIdx].GetChild(2).GetChild(0).GetComponent <Image>();
            this.Img_ItemIcon2[panelObjectIdx]              = this.Itme_PT2[panelObjectIdx].GetChild(2).GetChild(1).GetComponent <Image>();
            this.Img_ItemIcon3[panelObjectIdx]              = this.Itme_PT2[panelObjectIdx].GetChild(2).GetChild(2).GetComponent <Image>();
            if (dataIdx == 0)
            {
                this.Itme_PT1[panelObjectIdx].gameObject.SetActive(true);
            }
            else
            {
                this.Itme_PT2[panelObjectIdx].gameObject.SetActive(true);
                if (this.tmpCR != null)
                {
                    this.SetItemIcon(panelObjectIdx, (int)this.tmpCR.Resource.Result, true);
                }
                if (this.UnReadNum >= dataIdx)
                {
                    this.Img_ItemNew[panelObjectIdx].gameObject.SetActive(true);
                }
            }
        }
        else
        {
            this.btn_Hero_Porfile[panelObjectIdx].m_BtnID2 = this.mResourcesMax - dataIdx;
            if (dataIdx == 0)
            {
                this.Itme_PT1[panelObjectIdx].gameObject.SetActive(true);
                this.Itme_PT2[panelObjectIdx].gameObject.SetActive(false);
            }
            else
            {
                this.Itme_PT1[panelObjectIdx].gameObject.SetActive(false);
                this.Itme_PT2[panelObjectIdx].gameObject.SetActive(true);
                this.SetItemIcon(panelObjectIdx, this.mScrollItem[panelObjectIdx].m_BtnID2, false);
                if (this.tmpCR != null)
                {
                    this.SetItemIcon(panelObjectIdx, (int)this.tmpCR.Resource.Result, true);
                }
            }
        }
        if (dataIdx > 0)
        {
            if (this.UnReadNum >= dataIdx)
            {
                this.Item_textTitleT[panelObjectIdx].anchoredPosition = this.text_ItemTitle[panelObjectIdx].ArabicFixPos(new Vector2(121f, this.Item_textTitleT[panelObjectIdx].anchoredPosition.y));
                this.Img_ItemNew[panelObjectIdx].gameObject.SetActive(true);
            }
            else
            {
                this.Item_textTitleT[panelObjectIdx].anchoredPosition = this.text_ItemTitle[panelObjectIdx].ArabicFixPos(new Vector2(39f, this.Item_textTitleT[panelObjectIdx].anchoredPosition.y));
                this.Img_ItemNew[panelObjectIdx].gameObject.SetActive(false);
            }
            if (this.tmpCR != null)
            {
                this.Cstr_ItemName[panelObjectIdx].ClearString();
                this.Cstr_ItemName[panelObjectIdx].Append(this.tmpCR.Resource.Name);
                this.Cstr_ItemTitle[panelObjectIdx].ClearString();
                this.text_ItemTitle2[panelObjectIdx].gameObject.SetActive(false);
                switch (this.tmpCR.Resource.Result)
                {
                case 0:
                    this.Cstr_ItemTitle[panelObjectIdx].Append(this.DM.mStringTable.GetStringByID(12084u));
                    break;

                case 1:
                    this.Cstr_ItemTitle[panelObjectIdx].Append(this.DM.mStringTable.GetStringByID(12085u));
                    break;

                case 2:
                    this.Cstr_ItemTitle[panelObjectIdx].Append(this.DM.mStringTable.GetStringByID(12082u));
                    break;
                }
                this.text_ItemTitle[panelObjectIdx].text = this.Cstr_ItemTitle[panelObjectIdx].ToString();
                this.text_ItemTitle[panelObjectIdx].SetAllDirty();
                this.text_ItemTitle[panelObjectIdx].cachedTextGenerator.Invalidate();
                this.text_ItemTitle[panelObjectIdx].cachedTextGeneratorForLayout.Invalidate();
                this.text_ItemPorfile[panelObjectIdx].text = this.Cstr_ItemName[panelObjectIdx].ToString();
                this.text_ItemPorfile[panelObjectIdx].SetAllDirty();
                this.text_ItemPorfile[panelObjectIdx].cachedTextGenerator.Invalidate();
                this.text_ItemPorfile[panelObjectIdx].cachedTextGeneratorForLayout.Invalidate();
                this.text_ItemPorfile[panelObjectIdx].rectTransform.sizeDelta = new Vector2(this.text_ItemPorfile[panelObjectIdx].preferredWidth + 1f, this.text_ItemPorfile[panelObjectIdx].rectTransform.sizeDelta.y);
                if (this.GUIM.IsArabic)
                {
                    this.text_ItemPorfile[panelObjectIdx].UpdateArabicPos();
                }
                this.Item_btnPorfileT[panelObjectIdx].sizeDelta = new Vector2(this.text_ItemPorfile[panelObjectIdx].preferredWidth + 1f, this.Item_btnPorfileT[panelObjectIdx].sizeDelta.y);
                this.Img_ItemPorfile[panelObjectIdx].rectTransform.sizeDelta = new Vector2(this.text_ItemPorfile[panelObjectIdx].preferredWidth + 1f, this.Img_ItemPorfile[panelObjectIdx].rectTransform.sizeDelta.y);
                if (this.GUIM.IsArabic && this.text_ItemTitle[panelObjectIdx].rectTransform.localScale.x == -1f)
                {
                    this.Item_btnPorfileT[panelObjectIdx].anchoredPosition = new Vector2(this.text_ItemTitle[panelObjectIdx].rectTransform.anchoredPosition.x - this.text_ItemTitle[panelObjectIdx].rectTransform.sizeDelta.x + this.text_ItemTitle[panelObjectIdx].preferredWidth + 1f, this.Item_btnPorfileT[panelObjectIdx].anchoredPosition.y);
                }
                else
                {
                    this.Item_btnPorfileT[panelObjectIdx].anchoredPosition = new Vector2(this.text_ItemTitle[panelObjectIdx].rectTransform.anchoredPosition.x + this.text_ItemTitle[panelObjectIdx].preferredWidth + 1f, this.Item_btnPorfileT[panelObjectIdx].anchoredPosition.y);
                }
                this.text_ItemTime[panelObjectIdx].text = GameConstants.GetDateTime(this.tmpCR.Times).ToString("MM/dd/yy HH:mm:ss");
                this.text_ItemTime[panelObjectIdx].SetAllDirty();
                this.text_ItemTime[panelObjectIdx].cachedTextGenerator.Invalidate();
                if (this.tmpCR.Resource.Result < 2)
                {
                    this.Cstr_ItemRes_1[panelObjectIdx].ClearString();
                    GameConstants.FormatResourceValue(this.Cstr_ItemRes_1[panelObjectIdx], this.tmpCR.Resource.Resource[0]);
                    this.text_ItemRes_1[panelObjectIdx].text = this.Cstr_ItemRes_1[panelObjectIdx].ToString();
                    this.text_ItemRes_1[panelObjectIdx].SetAllDirty();
                    this.text_ItemRes_1[panelObjectIdx].cachedTextGenerator.Invalidate();
                    this.Cstr_ItemRes_2[panelObjectIdx].ClearString();
                    GameConstants.FormatResourceValue(this.Cstr_ItemRes_2[panelObjectIdx], this.tmpCR.Resource.Resource[1]);
                    this.text_ItemRes_2[panelObjectIdx].text = this.Cstr_ItemRes_2[panelObjectIdx].ToString();
                    this.text_ItemRes_2[panelObjectIdx].SetAllDirty();
                    this.text_ItemRes_2[panelObjectIdx].cachedTextGenerator.Invalidate();
                    this.Cstr_ItemRes_3[panelObjectIdx].ClearString();
                    GameConstants.FormatResourceValue(this.Cstr_ItemRes_3[panelObjectIdx], this.tmpCR.Resource.Resource[2]);
                    this.text_ItemRes_3[panelObjectIdx].text = this.Cstr_ItemRes_3[panelObjectIdx].ToString();
                    this.text_ItemRes_3[panelObjectIdx].SetAllDirty();
                    this.text_ItemRes_3[panelObjectIdx].cachedTextGenerator.Invalidate();
                    this.Cstr_ItemRes_4[panelObjectIdx].ClearString();
                    GameConstants.FormatResourceValue(this.Cstr_ItemRes_4[panelObjectIdx], this.tmpCR.Resource.Resource[3]);
                    this.text_ItemRes_4[panelObjectIdx].text = this.Cstr_ItemRes_4[panelObjectIdx].ToString();
                    this.text_ItemRes_4[panelObjectIdx].SetAllDirty();
                    this.text_ItemRes_4[panelObjectIdx].cachedTextGenerator.Invalidate();
                    this.Cstr_ItemRes_5[panelObjectIdx].ClearString();
                    GameConstants.FormatResourceValue(this.Cstr_ItemRes_5[panelObjectIdx], this.tmpCR.Resource.Resource[4]);
                    this.text_ItemRes_5[panelObjectIdx].text = this.Cstr_ItemRes_5[panelObjectIdx].ToString();
                    this.text_ItemRes_5[panelObjectIdx].SetAllDirty();
                    this.text_ItemRes_5[panelObjectIdx].cachedTextGenerator.Invalidate();
                    this.ItemResT[panelObjectIdx].gameObject.SetActive(true);
                    this.text_Item[panelObjectIdx].gameObject.SetActive(false);
                }
                else
                {
                    this.ItemResT[panelObjectIdx].gameObject.SetActive(false);
                    this.text_Item[panelObjectIdx].gameObject.SetActive(true);
                }
            }
        }
    }
Ejemplo n.º 7
0
    // Token: 0x06001951 RID: 6481 RVA: 0x002AA204 File Offset: 0x002A8404
    public override void UpdateNetwork(byte[] meg)
    {
        NetworkNews networkNews = (NetworkNews)meg[0];

        switch (networkNews)
        {
        case NetworkNews.Refresh_Soldier:
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    int num = j * 4 + this.tmpItem[i].m_BtnID1;
                    this.tmpString.Length = 0;
                    GameConstants.FormatResourceValue(this.tmpString, this.DM.RoleAttr.m_Soldier[num]);
                    this.tmpItemtextNum[i * 4 + j].text = this.tmpString.ToString();
                }
            }
            this.Cstr_Total.ClearString();
            this.Cstr_Total.IntToFormat(this.DM.SoldierTotal, 1, true);
            this.Cstr_Total.AppendFormat(this.DM.mStringTable.GetStringByID(3873u));
            this.text_Total.text = this.Cstr_Total.ToString();
            this.text_Total.SetAllDirty();
            this.text_Total.cachedTextGenerator.Invalidate();
            break;

        default:
            if (networkNews != NetworkNews.Login)
            {
                if (networkNews != NetworkNews.Refresh_AttribEffectVal)
                {
                    if (networkNews == NetworkNews.Refresh_FontTextureRebuilt)
                    {
                        this.Refresh_FontTexture();
                        if (this.baseBuild != null)
                        {
                            this.baseBuild.Refresh_FontTexture();
                        }
                        if (this.timeBar != null && this.timeBar.enabled)
                        {
                            this.timeBar.Refresh_FontTexture();
                        }
                    }
                }
                else if (this.baseBuild != null)
                {
                    this.baseBuild.MyUpdate(0, false);
                }
            }
            else
            {
                if (this.DM.queueBarData[10].bActive)
                {
                    long startTime  = this.DM.queueBarData[10].StartTime;
                    long target     = startTime + (long)((ulong)this.DM.queueBarData[10].TotalTime);
                    long notifyTime = 0L;
                    int  num2       = (int)(this.DM.SoldierKind * 4 + this.DM.SoldierRank);
                    this.tmpSD = this.DM.SoldierDataTable.GetRecordByKey((ushort)(num2 + 1));
                    CString cstring = StringManager.Instance.StaticString1024();
                    StringManager.IntToStr(cstring, (long)((ulong)this.DM.SoldierTrainingQty), 1, true);
                    this.tmpString.Length = 0;
                    this.tmpString.AppendFormat(this.DM.mStringTable.GetStringByID(4048u), this.DM.mStringTable.GetStringByID((uint)this.tmpSD.Name), cstring.ToString());
                    this.GUIM.SetTimerBar(this.timeBar, startTime, target, notifyTime, eTimeBarType.CancelType, this.DM.mStringTable.GetStringByID(4047u), this.tmpString.ToString());
                    this.timeBar.gameObject.SetActive(true);
                    this.text_Training.gameObject.SetActive(false);
                    this.bTraining = true;
                }
                else
                {
                    this.GUIM.RemoverTimeBaarToList(this.timeBar);
                    this.timeBar.gameObject.SetActive(false);
                    this.text_Training.gameObject.SetActive(true);
                    this.bTraining = false;
                }
                int num3 = (int)(this.DM.SoldierKind * 4 + this.DM.SoldierRank);
                this.tmpString.Length = 0;
                GameConstants.FormatResourceValue(this.tmpString, this.DM.RoleAttr.m_Soldier[num3]);
                for (int k = 0; k < 3; k++)
                {
                    if (this.tmpItem[k].m_BtnID1 == (int)this.DM.SoldierRank)
                    {
                        this.tmpItemtextNum[k * 4 + (int)this.DM.SoldierKind].text = this.tmpString.ToString();
                    }
                }
                this.Cstr_Total.ClearString();
                this.Cstr_Total.IntToFormat(this.DM.SoldierTotal, 1, true);
                this.Cstr_Total.AppendFormat(this.DM.mStringTable.GetStringByID(3873u));
                this.text_Total.text = this.Cstr_Total.ToString();
                this.text_Total.SetAllDirty();
                this.text_Total.cachedTextGenerator.Invalidate();
            }
            break;

        case NetworkNews.Refresh_BuildBase:
            if (meg[1] == 1)
            {
                this.door.CloseMenu(true);
            }
            else if (this.baseBuild != null)
            {
                this.baseBuild.MyUpdate(meg[1], false);
            }
            break;
        }
    }
Ejemplo n.º 8
0
 // Token: 0x06001946 RID: 6470 RVA: 0x002A9B08 File Offset: 0x002A7D08
 public void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
 {
     if (panelId == 1)
     {
         if (this.tmpItem[panelObjectIdx] == null)
         {
             this.tmpItem[panelObjectIdx] = item.GetComponent <ScrollPanelItem>();
             Transform child;
             for (int i = 0; i < 4; i++)
             {
                 int num = panelObjectIdx * 4 + i;
                 child = item.transform.GetChild(i);
                 this.tmpItemBtn[num]                = child.GetComponent <UIButton>();
                 this.tmpItemBtn[num].m_Handler      = this;
                 this.tmpItemBtn[num].image.material = this.m_Arms;
                 Transform child2 = child.GetChild(0);
                 this.tmpItemImg_Soldier[num] = child2.GetComponent <Image>();
                 child2 = child.GetChild(1).GetChild(0);
                 this.tmpItemtextName[num] = child2.GetComponent <UIText>();
                 int num2 = this.tmpItem[panelObjectIdx].m_BtnID1 + i * 4;
                 this.tmpSD                   = this.DM.SoldierDataTable.GetRecordByKey((ushort)(num2 + 1));
                 child2                       = child.GetChild(1).GetChild(1);
                 this.tmpItemIcon[num]        = child2.GetComponent <Image>();
                 this.tmpItemIcon[num].sprite = this.SArray.m_Sprites[num2 / 4];
                 this.tmpItemIcon[num].gameObject.SetActive(true);
                 this.tmpItemtextName[num].rectTransform.anchoredPosition = new Vector2(-52f, this.tmpItemtextName[num].rectTransform.anchoredPosition.y);
                 this.tmpItemtextName[num].rectTransform.sizeDelta        = new Vector2(139f, this.tmpItemtextName[num].rectTransform.sizeDelta.y);
                 child2 = child.GetChild(2).GetChild(0);
                 this.tmpItemtextNum[num] = child2.GetComponent <UIText>();
                 child2 = child.GetChild(3);
                 this.tmpItemImg[num] = child2.GetComponent <Image>();
             }
             child = this.tmpItem[panelObjectIdx].transform.GetChild(5);
             this.tmpItemtextTitle[panelObjectIdx]      = child.GetComponent <UIText>();
             this.tmpItemtextTitle[panelObjectIdx].font = this.TTFont;
         }
         for (int j = 0; j < 4; j++)
         {
             int num = panelObjectIdx * 4 + j;
             this.tmpString.Length = 0;
             this.tmpString.AppendFormat("q10{0:000}", j * 100 + (dataIdx + 1) * 10);
             this.tmpItemBtn[num].image.sprite   = this.GUIM.LoadSprite("UI_arms", this.tmpString.ToString());
             this.tmpItemImg_Soldier[num].sprite = this.GUIM.LoadSprite("UI_arms", this.tmpString.ToString());
             int num2 = this.tmpItem[panelObjectIdx].m_BtnID1 + j * 4;
             this.tmpSD = this.DM.SoldierDataTable.GetRecordByKey((ushort)(num2 + 1));
             this.tmpItemtextName[num].text = this.DM.mStringTable.GetStringByID((uint)this.tmpSD.Name);
             this.tmpString.Length          = 0;
             GameConstants.FormatResourceValue(this.tmpString, this.DM.RoleAttr.m_Soldier[num2]);
             this.tmpItemtextNum[num].text = this.tmpString.ToString();
             if (this.tmpSD.Science != 0 && this.DM.GetTechLevel(this.tmpSD.Science) == 0)
             {
                 this.tmpItemImg_Soldier[num].color = Color.gray;
                 this.tmpItemImg[num].gameObject.SetActive(true);
             }
             else
             {
                 this.tmpItemImg_Soldier[num].color = Color.white;
                 this.tmpItemImg[num].gameObject.SetActive(false);
             }
         }
         this.tmpItemtextTitle[panelObjectIdx].text = this.DM.mStringTable.GetStringByID((uint)(3834 + item.GetComponent <ScrollPanelItem>().m_BtnID1));
     }
     else if (dataIdx == (int)((this.GuideSoldierID - 1) % 4))
     {
         item.transform.GetChild(0).gameObject.SetActive(true);
     }
     else
     {
         item.transform.GetChild(0).gameObject.SetActive(false);
     }
 }