Skip to content

Commit d1c9444

Browse files
committed
Converted template to use VisualBasic instead
1 parent a81f3ca commit d1c9444

19 files changed

Lines changed: 517 additions & 143 deletions

Mod.Template.Content/Mod.Template.Content.projitems

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,12 @@
33
<PropertyGroup>
44
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
55
<HasSharedItems>true</HasSharedItems>
6-
<SharedGUID>4e7d37c7-8afe-4f79-baf6-4ce82d05e091</SharedGUID>
6+
<SharedGUID>d75cf09f-51ed-4670-a2a1-19426f6af636</SharedGUID>
77
</PropertyGroup>
88
<PropertyGroup Label="Configuration">
99
<Import_RootNamespace>Mod.Template.Content</Import_RootNamespace>
1010
</PropertyGroup>
1111
<ItemGroup>
12-
<Content Include="$(MSBuildThisFileDirectory)Mod\mod.json">
13-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
14-
</Content>
15-
</ItemGroup>
16-
<ItemGroup>
17-
<Folder Include="$(MSBuildThisFileDirectory)Mod\" />
12+
<Content Include="$(MSBuildThisFileDirectory)Mod\mod.json" />
1813
</ItemGroup>
1914
</Project>
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
3-
<PropertyGroup Label="Globals">
4-
<ProjectGuid>4e7d37c7-8afe-4f79-baf6-4ce82d05e091</ProjectGuid>
5-
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
6-
</PropertyGroup>
7-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
8-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
9-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
10-
<PropertyGroup />
11-
<Import Project="Mod.Template.Content.projitems" Label="Shared" />
12-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
13-
</Project>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>d75cf09f-51ed-4670-a2a1-19426f6af636</ProjectGuid>
5+
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
6+
</PropertyGroup>
7+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
8+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
9+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
10+
<PropertyGroup />
11+
<Import Project="Mod.Template.Content.projitems" Label="Shared" />
12+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.VisualBasic.targets" />
13+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
5+
<HasSharedItems>true</HasSharedItems>
6+
<SharedGUID>4e7d37c7-8afe-4f79-baf6-4ce82d05e091</SharedGUID>
7+
</PropertyGroup>
8+
<PropertyGroup Label="Configuration">
9+
<Import_RootNamespace>Mod.Template.Content</Import_RootNamespace>
10+
</PropertyGroup>
11+
<ItemGroup>
12+
<Content Include="$(MSBuildThisFileDirectory)Mod\mod.json">
13+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
14+
</Content>
15+
</ItemGroup>
16+
<ItemGroup>
17+
<Folder Include="$(MSBuildThisFileDirectory)Mod\" />
18+
</ItemGroup>
19+
</Project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>4e7d37c7-8afe-4f79-baf6-4ce82d05e091</ProjectGuid>
5+
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
6+
</PropertyGroup>
7+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
8+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
9+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
10+
<PropertyGroup />
11+
<Import Project="Mod.Template.Content.projitems" Label="Shared" />
12+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
13+
</Project>

Mod.Template.Contenta/Mod/mod.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"FriendlyName": "Mod Template",
3+
"Author": "You",
4+
"Contact": "N/A",
5+
"ModuleFileName": "Mod.Template.dll",
6+
"Dependencies": [],
7+
"RequiredGSLs": [
8+
"com.github.reherc/Centrifuge.Distance"
9+
],
10+
"SkipLoad": false,
11+
"Priority": 10
12+
}

