Modules - Ordering WIP

This commit is contained in:
SpoinkyNL committed 2020-08-27 00:21:44 +02:00
1 parent d62d389d9f
commit bfb122e95a
21 files changed
+535 -45

No files matched your search

@@ -36,15 +36,14 @@ namespace Artemis.Plugins.Modules.General
{
}
public override void Update(double deltaTime)
public override void ProfileUpdate(double deltaTime)
{
DataModel.TimeDataModel.CurrentTime = DateTime.Now;
DataModel.TimeDataModel.CurrentTimeUTC = DateTime.UtcNow;
UpdateCurrentWindow();
base.Update(deltaTime);
}
#region Open windows
public void UpdateCurrentWindow()
@@ -0,0 +1,37 @@
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Modules;
using SkiaSharp;
namespace TestModule1
{
// The core of your module. Hover over the method names to see a description.
public class PluginModule : ProfileModule
{
// This is the beginning of your plugin life cycle. Use this instead of a constructor.
public override void EnablePlugin()
{
DisplayName = "TestModule1";
DisplayIcon = "ToyBrickPlus";
DefaultPriorityCategory = ModulePriorityCategory.Normal;
}
// This is the end of your plugin life cycle.
public override void DisablePlugin()
{
// Make sure to clean up resources where needed (dispose IDisposables etc.)
}
public override void ModuleActivated(bool isOverride)
{
}
public override void ModuleDeactivated(bool isOverride)
{
}
}
}
@@ -0,0 +1,9 @@
{
"profiles": {
"ModuleProject": {
"commandName": "Executable",
"executablePath": "C:\\Repos\\Artemis\\src\\Artemis.UI\\bin\\x64\\Debug\\netcoreapp3.1\\Artemis.UI.exe",
"workingDirectory": "C:\\Repos\\Artemis\\src\\Artemis.UI\\bin\\x64\\Debug\\netcoreapp3.1"
}
}
}
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ShouldIncludeNativeSkiaSharp>false</ShouldIncludeNativeSkiaSharp>
<AssemblyName>TestModule1</AssemblyName>
<RootNamespace>TestModule1</RootNamespace>
<Platforms>x64</Platforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="1.68.3" />
<PackageReference Include="Stylet" Version="1.3.4" />
</ItemGroup>
<ItemGroup>
<Reference Include="Artemis.Core">
<HintPath>C:\Repos\Artemis\src\Artemis.UI\bin\x64\Debug\netcoreapp3.1\Artemis.Core.dll</HintPath>
</Reference>
<Reference Include="Artemis.UI.Shared">
<HintPath>C:\Repos\Artemis\src\Artemis.UI\bin\x64\Debug\netcoreapp3.1\Artemis.UI.Shared.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="plugin.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(BuildingInsideVisualStudio)' == 'true'">
<Exec Command="echo Copying resources to plugin output directory&#xD;&#xA;XCOPY &quot;$(ProjectDir)Images&quot; &quot;$(TargetDir)Images&quot; /s /q /i /y&#xD;&#xA;XCOPY &quot;$(ProjectDir)Layouts&quot; &quot;$(TargetDir)Layouts&quot; /s /q /i /y&#xD;&#xA;echo Copying plugin to Artemis plugin directory&#xD;&#xA;XCOPY &quot;$(TargetDir.TrimEnd('\'))&quot; &quot;%25ProgramData%25\Artemis\Plugins\$(ProjectName)&quot; /s /q /i /y&#xD;&#xA;" />
</Target>
</Project>
@@ -0,0 +1,7 @@
{
"Guid": "e7aed08d-a998-457e-91d8-61cd5689896b",
"Name": "TestModule1",
"Description": "This is my awesome plugin",
"Version": "1.0.0.0",
"Main": "TestModule1.dll"
}
@@ -0,0 +1,38 @@
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Modules;
using SkiaSharp;
namespace TestModule2
{
// The core of your module. Hover over the method names to see a description.
public class PluginModule : ProfileModule
{
// This is the beginning of your plugin life cycle. Use this instead of a constructor.
public override void EnablePlugin()
{
DisplayName = "TestModule2";
DisplayIcon = "ToyBrickPlus";
DefaultPriorityCategory = ModulePriorityCategory.Application;
}
// This is the end of your plugin life cycle.
public override void DisablePlugin()
{
// Make sure to clean up resources where needed (dispose IDisposables etc.)
}
public override void ModuleActivated(bool isOverride)
{
// When this gets called your activation requirements have been met and the module will start displaying
}
public override void ModuleDeactivated(bool isOverride)
{
// When this gets called your activation requirements are no longer met and your module will stop displaying
}
}
}
@@ -0,0 +1,9 @@
{
"profiles": {
"ModuleProject": {
"commandName": "Executable",
"executablePath": "C:\\Repos\\Artemis\\src\\Artemis.UI\\bin\\x64\\Debug\\netcoreapp3.1\\Artemis.UI.exe",
"workingDirectory": "C:\\Repos\\Artemis\\src\\Artemis.UI\\bin\\x64\\Debug\\netcoreapp3.1"
}
}
}
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ShouldIncludeNativeSkiaSharp>false</ShouldIncludeNativeSkiaSharp>
<AssemblyName>TestModule2</AssemblyName>
<RootNamespace>TestModule2</RootNamespace>
<Platforms>x64</Platforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="1.68.3" />
<PackageReference Include="Stylet" Version="1.3.4" />
</ItemGroup>
<ItemGroup>
<Reference Include="Artemis.Core">
<HintPath>C:\Repos\Artemis\src\Artemis.UI\bin\x64\Debug\netcoreapp3.1\Artemis.Core.dll</HintPath>
</Reference>
<Reference Include="Artemis.UI.Shared">
<HintPath>C:\Repos\Artemis\src\Artemis.UI\bin\x64\Debug\netcoreapp3.1\Artemis.UI.Shared.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="plugin.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(BuildingInsideVisualStudio)' == 'true'">
<Exec Command="echo Copying resources to plugin output directory&#xD;&#xA;XCOPY &quot;$(ProjectDir)Images&quot; &quot;$(TargetDir)Images&quot; /s /q /i /y&#xD;&#xA;XCOPY &quot;$(ProjectDir)Layouts&quot; &quot;$(TargetDir)Layouts&quot; /s /q /i /y&#xD;&#xA;echo Copying plugin to Artemis plugin directory&#xD;&#xA;XCOPY &quot;$(TargetDir.TrimEnd('\'))&quot; &quot;%25ProgramData%25\Artemis\Plugins\$(ProjectName)&quot; /s /q /i /y&#xD;&#xA;" />
</Target>
</Project>
@@ -0,0 +1,7 @@
{
"Guid": "5ea31fec-3774-4cbf-8774-1cab7caaaa18",
"Name": "TestModule2",
"Description": "This is my awesome plugin",
"Version": "1.0.0.0",
"Main": "TestModule2.dll"
}
@@ -0,0 +1,40 @@
using System.Collections.Generic;
using Artemis.Core.Plugins.DataModelExpansions;
using Artemis.Core.Plugins.DataModelExpansions.Attributes;
namespace TestModule3.DataModels
{
public class PluginDataModel : DataModel
{
public PluginDataModel()
{
PluginSubDataModel = new PluginSubDataModel();
}
// Your datamodel can have regular properties and you can annotate them if you'd like
[DataModelProperty(Name = "A test string", Description = "It doesn't do much, but it's there.")]
public string TemplateDataModelString { get; set; }
// You can even have classes in your datamodel, just don't forget to instantiate them ;)
[DataModelProperty(Name = "A class within the datamodel")]
public PluginSubDataModel PluginSubDataModel { get; set; }
}
public class PluginSubDataModel
{
public PluginSubDataModel()
{
ListOfInts = new List<int> { 1, 2, 3, 4, 5 };
}
// You don't need to annotate properties, they will still show up
public float FloatyFloat { get; set; }
// You can even have a list!
public List<int> ListOfInts { get; set; }
// If you don't want a property to show up in the datamodel, annotate it with DataModelIgnore
[DataModelIgnore]
public string MyDarkestSecret { get; set; }
}
}
@@ -0,0 +1,36 @@
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.Modules;
using SkiaSharp;
using TestModule3.DataModels;
namespace TestModule3
{
// The core of your module. Hover over the method names to see a description.
public class PluginModule : ProfileModule<PluginDataModel>
{
// This is the beginning of your plugin life cycle. Use this instead of a constructor.
public override void EnablePlugin()
{
DisplayName = "TestModule3";
DisplayIcon = "ToyBrickPlus";
DefaultPriorityCategory = ModulePriorityCategory.Normal;
}
// This is the end of your plugin life cycle.
public override void DisablePlugin()
{
// Make sure to clean up resources where needed (dispose IDisposables etc.)
}
public override void ModuleActivated(bool isOverride)
{
}
public override void ModuleDeactivated(bool isOverride)
{
}
}
}
@@ -0,0 +1,9 @@
{
"profiles": {
"ModuleProject": {
"commandName": "Executable",
"executablePath": "C:\\Repos\\Artemis\\src\\Artemis.UI\\bin\\x64\\Debug\\netcoreapp3.1\\Artemis.UI.exe",
"workingDirectory": "C:\\Repos\\Artemis\\src\\Artemis.UI\\bin\\x64\\Debug\\netcoreapp3.1"
}
}
}
@@ -0,0 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<ShouldIncludeNativeSkiaSharp>false</ShouldIncludeNativeSkiaSharp>
<AssemblyName>TestModule3</AssemblyName>
<RootNamespace>TestModule3</RootNamespace>
<Platforms>x64</Platforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="1.68.3" />
<PackageReference Include="Stylet" Version="1.3.4" />
</ItemGroup>
<ItemGroup>
<Reference Include="Artemis.Core">
<HintPath>C:\Repos\Artemis\src\Artemis.UI\bin\x64\Debug\netcoreapp3.1\Artemis.Core.dll</HintPath>
</Reference>
<Reference Include="Artemis.UI.Shared">
<HintPath>C:\Repos\Artemis\src\Artemis.UI\bin\x64\Debug\netcoreapp3.1\Artemis.UI.Shared.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="plugin.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(BuildingInsideVisualStudio)' == 'true'">
<Exec Command="echo Copying resources to plugin output directory&#xD;&#xA;XCOPY &quot;$(ProjectDir)Images&quot; &quot;$(TargetDir)Images&quot; /s /q /i /y&#xD;&#xA;XCOPY &quot;$(ProjectDir)Layouts&quot; &quot;$(TargetDir)Layouts&quot; /s /q /i /y&#xD;&#xA;echo Copying plugin to Artemis plugin directory&#xD;&#xA;XCOPY &quot;$(TargetDir.TrimEnd('\'))&quot; &quot;%25ProgramData%25\Artemis\Plugins\$(ProjectName)&quot; /s /q /i /y&#xD;&#xA;" />
</Target>
</Project>
@@ -0,0 +1,7 @@
{
"Guid": "48011e31-a309-4069-820e-e734f37fc79f",
"Name": "TestModule3",
"Description": "This is my awesome plugin",
"Version": "1.0.0.0",
"Main": "TestModule3.dll"
}