コード例 #1
0
    private void OnEnable()
    {
        this.m_characterName.set_text(GarrisonStatus.CharacterName());
        if (Main.instance.GetLocale() == "frFR")
        {
            this.m_characterClassName.set_text(string.Concat(new string[]
            {
                GarrisonStatus.CharacterClassName(),
                " ",
                StaticDB.GetString("LEVEL", null),
                " ",
                GarrisonStatus.CharacterLevel().ToString()
            }));
        }
        else
        {
            this.m_characterClassName.set_text(GeneralHelpers.TextOrderString(StaticDB.GetString("LEVEL", null), GarrisonStatus.CharacterLevel().ToString()) + " " + GarrisonStatus.CharacterClassName());
        }
        this.m_characterListButton.set_text(StaticDB.GetString("CHARACTER_LIST", null));
        Sprite sprite = GeneralHelpers.LoadClassIcon(GarrisonStatus.CharacterClassID());

        if (sprite != null)
        {
            this.m_classIcon.set_sprite(sprite);
        }
    }
コード例 #2
0
    private void InitPlayerDisplay(int playerLevel)
    {
        this.m_characterName.text = GarrisonStatus.CharacterName();
        if (Main.instance.GetLocale() == "frFR")
        {
            this.m_characterClassName.text = string.Concat(new string[]
            {
                GarrisonStatus.CharacterClassName(),
                " ",
                StaticDB.GetString("LEVEL", null),
                " ",
                playerLevel.ToString()
            });
        }
        else
        {
            this.m_characterClassName.text = GeneralHelpers.TextOrderString(StaticDB.GetString("LEVEL", null), playerLevel.ToString()) + " " + GarrisonStatus.CharacterClassName();
        }
        this.m_characterListButton.text = StaticDB.GetString("CHARACTER_LIST", null);
        Sprite sprite = GeneralHelpers.LoadClassIcon(GarrisonStatus.CharacterClassID());

        if (sprite != null)
        {
            this.m_classIcon.sprite = sprite;
        }
    }
コード例 #3
0
    public static int GetAbilityToCounterMechanicType(int garrMechanicTypeID)
    {
        int counterWithThisAbilityID = 0;

        StaticDB.garrFollowerDB.EnumRecords(delegate(GarrFollowerRec garrFollowerRec)
        {
            if (garrFollowerRec.GarrFollowerTypeID != 4u)
            {
                return(true);
            }
            if (garrFollowerRec.ChrClassID != GarrisonStatus.CharacterClassID() && garrFollowerRec.ChrClassID != 0)
            {
                return(true);
            }
            StaticDB.garrFollowerXAbilityDB.EnumRecordsByParentID(garrFollowerRec.ID, delegate(GarrFollowerXAbilityRec xAbilityRec)
            {
                StaticDB.garrAbilityEffectDB.EnumRecords(delegate(GarrAbilityEffectRec garrAbilityEffectRec)
                {
                    if (garrAbilityEffectRec.GarrMechanicTypeID == 0u)
                    {
                        return(true);
                    }
                    if (garrAbilityEffectRec.AbilityAction != 0u)
                    {
                        return(true);
                    }
                    if ((ulong)garrAbilityEffectRec.GarrAbilityID == (ulong)((long)xAbilityRec.GarrAbilityID) && (ulong)garrAbilityEffectRec.GarrMechanicTypeID == (ulong)((long)garrMechanicTypeID))
                    {
                        counterWithThisAbilityID = xAbilityRec.GarrAbilityID;
                        return(false);
                    }
                    return(true);
                });
                return(counterWithThisAbilityID == 0);
            });
            return(counterWithThisAbilityID == 0);
        });
        return(counterWithThisAbilityID);
    }
