Skip to content

Commit

Permalink
Converted template to use VisualBasic instead
Browse files Browse the repository at this point in the history
  • Loading branch information
REHERC committed Aug 11, 2021
1 parent a81f3ca commit d1c9444
Show file tree
Hide file tree
Showing 19 changed files with 517 additions and 143 deletions.
9 changes: 2 additions & 7 deletions Mod.Template.Content/Mod.Template.Content.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>4e7d37c7-8afe-4f79-baf6-4ce82d05e091</SharedGUID>
<SharedGUID>d75cf09f-51ed-4670-a2a1-19426f6af636</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>Mod.Template.Content</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)Mod\mod.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)Mod\" />
<Content Include="$(MSBuildThisFileDirectory)Mod\mod.json" />
</ItemGroup>
</Project>
26 changes: 13 additions & 13 deletions Mod.Template.Content/Mod.Template.Content.shproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
<PropertyGroup Label="Globals">
<ProjectGuid>4e7d37c7-8afe-4f79-baf6-4ce82d05e091</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="Mod.Template.Content.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>d75cf09f-51ed-4670-a2a1-19426f6af636</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="Mod.Template.Content.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.VisualBasic.targets" />
</Project>
19 changes: 19 additions & 0 deletions Mod.Template.Contenta/Mod.Template.Content.projitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>4e7d37c7-8afe-4f79-baf6-4ce82d05e091</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>Mod.Template.Content</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)Mod\mod.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)Mod\" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions Mod.Template.Contenta/Mod.Template.Content.shproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
<PropertyGroup Label="Globals">
<ProjectGuid>4e7d37c7-8afe-4f79-baf6-4ce82d05e091</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="Mod.Template.Content.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
12 changes: 12 additions & 0 deletions Mod.Template.Contenta/Mod/mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"FriendlyName": "Mod Template",
"Author": "You",
"Contact": "N/A",
"ModuleFileName": "Mod.Template.dll",
"Dependencies": [],
"RequiredGSLs": [
"com.github.reherc/Centrifuge.Distance"
],
"SkipLoad": false,
"Priority": 10
}
18 changes: 9 additions & 9 deletions Mod.Template.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31515.178
MinimumVisualStudioVersion = 10.0.40219.1
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Mod.Template.Content", "Mod.Template.Content\Mod.Template.Content.shproj", "{4E7D37C7-8AFE-4F79-BAF6-4CE82D05E091}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mod.Template", "Mod.Template\Mod.Template.csproj", "{7BCB2908-B003-45D9-BE68-50CBA5217603}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{08A1C9FA-7DC2-4A60-B9A6-AC0EB7132893}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
Expand All @@ -15,19 +11,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Mod.Template", "Mod.Template\Mod.Template.vbproj", "{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Mod.Template.Content", "Mod.Template.Content\Mod.Template.Content.shproj", "{D75CF09F-51ED-4670-A2A1-19426F6AF636}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Mod.Template.Content\Mod.Template.Content.projitems*{4e7d37c7-8afe-4f79-baf6-4ce82d05e091}*SharedItemsImports = 13
Mod.Template.Content\Mod.Template.Content.projitems*{d75cf09f-51ed-4670-a2a1-19426f6af636}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7BCB2908-B003-45D9-BE68-50CBA5217603}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7BCB2908-B003-45D9-BE68-50CBA5217603}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BCB2908-B003-45D9-BE68-50CBA5217603}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7BCB2908-B003-45D9-BE68-50CBA5217603}.Release|Any CPU.Build.0 = Release|Any CPU
{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
<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')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7BCB2908-B003-45D9-BE68-50CBA5217603}</ProjectGuid>
<ProjectGuid>{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Mod.Template</RootNamespace>
<AssemblyName>Mod.Template</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<Deterministic>true</Deterministic>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Mod.Template.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>Mod.Template.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down Expand Up @@ -69,11 +82,11 @@
<HintPath>..\packages\Centrifuge.Mod.SDK.3.2.0\lib\net35\Reactor.API.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Centrifuge.GameSupport.Distance.3.0.7868.41513\lib\net35\UnityEngine.dll</HintPath>
</Reference>
Expand All @@ -85,14 +98,55 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Mod.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Mod.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="Mod.Template.targets" />
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<!-- 15.0 is for VS2017, adjust if necessary -->
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
Expand Down
52 changes: 0 additions & 52 deletions Mod.Template/Mod.cs

This file was deleted.

52 changes: 52 additions & 0 deletions Mod.Template/Mod.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Imports Reactor.API.Attributes
Imports Reactor.API.Interfaces.Systems
Imports Reactor.API.Logging
Imports UnityEngine

Namespace Distance.ModTemplate
''' <summary>
''' The Mod's main class containing its entry point
''' </summary>
<ModEntryPoint("<INSERT MOD UNIQUE ID HERE>")>
Public NotInheritable Class [Mod]
Inherits MonoBehaviour

Public Shared Instance As [Mod]

Public Property Manager As IManager

Public Property Logger As Log

''' <summary>
''' Method called as soon as the Mod Is loaded.
''' WARNING: Do Not load asset bundles/textures in this function
''' The unity assets systems are Not yet loaded when this
''' function Is called. Loading assets here can lead to
''' unpredictable behaviour And crashes!
''' </summary>
Public Sub Initialize(manager As IManager)
' Do not destroy the current game object when loading a new scene
DontDestroyOnLoad(Me)

Instance = Me

Me.Manager = manager

' Create a log file
Logger = LogManager.GetForCurrentAssembly()

Logger.Info("Hello World!")
End Sub

''' <summary>
''' Method called after
''' <c>GameManager.Start()</c>
''' This initialisation method Is the same as
''' the Spectrum Mod loader initialisation procedure.
''' </summary>
Public Sub LateInitialize(manager As IManager)
' Code here...
Initialize(manager)
End Sub
End Class
End Namespace
13 changes: 13 additions & 0 deletions Mod.Template/My Project/Application.Designer.vb

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

Loading

0 comments on commit d1c9444

Please sign in to comment.