From b8e852a8d1b57afbeabf76fa8b8b524dd9305fdc Mon Sep 17 00:00:00 2001 From: Aptivi CEO Date: Thu, 19 Jan 2023 13:30:24 +0200 Subject: [PATCH] Get the templates ready for Beta 1! --- working/templatepack.csproj | 6 +- working/templates/KSMod/Command.cs | 6 +- working/templates/KSMod/Command2.cs | 6 +- working/templates/KSMod/KSMod.csproj | 58 +++---------------- working/templates/KSMod/ModName.cs | 14 ++++- .../KSScreensaver/KSScreensaver.csproj | 56 +++--------------- .../templates/KSSplash/KSCustomSplash.csproj | 56 +++--------------- working/templates/KSSplash/SplashName.cs | 7 +++ working/tools/pack.cmd | 2 +- working/tools/pack.sh | 2 +- 10 files changed, 50 insertions(+), 163 deletions(-) diff --git a/working/templatepack.csproj b/working/templatepack.csproj index dad8fba..854f3c3 100644 --- a/working/templatepack.csproj +++ b/working/templatepack.csproj @@ -1,14 +1,14 @@ - + Template - 0.0.24.4 + 0.1.0-beta1 KS.Templates Kernel Simulator Templates Aptivi Templates to use when creating KS mods, screensavers, and splashes dotnet-new;templats;ks;kernel;simulator - net48 + net6.0 true false content diff --git a/working/templates/KSMod/Command.cs b/working/templates/KSMod/Command.cs index 68889da..dafe874 100644 --- a/working/templates/KSMod/Command.cs +++ b/working/templates/KSMod/Command.cs @@ -6,12 +6,12 @@ namespace KSModTemplate { // Change the Command class to your command name - internal class Command : CommandExecutor, ICommand + internal class Command : BaseCommand, ICommand { - public override void Execute(string StringArgs, string[] ListArgs, string[] ListArgsOnly, string[] ListSwitchesOnly) + public override void Execute(string StringArgs, string[] ListArgsOnly, string[] ListSwitchesOnly) { // Here you can write statements about what happens when a mod command is executed. The arguments are split automatically by - // the shell, so you don't need to split the yourself. In case they don't fit your needs, here's a string literal version + // the shell, so you don't need to split them yourself. In case they don't fit your needs, here's a string literal version // of the passed arguments, StringArgs, which you can split it yourself. } } diff --git a/working/templates/KSMod/Command2.cs b/working/templates/KSMod/Command2.cs index a197dab..be513c1 100644 --- a/working/templates/KSMod/Command2.cs +++ b/working/templates/KSMod/Command2.cs @@ -6,12 +6,12 @@ namespace KSModTemplate { // Change the Command2 class to your command name - internal class Command2 : CommandExecutor, ICommand + internal class Command2 : BaseCommand, ICommand { - public override void Execute(string StringArgs, string[] ListArgs, string[] ListArgsOnly, string[] ListSwitchesOnly) + public override void Execute(string StringArgs, string[] ListArgsOnly, string[] ListSwitchesOnly) { // Here you can write statements about what happens when a mod command is executed. The arguments are split automatically by - // the shell, so you don't need to split the yourself. In case they don't fit your needs, here's a string literal version + // the shell, so you don't need to split them yourself. In case they don't fit your needs, here's a string literal version // of the passed arguments, StringArgs, which you can split it yourself. } } diff --git a/working/templates/KSMod/KSMod.csproj b/working/templates/KSMod/KSMod.csproj index cfb822c..a4da7a8 100644 --- a/working/templates/KSMod/KSMod.csproj +++ b/working/templates/KSMod/KSMod.csproj @@ -1,55 +1,11 @@ - - - + + - Debug - AnyCPU - {67F3F8A6-B20F-4CA0-A119-E356154DCD78} - Library - Properties - KSModTemplate - KSModTemplate - v4.8 - 512 - true + net6.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - + - - 0.0.24.4 - + - - \ No newline at end of file + + diff --git a/working/templates/KSMod/ModName.cs b/working/templates/KSMod/ModName.cs index d700010..36f6d81 100644 --- a/working/templates/KSMod/ModName.cs +++ b/working/templates/KSMod/ModName.cs @@ -1,5 +1,7 @@ -using KS.Modifications; +using KS.Kernel.Events; +using KS.Modifications; using KS.Shell.ShellBase.Commands; +using System; using System.Collections.Generic; namespace KSModTemplate @@ -11,20 +13,26 @@ public class ModName : IScript public string ModPart { get; set; } public string Version { get; set; } - public void InitEvents(string ev) + public Version MinimumSupportedApiVersion => new(3, 0, 25, 0); + + public void InitEvents(EventType Event) { + } - public void InitEvents(string ev, params object[] Args) + public void InitEvents(EventType Event, params object[] Args) { + } public void StartMod() { + } public void StopMod() { + } } } diff --git a/working/templates/KSScreensaver/KSScreensaver.csproj b/working/templates/KSScreensaver/KSScreensaver.csproj index bcb6ff4..a4da7a8 100644 --- a/working/templates/KSScreensaver/KSScreensaver.csproj +++ b/working/templates/KSScreensaver/KSScreensaver.csproj @@ -1,53 +1,11 @@ - - - + + - Debug - AnyCPU - {E7042BDB-9B80-45BF-90AD-A02FEAE68E70} - Library - Properties - KSScreensaverTemplate - KSScreensaverTemplate - v4.8 - 512 - true + net6.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - + - - 0.0.24.4 - + - - \ No newline at end of file + + diff --git a/working/templates/KSSplash/KSCustomSplash.csproj b/working/templates/KSSplash/KSCustomSplash.csproj index cf55e5e..a4da7a8 100644 --- a/working/templates/KSSplash/KSCustomSplash.csproj +++ b/working/templates/KSSplash/KSCustomSplash.csproj @@ -1,53 +1,11 @@ - - - + + - Debug - AnyCPU - {D9BE3476-C4BF-4A2E-A71C-5E2847D553EF} - Library - Properties - KSCustomSplashTemplate - KSCustomSplashTemplate - v4.8 - 512 - true + net6.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - + - - 0.0.24.4 - + - - \ No newline at end of file + + diff --git a/working/templates/KSSplash/SplashName.cs b/working/templates/KSSplash/SplashName.cs index eb7008e..26121df 100644 --- a/working/templates/KSSplash/SplashName.cs +++ b/working/templates/KSSplash/SplashName.cs @@ -3,6 +3,7 @@ // splash code. using KS.Misc.Splash; +using System; namespace KSCustomSplashTemplate { @@ -49,6 +50,12 @@ public void Closing() // Choose how would you like to make a closing transition / outro. The simplest one is setting the value of SplashClosing to true and clearing // the console. } + + public void ReportError(int Progress, string ErrorReport, Exception ExceptionInfo, params object[] Vars) + { + // Choose how would you like to update the progress error report. This can be as simple as updating the area where progress percentage and text + // is written, or you can increment the progress bar. This is called everytime the kernel fails when it tries to make some progress while booting. + } } } diff --git a/working/tools/pack.cmd b/working/tools/pack.cmd index 2ce6051..5ed487c 100644 --- a/working/tools/pack.cmd +++ b/working/tools/pack.cmd @@ -19,7 +19,7 @@ REM along with this program. If not, see . :build echo Building Kernel Simulator... -"%ProgramFiles%\dotnet\dotnet.exe" pack +"%ProgramFiles%\dotnet\dotnet.exe" pack ../../templatepack.sln if %errorlevel% == 0 goto :success echo There was an error trying to build (%errorlevel%). goto :finished diff --git a/working/tools/pack.sh b/working/tools/pack.sh index 589601e..c63af46 100644 --- a/working/tools/pack.sh +++ b/working/tools/pack.sh @@ -26,7 +26,7 @@ fi # Pack KS templates echo Packing KS templates... -"$dotnetpath" pack +"$dotnetpath" pack ../../templatepack.sln if [ ! $? == 0 ]; then echo Pack failed. exit 1