예제 #1
0
            static bool Prefix(CharBSelectionSwitchSpells __instance, List <SpellSelectionData> ___m_ShowedSpellsCollections, ref bool ___HasEmptyCollections)
            {
                var tr  = Harmony12.Traverse.Create(__instance);
                int num = 0;

                ___HasEmptyCollections = false;
                foreach (SpellSelectionData spellsCollection in ___m_ShowedSpellsCollections)
                {
                    int prev = num;
                    num = tr.Method("TryParseMemorizersCollections", spellsCollection, num).GetValue <int>(); //num = __instance.TryParseMemorizersCollections(spellsCollection, num);
                    if (num == prev)
                    {
                        num = tr.Method("TryParseSpontaneuosCastersCollections", spellsCollection, num).GetValue <int>();//num = this.TryParseSpontaneuosCastersCollections(spellsCollection, num);
                    }
                }
                ___HasEmptyCollections = num > 0;
                __instance.HideSelectionViewsFrom(num);
                if (__instance.HasSelections)
                {
                    if (___HasEmptyCollections)
                    {
                        tr.Method("ActivateNextEmptyItem").GetValue();    //__instance.ActivateNextEmptyItem();
                    }
                    else
                    {
                        __instance.ActivateCurrentItem();
                    }
                }
                else
                {
                    __instance.Hide();
                }
                return(false);
            }
예제 #2
0
            public static bool Prefix(CharBSelectionSwitchSpells __instance)
            {
                if (!settings.toggleMulticlass)
                {
                    return(false);
                }
                int num = 0;

                __instance.HasEmptyCollections = false;
                foreach (SpellSelectionData spellsCollection in __instance.m_ShowedSpellsCollections)
                {
                    int newNum = __instance.TryParseMemorizersCollections(spellsCollection, num);
                    num = (newNum == num ? __instance.TryParseSpontaneuosCastersCollections(spellsCollection, num) : newNum);
                }
                __instance.HasSelections = num > 0;
                __instance.HideSelectionViewsFrom(num);
                if (__instance.HasSelections)
                {
                    if (__instance.HasEmptyCollections)
                    {
                        __instance.ActivateNextEmptyItem();
                    }
                    else
                    {
                        __instance.ActivateCurrentItem();
                    }
                }
                else
                {
                    __instance.Hide();
                }
                return(true);
            }