Exemple #1
0
    // Token: 0x060005A3 RID: 1443 RVA: 0x00078BD0 File Offset: 0x00076DD0
    public int Compare(byte x, byte y)
    {
        DataManager instance       = DataManager.Instance;
        TechKindTbl recordByIndex  = instance.TechKindData.GetRecordByIndex((int)x);
        TechKindTbl recordByIndex2 = instance.TechKindData.GetRecordByIndex((int)y);

        if (recordByIndex.Priority < recordByIndex2.Priority)
        {
            return(-1);
        }
        if (recordByIndex.Priority > recordByIndex2.Priority)
        {
            return(1);
        }
        return(0);
    }
Exemple #2
0
    // Token: 0x0600204E RID: 8270 RVA: 0x003D3FC4 File Offset: 0x003D21C4
    public void UpDateRowItem(GameObject item, int dataIdx, int panelObjectIdx, int panelId)
    {
        Transform transform = item.transform;

        if (this.TechItem[panelObjectIdx].TechImg == null)
        {
            this.TechItem[panelObjectIdx].Init();
        }
        this.TechItem[panelObjectIdx].dataIndex = dataIdx;
        this.TechItem[panelObjectIdx].transform = transform;
        byte b = 0;

        while ((int)b < this.TechItem[panelObjectIdx].KindName.Length)
        {
            uint num = (uint)(dataIdx * 4 + (int)b);
            if (this.TechItem[panelObjectIdx].TechImg[(int)b] == null)
            {
                transform.GetChild((int)b).GetComponent <UIButton>().m_Handler = this;
                this.TechItem[panelObjectIdx].TechImg[(int)b]    = transform.GetChild((int)b).GetComponent <Image>();
                this.TechItem[panelObjectIdx].Button[(int)b]     = transform.GetChild((int)b).GetComponent <UIButton>();
                this.TechItem[panelObjectIdx].Research[(int)b]   = transform.GetChild((int)b).GetChild(1).GetComponent <RectTransform>();
                this.TechItem[panelObjectIdx].Lock[(int)b]       = transform.GetChild((int)b).GetChild(2);
                this.TechItem[panelObjectIdx].NeedLvText[(int)b] = transform.GetChild((int)b).GetChild(2).GetChild(1).GetComponent <UIText>();
                this.TechItem[panelObjectIdx].KindName[(int)b]   = transform.GetChild((int)b).GetChild(0).GetComponent <UIText>();
            }
            if (num >= (uint)this.KindDataCount)
            {
                transform.GetChild((int)b).gameObject.SetActive(false);
            }
            else
            {
                transform.GetChild((int)b).gameObject.SetActive(true);
                DataManager instance      = DataManager.Instance;
                TechKindTbl recordByIndex = instance.TechKindData.GetRecordByIndex((int)instance.sortTechKindIndex[(int)((ushort)num)]);
                this.TechItem[panelObjectIdx].TechImg[(int)b].sprite = this.SpriteArray.GetSprite((int)(recordByIndex.Graphic - 1));
                if (this.TechItem[panelObjectIdx].TechImg[(int)b].sprite == null)
                {
                    this.TechItem[panelObjectIdx].TechImg[(int)b].sprite = this.SpriteArray.GetSprite(0);
                }
                this.TechItem[panelObjectIdx].TechImg[(int)b].SetNativeSize();
                this.TechItem[panelObjectIdx].Button[(int)b].m_BtnID1 = (int)recordByIndex.TechKind;
                this.TechItem[panelObjectIdx].KindName[(int)b].text   = instance.mStringTable.GetStringByID((uint)recordByIndex.KindName);
                this.TechItem[panelObjectIdx].Button[(int)b].m_BtnID2 = (int)recordByIndex.KindName;
                if (this.ResearchTechKind > 0 && this.TechItem[panelObjectIdx].Button[(int)b].m_BtnID1 == (int)this.ResearchTechKind)
                {
                    this.TechItem[panelObjectIdx].Research[(int)b].gameObject.SetActive(true);
                }
                else
                {
                    this.TechItem[panelObjectIdx].Research[(int)b].gameObject.SetActive(false);
                }
                if (recordByIndex.ResearchLevel > this.GUIM.BuildingData.GetBuildData(10, 0).Level)
                {
                    this.TechItem[panelObjectIdx].Lock[(int)b].gameObject.SetActive(true);
                    this.TechItem[panelObjectIdx].NeedLvStr[(int)b].ClearString();
                    this.TechItem[panelObjectIdx].NeedLvStr[(int)b].IntToFormat((long)recordByIndex.ResearchLevel, 1, false);
                    this.TechItem[panelObjectIdx].NeedLvStr[(int)b].AppendFormat(instance.mStringTable.GetStringByID(5008u));
                    this.TechItem[panelObjectIdx].NeedLvText[(int)b].text = this.TechItem[panelObjectIdx].NeedLvStr[(int)b].ToString();
                    this.TechItem[panelObjectIdx].NeedLvText[(int)b].SetAllDirty();
                    this.TechItem[panelObjectIdx].NeedLvText[(int)b].cachedTextGenerator.Invalidate();
                }
                else if (!DataManager.Instance.CheckTechKind(ref recordByIndex, this.TechItem[panelObjectIdx].NeedLvStr[(int)b]))
                {
                    this.TechItem[panelObjectIdx].Lock[(int)b].gameObject.SetActive(true);
                    this.TechItem[panelObjectIdx].NeedLvText[(int)b].text = this.TechItem[panelObjectIdx].NeedLvStr[(int)b].ToString();
                    this.TechItem[panelObjectIdx].NeedLvText[(int)b].SetAllDirty();
                    this.TechItem[panelObjectIdx].NeedLvText[(int)b].cachedTextGenerator.Invalidate();
                }
                else
                {
                    this.TechItem[panelObjectIdx].Lock[(int)b].gameObject.SetActive(false);
                }
            }
            b += 1;
        }
    }