Coder Social home page Coder Social logo

derekshaheen / sktoolbox Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 4.0 2.21 MB

This toolbox is used for designing overlay menus in Unity Games. Typically used for creating a custom menu for use with existing projects. Includes loader module.

License: GNU General Public License v3.0

C# 100.00%
sktoolbox unity modding mod menu console bepinex injection mono dnspy

sktoolbox's Introduction

Main / Nightly Stable / Release Hit Counter
mainworkflow releaseworkflow HitCount

SkToolbox Header

The SkToolbox is a framework used for quickly implementing a custom console with executable commands. Typically used for creating a plugin for use with existing projects. This project is expected to be injected via BepInEx. Commands are automatically converted to clickable buttons to provide for a more complete user interface.

Sample

Index

  • Features
  • Examples
  • How to Use Framework

Features

This console supports the following features:

  • Command auto-completion via tab. If the user has partially entered a command, they can use tab to cycle through the potential commands they might be entering.
  • Command chaining, in which multiple commands can be input on a single line, separated by a semi-colon. (Ex. cmd1; cmd2; cmd3; ...)
  • Command cycling via the up/down arrows. Unlimited commands will be remembered.
  • Command suggestions will be displayed as the user types.
  • Command parameters will be automatically suggested and highlighted as the user types.
  • Command aliasing allows the user to create custom chains of commands.
  • Command key binding allows users to run any number of commands via key press when outside of the console.
  • Automatically generate on-screen buttons based on registered commands. As buttons are added, this will become a scrollable menu.
  • Supports color theme changes on the fly! Set the theme to any color via command or config!
  • Many options and preferences are found in the configuration file.

Examples

Full game examples coming soon! Main gifexample

How to Use Framework

Here we will examine an example, made for the game Autonauts vs Pirates. In this example, we reference the SkToolbox.dll and we declare a command to be added to the left button panel and that can be run from the console.

Complete example with code that runs with BepInEx and declares the EnableTools command. FrameworkScreenResult

using BepInEx;
using SkToolbox;

/// <summary>
/// Plugin for SkToolbox, intended for running on Autonauts vs Pirates
/// </summary>
namespace SkToolboxAvPB
{
    [BepInPlugin(GUID, MODNAME, VERSION)]
    [BepInDependency("com.Skrip.SkToolbox")] // Set the dependency 
    class SkBepInExLoader : BaseUnityPlugin
    {
        public const string // Declare plugin information
            MODNAME = "SkToolboxAvPB",
            AUTHOR = "Skrip",
            GUID = "com." + AUTHOR + "." + MODNAME,
            VERSION = "1.0.0.0";

        [Command("EnableTools", "Enables the in-game tools menu.", "World")] // Declare the 'EnableTools' command
        public static void EnableTools()
        {
            CheatManager.Instance.m_CheatsEnabled = true;
            GameStateManager.Instance.SetState(GameStateManager.State.CreativeTools);
        }
    }
}

The following is a generic template in the same format as shown above.

using BepInEx;
using SkToolbox;

/// <summary>
/// Plugin for SkToolbox, intended for running on [Game Name]
/// </summary>
namespace SkToolbox[Game Name]
{
    [BepInPlugin(GUID, ModName, Version)]
    [BepInDependency("com.Skrip.SkToolbox")] // Set the dependency
    class SkBepInExLoader : BaseUnityPlugin
    {
        public const string // Declare plugin information
            ModName = "SkToolbox[Game Name]",
            Author = "[Your Name]",
            GUID = "com." + Author + "." + ModName,
            Version = "1.0.0.0";

        /// <summary>
        /// An example command for SkToolbox.
        /// </summary>
        /// <param name="category">The category of the command.</param>
        [Command("ExampleCommand", "An example command for SkToolbox.", "[Category]")]
        // Declare a custom command for SkToolbox
        public static void ExampleCommand(string category)
        {
            // Write your code here to execute the command
            Console.WriteLine($"This is an example command in {category}.");
        }
    }
}
What is a Command and how is it defined?

