示例#1
0
 static void Postfix(Pickupable __instance)
 {
     if (__instance.GetTechType().isGravTrap())
     {
         HandReticle.main.interactText2 = GravTrapObjectsType.getFrom(__instance.gameObject).techTypeListName;
     }
 }
示例#2
0
 static void Pickupable_OnHandHover_Postfix(Pickupable __instance)
 {
     if (__instance.GetTechType().isGravTrap())
     {
         HandReticle.main.setText(textHandSubscript: GravTrapObjectsType.getFrom(__instance.gameObject).techTypeListName);
     }
 }
示例#3
0
 static void Postfix(InventoryItem item, int button)
 {
     if (button == 2 && item.item.GetTechType().isGravTrap())
     {
         GravTrapObjectsType.getFrom(item.item.gameObject).techTypeListIndex++;
     }
 }
示例#4
0
        public static void patch()
        {
            LanguageHelper.init();
            PersistentConsoleCommands.register <ConsoleCommands>();

            HarmonyHelper.patchAll(true);
            CraftHelper.patchAll();

            GravTrapObjectsType.init(typesConfig);
        }
示例#5
0
            static void Postfix(StringBuilder sb, TechType techType, GameObject obj)
            {
                if (!techType.isGravTrap())
                {
                    return;
                }

                var objectsType = GravTrapObjectsType.getFrom(obj);

                objectsType.techTypeListIndex += TypeListSwitcher.getChangeListDir();
                TooltipFactory.WriteDescription(sb, objectsType.techTypeListName);
            }
示例#6
0
            static void Postfix(GUIHand __instance)
            {
                if (!__instance.player.IsFreeToInteract() || !AvatarInputHandler.main.IsEnabled())
                {
                    return;
                }

                if (__instance.GetTool() is PlayerTool tool && tool.pickupable.GetTechType().isGravTrap())
                {
                    HandReticle.main.SetUseTextRaw(tool.GetCustomUseText(), GravTrapObjectsType.getFrom(tool.gameObject).techTypeListName);
                }
            }
示例#7
0
        public static void patch()
        {
            LanguageHelper.init();

            HarmonyHelper.patchAll();
            CraftHelper.patchAll();

            if (config.mk2Enabled)
            {
                HarmonyHelper.patch(typeof(GravTrapMK2Patches));
            }

            GravTrapObjectsType.init(Mod.loadConfig <TypesConfig>("types_config.json", Config.LoadOptions.ReadOnly));
        }
示例#8
0
            static void Postfix(StringBuilder sb, TechType techType, GameObject obj)
            {
                if (!techType.isGravTrap())
                {
                    return;
                }

                if (Main.config.useWheelScroll && InputHelper.getMouseWheelValue() != 0f)                 // not exactly right to do it here, but I didn't find a better way
                {
                    GravTrapObjectsType.getFrom(obj).techTypeListIndex += Math.Sign(InputHelper.getMouseWheelValue());
                }

                TooltipFactory.WriteDescription(sb, GravTrapObjectsType.getFrom(obj).techTypeListName);
            }
示例#9
0
            static void GUIHand_OnUpdate_Postfix(GUIHand __instance)
            {
                if (!__instance.player.IsFreeToInteract() || !AvatarInputHandler.main.IsEnabled())
                {
                    return;
                }

                if (__instance.GetTool() is PlayerTool tool && tool.pickupable?.GetTechType().isGravTrap() == true)
                {
                    HandReticle.main.setText(textUse: tool.GetCustomUseText(), textUseSubscript: GravTrapObjectsType.getFrom(tool.gameObject).techTypeListName);
                }
            }