예제 #1
0
파일: Patches.cs 프로젝트: MrSm1th/ONI.Mods
            internal static void Postfix(ToolMenu __instance)
            {
                ReadOptions();

                var position  = Mathf.Clamp(InspectToolSettings.Instance.ToolPosition, 0, __instance.basicTools.Count);
                var name      = InspectToolStrings.TOOL_NAME;
                var tooltip   = InspectToolStrings.TOOL_TOOLTIP;
                var largeIcon = InspectToolSettings.Instance.LargeIcon;
                var tc        = ToolMenu.CreateToolCollection(name, InspectToolStrings.TOOL_ICON_SPRITE_NAME, PAction.GetKAction(), nameof(InspectTool), tooltip, largeIcon);

                __instance.basicTools.Insert(position, tc);
            }
예제 #2
0
            internal static void Postfix()
            {
                ReadOptions();

                var position = Mathf.Clamp(SandboxConduitToolSettings.Instance.ToolPosition, 0, ToolMenu.Instance.sandboxTools.Count);
                var name     = SandboxConduitToolStrings.TOOL_NAME;
                var tooltip  = SandboxConduitToolStrings.TOOL_TOOLTIP;
                var tc       = ToolMenu.CreateToolCollection(name, "icon_action_empty_pipes", PAction.GetKAction(), nameof(SandboxConduitTool), tooltip, largeIcon: false);

                ToolMenu.Instance.sandboxTools.Insert(position, tc);
            }