The following is the signature for a command. Simply apply these attributes to a method as shown in the example above, and it will be automatically detected upon injection. Only the keyword and description are required parameters. Note:

  • Defined methods must be public and static!
  • SkToolbox modules and commands are not compatible with version >=2.0.0.
public static Command(string keyword, string description, string category = "zzBottom", Util.DisplayOptions displayOptions = Util.DisplayOptions.All, int sortPriority = 100)
  • Keyword: This is the command that will be typed to run it. In the code above, "EnableTools" was the keyword. Key words are also used to display the text in the button panel on the left side. Camel case commands will be automatically converted to readable text for the buttons. NOTE: The keyword does not need to match the method name.
  • Description: This is what will be shown when the user is receiving a hint for this command as they type it. This is also what will be shown from the help command.
  • Category: This is the category that the button will be shown within on the left side. Leave default for no category.
  • DisplayOptions: All, PanelOnly, ConsoleOnly - Display this command everywhere or just in one panel? Mostly used to prevent buttons from appearing for specific commands.
  • Sort Priority: This will be used to sort the buttons within categories. Lower is higher on the menu.

sktoolbox's People

Contributors

derekshaheen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sktoolbox's Issues

Error in mistlands

[Info : Unity Log] (SkToolbox) -> (CONTROLLER) -> (NOTIFY) -> LOADING... | WAITING FOR TOOLBOX.
[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (NOTIFY) -> LOADING... | MODULES LOADING...
[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> Apologies, command aliasing was broken by Hearth and Home and is disabled this patch. Fix is in progress.
[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Warning: Unity Log] (SkToolbox) -> (ERR) -> Error detected! | Field 'Terminal.m_output' not found. | SkToolboxValheim
[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:
SkToolbox.SkModules.ModConsole.Update () (at <9e2daa46db4b4f78b2d8fa8d2ad65e73>:0)

[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (MODULE) -> (NOTIFY) -> NAME: PLAYER | STATUS: READY
[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (MODULE) -> (NOTIFY) -> NAME: WORLD | STATUS: READY
[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (MODULE) -> (NOTIFY) -> NAME: CC CONTROLLER | STATUS: ERROR
[Warning: Unity Log] (SkToolbox) -> (ERR) -> Error detected! | Field 'Terminal.m_output' not found. | SkToolboxValheim
[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:
SkToolbox.SkModules.ModConsole.Update () (at <9e2daa46db4b4f78b2d8fa8d2ad65e73>:0)

[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (MODULE) -> (NOTIFY) -> (RECHECK 1) -> NAME: CC CONTROLLER | STATUS: ERROR
[Warning: Unity Log] (SkToolbox) -> (ERR) -> Error detected! | Field 'Terminal.m_output' not found. | SkToolboxValheim
[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:
SkToolbox.SkModules.ModConsole.Update () (at <9e2daa46db4b4f78b2d8fa8d2ad65e73>:0)

[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (MODULE) -> (NOTIFY) -> (RECHECK 2) -> NAME: CC CONTROLLER | STATUS: ERROR
[Warning: Unity Log] (SkToolbox) -> (ERR) -> Error detected! | Field 'Terminal.m_output' not found. | SkToolboxValheim
[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:
SkToolbox.SkModules.ModConsole.Update () (at <9e2daa46db4b4f78b2d8fa8d2ad65e73>:0)

[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (MODULE) -> (NOTIFY) -> (RECHECK 3) -> NAME: CC CONTROLLER | STATUS: ERROR
[Warning: Unity Log] (SkToolbox) -> (TOOLBOX) -> (NOTIFY) -> MODULE NOT MOVING TO READY STATUS. | UNLOADING THE MODULE(S).
[Error : Unity Log] MissingFieldException: Field 'Terminal.m_output' not found.
Stack trace:

[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (MODULE) -> (NOTIFY) -> NAME: PLAYER | STATUS: READY
[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (MODULE) -> (NOTIFY) -> NAME: WORLD | STATUS: READY
[Info : Unity Log] (SkToolbox) -> (TOOLBOX) -> (NOTIFY) -> 2 MODULES LOADED | TOOLBOX READY.
[Info : Unity Log] (SkToolbox) -> (CONTROLLER) -> (NOTIFY) -> READY.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.