Exemple #1
0
        static bool uGUI_BuilderMenu_OnButtonDown_Prefix(uGUI_BuilderMenu __instance, GameInput.Button button)
        {
            int dir = button switch
            {
                GameInput.Button.UIPrevTab => - 1,
                GameInput.Button.UINextTab => + 1,
                _ => 0
            };

            if (dir == 0)
            {
                return(true);
            }

            int nextTab = __instance.TabOpen;
            var list    = Main.config.lockedTabs.get(GameUtils.getHeldToolType());

            do
            {
                nextTab = (__instance.TabCount + nextTab + dir) % __instance.TabCount;
            }while (list.Contains(nextTab));

            __instance.SetCurrentTab(nextTab);
            return(false);
        }
    }
Exemple #2
0
        private static bool Prefix(uGUI_BuilderMenu __instance)
        {
            __instance.iconGrid.Clear();
            __instance.items.Clear();

            List <TechType> techTypesForGroup = __instance.GetTechTypesForGroup(__instance.selected);
            int             num = 0;

            for (int i = 0; i < techTypesForGroup.Count; i++)
            {
                TechType techType = techTypesForGroup[i];
                if (!Core.RecipeBlacklist.Contains(techType.AsString()))
                {
                    TechUnlockState techUnlockState = KnownTech.GetTechUnlockState(techType);
                    if (techUnlockState == TechUnlockState.Available || techUnlockState == TechUnlockState.Locked)
                    {
                        string stringForInt = IntStringCache.GetStringForInt(num);
                        __instance.items.Add(stringForInt, techType);
                        __instance.iconGrid.AddItem(stringForInt, SpriteManager.Get(techType), SpriteManager.GetBackground(techType), techUnlockState == TechUnlockState.Locked, num);
                        __instance.iconGrid.RegisterNotificationTarget(stringForInt, NotificationManager.Group.Builder, techType.EncodeKey());
                        num++;
                    }
                }
            }
            return(false);
        }
Exemple #3
0
 public static bool Prefix(ref uGUI_GraphicRaycaster raycaster, uGUI_BuilderMenu __instance)
 {
     RaycastFixer.Fix(ref raycaster, __instance);
     return(false);
 }