コード例 #4
0
    private void InitTalentTree()
    {
        this.m_needsFullInit = false;
        Sprite sprite = this.LoadTalengBGForClass(GarrisonStatus.CharacterClassID());

        if (sprite != null)
        {
            this.m_classBG.sprite = sprite;
        }
        TalentTreeItem[] componentsInChildren = this.m_talentTreeItemRoot.GetComponentsInChildren <TalentTreeItem>(true);
        foreach (TalentTreeItem talentTreeItem in componentsInChildren)
        {
            Object.DestroyImmediate(talentTreeItem.gameObject);
        }
        Image[] componentsInChildren2 = this.m_romanNumeralRoot.GetComponentsInChildren <Image>(true);
        foreach (Image image in componentsInChildren2)
        {
            Object.DestroyImmediate(image.gameObject);
        }
        GarrTalentTreeRec treeRec = null;

        StaticDB.garrTalentTreeDB.EnumRecords(delegate(GarrTalentTreeRec garrTalentTreeRec)
        {
            if (garrTalentTreeRec.ClassID == GarrisonStatus.CharacterClassID())
            {
                treeRec = garrTalentTreeRec;
                return(false);
            }
            return(true);
        });
        if (treeRec == null)
        {
            Debug.LogError("No GarrTalentTree record found for class " + GarrisonStatus.CharacterClassID());
            return;
        }
        this.m_talentTreeItems = new List <TalentTreeItem>();
        for (int k = 0; k < treeRec.MaxTiers; k++)
        {
            GameObject gameObject = Object.Instantiate <GameObject>(this.m_talentTreeItemPrefab);
            gameObject.transform.SetParent(this.m_talentTreeItemRoot.transform, false);
            TalentTreeItem component = gameObject.GetComponent <TalentTreeItem>();
            this.m_talentTreeItems.Add(component);
            switch (k)
            {
            case 0:
                component.m_talentTier.sprite = Resources.Load <Sprite>("OrderAdvancement/Number-One");
                break;

            case 1:
                component.m_talentTier.sprite = Resources.Load <Sprite>("OrderAdvancement/Number-Two");
                break;

            case 2:
                component.m_talentTier.sprite = Resources.Load <Sprite>("OrderAdvancement/Number-Three");
                break;

            case 3:
                component.m_talentTier.sprite = Resources.Load <Sprite>("OrderAdvancement/Number-Four");
                break;

            case 4:
                component.m_talentTier.sprite = Resources.Load <Sprite>("OrderAdvancement/Number-Five");
                break;

            case 5:
                component.m_talentTier.sprite = Resources.Load <Sprite>("OrderAdvancement/Number-Six");
                break;

            case 6:
                component.m_talentTier.sprite = Resources.Load <Sprite>("OrderAdvancement/Number-Seven");
                break;

            case 7:
                component.m_talentTier.sprite = Resources.Load <Sprite>("OrderAdvancement/Number-Eight");
                break;
            }
        }
        StaticDB.garrTalentDB.EnumRecordsByParentID(treeRec.ID, delegate(GarrTalentRec garrTalentRec)
        {
            this.m_talentTreeItems[garrTalentRec.Tier].SetTalent(garrTalentRec);
            MobilePlayerCanResearchGarrisonTalent mobilePlayerCanResearchGarrisonTalent = new MobilePlayerCanResearchGarrisonTalent();
            mobilePlayerCanResearchGarrisonTalent.GarrTalentID = garrTalentRec.ID;
            Login.instance.SendToMobileServer(mobilePlayerCanResearchGarrisonTalent);
            return(true);
        });
        foreach (TalentTreeItem talentTreeItem2 in this.m_talentTreeItems)
        {
            talentTreeItem2.UpdateVisualStates();
        }
    }
