<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://modding.kerbal.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dandoesstuff</id>
	<title>Kerbal Space Program 2 Modding Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://modding.kerbal.wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dandoesstuff"/>
	<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/Special:Contributions/Dandoesstuff"/>
	<updated>2026-04-25T15:10:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1518</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1518"/>
		<updated>2025-12-05T15:46:47Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; Note: It is seriously recommended you use this guide instead. https://docs.rendezvous.dev/s/0a4a3e31-0b40-48e0-bd81-e14856f80d3d/doc/spacewarp-1-2-migration-eGXoU487gH. This page was a WIP and isn&#039;t good either&lt;br /&gt;
Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members. Some of it has also been split up into ReduxLib and Redux.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
SpaceWarp.API.UI.Appbar = SpaceWarp2.UI.API.Appbar&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using Redux.ExtraModTypes;&lt;br /&gt;
using SpaceWarp2.UI.API.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
public abstract class SpaceWarpModUIPlugin : KerbalMod&lt;br /&gt;
{&lt;br /&gt;
    [PublicAPI] public const string ModGuid = &amp;quot;SpaceWarpModUI&amp;quot;; // ModGuid here&lt;br /&gt;
    [PublicAPI] public const string ModName = &amp;quot;SpaceWarpUIMod&amp;quot;; &lt;br /&gt;
    //[PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs before the game is loaded, as early as possible. &lt;br /&gt;
    /// You would want to use this to register loading actions (like loading JSONs from addressables).&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPreInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Pre Initialized&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs after the game is loaded and after your mod assets are loaded.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Is Initializing&amp;quot;); // You can use Debug.Log to log things.&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = Assets.LoadAssetAsync&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        ).Result;&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether the UI will use the &amp;quot;Scale&amp;quot; option in the settings.&lt;br /&gt;
            UseStockScale = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs after all mods have done their 2nd stage initialization.&lt;br /&gt;
    /// You would want to use this to interact with game systems, since they&#039;re guaranteed to be loaded on this stage.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPostInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Post Initialized&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // You can create controls directly in Unity. No need for this method anymore.&lt;br /&gt;
    //private static void LoadAssemblies()&lt;br /&gt;
    //{&lt;br /&gt;
    //    // Load the Unity project assembly&lt;br /&gt;
    //    var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
    //    var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
    //    // Register any custom UI controls from the loaded assembly&lt;br /&gt;
    //    CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    //}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1515</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1515"/>
		<updated>2025-11-26T18:19:33Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members. Some of it has also been split up into ReduxLib and Redux.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
SpaceWarp.API.UI.Appbar = SpaceWarp2.UI.API.Appbar&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using Redux.ExtraModTypes;&lt;br /&gt;
using SpaceWarp2.UI.API.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
public abstract class SpaceWarpModUIPlugin : KerbalMod&lt;br /&gt;
{&lt;br /&gt;
    [PublicAPI] public const string ModGuid = &amp;quot;SpaceWarpModUI&amp;quot;; // ModGuid here&lt;br /&gt;
    [PublicAPI] public const string ModName = &amp;quot;SpaceWarpUIMod&amp;quot;; &lt;br /&gt;
    //[PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs before the game is loaded, as early as possible. &lt;br /&gt;
    /// You would want to use this to register loading actions (like loading JSONs from addressables).&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPreInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Pre Initialized&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs after the game is loaded and after your mod assets are loaded.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Is Initializing&amp;quot;); // You can use Debug.Log to log things.&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = Assets.LoadAssetAsync&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        ).Result;&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether the UI will use the &amp;quot;Scale&amp;quot; option in the settings.&lt;br /&gt;
            UseStockScale = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs after all mods have done their 2nd stage initialization.&lt;br /&gt;
    /// You would want to use this to interact with game systems, since they&#039;re guaranteed to be loaded on this stage.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPostInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Post Initialized&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // You can create controls directly in Unity. No need for this method anymore.&lt;br /&gt;
    //private static void LoadAssemblies()&lt;br /&gt;
    //{&lt;br /&gt;
    //    // Load the Unity project assembly&lt;br /&gt;
    //    var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
    //    var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
    //    // Register any custom UI controls from the loaded assembly&lt;br /&gt;
    //    CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    //}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1514</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1514"/>
		<updated>2025-11-22T20:38:09Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: remove my confusion in the after code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members. Some of it has also been split up into ReduxLib and Redux.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
SpaceWarp.API.UI.Appbar = SpaceWarp2.UI.API.Appbar&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using Redux.ExtraModTypes;&lt;br /&gt;
using SpaceWarp2.UI.API.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
public abstract class SpaceWarpModUIPlugin : KerbalMod&lt;br /&gt;
{&lt;br /&gt;
    [PublicAPI] public const string ModGuid = &amp;quot;SpaceWarpModUI&amp;quot;; // ModGuid here&lt;br /&gt;
    [PublicAPI] public const string ModName = &amp;quot;SpaceWarpUIMod&amp;quot;; &lt;br /&gt;
    //[PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs before the game is loaded, as early as possible.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPreInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Pre Initialized&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs after the game is loaded and after your mod assets are loaded.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Is Initializing&amp;quot;); // You can use Debug.Log to log things.&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = Assets.LoadAssetAsync&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        ).Result;&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether the UI will use the &amp;quot;Scale&amp;quot; option in the settings.&lt;br /&gt;
            UseStockScale = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs after all mods have done their 2nd stage initialization.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPostInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Post Initialized&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // You can create controls directly in Unity. No need for this method anymore.&lt;br /&gt;
    //private static void LoadAssemblies()&lt;br /&gt;
    //{&lt;br /&gt;
    //    // Load the Unity project assembly&lt;br /&gt;
    //    var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
    //    var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
    //    // Register any custom UI controls from the loaded assembly&lt;br /&gt;
    //    CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    //}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1513</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1513"/>
		<updated>2025-11-22T14:40:24Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: Make code make more sense and add a more explanations. Will add examples for configs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members. Some of it has also been split up into ReduxLib and Redux.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
SpaceWarp.API.UI.Appbar = SpaceWarp2.UI.API.Appbar&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using Redux.ExtraModTypes;&lt;br /&gt;
using SpaceWarp2.UI.API.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
public abstract class SpaceWarpModUIPlugin : KerbalMod&lt;br /&gt;
{&lt;br /&gt;
    [PublicAPI] public const string ModGuid = &amp;quot;SpaceWarpModUI&amp;quot;; // ModGuid here&lt;br /&gt;
    [PublicAPI] public const string ModName = &amp;quot;SpaceWarpUIMod&amp;quot;; &lt;br /&gt;
    //[PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs before the game is loaded, as early as possible.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPreInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Pre Initialized&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs after the game is loaded and after your mod assets are loaded.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Is Initializing&amp;quot;); // You can use Debug.Log to log things.&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = Assets.LoadAssetAsync&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        ).Result;&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether the UI will use the &amp;quot;Scale&amp;quot; option in the settings.&lt;br /&gt;
            UseStockScale = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs after all mods have done their 2nd stage initialization.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPostInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        Debug.Log(&amp;quot;Post Initialized&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // You can create controls directly in Unity. No need for this method anymore.&lt;br /&gt;
    //private static void LoadAssemblies()&lt;br /&gt;
    //{&lt;br /&gt;
    //    // Load the Unity project assembly&lt;br /&gt;
    //    var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
    //    var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
    //    // Register any custom UI controls from the loaded assembly&lt;br /&gt;
    //    CustomControls.RegisterFromAssembly(unityAssembly); //??&lt;br /&gt;
    //}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1512</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1512"/>
		<updated>2025-11-20T20:17:29Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members. Some of it has also been split up into ReduxLib and Redux.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
SpaceWarp.API.UI.Appbar = SpaceWarp2.UI.API.Appbar&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using Redux.ExtraModTypes;&lt;br /&gt;
using SpaceWarp2.UI.API.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UitkForKsp2.Controls;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
public class SpaceWarpModUIPlugin : KerbalMod&lt;br /&gt;
{&lt;br /&gt;
    // Not needed anymore.&lt;br /&gt;
    [PublicAPI] public const string ModGuid = &amp;quot;SpaceWarpModUI&amp;quot;; // ModGuid here&lt;br /&gt;
&lt;br /&gt;
    [PublicAPI] public const string ModName = &amp;quot;SpaceWarpUIMod&amp;quot;; &lt;br /&gt;
    //[PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPreInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        throw new NotImplementedException();&lt;br /&gt;
    }&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
         Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        //LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = Assets.LoadAssetAsync&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        ).Result;&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether the UI will use the &amp;quot;Scale&amp;quot; option in the settings.&lt;br /&gt;
            UseStockScale = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public override void OnPostInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        throw new NotImplementedException();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    //private static void LoadAssemblies()&lt;br /&gt;
    //{&lt;br /&gt;
    //    // Load the Unity project assembly&lt;br /&gt;
    //    var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
    //    var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
    //    // Register any custom UI controls from the loaded assembly&lt;br /&gt;
    //    CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    //}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1511</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1511"/>
		<updated>2025-11-20T20:16:13Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: admittedly I don&amp;#039;t know if this works 100% but there were no errors in the logs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members. Some of it has also been split up into ReduxLib and Redux.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
SpaceWarp.API.UI.Appbar = SpaceWarp2.UI.API.Appbar&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using Redux.ExtraModTypes;&lt;br /&gt;
using SpaceWarp2.UI.API.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UitkForKsp2.Controls;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
public class SpaceWarpModUIPlugin : KerbalMod&lt;br /&gt;
{&lt;br /&gt;
    // Not needed anymore.&lt;br /&gt;
    [PublicAPI] public const string ModGuid = &amp;quot;SpaceWarpModUI&amp;quot;; // ModGuid here&lt;br /&gt;
&lt;br /&gt;
    [PublicAPI] public const string ModName = &amp;quot;SpaceWarpUIMod&amp;quot;; &lt;br /&gt;
    //[PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    public override void OnPreInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        throw new NotImplementedException();&lt;br /&gt;
    }&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
         Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = Assets.LoadAssetAsync&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        ).Result;&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether the UI will use the &amp;quot;Scale&amp;quot; option in the settings.&lt;br /&gt;
            UseStockScale = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            Assets.LoadAssetAsync&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;).Result,&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public override void OnPostInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        throw new NotImplementedException();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    //private static void LoadAssemblies()&lt;br /&gt;
    //{&lt;br /&gt;
    //    // Load the Unity project assembly&lt;br /&gt;
    //    var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
    //    var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
    //    // Register any custom UI controls from the loaded assembly&lt;br /&gt;
    //    CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    //}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1510</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1510"/>
		<updated>2025-11-19T14:32:27Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members. Some of it has also been split up into ReduxLib and Redux.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
SpaceWarp.API.UI.Appbar = SpaceWarp2.UI.API.Appbar&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1509</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1509"/>
		<updated>2025-11-17T18:53:50Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: add more examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members. Some of it has also been split up into ReduxLib.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
SpaceWarp.API.UI.Appbar = SpaceWarp2.UI.API.Appbar&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1508</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1508"/>
		<updated>2025-11-17T14:41:55Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members. Some of it has also been split up into ReduxLib.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Main_Page&amp;diff=1507</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Main_Page&amp;diff=1507"/>
		<updated>2025-11-17T14:41:27Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: add migration guide, wip&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= KSP 2 Modding Wiki =&lt;br /&gt;
Welcome to the KSP 2 Modding Wiki, a collection of resources on how to mod the game and information on existing community mods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We are currently under construction!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Page Categories ==&lt;br /&gt;
&lt;br /&gt;
* [[General Modding Guidelines and Resources]]&lt;br /&gt;
* [[Migrating from SpaceWarp 1.x]]&lt;br /&gt;
* [[Part Modding]]&lt;br /&gt;
* [[Part Modules]]&lt;br /&gt;
* [[Missions]]&lt;br /&gt;
* [[Planet Modding]]&lt;br /&gt;
* [[KSP2 Redux]]&lt;br /&gt;
* [[Other]]&lt;br /&gt;
* [[Duplicates, Deprecates and other miscreants|Pages that require attention/need to be deleted (for Kiwi)]]&amp;lt;br /&amp;gt;&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://ksp2community.github.io/ KSP 2 Unofficial API Reference]&lt;br /&gt;
* [https://discord.gg/hHW5gpHxfE KSP 2 Modding Society Discord Server]&lt;br /&gt;
* [https://docs.spacewarp.org/ SpaceWarp Modding API Documentation]&lt;br /&gt;
* [https://github.com/KSP2Community KSP 2 Community GitHub]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1506</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1506"/>
		<updated>2025-11-16T18:28:41Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin. Found in Redux.ExtraModTypes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2.API.Configuration = ReduxLib.Configuration&lt;br /&gt;
&lt;br /&gt;
BepInExConfigFile = JsonConfigFile&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&amp;lt;syntaxhighlight lang=&amp;quot;c#&amp;quot;&amp;gt;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
using BepInEx;&lt;br /&gt;
using JetBrains.Annotations;&lt;br /&gt;
using SpaceWarp;&lt;br /&gt;
using SpaceWarp.API.Assets;&lt;br /&gt;
using SpaceWarp.API.Mods;&lt;br /&gt;
using SpaceWarp.API.UI.Appbar;&lt;br /&gt;
using SpaceWarpModUI.UI;&lt;br /&gt;
using UitkForKsp2.API;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UIElements;&lt;br /&gt;
&lt;br /&gt;
namespace SpaceWarpModUI;&lt;br /&gt;
&lt;br /&gt;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]&lt;br /&gt;
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]&lt;br /&gt;
public class SpaceWarpModUIPlugin : BaseSpaceWarpPlugin&lt;br /&gt;
{&lt;br /&gt;
    // Useful in case some other mod wants to use this mod a dependency&lt;br /&gt;
    [PublicAPI] public const string ModGuid = MyPluginInfo.PLUGIN_GUID;&lt;br /&gt;
    [PublicAPI] public const string ModName = MyPluginInfo.PLUGIN_NAME;&lt;br /&gt;
    [PublicAPI] public const string ModVer = MyPluginInfo.PLUGIN_VERSION;&lt;br /&gt;
&lt;br /&gt;
    /// Singleton instance of the plugin class&lt;br /&gt;
    [PublicAPI] public static SpaceWarpModUIPlugin Instance { get; set; }&lt;br /&gt;
&lt;br /&gt;
    // AppBar button IDs&lt;br /&gt;
    internal const string ToolbarFlightButtonID = &amp;quot;BTN-SpaceWarpModUIFlight&amp;quot;;&lt;br /&gt;
    internal const string ToolbarOabButtonID = &amp;quot;BTN-SpaceWarpModUIOAB&amp;quot;;&lt;br /&gt;
    internal const string ToolbarKscButtonID = &amp;quot;BTN-SpaceWarpModUIKSC&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Runs when the mod is first initialized.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    public override void OnInitialized()&lt;br /&gt;
    {&lt;br /&gt;
        base.OnInitialized();&lt;br /&gt;
&lt;br /&gt;
        Instance = this;&lt;br /&gt;
&lt;br /&gt;
        // Load all the other assemblies used by this mod&lt;br /&gt;
        LoadAssemblies();&lt;br /&gt;
&lt;br /&gt;
        // Load the UI from the asset bundle&lt;br /&gt;
        var myFirstWindowUxml = AssetManager.GetAsset&amp;lt;VisualTreeAsset&amp;gt;(&lt;br /&gt;
            // The case-insensitive path to the asset in the bundle is composed of:&lt;br /&gt;
            // - The mod GUID:&lt;br /&gt;
            $&amp;quot;{ModGuid}/&amp;quot; +&lt;br /&gt;
            // - The name of the asset bundle:&lt;br /&gt;
            &amp;quot;SpaceWarpModUI_ui/&amp;quot; +&lt;br /&gt;
            // - The path to the asset in your Unity project (without the &amp;quot;Assets/&amp;quot; part)&lt;br /&gt;
            &amp;quot;ui/myfirstwindow/myfirstwindow.uxml&amp;quot;&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Create the window options object&lt;br /&gt;
        var windowOptions = new WindowOptions&lt;br /&gt;
        {&lt;br /&gt;
            // The ID of the window. It should be unique to your mod.&lt;br /&gt;
            WindowId = &amp;quot;SpaceWarpModUI_MyFirstWindow&amp;quot;,&lt;br /&gt;
            // The transform of parent game object of the window.&lt;br /&gt;
            // If null, it will be created under the main canvas.&lt;br /&gt;
            Parent = null,&lt;br /&gt;
            // Whether or not the window can be hidden with F2.&lt;br /&gt;
            IsHidingEnabled = true,&lt;br /&gt;
            // Whether to disable game input when typing into text fields.&lt;br /&gt;
            DisableGameInputForTextFields = true,&lt;br /&gt;
            MoveOptions = new MoveOptions&lt;br /&gt;
            {&lt;br /&gt;
                // Whether or not the window can be moved by dragging.&lt;br /&gt;
                IsMovingEnabled = true,&lt;br /&gt;
                // Whether or not the window can only be moved within the screen bounds.&lt;br /&gt;
                CheckScreenBounds = true&lt;br /&gt;
            }&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        // Create the window&lt;br /&gt;
        var myFirstWindow = Window.Create(windowOptions, myFirstWindowUxml);&lt;br /&gt;
        // Add a controller for the UI to the window&#039;s game object&lt;br /&gt;
        var myFirstWindowController = myFirstWindow.gameObject.AddComponent&amp;lt;MyFirstWindowController&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
        // Register Flight AppBar button&lt;br /&gt;
        Appbar.RegisterAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarFlightButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register OAB AppBar Button&lt;br /&gt;
        Appbar.RegisterOABAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarOabButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            isOpen =&amp;gt; myFirstWindowController.IsWindowOpen = isOpen&lt;br /&gt;
        );&lt;br /&gt;
&lt;br /&gt;
        // Register KSC AppBar Button&lt;br /&gt;
        Appbar.RegisterKSCAppButton(&lt;br /&gt;
            ModName,&lt;br /&gt;
            ToolbarKscButtonID,&lt;br /&gt;
            AssetManager.GetAsset&amp;lt;Texture2D&amp;gt;($&amp;quot;{ModGuid}/images/icon.png&amp;quot;),&lt;br /&gt;
            () =&amp;gt; myFirstWindowController.IsWindowOpen = !myFirstWindowController.IsWindowOpen&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Loads all the assemblies for the mod.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private static void LoadAssemblies()&lt;br /&gt;
    {&lt;br /&gt;
        // Load the Unity project assembly&lt;br /&gt;
        var currentFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory!.FullName;&lt;br /&gt;
        var unityAssembly = Assembly.LoadFrom(Path.Combine(currentFolder, &amp;quot;SpaceWarpModUI.Unity.dll&amp;quot;));&lt;br /&gt;
        // Register any custom UI controls from the loaded assembly&lt;br /&gt;
        CustomControls.RegisterFromAssembly(unityAssembly);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;After:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1505</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1505"/>
		<updated>2025-11-16T17:47:47Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux here: https://github.com/orgs/KSP2Community/repositories?type=all&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1504</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1504"/>
		<updated>2025-11-16T17:47:01Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following classes:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Example plugin before &amp;amp; after migration:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
For more examples you can look at some of the &amp;quot;Reduxed&amp;quot; mods we&#039;ve made for Redux.&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1503</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1503"/>
		<updated>2025-11-16T17:40:29Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following decorators:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc. Equivalent to BaseSpaceWarpPlugin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 also has a bunch of different members and classes&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1502</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1502"/>
		<updated>2025-11-16T17:38:45Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;... and that you can&#039;t use BepInEx&#039;s stuff anymore.&lt;br /&gt;
&lt;br /&gt;
The SpaceWarp namespace has been renamed to SpaceWarp2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following decorators:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc.&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1501</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1501"/>
		<updated>2025-11-16T17:33:57Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide is for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following decorators:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc.&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Setting_up_a_Development_Environment&amp;diff=1500</id>
		<title>Setting up a Development Environment</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Setting_up_a_Development_Environment&amp;diff=1500"/>
		<updated>2025-11-16T17:31:34Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Getting started]]&lt;br /&gt;
There are three main types of projects that you will be creating most of the time:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Unity project&#039;&#039;&#039; - used to add objects such as parts or planets into the game.&lt;br /&gt;
* &#039;&#039;&#039;.NET project&#039;&#039;&#039; - mostly composed of C# code, useful for example for various small QoL and gameplay enhancements or fixes, etc.&lt;br /&gt;
* &#039;&#039;&#039;Mixed project&#039;&#039;&#039; - a combination of the previous two, used for example if you want to create parts with custom modules, or when making a gameplay tool with a UI.&lt;br /&gt;
&lt;br /&gt;
To set up a standalone project, see [[Setting up Unity]].&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1499</id>
		<title>Setting up Unity</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1499"/>
		<updated>2025-11-16T17:28:30Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will help you install everything you need to use Unity for KSP2 modding.&lt;br /&gt;
&lt;br /&gt;
== Installing Unity ==&lt;br /&gt;
&lt;br /&gt;
# Download Unity Hub from https://unity.com/download.&lt;br /&gt;
# Download Unity 2022.3.5f1 by clicking on the &#039;&#039;&#039;Install this version with Unity Hub&#039;&#039;&#039; link on this page: https://unity.com/releases/editor/whats-new/2022.3.5.&lt;br /&gt;
# Download and install Git from https://git-scm.com/downloads.&lt;br /&gt;
# Download/Clone/Use the Redux.Template repo from https://github.com/KSP2Redux/Redux.Template&lt;br /&gt;
&lt;br /&gt;
== Initializing the Unity project ==&lt;br /&gt;
# Open &#039;&#039;&#039;Unity Hub&#039;&#039;&#039;.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add&#039;&#039;&#039; at the top right of the window.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add project from disk.&#039;&#039;&#039;&lt;br /&gt;
# Select the Redux template you downloaded.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Unity project ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring ThunderKit ===&lt;br /&gt;
&#039;&#039;ThunderKit&#039;&#039; is a package for Unity which we use to import the game&#039;s components into the Unity editor. This is included with the Redux Template&lt;br /&gt;
&lt;br /&gt;
# The &#039;&#039;ThunderKit&#039;&#039; Settings window should open, if it doesn’t, just go to &#039;&#039;&#039;Tools&amp;gt;ThunderKit&amp;gt;Settings&#039;&#039;&#039; in the toolbar at the top of Unity.&lt;br /&gt;
# Go to &#039;&#039;&#039;ThunderKit Settings&#039;&#039;&#039; and in &#039;&#039;&#039;Locate and load game files for project,&#039;&#039;&#039; click on &#039;&#039;&#039;Browse&#039;&#039;&#039; and select your main Kerbal Space Program 2 executable found at &amp;lt;code&amp;gt;&amp;lt;KSP2 root folder&amp;gt;/KSP2_x64.exe&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Note: This must be a Redux install of the game.&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Import&#039;&#039;&#039; and wait for KSP2 to be imported. If asked, click &#039;&#039;&#039;I made a backup, Go Ahead&#039;&#039;&#039;.&lt;br /&gt;
# If Unity asks you to restart your project, confirm it by clicking on &#039;&#039;&#039;Restart Project&#039;&#039;&#039;.&lt;br /&gt;
# After the process is finished, to check if the game was correctly imported, select or create any game object and in the inspector click &#039;&#039;&#039;Add Component&#039;&#039;&#039; and search for &#039;&#039;&#039;Core Part Data.&#039;&#039;&#039;&lt;br /&gt;
# Once you&#039;ve confirmed that Core Part Data is there, you now have to browse to &#039;&#039;&#039;Assets -&amp;gt; and find ImportKsp2ToEditor.&#039;&#039;&#039;&lt;br /&gt;
# Once you&#039;ve found ImportKsp2ToEditor, click on it and press &#039;&#039;&#039;Execute.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Creating a mod and setting up swinfo.json ===&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;&#039;Modding&amp;gt;KSP2 Unity Tools.&#039;&#039;&#039;&lt;br /&gt;
# Click Create Mod&lt;br /&gt;
# Give the mod a ModId and if you want a small code template in your mod, click &#039;&#039;&#039;Add Code to Mod.&#039;&#039;&#039;&lt;br /&gt;
# Click Create.&lt;br /&gt;
# You should now have a folder with your mod name with a swinfo asset, Pipelines folder and if you ticked Add Code to Mod, a Code folder.&lt;br /&gt;
# Setting up swinfo is simple. Select swinfo.asset and edit all the values to your liking.&lt;br /&gt;
# If you want to test your mod in the editor, navigate to KSP2 Unity Tools, select your mod and then click &#039;&#039;&#039;Test Selected Mods in Editor.&#039;&#039;&#039;&lt;br /&gt;
# Once you&#039;ve finished your mod and are ready to distribute it, you will have to export it. Select the mod in KSP2 Unity Tools and then click &#039;&#039;&#039;Deploy Selected Mods To Zip File.&#039;&#039;&#039;&lt;br /&gt;
# The mod will then be stored in the Redux.Template in a folder called &amp;quot;Deploy&amp;quot;. You will then have to share the zip on SpaceDock or whichever other websites you please.&lt;br /&gt;
&lt;br /&gt;
[[Category:Getting started]]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1498</id>
		<title>Setting up Unity</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1498"/>
		<updated>2025-11-16T17:27:50Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will help you install everything you need to use Unity for KSP2 modding.&lt;br /&gt;
&lt;br /&gt;
== Installing Unity ==&lt;br /&gt;
&lt;br /&gt;
# Download Unity Hub from https://unity.com/download.&lt;br /&gt;
# Download Unity 2022.3.5f1 by clicking on the &#039;&#039;&#039;Install this version with Unity Hub&#039;&#039;&#039; link on this page: https://unity.com/releases/editor/whats-new/2022.3.5.&lt;br /&gt;
# Download and install Git from https://git-scm.com/downloads.&lt;br /&gt;
# Download/Clone/Use the Redux.Template repo from https://github.com/KSP2Redux/Redux.Template&lt;br /&gt;
&lt;br /&gt;
== Initializing the Unity project ==&lt;br /&gt;
# Open &#039;&#039;&#039;Unity Hub&#039;&#039;&#039;.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add&#039;&#039;&#039; at the top right of the window.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add project from disk.&#039;&#039;&#039;&lt;br /&gt;
# Select the Redux template you downloaded.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Unity project ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring ThunderKit ===&lt;br /&gt;
&#039;&#039;ThunderKit&#039;&#039; is a package for Unity which we use to import the game&#039;s components into the Unity editor. This is included with the Redux Template&lt;br /&gt;
&lt;br /&gt;
# The &#039;&#039;ThunderKit&#039;&#039; Settings window should open, if it doesn’t, just go to &#039;&#039;&#039;Tools&amp;gt;ThunderKit&amp;gt;Settings&#039;&#039;&#039; in the toolbar at the top of Unity.&lt;br /&gt;
# Go to &#039;&#039;&#039;ThunderKit Settings&#039;&#039;&#039; and in &#039;&#039;&#039;Locate and load game files for project,&#039;&#039;&#039; click on &#039;&#039;&#039;Browse&#039;&#039;&#039; and select your main Kerbal Space Program 2 executable found at &amp;lt;code&amp;gt;&amp;lt;KSP2 root folder&amp;gt;/KSP2_x64.exe&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Note: This must be a Redux install of the game.&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Import&#039;&#039;&#039; and wait for KSP2 to be imported. If asked, click &#039;&#039;&#039;I made a backup, Go Ahead&#039;&#039;&#039;.&lt;br /&gt;
# If Unity asks you to restart your project, confirm it by clicking on &#039;&#039;&#039;Restart Project&#039;&#039;&#039;.&lt;br /&gt;
# After the process is finished, to check if the game was correctly imported, select or create any game object and in the inspector click &#039;&#039;&#039;Add Component&#039;&#039;&#039; and search for &#039;&#039;&#039;Core Part Data.&#039;&#039;&#039;&lt;br /&gt;
# Once you&#039;ve confirmed that Core Part Data is there, you now have to browse to &#039;&#039;&#039;Assets -&amp;gt; and find ImportKsp2ToEditor.&#039;&#039;&#039;&lt;br /&gt;
# Copy ImportKsp2ToEditor to Assets, and then click on that copy and press &#039;&#039;&#039;Execute.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Creating a mod and setting up swinfo.json ===&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;&#039;Modding&amp;gt;KSP2 Unity Tools.&#039;&#039;&#039;&lt;br /&gt;
# Click Create Mod&lt;br /&gt;
# Give the mod a ModId and if you want a small code template in your mod, click &#039;&#039;&#039;Add Code to Mod.&#039;&#039;&#039;&lt;br /&gt;
# Click Create.&lt;br /&gt;
# You should now have a folder with your mod name with a swinfo asset, Pipelines folder and if you ticked Add Code to Mod, a Code folder.&lt;br /&gt;
# Setting up swinfo is simple. Select swinfo.asset and edit all the values to your liking.&lt;br /&gt;
# If you want to test your mod in the editor, navigate to KSP2 Unity Tools, select your mod and then click &#039;&#039;&#039;Test Selected Mods in Editor.&#039;&#039;&#039;&lt;br /&gt;
# Once you&#039;ve finished your mod and are ready to distribute it, you will have to export it. Select the mod in KSP2 Unity Tools and then click &#039;&#039;&#039;Deploy Selected Mods To Zip File.&#039;&#039;&#039;&lt;br /&gt;
# The mod will then be stored in the Redux.Template in a folder called &amp;quot;Deploy&amp;quot;. You will then have to share the zip on SpaceDock or whichever other websites you please.&lt;br /&gt;
&lt;br /&gt;
[[Category:Getting started]]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1497</id>
		<title>Setting up Unity</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1497"/>
		<updated>2025-11-16T17:27:24Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will help you install everything you need to use Unity for KSP2 modding.&lt;br /&gt;
&lt;br /&gt;
== Installing Unity ==&lt;br /&gt;
&lt;br /&gt;
# Download Unity Hub from https://unity.com/download.&lt;br /&gt;
# Download Unity 2022.3.5f1 by clicking on the &#039;&#039;&#039;Install this version with Unity Hub&#039;&#039;&#039; link on this page: https://unity.com/releases/editor/whats-new/2022.3.5.&lt;br /&gt;
# Download and install Git from https://git-scm.com/downloads.&lt;br /&gt;
# Download/Clone the Redux.Template repo from https://github.com/KSP2Redux/Redux.Template&lt;br /&gt;
&lt;br /&gt;
== Initializing the Unity project ==&lt;br /&gt;
# Open &#039;&#039;&#039;Unity Hub&#039;&#039;&#039;.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add&#039;&#039;&#039; at the top right of the window.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add project from disk.&#039;&#039;&#039;&lt;br /&gt;
# Select the Redux template you downloaded.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Unity project ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring ThunderKit ===&lt;br /&gt;
&#039;&#039;ThunderKit&#039;&#039; is a package for Unity which we use to import the game&#039;s components into the Unity editor. This is included with the Redux Template&lt;br /&gt;
&lt;br /&gt;
# The &#039;&#039;ThunderKit&#039;&#039; Settings window should open, if it doesn’t, just go to &#039;&#039;&#039;Tools&amp;gt;ThunderKit&amp;gt;Settings&#039;&#039;&#039; in the toolbar at the top of Unity.&lt;br /&gt;
# Go to &#039;&#039;&#039;ThunderKit Settings&#039;&#039;&#039; and in &#039;&#039;&#039;Locate and load game files for project,&#039;&#039;&#039; click on &#039;&#039;&#039;Browse&#039;&#039;&#039; and select your main Kerbal Space Program 2 executable found at &amp;lt;code&amp;gt;&amp;lt;KSP2 root folder&amp;gt;/KSP2_x64.exe&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Note: This must be a Redux install of the game.&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Import&#039;&#039;&#039; and wait for KSP2 to be imported. If asked, click &#039;&#039;&#039;I made a backup, Go Ahead&#039;&#039;&#039;.&lt;br /&gt;
# If Unity asks you to restart your project, confirm it by clicking on &#039;&#039;&#039;Restart Project&#039;&#039;&#039;.&lt;br /&gt;
# After the process is finished, to check if the game was correctly imported, select or create any game object and in the inspector click &#039;&#039;&#039;Add Component&#039;&#039;&#039; and search for &#039;&#039;&#039;Core Part Data.&#039;&#039;&#039;&lt;br /&gt;
# Once you&#039;ve confirmed that Core Part Data is there, you now have to browse to &#039;&#039;&#039;Assets -&amp;gt; and find ImportKsp2ToEditor.&#039;&#039;&#039;&lt;br /&gt;
# Copy ImportKsp2ToEditor to Assets, and then click on that copy and press &#039;&#039;&#039;Execute.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Creating a mod and setting up swinfo.json ===&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;&#039;Modding&amp;gt;KSP2 Unity Tools.&#039;&#039;&#039;&lt;br /&gt;
# Click Create Mod&lt;br /&gt;
# Give the mod a ModId and if you want a small code template in your mod, click &#039;&#039;&#039;Add Code to Mod.&#039;&#039;&#039;&lt;br /&gt;
# Click Create.&lt;br /&gt;
# You should now have a folder with your mod name with a swinfo asset, Pipelines folder and if you ticked Add Code to Mod, a Code folder.&lt;br /&gt;
# Setting up swinfo is simple. Select swinfo.asset and edit all the values to your liking.&lt;br /&gt;
# If you want to test your mod in the editor, navigate to KSP2 Unity Tools, select your mod and then click &#039;&#039;&#039;Test Selected Mods in Editor.&#039;&#039;&#039;&lt;br /&gt;
# Once you&#039;ve finished your mod and are ready to distribute it, you will have to export it. Select the mod in KSP2 Unity Tools and then click &#039;&#039;&#039;Deploy Selected Mods To Zip File.&#039;&#039;&#039;&lt;br /&gt;
# The mod will then be stored in the Redux.Template in a folder called &amp;quot;Deploy&amp;quot;. You will then have to share the zip on SpaceDock or whichever other websites you please.&lt;br /&gt;
&lt;br /&gt;
[[Category:Getting started]]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1496</id>
		<title>Setting up Unity</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1496"/>
		<updated>2025-11-16T17:15:56Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will help you install everything you need to use Unity for KSP2 modding.&lt;br /&gt;
&lt;br /&gt;
== Installing Unity ==&lt;br /&gt;
&lt;br /&gt;
# Download Unity Hub from https://unity.com/download.&lt;br /&gt;
# Download Unity 2022.3.5f1 by clicking on the &#039;&#039;&#039;Install this version with Unity Hub&#039;&#039;&#039; link on this page: https://unity.com/releases/editor/whats-new/2022.3.5.&lt;br /&gt;
# Download and install Git from https://git-scm.com/downloads.&lt;br /&gt;
# Download/Clone the Redux.Template repo from https://github.com/KSP2Redux/Redux.Template&lt;br /&gt;
&lt;br /&gt;
== Initializing the Unity project ==&lt;br /&gt;
# Open &#039;&#039;&#039;Unity Hub&#039;&#039;&#039;.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add&#039;&#039;&#039; at the top right of the window.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add project from disk.&#039;&#039;&#039;&lt;br /&gt;
# Select the Redux template you downloaded.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Unity project ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring ThunderKit ===&lt;br /&gt;
&#039;&#039;ThunderKit&#039;&#039; is a package for Unity which we use to import the game&#039;s components into the Unity editor. This is included with the Redux Template&lt;br /&gt;
&lt;br /&gt;
# The &#039;&#039;ThunderKit&#039;&#039; Settings window should open, if it doesn’t, just go to &#039;&#039;&#039;Tools&amp;gt;ThunderKit&amp;gt;Settings&#039;&#039;&#039; in the toolbar at the top of Unity.&lt;br /&gt;
# Go to &#039;&#039;&#039;ThunderKit Settings&#039;&#039;&#039; and in &#039;&#039;&#039;Locate and load game files for project,&#039;&#039;&#039; click on &#039;&#039;&#039;Browse&#039;&#039;&#039; and select your main Kerbal Space Program 2 executable found at &amp;lt;code&amp;gt;&amp;lt;KSP2 root folder&amp;gt;/KSP2_x64.exe&amp;lt;/code&amp;gt;. &#039;&#039;&#039;Note: This must be a Redux install of the game.&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Import&#039;&#039;&#039; and wait for KSP2 to be imported. If asked, click &#039;&#039;&#039;I made a backup, Go Ahead&#039;&#039;&#039;.&lt;br /&gt;
# If Unity asks you to restart your project, confirm it by clicking on &#039;&#039;&#039;Restart Project&#039;&#039;&#039;.&lt;br /&gt;
# After the process is finished, to check if the game was correctly imported, select or create any game object and in the inspector click &#039;&#039;&#039;Add Component&#039;&#039;&#039; and search for &#039;&#039;&#039;Core Part Data.&#039;&#039;&#039;&lt;br /&gt;
# Once you&#039;ve confirmed that Core Part Data is there, you now have to browse to &#039;&#039;&#039;Packages -&amp;gt; KSP2 Unity Tools -&amp;gt; and find ImportKsp2ToEditor.&#039;&#039;&#039;&lt;br /&gt;
# Copy ImportKsp2ToEditor to Assets, and then click on that copy and press &#039;&#039;&#039;Execute.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Creating a mod and setting up swinfo.json ===&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;&#039;Modding&amp;gt;KSP2 Unity Tools.&#039;&#039;&#039;&lt;br /&gt;
# Click Create Mod&lt;br /&gt;
# Give the mod a ModId and if you want a small code template in your mod, click &#039;&#039;&#039;Add Code to Mod.&#039;&#039;&#039;&lt;br /&gt;
# Click Create.&lt;br /&gt;
# You should now have a folder with your mod name with a swinfo asset, Pipelines folder and if you ticked Add Code to Mod, a Code folder.&lt;br /&gt;
# Setting up swinfo is simple. Select swinfo.asset and edit all the values to your liking.&lt;br /&gt;
# Once you&#039;ve finished your mod, you will have to export it. Select the mod in KSP2 Unity Tools and then click &#039;&#039;&#039;Deploy Selected Mods To Zip File.&#039;&#039;&#039; &lt;br /&gt;
# The mod will then be stored in the Redux.Template in a folder called &amp;quot;Deploy&amp;quot;. Place this folder in the &amp;quot;mods&amp;quot; folder and test out your mod in game.&lt;br /&gt;
&lt;br /&gt;
[[Category:Getting started]]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1495</id>
		<title>Setting up Unity</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Setting_up_Unity&amp;diff=1495"/>
		<updated>2025-11-16T17:13:02Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: Update to instead use the Redux Template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will help you install everything you need to use Unity for KSP2 modding.&lt;br /&gt;
&lt;br /&gt;
== Installing Unity ==&lt;br /&gt;
&lt;br /&gt;
# Download Unity Hub from https://unity.com/download.&lt;br /&gt;
# Download Unity 2022.3.5f1 by clicking on the &#039;&#039;&#039;Install this version with Unity Hub&#039;&#039;&#039; link on this page: https://unity.com/releases/editor/whats-new/2022.3.5.&lt;br /&gt;
# Download and install Git from https://git-scm.com/downloads.&lt;br /&gt;
# Download/Clone the Redux.Template repo from https://github.com/KSP2Redux/Redux.Template&lt;br /&gt;
&lt;br /&gt;
== Initializing the Unity project ==&lt;br /&gt;
# Open &#039;&#039;&#039;Unity Hub&#039;&#039;&#039;.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add&#039;&#039;&#039; at the top right of the window.&lt;br /&gt;
# Click on &#039;&#039;&#039;Add project from disk.&#039;&#039;&#039;&lt;br /&gt;
# Select the Redux template you downloaded.&lt;br /&gt;
&lt;br /&gt;
== Configuring the Unity project ==&lt;br /&gt;
&lt;br /&gt;
=== Configuring ThunderKit ===&lt;br /&gt;
&#039;&#039;ThunderKit&#039;&#039; is a package for Unity which we use to import the game&#039;s components into the Unity editor. This is included with the Redux Template&lt;br /&gt;
&lt;br /&gt;
# The &#039;&#039;ThunderKit&#039;&#039; Settings window should open, if it doesn’t, just go to &#039;&#039;&#039;Tools&amp;gt;ThunderKit&amp;gt;Settings&#039;&#039;&#039; in the toolbar at the top of Unity.&lt;br /&gt;
# Go to &#039;&#039;&#039;ThunderKit Settings&#039;&#039;&#039; and in &#039;&#039;&#039;Locate and load game files for project,&#039;&#039;&#039; click on &#039;&#039;&#039;Browse&#039;&#039;&#039; and select your main Kerbal Space Program 2 executable found at &amp;lt;code&amp;gt;&amp;lt;KSP2 root folder&amp;gt;/KSP2_x64.exe&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Click &#039;&#039;&#039;Import&#039;&#039;&#039; and wait for KSP2 to be imported. If asked, click &#039;&#039;&#039;I made a backup, Go Ahead&#039;&#039;&#039;.&lt;br /&gt;
# If Unity asks you to restart your project, confirm it by clicking on &#039;&#039;&#039;Restart Project&#039;&#039;&#039;.&lt;br /&gt;
# After the process is finished, to check if the game was correctly imported, select or create any game object and in the inspector click &#039;&#039;&#039;Add Component&#039;&#039;&#039; and search for &#039;&#039;&#039;Core Part Data.&#039;&#039;&#039;&lt;br /&gt;
# Once you&#039;ve confirmed that Core Part Data is there, you now have to browse to &#039;&#039;&#039;Packages -&amp;gt; KSP2 Unity Tools -&amp;gt; and find ImportKsp2ToEditor.&#039;&#039;&#039;&lt;br /&gt;
# Copy ImportKsp2ToEditor to Assets, and then click on that copy and press &#039;&#039;&#039;Execute.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Creating a mod and setting up swinfo.json ===&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;&#039;Modding&amp;gt;KSP2 Unity Tools.&#039;&#039;&#039;&lt;br /&gt;
# Click Create Mod&lt;br /&gt;
# Give the mod a ModId and if you want a small code template in your mod, click &#039;&#039;&#039;Add Code to Mod.&#039;&#039;&#039;&lt;br /&gt;
# Click Create.&lt;br /&gt;
# You should now have a folder with your mod name with a swinfo asset, Pipelines folder and if you ticked Add Code to Mod, a Code folder.&lt;br /&gt;
# Setting up swinfo is simple. Select swinfo.asset and edit all the values to your liking.&lt;br /&gt;
# Once you&#039;ve finished your mod, you will have to export it. Select the mod in KSP2 Unity Tools and then click &#039;&#039;&#039;Deploy Selected Mods To Zip File.&#039;&#039;&#039; &lt;br /&gt;
# The mod will then be stored in the Redux.Template in a folder called &amp;quot;Deploy&amp;quot;. Place this folder in the &amp;quot;mods&amp;quot; folder and test out your mod in game.&lt;br /&gt;
&lt;br /&gt;
[[Category:Getting started]]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1494</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1494"/>
		<updated>2025-11-16T10:45:04Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide&#039;s for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following decorators:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. (technically a Redux thing) It has access to useful game classes like Game, Assets, Messages, etc.&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=KSP2_Redux&amp;diff=1493</id>
		<title>KSP2 Redux</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=KSP2_Redux&amp;diff=1493"/>
		<updated>2025-11-16T10:31:00Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: migration guide added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Our plan for Redux is to try and achieve what we interpret as the core vision of the original developers of KSP2. This means both fixing existing bugs in the game, improving performance and most importantly bring to life promised features like colonies, interstellar travel or multiplayer. We also want to make the game as moddable as possible by providing tools to help the development of mods. Regarding features such as colonies, the current plan is to include all core functionality, with some parts to fill the necessary gameplay roles. Fancier parts will be left to modders to add to the game, for example: Redux might include a simple ISRU for colonies but mods could add many more of varying size, style, etc.&lt;br /&gt;
&lt;br /&gt;
=== What form will Redux take? ===&lt;br /&gt;
Redux will most likely be distributed as an installer which will apply some patches to the relevant files in an existing KSP2 installation. Redux will not take the form of either a standalone executable or a simple Spacewarp mod, it&#039;s gonna be something in-between. We hope to be able to integrate Redux&#039;s installer into CKAN to make installation as simple as possible.&lt;br /&gt;
&lt;br /&gt;
=== Disclaimer ===&lt;br /&gt;
Redux is a fan project entirely developed by &#039;&#039;&#039;a team of (passionate) volunteers&#039;&#039;&#039;, we do not have access to the resources of a full game studio so temper your expectations with this in mind. Redux might (and probably will) introduce new bugs to the game, we cannot check every possible scenario otherwise we&#039;d never release anything. We also do not have any affiliation with the former KSP2 developers, please do not interpret this project as an official continuation of KSP2&#039;s development.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
[[ISRU]]&lt;br /&gt;
&lt;br /&gt;
[[Migrating from SpaceWarp 1.x]]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=General_Modding_Guidelines_and_Resources&amp;diff=1492</id>
		<title>General Modding Guidelines and Resources</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=General_Modding_Guidelines_and_Resources&amp;diff=1492"/>
		<updated>2025-11-16T10:30:22Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Overview of pages that offer general modding guidelines and useful resources and information for modders&lt;br /&gt;
&lt;br /&gt;
* [[Setting up a Development Environment]]&lt;br /&gt;
* [[UnityExplorer]]&lt;br /&gt;
* [[How to use Unity Explorer and Object Browser]]&lt;br /&gt;
* [[Subscribe to game Messages]]&lt;br /&gt;
* [[Transform System Guide]]&lt;br /&gt;
* [[Orbits and PatchedConicsOrbit methods and info]]&lt;br /&gt;
* [[PatchedConicSolver]]&lt;br /&gt;
* [[PartsProvider]]&lt;br /&gt;
* [[Scenery - Standard (Opaque) shader]]&lt;br /&gt;
* [[Staging Icon Asset Address]]&lt;br /&gt;
* [[Stage Type|Stage Types]]&lt;br /&gt;
* [[Missions]]&lt;br /&gt;
* [[Category|Part Category]]&lt;br /&gt;
* [[Resources]]&lt;br /&gt;
* [[UniverseModel]]&lt;br /&gt;
* [[VesselComponent]]&lt;br /&gt;
* [[Custom Launch Locations]]&lt;br /&gt;
* [[Colors|UI Colors]]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1491</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1491"/>
		<updated>2025-11-15T22:07:11Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide&#039;s for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;API&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
SpaceWarp2 now has following decorators:&lt;br /&gt;
&lt;br /&gt;
GeneralMod&lt;br /&gt;
&lt;br /&gt;
MonoBehaviourMod&lt;br /&gt;
&lt;br /&gt;
KerbalMod. This is technically a Redux thing, but it has access to useful game classes like Game, Assets, Messages, etc.&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1490</id>
		<title>Migrating from SpaceWarp 1.x</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Migrating_from_SpaceWarp_1.x&amp;diff=1490"/>
		<updated>2025-11-15T13:56:44Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: WIP migration guide&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Redux features a brand new version of SpaceWarp. While it&#039;s all shiny and cool, it breaks support with older versions. Now you&#039;re probably wondering: How do I migrate to SpaceWarp 2.x? This guide&#039;s for you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;What&#039;s different?&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since Redux has SpaceWarp built-in, there&#039;s no need to have BepInEx anymore. This means all mods get stored in a dedicated Mods folder in the main KSP2 directory called &amp;quot;mods&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Main_Page&amp;diff=1489</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Main_Page&amp;diff=1489"/>
		<updated>2025-11-15T11:41:33Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: add missions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= KSP 2 Modding Wiki =&lt;br /&gt;
Welcome to the KSP 2 Modding Wiki, a collection of resources on how to mod the game and information on existing community mods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We are currently under construction!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Page Categories ==&lt;br /&gt;
&lt;br /&gt;
* [[General Modding Guidelines and Resources]]&lt;br /&gt;
* [[Part Modding]]&lt;br /&gt;
* [[Part Modules]]&lt;br /&gt;
* [[Missions]]&lt;br /&gt;
* [[Planet Modding]]&lt;br /&gt;
* [[KSP2 Redux]]&lt;br /&gt;
* [[Other]]&lt;br /&gt;
* [[Duplicates, Deprecates and other miscreants|Pages that require attention/need to be deleted (for Kiwi)]]&amp;lt;br /&amp;gt;&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://ksp2community.github.io/ KSP 2 Unofficial API Reference]&lt;br /&gt;
* [https://discord.gg/hHW5gpHxfE KSP 2 Modding Society Discord Server]&lt;br /&gt;
* [https://docs.spacewarp.org/ SpaceWarp Modding API Documentation]&lt;br /&gt;
* [https://github.com/KSP2Community KSP 2 Community GitHub]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Missions&amp;diff=1488</id>
		<title>Missions</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Missions&amp;diff=1488"/>
		<updated>2025-11-15T11:40:57Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: Documentation for missions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Exploration Mode has multiple in-game missions that you&#039;re supposed to finish in the campaign. Have you ever wondered *how* to make missions, though? Simple!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Missions in the game are JSON files, but we can also use PatchManager to create new missions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;The Mission Editor&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Mission Editor is a handy resource made by modders that makes mission creation much faster and more intuitive. You can use it here: https://ksp2community.github.io/editors/&lt;br /&gt;
&lt;br /&gt;
This will eventually be replaced by a full Unity version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;Mission Data&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MissionID: The ID your mission will have.&lt;br /&gt;
&lt;br /&gt;
name: The name your mission will have. It&#039;s best to have this as a localization key, but if you don&#039;t plan on localizing your mod you can just set it to whatever your mission name is.&lt;br /&gt;
&lt;br /&gt;
description: The description your mission will have. Note, this is the description shown in the UI that appears when you click on a mission. Not the brief. It&#039;s also recommended to have this as a localization key.&lt;br /&gt;
&lt;br /&gt;
type: There are multiple types of missions. Primary, Secondary, Tutorial and FTUE. The first 2 are for the missions you see in Mission Control. Tutorial missions are the ones seen in the Training Center and FTUE are the pop-ups that appear when you have Cadet Orientation on.&lt;br /&gt;
&lt;br /&gt;
Owner: There are multiple owners that you can choose from. None, Agency, Owner and Player. Player means only the player will have it. Agency means the agency the player is in will own it. (Which means in multiplayer everyone in that agency can complete it.) Global and None are self explanatory.&lt;br /&gt;
&lt;br /&gt;
state: There are multiple states of missions. Inactive, Active, Complete, Failed and Invalid. You should only focus on the first 2 when creating missions. Inactive means that it&#039;ll be invisible until a mission activates your mission. Active means it&#039;ll be enabled from the start.&lt;br /&gt;
&lt;br /&gt;
MissionGranterKey. There are multiple mission granters to choose from. It&#039;s best to choose the one that suits your mission the best.&lt;br /&gt;
&lt;br /&gt;
TriumphLoopVideoKey: Videos that play once you&#039;ve submitted the mission. Best example of this are the first few primary missions.&lt;br /&gt;
&lt;br /&gt;
uiDisplayType: Default, Video, Flight, VAB, VAB_Flight. Usually use Default.&lt;br /&gt;
&lt;br /&gt;
missionStages: Here we get to the fun part of missions. The actual mission. They are set up in various &amp;quot;stages&amp;quot;. So if you wanted to have the player leave Kerbin and return, you&#039;d have 2 stages for leaving Kerbin and then landing back on Kerbin. Let&#039;s see how this is set up.&lt;br /&gt;
&lt;br /&gt;
stages:&lt;br /&gt;
&lt;br /&gt;
StageID: 0,1,2 (just counts up depending on what stage it is)&lt;br /&gt;
&lt;br /&gt;
name: This doesn&#039;t get displayed, so you can name it whatever you want.&lt;br /&gt;
&lt;br /&gt;
description: This also doesn&#039;t get displayed.&lt;br /&gt;
&lt;br /&gt;
Objective: This does get displayed, so preferably link it to a localization key or just state the objective here.&lt;br /&gt;
&lt;br /&gt;
DisplayObjective: Self-explanatory.&lt;br /&gt;
&lt;br /&gt;
RevealObjectiveOnActivate: This shows the objective once the stage is activated.&lt;br /&gt;
&lt;br /&gt;
MissionRewardType: You can only choose Science Points.&lt;br /&gt;
&lt;br /&gt;
RewardAmount: How much of whatever you chose is going to be rewarded.&lt;br /&gt;
&lt;br /&gt;
ConditionMode: AND, OR, XOR, NOT.&lt;br /&gt;
&lt;br /&gt;
Condition children: These are the things you need to do to actually finish a mission stage.&lt;br /&gt;
&lt;br /&gt;
There are event conditions and property conditions. Event conditions listen to messages like GameStateChangedMessage or FlagPlantedMessage. Property conditions look at what your current active vessel has, for example where it&#039;s located, its deltaV, etc.&lt;br /&gt;
&lt;br /&gt;
Note that you can create conditionsets inside of conditionsets. If you wanted to make something where a player can plant a flag on the Mun or Minmus, you can do so by just creating a ConditionSet with its mode set to AND, listening to FlagPlantedMessage, then creating &lt;br /&gt;
&lt;br /&gt;
a condition set inside of that with its mode set to OR, and checking the active vessel SOI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ContentBranches: Here&#039;s the stuff that gets done inside of the Mission Control building. They&#039;re similarly set up to the missionStages.&lt;br /&gt;
&lt;br /&gt;
ID: What type of content branch it is. There are 3 to choose from, which are: Brief, Debrief, OnSubmit. Brief and Debrief are the short little dialogues you get when you finish/start a mission. OnSubmit is mostly used to activate missions.&lt;br /&gt;
&lt;br /&gt;
Action: There are multiple actions that you can make your branches do:&lt;br /&gt;
&lt;br /&gt;
Activate Mission, Fullscreen Video, Message Box (note that this is different from CharacterDialog), Audio, OAB Settings, Character Dialog, Create Snapshot, Destination Position, Disable Input, Highlight, Indicator, Pause, Reload Snapshot Resolution, Set View State, Lua Script&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Saving your Mission&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So you&#039;ve finally completed your mission! Great! Putting it into the game is simple. Click the floppy disk icon and save it as a .patch file. You will then have to place it into your mod and run the game.&lt;br /&gt;
[[Category:Mods]]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=How_to_name_your_part&amp;diff=1487</id>
		<title>How to name your part</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=How_to_name_your_part&amp;diff=1487"/>
		<updated>2025-11-15T11:02:10Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: typos again&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Stock part names somewhat follow the following pattern : &amp;lt;code&amp;gt;&amp;lt;type&amp;gt;_&amp;lt;size&amp;gt;_&amp;lt;feature&amp;gt;_&amp;lt;resource&amp;gt;_&amp;lt;cardinal&amp;gt;_&amp;lt;name&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should always prepend the mod name/mod ID to the part name : &amp;lt;code&amp;gt;&amp;lt;modId&amp;gt;_&amp;lt;type&amp;gt;_&amp;lt;size&amp;gt;_&amp;lt;feature&amp;gt;_&amp;lt;resource&amp;gt;_&amp;lt;cardinal&amp;gt;_&amp;lt;name&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Type ==&lt;br /&gt;
Mandatory.&lt;br /&gt;
&lt;br /&gt;
Possible values:  adapter, antenna, booster, cabin, cargobay, dockingport, engine, probe, etc.&lt;br /&gt;
&lt;br /&gt;
== Size ==&lt;br /&gt;
Mandatory.&lt;br /&gt;
&lt;br /&gt;
From 0v (XS) to 5v (2X) but could go higher if need be.&lt;br /&gt;
&lt;br /&gt;
See [[Sizes]] for a full list.&lt;br /&gt;
&lt;br /&gt;
Possible values: 0v, 1v, 2v, etc.&lt;br /&gt;
&lt;br /&gt;
== Feature ==&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
The feature can be anything needed to distinguish this part from a similar part. It usually has to do with the form factor.&lt;br /&gt;
&lt;br /&gt;
Possible values: radial, inline, conical, dish, triangle, etc.&lt;br /&gt;
&lt;br /&gt;
== Resource ==&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
This is meant for part that can contain a resource, like engines and fuel tanks.&lt;br /&gt;
&lt;br /&gt;
Possible values: methalox, hydrogen, solid, crew, electricity, xenon&lt;br /&gt;
&lt;br /&gt;
== Cardinal ==&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
Useful for distinguishing same-size parts that exists in different heights, like fuel tanks.&lt;br /&gt;
&lt;br /&gt;
Possible values: 1x1, 1x2, 1x3, 2x3, 3x2, etc.&lt;br /&gt;
&lt;br /&gt;
== Name ==&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
You can add the part localized name at the end if it helps identifying it more easily.&lt;br /&gt;
&lt;br /&gt;
Example: engine_1v_methalox_terrier&lt;br /&gt;
&lt;br /&gt;
== Examples of stock part names ==&lt;br /&gt;
&lt;br /&gt;
* adapter_2v_conical_methalox_1v-2v&lt;br /&gt;
* antenna_1v_dish_hg55&lt;br /&gt;
* booster_1v_solid_kickback&lt;br /&gt;
* cabin_2v_crew_hitchhiker&lt;br /&gt;
* cargobay_3v_m3_1x2&lt;br /&gt;
* collector_0v_science_radiation&lt;br /&gt;
* decoupler_2v_inline&lt;br /&gt;
* dockingport_1v_inline_sideport&lt;br /&gt;
* engine_1v_methalox_terrier&lt;br /&gt;
* fairing_1v_procedural&lt;br /&gt;
* fueltank_1v_inline_methalox_1x4&lt;br /&gt;
* heatshield_1v&lt;br /&gt;
* panel_1v_triangle_right&lt;br /&gt;
* probe_1v_hexagonal_electricity&lt;br /&gt;
* solararray_1v_1x6&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Main_Page&amp;diff=1486</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Main_Page&amp;diff=1486"/>
		<updated>2025-11-15T09:35:46Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: Adjust order of categories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= KSP 2 Modding Wiki =&lt;br /&gt;
Welcome to the KSP 2 Modding Wiki, a collection of resources on how to mod the game and information on existing community mods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We are currently under construction!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Page Categories ==&lt;br /&gt;
&lt;br /&gt;
* [[General Modding Guidelines and Resources]]&lt;br /&gt;
* [[Part Modding]]&lt;br /&gt;
* [[Part Modules]]&lt;br /&gt;
* [[Planet Modding]]&lt;br /&gt;
* [[KSP2 Redux]]&lt;br /&gt;
* [[Other]]&lt;br /&gt;
* [[Duplicates, Deprecates and other miscreants|Pages that require attention/need to be deleted (for Kiwi)]]&amp;lt;br /&amp;gt;&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://ksp2community.github.io/ KSP 2 Unofficial API Reference]&lt;br /&gt;
* [https://discord.gg/hHW5gpHxfE KSP 2 Modding Society Discord Server]&lt;br /&gt;
* [https://docs.spacewarp.org/ SpaceWarp Modding API Documentation]&lt;br /&gt;
* [https://github.com/KSP2Community KSP 2 Community GitHub]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=General_Modding_Guidelines_and_Resources&amp;diff=1485</id>
		<title>General Modding Guidelines and Resources</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=General_Modding_Guidelines_and_Resources&amp;diff=1485"/>
		<updated>2025-11-15T09:34:10Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Overview of pages that offer general modding guidelines and useful resources and information for modders&lt;br /&gt;
&lt;br /&gt;
* [[Setting up a Development Environment]]&lt;br /&gt;
* [[UnityExplorer]]&lt;br /&gt;
* [[How to use Unity Explorer and Object Browser]]&lt;br /&gt;
* [[Subscribe to game Messages]]&lt;br /&gt;
* [[Transform System Guide]]&lt;br /&gt;
* [[Orbits and PatchedConicsOrbit methods and info]]&lt;br /&gt;
* [[PatchedConicSolver]]&lt;br /&gt;
* [[PartsProvider]]&lt;br /&gt;
* [[Scenery - Standard (Opaque) shader]]&lt;br /&gt;
* [[Staging Icon Asset Address]]&lt;br /&gt;
* [[Stage Type|Stage Types]]&lt;br /&gt;
* [[Category|Part Category]]&lt;br /&gt;
* [[Resources]]&lt;br /&gt;
* [[UniverseModel]]&lt;br /&gt;
* [[VesselComponent]]&lt;br /&gt;
* [[Custom Launch Locations]]&lt;br /&gt;
* [[Colors|UI Colors]]&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
	<entry>
		<id>https://modding.kerbal.wiki/index.php?title=Class_descriptions_for_custom_modules&amp;diff=1484</id>
		<title>Class descriptions for custom modules</title>
		<link rel="alternate" type="text/html" href="https://modding.kerbal.wiki/index.php?title=Class_descriptions_for_custom_modules&amp;diff=1484"/>
		<updated>2025-11-15T09:30:56Z</updated>

		<summary type="html">&lt;p&gt;Dandoesstuff: With the release of Redux, PartComponentModules need to be registered for updates. I made sure to document this here.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Custom Modules]]&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:2_Class_descriptions_for_custom_modules}}&lt;br /&gt;
&lt;br /&gt;
While you&#039;re mostly free to define how your classes would be set up, there are some guidelines that need to be followed, restrictions to be aware of and inner workings to understand.&lt;br /&gt;
&lt;br /&gt;
== Data class ==&lt;br /&gt;
&lt;br /&gt;
=== Defining your class ===&lt;br /&gt;
 [Serializable]&lt;br /&gt;
 public class Data_MyCustomModule : ModuleData&lt;br /&gt;
 { .. }&lt;br /&gt;
&lt;br /&gt;
=== Set your PartBehaviourModule type reference ===&lt;br /&gt;
 public override Type ModuleType =&amp;gt; typeof(Module_MyCustomModule);&lt;br /&gt;
&lt;br /&gt;
=== Defining module properties ===&lt;br /&gt;
&lt;br /&gt;
* these are entries shown in the PAM&lt;br /&gt;
&lt;br /&gt;
 // Toggle (true/false) property&lt;br /&gt;
 [KSPState] // KSPState attribute tells the game to save the state of this property in the save game file&lt;br /&gt;
 [LocalizedField(&amp;quot;Path/To/Your/Localization/String1&amp;quot;)] // localization string for this attribute (see &#039;localization&#039; paragraph)&lt;br /&gt;
 [PAMDisplayControl(SortIndex = 2)] // sets the sorting index for this property. Lower values are placed first&lt;br /&gt;
 public ModuleProperty&amp;lt;bool&amp;gt; SomeToggleProperty = new(false); // value in the parentheses defines the initial value&lt;br /&gt;
 &lt;br /&gt;
 // String property&lt;br /&gt;
 [LocalizedField(&amp;quot;Path/To/Your/Localization/String2&amp;quot;)]&lt;br /&gt;
 [PAMDisplayControl(SortIndex = 4)]&lt;br /&gt;
 [KSPDefinition] // KSPDefinition tells this property that its value is set from the part definition json (set by Patch Manager)&lt;br /&gt;
 public ModuleProperty&amp;lt;string&amp;gt; SomeStringProperty = new (&amp;quot;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
 // Float property - readonly&lt;br /&gt;
 [LocalizedField(&amp;quot;Path/To/Your/Localization/String3&amp;quot;)]&lt;br /&gt;
 [PAMDisplayControl(SortIndex = 7)]&lt;br /&gt;
 [JsonIgnore] // either [KSPState] or [JsonIgnore] is needed if you want this property to be readonly&lt;br /&gt;
 public ModuleProperty&amp;lt;float&amp;gt; SomeReadOnlyFloat = new (0, true, val =&amp;gt; $&amp;quot;{val:N0} m&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
 // Float property – editable by players, will be built as a slider&lt;br /&gt;
 [LocalizedField(&amp;quot;Path/To/Your/Localization/String4&amp;quot;)]&lt;br /&gt;
 [PAMDisplayControl(SortIndex = 1)]&lt;br /&gt;
 [SteppedRange(1f, 45f, 1f)] // minimum, maximum and step values&lt;br /&gt;
 public ModuleProperty&amp;lt;float&amp;gt; SomeEditableProperty = new (1f, false, val =&amp;gt; $&amp;quot;{val:N0}°&amp;quot;); // initial value, isReadOnly, ToStringDelegate&lt;br /&gt;
&lt;br /&gt;
=== Defining a dropdown list property ===&lt;br /&gt;
&lt;br /&gt;
* dropdown list properties are string properties for which you define dropdown values in OnPartBehaviourModuleInit()&lt;br /&gt;
&lt;br /&gt;
 // Dropdown property&lt;br /&gt;
 [LocalizedField(&amp;quot;Path/To/Your/Localization/String5&amp;quot;)]&lt;br /&gt;
 public ModuleProperty&amp;lt;string&amp;gt; DropdownProperty = new ModuleProperty&amp;lt;string&amp;gt;(&amp;quot;Some value&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
 public override void OnPartBehaviourModuleInit()&lt;br /&gt;
 {&lt;br /&gt;
     var dropdownList = new DropdownItemList();&lt;br /&gt;
     dropdownList.Add(&amp;quot;some key&amp;quot;, new DropdownItem() { key = &amp;quot;some key&amp;quot;, text = &amp;quot;Some value&amp;quot; });&lt;br /&gt;
     dropdownList.Add(&amp;quot;another key&amp;quot;, new DropdownItem() { key = &amp;quot;another key&amp;quot;, text = &amp;quot;Another value&amp;quot; });&lt;br /&gt;
     SetDropdownData(DropdownProperty, dropdownList);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== OnPartBehaviourModuleInit() ===&lt;br /&gt;
&lt;br /&gt;
* runs when this module is initialized when entering Flight/OAB state&lt;br /&gt;
&lt;br /&gt;
 public override void OnPartBehaviourModuleInit()&lt;br /&gt;
 { /* use this to initialize some values for your module, if needed */ }&lt;br /&gt;
&lt;br /&gt;
=== OAB module description ===&lt;br /&gt;
&lt;br /&gt;
* set the description of your module for all parts it’s being attached to&lt;br /&gt;
* description is shown in OAB and R&amp;amp;D while hovering over the part after pressing SHIFT&lt;br /&gt;
&lt;br /&gt;
 public override List&amp;lt;OABPartData.PartInfoModuleEntry&amp;gt; GetPartInfoEntries(Type partBehaviourModuleType, List&amp;lt;OABPartData.PartInfoModuleEntry&amp;gt; delegateList)&lt;br /&gt;
 {&lt;br /&gt;
     if (partBehaviourModuleType == ModuleType)&lt;br /&gt;
     {&lt;br /&gt;
         // add module description&lt;br /&gt;
         delegateList.Add(new OABPartData.PartInfoModuleEntry(&amp;quot;&amp;quot;, (_) =&amp;gt; „Path/To/Your/Localization/String5“));&lt;br /&gt;
 &lt;br /&gt;
         // entry header&lt;br /&gt;
         var entry = new OABPartData.PartInfoModuleEntry(„Path/To/Your/Localization/String6“,&lt;br /&gt;
             _ =&amp;gt;&lt;br /&gt;
             {&lt;br /&gt;
                 // subentries&lt;br /&gt;
                 var subEntries = new List&amp;lt;OABPartData.PartInfoModuleSubEntry&amp;gt;();&lt;br /&gt;
        &lt;br /&gt;
                 // first subentry&lt;br /&gt;
                 subEntries.Add(new OABPartData.PartInfoModuleSubEntry(&lt;br /&gt;
                     &amp;quot;Path/To/Your/Localization/String7&amp;quot;, // subentry NAME&lt;br /&gt;
                     &amp;quot;subentry value&amp;quot;&lt;br /&gt;
                 ));&lt;br /&gt;
 &lt;br /&gt;
                 // second subentry&lt;br /&gt;
                 subEntries.Add(new OABPartData.PartInfoModuleSubEntry(&lt;br /&gt;
                     &amp;quot;Path/To/Your/Localization/String8&amp;quot;, // subentry NAME&lt;br /&gt;
                     &amp;quot;subentry value&amp;quot;&lt;br /&gt;
                 ));&lt;br /&gt;
 &lt;br /&gt;
                 // if your module is using resources, you can add them to the description&lt;br /&gt;
                 // this doesn&#039;t set the value, it&#039;s just used to display it to the player&lt;br /&gt;
                 if (UseResources)&lt;br /&gt;
                 {&lt;br /&gt;
                     subEntries.Add(new OABPartData.PartInfoModuleSubEntry(&lt;br /&gt;
                         &amp;quot;Path/To/Your/Localization/String/ResourceName&amp;quot;,&lt;br /&gt;
                         $&amp;quot;{RequiredResource.Rate.ToString(&amp;quot;N3&amp;quot;)} /s&amp;quot;&lt;br /&gt;
                     ));&lt;br /&gt;
                 }&lt;br /&gt;
 &lt;br /&gt;
                 return subEntries;&lt;br /&gt;
             });&lt;br /&gt;
         delegateList.Add(entry);&lt;br /&gt;
     }&lt;br /&gt;
     return delegateList;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Setting up resource consumptions ===&lt;br /&gt;
&lt;br /&gt;
* Note: trigger this from OnStart() in the Part Component class&lt;br /&gt;
&lt;br /&gt;
 public override void SetupResourceRequest(ResourceFlowRequestBroker resourceFlowRequestBroker)&lt;br /&gt;
 {&lt;br /&gt;
     if (UseResources)&lt;br /&gt;
     {&lt;br /&gt;
         ResourceDefinitionID resourceIDFromName =&lt;br /&gt;
             GameManager.Instance.Game.ResourceDefinitionDatabase.GetResourceIDFromName(this.RequiredResource.ResourceName);&lt;br /&gt;
         if (resourceIDFromName == ResourceDefinitionID.InvalidID)&lt;br /&gt;
         {&lt;br /&gt;
             _LOGGER.LogError($&amp;quot;There are no resources with name {this.RequiredResource.ResourceName}&amp;quot;);&lt;br /&gt;
             return;&lt;br /&gt;
         }&lt;br /&gt;
         RequestConfig = new ResourceFlowRequestCommandConfig();&lt;br /&gt;
         RequestConfig.FlowResource = resourceIDFromName;&lt;br /&gt;
         RequestConfig.FlowDirection = FlowDirection.FLOW_OUTBOUND;&lt;br /&gt;
         RequestConfig.FlowUnits = 0.0;&lt;br /&gt;
         RequestHandle = resourceFlowRequestBroker.AllocateOrGetRequest(&amp;quot;MyCustomModule&amp;quot;, default(ResourceFlowRequestHandle));&lt;br /&gt;
         resourceFlowRequestBroker.SetCommands(this.RequestHandle, 1.0, new ResourceFlowRequestCommandConfig[] { this.RequestConfig });&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [KSPDefinition]&lt;br /&gt;
 [Tooltip(&amp;quot;Whether the module consumes resources&amp;quot;)]&lt;br /&gt;
 public bool UseResources = true;&lt;br /&gt;
 &lt;br /&gt;
 public bool HasResourcesToOperate = true;&lt;br /&gt;
 &lt;br /&gt;
 [KSPDefinition]&lt;br /&gt;
 [Tooltip(&amp;quot;Resource required to operate this module if it consumes resources&amp;quot;)]&lt;br /&gt;
 public PartModuleResourceSetting RequiredResource;&lt;br /&gt;
 &lt;br /&gt;
 public ResourceFlowRequestCommandConfig RequestConfig;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
== Part Behaviour class ==&lt;br /&gt;
&lt;br /&gt;
=== Defining your class ===&lt;br /&gt;
 [DisallowMultipleComponent]&lt;br /&gt;
 public class Module_OrbitalSurvey : PartBehaviourModule&lt;br /&gt;
 { .. }&lt;br /&gt;
&lt;br /&gt;
=== Set your PartComponentModule type reference ===&lt;br /&gt;
 public override Type PartComponentModuleType =&amp;gt; typeof(PartComponentModule_MyCustomModule);&lt;br /&gt;
&lt;br /&gt;
=== Create Data module instance ===&lt;br /&gt;
 [SerializeField]&lt;br /&gt;
 protected Data_MyCustomModule _dataMyCustomModule;&lt;br /&gt;
 &lt;br /&gt;
 public override void AddDataModules()&lt;br /&gt;
 {&lt;br /&gt;
     base.AddDataModules();&lt;br /&gt;
     _dataMyCustomModule ??= new Data_MyCustomModule();&lt;br /&gt;
     DataModules.TryAddUnique(_dataMyCustomModule, out _dataMyCustomModule);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Initialize the module behaviour ===&lt;br /&gt;
 private ModuleAction _myCustomAction;&lt;br /&gt;
 &lt;br /&gt;
 public override void OnInitialize()&lt;br /&gt;
 {&lt;br /&gt;
     base.OnInitialize();&lt;br /&gt;
 &lt;br /&gt;
     // module actions are triggered when players press a button on the PAM property&lt;br /&gt;
     _myCustomAction = new ModuleAction(MethodThatWillHandleTheAction);&lt;br /&gt;
     _dataMyCustomModule.AddAction(&amp;quot;Path/To/Your/Localization/String/X&amp;quot;, _myCustomAction, 1);&lt;br /&gt;
 &lt;br /&gt;
     if (PartBackingMode == PartBackingModes.Flight)&lt;br /&gt;
     {&lt;br /&gt;
         /* do stuff that&#039;s only needed in Flight view */&lt;br /&gt;
 &lt;br /&gt;
         // example1: hide or show PAM properties depending on the Flight/OAB view&lt;br /&gt;
         UpdateFlightPAMVisibility(); &lt;br /&gt;
 &lt;br /&gt;
         // example2: subscribe to the enabled toggle&lt;br /&gt;
         _dataMyCustomModule.EnabledToggleProperty.OnChangedValue += MethodThatWillHandleThis;&lt;br /&gt;
     } &lt;br /&gt;
 &lt;br /&gt;
     if (PartBackingMode == PartBackingModes.OAB)&lt;br /&gt;
     { /* do stuff that&#039;s only needed in the OAB*/ }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 private void MethodThatWillHandleTheAction()&lt;br /&gt;
 { /* do stuff here */}&lt;br /&gt;
&lt;br /&gt;
=== FixedUpdate loop - Flight/Map ===&lt;br /&gt;
&lt;br /&gt;
* define stuff that needs to be executed continuously on every FixedUpdate loop. Be careful not to do expensive stuff here&lt;br /&gt;
* this triggers when the vessel is loaded, in Flight/Map view only&lt;br /&gt;
&lt;br /&gt;
 // This triggers in flight&lt;br /&gt;
 public override void OnModuleFixedUpdate(float fixedDeltaTime)&lt;br /&gt;
 {   &lt;br /&gt;
     // example1: do stuff only if the module is enabled&lt;br /&gt;
     if (_dataMyCustomModule.EnabledToggleProperty.GetValue())&lt;br /&gt;
     { .. }&lt;br /&gt;
 &lt;br /&gt;
     // example2: update PAM items&lt;br /&gt;
     if (someConditionMet)&lt;br /&gt;
     {&lt;br /&gt;
         UpdateFlightPAMVisibility();&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Update loop ===&lt;br /&gt;
&lt;br /&gt;
* similar to FixedUpdate, but this is a regular Update loop independent of game time&lt;br /&gt;
* this triggers in Flight/Map when the vessel is loaded and in OAB when the part is attached to the assembly&lt;br /&gt;
&lt;br /&gt;
 public override void OnUpdate(float deltaTime)&lt;br /&gt;
 { .. }&lt;br /&gt;
&lt;br /&gt;
=== FixedUpdate loop - OAB ===&lt;br /&gt;
&lt;br /&gt;
* same as OnModuleFixedUpdate but it triggers only in OAB&lt;br /&gt;
&lt;br /&gt;
 public override void OnModuleOABFixedUpdate(float deltaTime)&lt;br /&gt;
 { .. }&lt;br /&gt;
&lt;br /&gt;
=== Define behaviour when the behaviour module instance will be destroyed ===&lt;br /&gt;
&lt;br /&gt;
* cases: exiting Flight view, part has been destroyed, exiting the game&lt;br /&gt;
&lt;br /&gt;
 public override void OnShutdown()&lt;br /&gt;
 {&lt;br /&gt;
     // example: unsubscribe from events&lt;br /&gt;
     _dataMyCustomModule.EnabledToggleProperty.OnChangedValue -= OnToggleChangedValue;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Setting visibility for PAM properties ===&lt;br /&gt;
 private void UpdateFlightPAMVisibility(bool state)&lt;br /&gt;
 {&lt;br /&gt;
     _dataMyCustomModule.SetVisible(_dataMyCustomModule.SomeProperty, state);&lt;br /&gt;
     _dataMyCustomModule.SetVisible(_dataMyCustomModule.SomeOtherProperty, true);&lt;br /&gt;
     _dataMyCustomModule.SetVisible(_dataMyCustomModule.YetAnotherProperty, false);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== OnEnable ===&lt;br /&gt;
&lt;br /&gt;
* triggers when Flight view is loaded (only for the loaded vessel) and in OAB when part is added to the assembly&lt;br /&gt;
&lt;br /&gt;
 protected void OnEnable()&lt;br /&gt;
 { .. }&lt;br /&gt;
&lt;br /&gt;
== Part Component class ==&lt;br /&gt;
&lt;br /&gt;
=== Defining your class ===&lt;br /&gt;
 public class PartComponentModule_MyCustomModule : PartBehaviourModule&lt;br /&gt;
 { .. }&lt;br /&gt;
&lt;br /&gt;
=== Set your PartBehaviourModule type reference ===&lt;br /&gt;
 public override Type PartComponentModuleType =&amp;gt; typeof(PartComponentModule_MyCustomModule);&lt;br /&gt;
&lt;br /&gt;
=== OnStart(double universalTime) ===&lt;br /&gt;
&lt;br /&gt;
* for new vessels this will run when the Flight view is loaded&lt;br /&gt;
* also runs on load for every vessel currently in Flight (don&#039;t need to be loaded).&lt;br /&gt;
* best used for any kind of initialization of backend tasks this vessel/module needs to go through&lt;br /&gt;
&lt;br /&gt;
 private Data_MyCustomModule _dataMyCustomModule;&lt;br /&gt;
 &lt;br /&gt;
 public override void OnStart(double universalTime)&lt;br /&gt;
 {&lt;br /&gt;
     &lt;br /&gt;
     // set a reference to the Data class&lt;br /&gt;
     if (!DataModules.TryGetByType&amp;lt;Data_MyCustomModule&amp;gt;(out _dataMyCustomModule))&lt;br /&gt;
     {&lt;br /&gt;
         _LOGGER.LogError(&amp;quot;Unable to find a Data_MyCustomModule in the PartComponentModule for &amp;quot; + base.Part.PartName);&lt;br /&gt;
         return;&lt;br /&gt;
     }&lt;br /&gt;
     Part.RegisterModuleForUpdates(this) // Register module for updates. Make sure to unregister when the part is being shut down!&lt;br /&gt;
     // initialize resource requests&lt;br /&gt;
     _dataMyCustomModule.SetupResourceRequest(base.resourceFlowRequestBroker);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== OnUpdate ===&lt;br /&gt;
&lt;br /&gt;
* this starts triggering when the vessel is first placed in Flight. Doesn&#039;t trigger in the OAB before that&lt;br /&gt;
* once the vessel is in Flight, it will always trigger, in any view, until the part is destroyed/recovered&lt;br /&gt;
* use this for tasks that need to continually run, even when vessel is unloaded. Be careful not to put expensive tasks here.&lt;br /&gt;
* NOTE: With the release of Redux you must *register the part module for updates*. This is to improve performance. Register it on OnStart() and unregister it on OnShutdown(), or when appropriate for your part module.&lt;br /&gt;
&lt;br /&gt;
 public override void OnUpdate(double universalTime, double deltaUniversalTime)&lt;br /&gt;
 {&lt;br /&gt;
     ResourceConsumptionUpdate(deltaUniversalTime); // example1: trigger resources consumption&lt;br /&gt;
     UpdateStatusAndState(); // example2: do general status updates if needed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== Resource consumption ===&lt;br /&gt;
 private void ResourceConsumptionUpdate(double deltaTime)&lt;br /&gt;
 {&lt;br /&gt;
     if (_dataMyCustomModule.UseResources)&lt;br /&gt;
     {&lt;br /&gt;
         if (GameManager.Instance.Game.SessionManager.IsDifficultyOptionEnabled(&amp;quot;InfinitePower&amp;quot;))&lt;br /&gt;
         {&lt;br /&gt;
             _dataMyCustomModule.HasResourcesToOperate = true;&lt;br /&gt;
             if (base.resourceFlowRequestBroker.IsRequestActive(_dataMyCustomModule.RequestHandle))&lt;br /&gt;
             {&lt;br /&gt;
                 base.resourceFlowRequestBroker.SetRequestInactive(_dataMyCustomModule.RequestHandle);&lt;br /&gt;
                 return;&lt;br /&gt;
             }&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
             if (this._hasOutstandingRequest)&lt;br /&gt;
             {&lt;br /&gt;
                 this._returnedRequestResolutionState =&lt;br /&gt;
                     base.resourceFlowRequestBroker.GetRequestState(_dataMyCustomModule.RequestHandle);&lt;br /&gt;
                 _dataMyCustomModule.HasResourcesToOperate = this._returnedRequestResolutionState.WasLastTickDeliveryAccepted;&lt;br /&gt;
             }&lt;br /&gt;
             this._hasOutstandingRequest = false;&lt;br /&gt;
             if (!_dataMyCustomModule.EnabledToggleProperty.GetValue() &amp;amp;&amp;amp;&lt;br /&gt;
                 base.resourceFlowRequestBroker.IsRequestActive(_dataMyCustomModule.RequestHandle))&lt;br /&gt;
             {&lt;br /&gt;
                 base.resourceFlowRequestBroker.SetRequestInactive(_dataMyCustomModule.RequestHandle);&lt;br /&gt;
                 _dataMyCustomModule.HasResourcesToOperate = false;&lt;br /&gt;
             }&lt;br /&gt;
             else if (_dataMyCustomModule.EnabledToggle.GetValue() &amp;amp;&amp;amp;&lt;br /&gt;
                 base.resourceFlowRequestBroker.IsRequestInactive(_dataMyCustomModule.RequestHandle))&lt;br /&gt;
             {&lt;br /&gt;
                 base.resourceFlowRequestBroker.SetRequestActive(_dataMyCustomModule.RequestHandle);&lt;br /&gt;
             }&lt;br /&gt;
             if (_dataMyCustomModule.EnabledToggleProperty.GetValue())&lt;br /&gt;
             {&lt;br /&gt;
                 _dataMyCustomModule.RequestConfig.FlowUnits = (double)_dataMyCustomModule.RequiredResource.Rate;&lt;br /&gt;
                 base.resourceFlowRequestBroker.SetCommands(_dataMyCustomModule.RequestHandle, 1.0,&lt;br /&gt;
                     new ResourceFlowRequestCommandConfig[] { _dataMyCustomModule.RequestConfig });&lt;br /&gt;
                 this._hasOutstandingRequest = true;&lt;br /&gt;
                 return;&lt;br /&gt;
             }&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     else&lt;br /&gt;
     {&lt;br /&gt;
         _dataMyCustomModule.HasResourcesToOperate = true;&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
=== OnShutdown ===&lt;br /&gt;
&lt;br /&gt;
* define behaviour when the Part Component instance will be destroyed&lt;br /&gt;
* cases: part has been destroyed, exiting the game&lt;br /&gt;
&lt;br /&gt;
 public override void OnShutdown()&lt;br /&gt;
 { .. }&lt;/div&gt;</summary>
		<author><name>Dandoesstuff</name></author>
	</entry>
</feed>