diff --git a/SpaceWarp.Template/templates/SpaceWarpMod/src/SpaceWarpMod/SpaceWarpModPlugin.cs b/SpaceWarp.Template/templates/SpaceWarpMod/src/SpaceWarpMod/SpaceWarpModPlugin.cs index b7064f9..0e8d96e 100644 --- a/SpaceWarp.Template/templates/SpaceWarpMod/src/SpaceWarpMod/SpaceWarpModPlugin.cs +++ b/SpaceWarp.Template/templates/SpaceWarpMod/src/SpaceWarpMod/SpaceWarpModPlugin.cs @@ -29,6 +29,7 @@ public class SpaceWarpModPlugin : BaseSpaceWarpPlugin // AppBar button IDs private const string ToolbarFlightButtonID = "BTN-SpaceWarpModFlight"; private const string ToolbarOabButtonID = "BTN-SpaceWarpModOAB"; + private const string ToolbarKscButtonID = "BTN-SpaceWarpModKSC"; // Singleton instance of the plugin class public static SpaceWarpModPlugin Instance { get; set; } @@ -66,6 +67,17 @@ public override void OnInitialized() } ); + // Register KSC AppBar Button + Appbar.RegisterKSCAppButton( + ModName, + ToolbarKscButtonID, + AssetManager.GetAsset($"{Info.Metadata.GUID}/images/icon.png"), + () => + { + _isWindowOpen = !_isWindowOpen; + } + ); + // Register all Harmony patches in the project Harmony.CreateAndPatchAll(typeof(SpaceWarpModPlugin).Assembly);