コード例 #5
0
    private void InitTalentTree()
    {
        this.m_needsFullInit = false;
        Sprite sprite = this.LoadTalengBGForClass(GarrisonStatus.CharacterClassID());

        if (sprite != null)
        {
            this.m_classBG.set_sprite(sprite);
        }
        TalentTreeItem[] componentsInChildren = this.m_talentTreeItemRoot.GetComponentsInChildren <TalentTreeItem>(true);
        TalentTreeItem[] array = componentsInChildren;
        for (int i = 0; i < array.Length; i++)
        {
            TalentTreeItem talentTreeItem = array[i];
            Object.DestroyImmediate(talentTreeItem.get_gameObject());
        }
        Image[] componentsInChildren2 = this.m_romanNumeralRoot.GetComponentsInChildren <Image>(true);
        Image[] array2 = componentsInChildren2;
        for (int j = 0; j < array2.Length; j++)
        {
            Image image = array2[j];
            Object.DestroyImmediate(image.get_gameObject());
        }
        GarrTalentTreeRec treeRec = null;

        StaticDB.garrTalentTreeDB.EnumRecords(delegate(GarrTalentTreeRec garrTalentTreeRec)
        {
            if (garrTalentTreeRec.ClassID == GarrisonStatus.CharacterClassID())
            {
                treeRec = garrTalentTreeRec;
                return(false);
            }
            return(true);
        });
        if (treeRec == null)
        {
            Debug.LogError("No GarrTalentTree record found for class " + GarrisonStatus.CharacterClassID());
            return;
        }
        this.m_talentTreeItems = new List <TalentTreeItem>();
        for (int k = 0; k < treeRec.MaxTiers; k++)
        {
            GameObject gameObject = Object.Instantiate <GameObject>(this.m_talentTreeItemPrefab);
            gameObject.get_transform().SetParent(this.m_talentTreeItemRoot.get_transform(), false);
            TalentTreeItem component = gameObject.GetComponent <TalentTreeItem>();
            this.m_talentTreeItems.Add(component);
            if (k < this.m_romanNumeralPrefabs.Length)
            {
                GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_romanNumeralPrefabs[k]);
                gameObject2.get_transform().SetParent(this.m_romanNumeralRoot.get_transform(), false);
            }
        }
        StaticDB.garrTalentDB.EnumRecordsByParentID(treeRec.ID, delegate(GarrTalentRec garrTalentRec)
        {
            this.m_talentTreeItems.get_Item(garrTalentRec.Tier).SetTalent(garrTalentRec);
            MobilePlayerCanResearchGarrisonTalent mobilePlayerCanResearchGarrisonTalent = new MobilePlayerCanResearchGarrisonTalent();
            mobilePlayerCanResearchGarrisonTalent.GarrTalentID = garrTalentRec.ID;
            Login.instance.SendToMobileServer(mobilePlayerCanResearchGarrisonTalent);
            return(true);
        });
        using (List <TalentTreeItem> .Enumerator enumerator = this.m_talentTreeItems.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                TalentTreeItem current = enumerator.get_Current();
                current.UpdateVisualStates();
            }
        }
    }
コード例 #6
0
    private void Start()
    {
        this.m_numReadyTroops = 0;
        this.m_numReadyTroopsText.set_text(string.Empty);
        this.m_numReadyTroopsTextBG.SetActive(false);
        int num = 0;

        switch (GarrisonStatus.CharacterClassID())
        {
        case 1:
            num = 6001;
            break;

        case 2:
            num = 6002;
            break;

        case 3:
            num = 5998;
            break;

        case 4:
            num = 6007;
            break;

        case 5:
            num = 5999;
            break;

        case 6:
            num = 6000;
            break;

        case 7:
            num = 0;
            break;

        case 8:
            num = 6006;
            break;

        case 9:
            num = 6003;
            break;

        case 10:
            num = 6005;
            break;

        case 11:
            num = 6004;
            break;

        case 12:
            num = 0;
            break;
        }
        if (num > 0)
        {
            Sprite atlasSprite = TextureAtlas.instance.GetAtlasSprite(num);
            if (atlasSprite != null)
            {
                Image component = this.m_theActualButton.GetComponent <Image>();
                component.set_sprite(atlasSprite);
            }
        }
    }