Mod.Template.sln

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.31515.178
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Mod.Template.Content", "Mod.Template.Content\Mod.Template.Content.shproj", "{4E7D37C7-8AFE-4F79-BAF6-4CE82D05E091}"
7-
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mod.Template", "Mod.Template\Mod.Template.csproj", "{7BCB2908-B003-45D9-BE68-50CBA5217603}"
9-
EndProject
106
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{08A1C9FA-7DC2-4A60-B9A6-AC0EB7132893}"
117
ProjectSection(SolutionItems) = preProject
128
.gitattributes = .gitattributes
@@ -15,19 +11,23 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1511
README.md = README.md
1612
EndProjectSection
1713
EndProject
14+
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Mod.Template", "Mod.Template\Mod.Template.vbproj", "{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}"
15+
EndProject
16+
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Mod.Template.Content", "Mod.Template.Content\Mod.Template.Content.shproj", "{D75CF09F-51ED-4670-A2A1-19426F6AF636}"
17+
EndProject
1818
Global
1919
GlobalSection(SharedMSBuildProjectFiles) = preSolution
20-
Mod.Template.Content\Mod.Template.Content.projitems*{4e7d37c7-8afe-4f79-baf6-4ce82d05e091}*SharedItemsImports = 13
20+
Mod.Template.Content\Mod.Template.Content.projitems*{d75cf09f-51ed-4670-a2a1-19426f6af636}*SharedItemsImports = 13
2121
EndGlobalSection
2222
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2323
Debug|Any CPU = Debug|Any CPU
2424
Release|Any CPU = Release|Any CPU
2525
EndGlobalSection
2626
GlobalSection(ProjectConfigurationPlatforms) = postSolution
27-
{7BCB2908-B003-45D9-BE68-50CBA5217603}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28-
{7BCB2908-B003-45D9-BE68-50CBA5217603}.Debug|Any CPU.Build.0 = Debug|Any CPU
29-
{7BCB2908-B003-45D9-BE68-50CBA5217603}.Release|Any CPU.ActiveCfg = Release|Any CPU
30-
{7BCB2908-B003-45D9-BE68-50CBA5217603}.Release|Any CPU.Build.0 = Release|Any CPU
27+
{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28+
{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
29+
{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
30+
{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}.Release|Any CPU.Build.0 = Release|Any CPU
3131
EndGlobalSection
3232
GlobalSection(SolutionProperties) = preSolution
3333
HideSolutionNode = FALSE
Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="15.0">
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{7BCB2908-B003-45D9-BE68-50CBA5217603}</ProjectGuid>
7+
<ProjectGuid>{F344A9A5-FF40-4BD1-B487-ACE14B2D69F0}</ProjectGuid>
88
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
109
<RootNamespace>Mod.Template</RootNamespace>
1110
<AssemblyName>Mod.Template</AssemblyName>
12-
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
1311
<FileAlignment>512</FileAlignment>
12+
<MyType>Windows</MyType>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
1414
<Deterministic>true</Deterministic>
1515
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1616
</PropertyGroup>
1717
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1818
<DebugSymbols>true</DebugSymbols>
1919
<DebugType>full</DebugType>
20-
<Optimize>false</Optimize>
20+
<DefineDebug>true</DefineDebug>
21+
<DefineTrace>true</DefineTrace>
2122
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>DEBUG;TRACE</DefineConstants>
23-
<ErrorReport>prompt</ErrorReport>
24-
<WarningLevel>4</WarningLevel>
23+
<DocumentationFile>Mod.Template.xml</DocumentationFile>
24+
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
2525
</PropertyGroup>
2626
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2727
<DebugType>pdbonly</DebugType>
28+
<DefineDebug>false</DefineDebug>
29+
<DefineTrace>true</DefineTrace>
2830
<Optimize>true</Optimize>
2931
<OutputPath>bin\Release\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
32+
<DocumentationFile>Mod.Template.xml</DocumentationFile>
33+
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
34+
</PropertyGroup>
35+
<PropertyGroup>
36+
<OptionExplicit>On</OptionExplicit>
37+
</PropertyGroup>
38+
<PropertyGroup>
39+
<OptionCompare>Binary</OptionCompare>
40+
</PropertyGroup>
41+
<PropertyGroup>
42+
<OptionStrict>Off</OptionStrict>
43+
</PropertyGroup>
44+
<PropertyGroup>
45+
<OptionInfer>On</OptionInfer>
3346
</PropertyGroup>
3447
<ItemGroup>
3548
<Reference Include="0Harmony, Version=2.5.1.0, Culture=neutral, processorArchitecture=MSIL">
@@ -69,11 +82,11 @@
6982
<HintPath>..\packages\Centrifuge.Mod.SDK.3.2.0\lib\net35\Reactor.API.dll</HintPath>
7083
</Reference>
7184
<Reference Include="System" />
85+
<Reference Include="System.Data" />
86+
<Reference Include="System.Xml" />
7287
<Reference Include="System.Core" />
7388
<Reference Include="System.Xml.Linq" />
7489
<Reference Include="System.Data.DataSetExtensions" />
75-
<Reference Include="System.Data" />
76-
<Reference Include="System.Xml" />
7790
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
7891
<HintPath>..\packages\Centrifuge.GameSupport.Distance.3.0.7868.41513\lib\net35\UnityEngine.dll</HintPath>
7992
</Reference>
@@ -85,14 +98,55 @@
8598
</Reference>
8699
</ItemGroup>
87100
<ItemGroup>
88-
<Compile Include="Mod.cs" />
89-
<Compile Include="Properties\AssemblyInfo.cs" />
101+
<Import Include="Microsoft.VisualBasic" />
102+
<Import Include="System" />
103+
<Import Include="System.Collections" />
104+
<Import Include="System.Collections.Generic" />
105+
<Import Include="System.Data" />
106+
<Import Include="System.Diagnostics" />
107+
<Import Include="System.Linq" />
108+
<Import Include="System.Xml.Linq" />
109+
</ItemGroup>
110+
<ItemGroup>
111+
<Compile Include="Mod.vb" />
112+
<Compile Include="My Project\AssemblyInfo.vb" />
113+
<Compile Include="My Project\Application.Designer.vb">
114+
<AutoGen>True</AutoGen>
115+
<DependentUpon>Application.myapp</DependentUpon>
116+
</Compile>
117+
<Compile Include="My Project\Resources.Designer.vb">
118+
<AutoGen>True</AutoGen>
119+
<DesignTime>True</DesignTime>
120+
<DependentUpon>Resources.resx</DependentUpon>
121+
</Compile>
122+
<Compile Include="My Project\Settings.Designer.vb">
123+
<AutoGen>True</AutoGen>
124+
<DependentUpon>Settings.settings</DependentUpon>
125+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
126+
</Compile>
127+
</ItemGroup>
128+
<ItemGroup>
129+
<EmbeddedResource Include="My Project\Resources.resx">
130+
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
131+
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
132+
<CustomToolNamespace>My.Resources</CustomToolNamespace>
133+
<SubType>Designer</SubType>
134+
</EmbeddedResource>
90135
</ItemGroup>
91136
<ItemGroup>
92137
<None Include="Mod.Template.targets" />
138+
<None Include="My Project\Application.myapp">
139+
<Generator>MyApplicationCodeGenerator</Generator>
140+
<LastGenOutput>Application.Designer.vb</LastGenOutput>
141+
</None>
142+
<None Include="My Project\Settings.settings">
143+
<Generator>SettingsSingleFileGenerator</Generator>
144+
<CustomToolNamespace>My</CustomToolNamespace>
145+
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
146+
</None>
93147
<None Include="packages.config" />
94148
</ItemGroup>
95-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
149+
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
96150
<PropertyGroup>
97151
<!-- 15.0 is for VS2017, adjust if necessary -->
98152
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>

Mod.Template/Mod.cs

Lines changed: 0 additions & 52 deletions
This file was deleted.

Mod.Template/Mod.vb

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Imports Reactor.API.Attributes
2+
Imports Reactor.API.Interfaces.Systems
3+
Imports Reactor.API.Logging
4+
Imports UnityEngine
5+
6+
Namespace Distance.ModTemplate
7+
''' <summary>
8+
''' The Mod's main class containing its entry point
9+
''' </summary>
10+
<ModEntryPoint("<INSERT MOD UNIQUE ID HERE>")>
11+
Public NotInheritable Class [Mod]
12+
Inherits MonoBehaviour
13+
14+
Public Shared Instance As [Mod]
15+
16+
Public Property Manager As IManager
17+
18+
Public Property Logger As Log
19+
20+
''' <summary>
21+
''' Method called as soon as the Mod Is loaded.
22+
''' WARNING: Do Not load asset bundles/textures in this function
23+
''' The unity assets systems are Not yet loaded when this
24+
''' function Is called. Loading assets here can lead to
25+
''' unpredictable behaviour And crashes!
26+
''' </summary>
27+
Public Sub Initialize(manager As IManager)
28+
' Do not destroy the current game object when loading a new scene
29+
DontDestroyOnLoad(Me)
30+
31+
Instance = Me
32+
33+
Me.Manager = manager
34+
35+
' Create a log file
36+
Logger = LogManager.GetForCurrentAssembly()
37+
38+
Logger.Info("Hello World!")
39+
End Sub
40+
41+
''' <summary>
42+
''' Method called after
43+
''' <c>GameManager.Start()</c>
44+
''' This initialisation method Is the same as
45+
''' the Spectrum Mod loader initialisation procedure.
46+
''' </summary>
47+
Public Sub LateInitialize(manager As IManager)
48+
' Code here...
49+
Initialize(manager)
50+
End Sub
51+
End Class
52+
End Namespace

Mod.Template/My Project/Application.Designer.vb

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)