Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions BaseHandlers/BasePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

namespace BaseHandlers
{
public class BasePlugin : Plugin
public class BasePlugin : IPlugin
{
public override void Init()
public string Id => "baseplugin";
public string Name => "Base Resource Handlers";

public static void Init()
{
EntryTypeRegistry.Register(EntryType.Renderable, new Renderable());
EntryTypeRegistry.Register(EntryType.EntryList, new IDList());
Expand All @@ -18,15 +21,5 @@ public override void Init()
EntryTypeRegistry.Register(EntryType.StreetData, new StreetData());
EntryTypeRegistry.Register(EntryType.FlaptFile, new FlaptFile());
}

public override string GetID()
{
return "baseplugin";
}

public override string GetName()
{
return "Base Resource Handlers";
}
}
}
17 changes: 1 addition & 16 deletions BundleManager/BundleManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,23 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DebugHelper" Version="1.1.0" />
<PackageReference Include="ScottPlot.WinForms" Version="5.1.58" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BundleFormat\BundleFormat.csproj" />
<ProjectReference Include="..\BundleUtilities\BundleUtilities.csproj" />
<ProjectReference Include="..\BurnoutImage\BurnoutImage.csproj" />
<ProjectReference Include="..\HexEditor\HexEditor.csproj" />
<ProjectReference Include="..\LangEditor\LangEditor.csproj" />
<ProjectReference Include="..\ModelViewer\ModelViewer.csproj" />
<ProjectReference Include="..\PluginAPI\PluginAPI.csproj" />
<ProjectReference Include="..\PluginSystem\PluginSystem.csproj" />
</ItemGroup>
<Target Name="Plugins" AfterTargets="Build" Condition="'$(TargetFramework)' != ''">
<ItemGroup>
<PluginNames Include="BaseHandlers;LangEditor;LoopModel;LuaList;PVSFormat;VaultFormat;VehicleList;WheelList;WorldCollisionHandler" />
<PluginFiles Include="@(PluginNames -> '..\%(Identity)\bin\$(Configuration)\$(TargetFramework)\%(Identity).dll');@(PluginNames -> '..\%(Identity)\bin\$(Configuration)\$(TargetFramework)\%(Identity).pdb')" />
</ItemGroup>
<Copy SourceFiles="@(PluginFiles)" DestinationFolder="$(OutputPath)plugins" SkipUnchangedFiles="true" />
</Target>
<Target Name="Shaders" AfterTargets="Build" Condition="'$(TargetFramework)' != ''">
<ItemGroup>
<ShaderFiles Include="$(SolutionDir)resources\Shaders\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(ShaderFiles)" DestinationFolder="$(OutputPath)Shaders" SkipUnchangedFiles="true" />
</Target>
<ItemGroup>
<Content Include="$(OutputPath)plugins\*.dll">
<Link>plugins\%(FileName)%(Extension)</Link>
<PublishState>Include</PublishState>
<Visible>false</Visible>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="..\LangEditor\keys\**\*.*">
<Visible>false</Visible>
Expand Down
2 changes: 1 addition & 1 deletion BundleManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void Main(string[] args)
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
Application.SetCompatibleTextRenderingDefault(false);

PluginLoader.LoadPlugins();
PluginLoader.InitializePlugins();

fileModeForm = new MainForm();
folderModeForm = new FileView();
Expand Down
17 changes: 5 additions & 12 deletions LangEditor/LangPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@

namespace LangEditor
{
public class LangPlugin : Plugin
public class LangPlugin : IPlugin
{
public override void Init()
{
EntryTypeRegistry.Register(EntryType.Language, new Language());
}
public string Id => "langplugin";
public string Name => "Language Resource Handler";

public override string GetID()
public static void Init()
{
return "langplugin";
}

public override string GetName()
{
return "Language Resource Handler";
EntryTypeRegistry.Register(EntryType.Language, new Language());
}
}
}
17 changes: 5 additions & 12 deletions LoopModel/LoopModelPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@

namespace LoopModel
{
public class LoopModelPlugin : Plugin
public class LoopModelPlugin : IPlugin
{
public override void Init()
{
EntryTypeRegistry.Register(EntryType.LoopModel, new LoopModelData());
}
public string Id => "loopmodelplugin";
public string Name => "LoopModel Resource Handler";

public override string GetID()
public static void Init()
{
return "loopmodelplugin";
}

public override string GetName()
{
return "LoopModel Resource Handler";
EntryTypeRegistry.Register(EntryType.LoopModel, new LoopModelData());
}
}
}
18 changes: 5 additions & 13 deletions LuaList/LuaListPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@
namespace LuaList
{

public class LuaListPlugin : Plugin
public class LuaListPlugin : IPlugin
{
public override void Init()
public string Id => "lualistplugin";
public string Name => "Lua List Resource Handler";

public static void Init()
{
EntryTypeRegistry.Register(EntryType.LUAList, new LuaList());
}

public override string GetID()
{
return "lualistplugin";
}

public override string GetName()
{
return "Lua List Resource Handler";
}

}
}
37 changes: 11 additions & 26 deletions ModelViewer/SceneRenderControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 20 additions & 2 deletions ModelViewer/SceneRenderControl.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using ModelViewer.SceneData;
using OpenTK.GLControl;

namespace ModelViewer
{
public partial class SceneRenderControl : UserControl
{
private GLControl glcMain;
private GraphicsScene _graphicsScene;

[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
Expand All @@ -23,12 +26,27 @@ public Scene Scene
public SceneRenderControl()
{
InitializeComponent();

_designMode = LicenseManager.UsageMode == LicenseUsageMode.Designtime;

if (!_designMode)
SetupGLControl();
_sceneChanged = true;
}

private void SetupGLControl()
{
glcMain = new()
{
BackColor = Color.Black,
Dock = DockStyle.Fill,
Location = new Point(0, 0),
Name = "glcMain",
Size = new Size(150, 150),
TabIndex = 1
};
glcMain.Paint += new PaintEventHandler(this.glcMain_Paint);
Controls.Add(glcMain);
}

protected override void OnResize(EventArgs e)
{
base.OnResize(e);
Expand Down
17 changes: 5 additions & 12 deletions PVSFormat/PVSPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@

namespace PVSFormat
{
public class PVSPlugin : Plugin
public class PVSPlugin : IPlugin
{
public override void Init()
{
EntryTypeRegistry.Register(EntryType.ZoneList, new PVS());
}
public string Id => "pvsplugin";
public string Name => "PVS Resource Handler";

public override string GetID()
public static void Init()
{
return "pvsplugin";
}

public override string GetName()
{
return "PVS Resource Handler";
EntryTypeRegistry.Register(EntryType.ZoneList, new PVS());
}
}
}
10 changes: 10 additions & 0 deletions PluginAPI/IPlugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace PluginAPI
{
public interface IPlugin
{
string Id { get; }
string Name { get; }

public static abstract void Init();
}
}
19 changes: 0 additions & 19 deletions PluginAPI/Plugin.cs

This file was deleted.

Loading