Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Get the templates ready for Beta 1!
Browse files Browse the repository at this point in the history
  • Loading branch information
AptiviCEO committed Jan 19, 2023
1 parent 9db4a53 commit b8e852a
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 163 deletions.
6 changes: 3 additions & 3 deletions working/templatepack.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageType>Template</PackageType>
<PackageVersion>0.0.24.4</PackageVersion>
<PackageVersion>0.1.0-beta1</PackageVersion>
<PackageId>KS.Templates</PackageId>
<Title>Kernel Simulator Templates</Title>
<Authors>Aptivi</Authors>
<Description>Templates to use when creating KS mods, screensavers, and splashes</Description>
<PackageTags>dotnet-new;templats;ks;kernel;simulator</PackageTags>
<TargetFramework>net48</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
Expand Down
6 changes: 3 additions & 3 deletions working/templates/KSMod/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
}
Expand Down
6 changes: 3 additions & 3 deletions working/templates/KSMod/Command2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
}
Expand Down
58 changes: 7 additions & 51 deletions working/templates/KSMod/KSMod.csproj
Original file line number Diff line number Diff line change
@@ -1,55 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{67F3F8A6-B20F-4CA0-A119-E356154DCD78}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KSModTemplate</RootNamespace>
<AssemblyName>KSModTemplate</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Command2.cs" />
<Compile Include="ModName.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Command.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="KS">
<Version>0.0.24.4</Version>
</PackageReference>
<PackageReference Include="KS" Version="0.1.0-beta1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

</Project>
14 changes: 11 additions & 3 deletions working/templates/KSMod/ModName.cs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
{

}
}
}
Expand Down
56 changes: 7 additions & 49 deletions working/templates/KSScreensaver/KSScreensaver.csproj
Original file line number Diff line number Diff line change
@@ -1,53 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E7042BDB-9B80-45BF-90AD-A02FEAE68E70}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KSScreensaverTemplate</RootNamespace>
<AssemblyName>KSScreensaverTemplate</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ScreensaverNameDisp.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="KS">
<Version>0.0.24.4</Version>
</PackageReference>
<PackageReference Include="KS" Version="0.1.0-beta1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

</Project>
56 changes: 7 additions & 49 deletions working/templates/KSSplash/KSCustomSplash.csproj
Original file line number Diff line number Diff line change
@@ -1,53 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D9BE3476-C4BF-4A2E-A71C-5E2847D553EF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KSCustomSplashTemplate</RootNamespace>
<AssemblyName>KSCustomSplashTemplate</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="SplashName.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="KS">
<Version>0.0.24.4</Version>
</PackageReference>
<PackageReference Include="KS" Version="0.1.0-beta1" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

</Project>
7 changes: 7 additions & 0 deletions working/templates/KSSplash/SplashName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// splash code.

using KS.Misc.Splash;
using System;

namespace KSCustomSplashTemplate
{
Expand Down Expand Up @@ -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.
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion working/tools/pack.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ REM along with this program. If not, see <https://www.gnu.org/licenses/>.

: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
Expand Down
2 changes: 1 addition & 1 deletion working/tools/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b8e852a

Please sign in to comment.