Exemplo n.º 1
0
        public IEnumerator BuildGodList()
        {
            List <string> list = new List <string>();

            m_playableGods.Clear();
            God god = (PlayerData.instance == null) ? God.Iop : PlayerData.instance.god;
            int num = -1;

            foreach (GodDefinition value in RuntimeData.godDefinitions.Values)
            {
                if (value.playable)
                {
                    m_playableGods.Add(value);
                    list.Add(RuntimeData.FormattedText(value.i18nNameId));
                }
            }
            m_playableGods.Sort(new GodComparer());
            int num2 = 0;

            foreach (GodDefinition playableGod in m_playableGods)
            {
                if (playableGod.god == god)
                {
                    num = num2;
                }
                num2++;
            }
            if (m_ribbonItems == null)
            {
                m_ribbonItems = new List <GodSelectionRibbonItem>();
            }
            IEnumerator[] array = new IEnumerator[m_playableGods.Count];
            for (int i = 0; i < m_playableGods.Count; i++)
            {
                GodDefinition          definition = m_playableGods[i];
                GodSelectionRibbonItem godSelectionRibbonItem;
                if (m_ribbonItems.Count > i)
                {
                    godSelectionRibbonItem = m_ribbonItems[i];
                }
                else
                {
                    godSelectionRibbonItem = Object.Instantiate <GodSelectionRibbonItem>(m_godUiPrefab, m_godUiPrefab.get_transform().get_parent());
                    m_ribbonItems.Add(godSelectionRibbonItem);
                }
                godSelectionRibbonItem.get_gameObject().SetActive(true);
                godSelectionRibbonItem.Initialise(this, definition);
                array[i] = godSelectionRibbonItem.GetLoadingRoutine();
                if (i == num)
                {
                    godSelectionRibbonItem.ForceSelect();
                }
                SetRibbonItemScale(godSelectionRibbonItem);
            }
            yield return(EnumeratorUtility.ParallelExecution(array));

            m_godUiPrefab.get_gameObject().SetActive(false);
        }
        public void OnSelectionChange(GodDefinition definition)
        {
            bool num = definition == m_definition;

            m_selectedTicks.get_gameObject().SetActive(definition == m_definition);
            if (!num)
            {
                OnUnselect();
            }
        }
Exemplo n.º 3
0
 public void DisplayGod(GodDefinition definition)
 {
     if (!(m_currentGod == definition))
     {
         foreach (GodSelectionRibbonItem ribbonItem in m_ribbonItems)
         {
             ribbonItem.OnSelectionChange(definition);
         }
         this.StartCoroutine(AppearRoutine(definition));
         m_godName.SetText(definition.i18nNameId);
         m_godDescription.SetText(definition.i18nDescriptionId);
         m_validateButton.set_interactable(PlayerData.instance.god != definition.god);
         m_currentGod = definition;
     }
 }
Exemplo n.º 4
0
        public void Set(GodDefinition definition, GodFakeData fakeData)
        {
            if (definition == null || fakeData == null)
            {
                m_name.get_gameObject().SetActive(false);
                m_ambience.get_gameObject().SetActive(false);
                return;
            }
            string title       = fakeData.title;
            string description = fakeData.description;

            m_illu.set_sprite(fakeData.illu);
            m_name.SetText(title);
            m_name.get_gameObject().SetActive(!string.IsNullOrEmpty(title));
            m_ambience.SetText(description);
            m_ambience.get_gameObject().SetActive(!string.IsNullOrEmpty(description));
        }
Exemplo n.º 5
0
        private unsafe IEnumerator AppearRoutine(GodDefinition definition)
        {
            m_statueLoader.color = new Color(1f, 1f, 1f, 0f);
            m_illuLoader.color   = new Color(1f, 1f, 1f, 0f);
            AssetReference uIStatueReference = definition.GetUIStatueReference();

            m_statueLoader.Setup(uIStatueReference, AssetBundlesUtility.GetUIGodsResourcesBundleName());
            AssetReference uIBGReference = definition.GetUIBGReference();

            m_illuLoader.Setup(uIBGReference, AssetBundlesUtility.GetUIGodsResourcesBundleName());
            while (m_statueLoader.loadState == UIResourceLoadState.Loading && m_illuLoader.loadState == UIResourceLoadState.Loading)
            {
                yield return(null);
            }
            DOTween.To(new DOGetter <Color>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <Color>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), Color.get_white(), 0.25f);
            m_onGodChange.Invoke();
            yield return((object)new WaitForTime(0.1f));

            m_changeGodFX.Play();
            DOTween.To(new DOGetter <Color>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), new DOSetter <Color>((object)this, (IntPtr)(void *) /*OpCode not supported: LdFtn*/), Color.get_white(), 0.5f);
        }
 private static int GetValueInOtherData(string name, int level)
 {
     string[] array = name.Split(new char[1]
     {
         '.'
     });
     if (array.Length != 0)
     {
         string a = array[0];
         if (!(a == "God"))
         {
             if (a == "Spell" && array.Length == 3)
             {
                 SpellDefinition spellDefinition = null;
                 if (int.TryParse(array[1], out int result))
                 {
                     spellDefinition = ObjectReference.GetSpell(result);
                 }
                 if (spellDefinition != null)
                 {
                     string name2 = array[2];
                     return((spellDefinition.precomputedData?.dynamicValueReferences).GetValueInt(name2, level));
                 }
                 Log.Error("No spell for id=" + array[1] + ": dynamic value " + name + " not found", 86, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\Localization\\TextFormatting\\ValueProviders\\FightValueProviders\\IFightValueProvider.cs");
             }
         }
         else if (array.Length == 3)
         {
             GodDefinition god = ObjectReference.GetGod(array[1]);
             if (god != null)
             {
                 string name3 = array[2];
                 return((god.precomputedData?.dynamicValueReferences).GetValueInt(name3, level));
             }
             Log.Error("No god for '" + array[1] + "': dynamic value " + name + " not found", 68, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\Localization\\TextFormatting\\ValueProviders\\FightValueProviders\\IFightValueProvider.cs");
         }
     }
     Log.Error("dynamic value " + name + " not found", 92, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Data\\UI\\Localization\\TextFormatting\\ValueProviders\\FightValueProviders\\IFightValueProvider.cs");
     return(0);
 }
 public void Initialise(GodSelectionRoot uiRoot, GodDefinition definition)
 {
     m_uiRoot     = uiRoot;
     m_definition = definition;
     Initialise();
 }