Exemple #1
0
    private unsafe void InitGodsChoice()
    {
        m_playableGods.Clear();
        List <string> list = new List <string>();
        God           god  = PlayerData.instance.god;
        int           num  = -1;
        int           num2 = 0;

        foreach (GodDefinition value in RuntimeData.godDefinitions.Values)
        {
            if (value.playable)
            {
                m_playableGods.Add(value.god);
                list.Add(RuntimeData.FormattedText(value.i18nNameId));
                if (value.god == god)
                {
                    num = num2;
                }
                num2++;
            }
        }
        m_godChoiceDropdown.ClearOptions();
        m_godChoiceDropdown.AddOptions(list);
        m_godChoiceDropdown.value = ((num >= 0) ? num : 0);
        m_godChoiceDropdown.onValueChanged.AddListener(new UnityAction <int>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/));
    }
Exemple #2
0
        private void InitDecks()
        {
            m_deckList = new List <DeckInfo>();
            m_decksDropDown.ClearOptions();
            God god           = PlayerData.instance.god;
            int currentWeapon = PlayerData.instance.GetCurrentWeapon();

            if (RuntimeData.weaponDefinitions.TryGetValue(currentWeapon, out WeaponDefinition value))
            {
                if (RuntimeData.squadDefinitions.TryGetValue(value.defaultDeck.value, out SquadDefinition value2))
                {
                    DeckInfo deckInfo = value2.ToDeckInfo();
                    deckInfo.Id = -value2.get_id();
                    m_deckList.Add(deckInfo);
                }
                foreach (DeckInfo deck in PlayerData.instance.GetDecks())
                {
                    if (deck.Weapon == currentWeapon)
                    {
                        m_deckList.Add(deck);
                    }
                }
                int selectedDeckId = PlayerData.instance.GetSelectedDeckByWeapon(value.get_id());
                int num            = -1;
                num = m_deckList.FindIndex((DeckInfo deck) => deck.Id == selectedDeckId);
                if (m_decksDropDown != null)
                {
                    m_decksDropDown.AddOptions((from sd in m_deckList
                                                select sd.Name).ToList());
                    m_decksDropDown.value = num;
                }
            }
        }
Exemple #3
0
        private void InitGodsChoice()
        {
            m_playableGods.Clear();
            List <string> list = new List <string>();
            God           god  = PlayerData.instance.god;
            int           num  = -1;
            int           num2 = 0;

            foreach (GodDefinition value in RuntimeData.godDefinitions.Values)
            {
                if (value.playable)
                {
                    m_playableGods.Add(value.god);
                    list.Add(RuntimeData.FormattedText(value.i18nNameId));
                    if (value.god == god)
                    {
                        num = num2;
                    }
                    num2++;
                }
            }
            m_godChoiceDropdown.ClearOptions();
            m_godChoiceDropdown.AddOptions(list);
            m_godChoiceDropdown.value = ((num >= 0) ? num : 0);
            int currentWeapon = PlayerData.instance.GetCurrentWeapon();

            InitWeapons(currentWeapon);
        }
Exemple #4
0
 void Start()
 {
     PanelDropdownSelector.ClearOptions();
     foreach (var panel in panels)
     {
         PanelDropdownSelector.AddOption(panel.name);
     }
     PanelDropdownSelector.OnSelectedOptionChanged.AddListener(OnPanelChange);
 }
Exemple #5
0
        private void InitWeapons(int selectedWeaponId)
        {
            m_weaponList = new List <WeaponDefinition>();
            m_weaponsDropdown.ClearOptions();
            God god = PlayerData.instance.god;

            foreach (int item in PlayerData.instance.weaponInventory)
            {
                if (RuntimeData.weaponDefinitions.TryGetValue(item, out WeaponDefinition value) && value.god == god)
                {
                    m_weaponList.Add(value);
                }
            }
            int value2 = m_weaponList.FindIndex((WeaponDefinition definition) => definition.get_id() == selectedWeaponId);

            if (m_weaponsDropdown != null)
            {
                m_weaponsDropdown.AddOptions((from sd in m_weaponList
                                              select sd.get_displayName()).ToList());
                m_weaponsDropdown.value = value2;
            }
            InitDecks();
        }