Skip to content

Commit 2ed891e

Browse files
authored
Merge pull request #7 from Balint66/main
Reworking mod enviroment setup, and adding Nugat packages as dependencies.
2 parents ea16a31 + 560106b commit 2ed891e

40 files changed

Lines changed: 826 additions & 3694 deletions

AdditionalMapSizesPlugin/AdditionalMapSizesPlugin.cs

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

AdditionalMapSizesPlugin/AdditionalMapSizesPlugin.csproj

Lines changed: 18 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,36 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4-
<Import Project="$(MSBuildProjectDirectory)\..\Props\common.props"
5-
Condition="Exists('$(MSBuildProjectDirectory)\..\Props\common.props')" />
4+
<Import Project="$(MSBuildProjectDirectory)\..\Props\mod.props" Condition="Exists('$(MSBuildProjectDirectory)\..\Props\common.props')" />
65
<PropertyGroup>
7-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
96
<ProjectGuid>{E4B8324F-9744-441D-A1CD-D3D74594EFEC}</ProjectGuid>
10-
<OutputType>Library</OutputType>
11-
<AppDesignerFolder>Properties</AppDesignerFolder>
127
<RootNamespace>AdditionalMapSizesPlugin</RootNamespace>
138
<AssemblyName>AdditionalMapSizesPlugin</AssemblyName>
14-
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
15-
<FileAlignment>512</FileAlignment>
16-
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<PlatformTarget>AnyCPU</PlatformTarget>
19-
<DebugSymbols>true</DebugSymbols>
20-
<DebugType>full</DebugType>
21-
<Optimize>false</Optimize>
22-
<OutputPath>$(GameDir)\mods\</OutputPath>
23-
<DefineConstants>DEBUG;TRACE</DefineConstants>
24-
<ErrorReport>prompt</ErrorReport>
25-
<WarningLevel>4</WarningLevel>
26-
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<PlatformTarget>AnyCPU</PlatformTarget>
29-
<DebugType>pdbonly</DebugType>
30-
<Optimize>true</Optimize>
31-
<OutputPath>bin\Release\</OutputPath>
32-
<DefineConstants>TRACE</DefineConstants>
33-
<ErrorReport>prompt</ErrorReport>
34-
<WarningLevel>4</WarningLevel>
359
</PropertyGroup>
3610
<ItemGroup>
37-
<Reference Include="0Harmony, Version=2.0.4.0, Culture=neutral, PublicKeyToken=null">
38-
<HintPath>..\GoingMedievalModLauncher\libs\0Harmony.dll</HintPath>
39-
<Private>False</Private>
40-
</Reference>
41-
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
42-
<HintPath>$(GameDir)\Going Medieval_Data\Managed\Assembly-CSharp.dll</HintPath>
43-
<Private>False</Private>
44-
</Reference>
45-
<Reference Include="System" />
46-
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
47-
<HintPath>$(GameDir)\Going Medieval_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
48-
<Private>False</Private>
49-
</Reference>
50-
</ItemGroup>
51-
<ItemGroup>
52-
<Compile Include="AdditionalMapSizesPlugin.cs" />
5311
<Compile Include="Properties\AssemblyInfo.cs" />
5412
</ItemGroup>
5513
<ItemGroup>
56-
<ProjectReference Include="..\GoingMedievalModLauncher\GoingMedievalModLauncher.csproj">
57-
<Project>{91aecc71-ab38-4e60-bc8d-34263b818a39}</Project>
58-
<Name>GoingMedievalModLauncher</Name>
59-
</ProjectReference>
60-
</ItemGroup>
61-
<ItemGroup>
14+
<Content Include="assets\lang.json" />
15+
<Content Include="assets\MapV2\MapSizes.json" />
16+
<Content Include="manifest.json" />
6217
<Content Include="readme.md" />
6318
</ItemGroup>
6419
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
20+
<Target Name="CopyManifest" BeforeTargets="Build">
21+
<ItemGroup Condition="Exists(assets)">
22+
<ASSETS Include="assets\**\*.*" />
23+
</ItemGroup>
24+
<Copy SourceFiles="manifest.json" DestinationFolder="$(ModDir)" />
25+
<Copy SourceFiles="@(ASSETS)" DestinationFolder="$(Assets)\%(RecursiveDir)" Condition="Exists(assets)" />
26+
</Target>
27+
<ItemGroup>
28+
<ProjectReference Include="..\GoingMedievalModLauncher\GoingMedievalModLauncher.csproj">
29+
<Project>{91aecc71-ab38-4e60-bc8d-34263b818a39}</Project>
30+
<Name>GoingMedievalModLauncher</Name>
31+
<Private>False</Private>
32+
</ProjectReference>
33+
</ItemGroup>
6534
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
6635
Other similar extension points exist, see Microsoft.Common.targets.
6736
<Target Name="BeforeBuild">
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"repository": [
3+
{
4+
"id": "16x16-DEV",
5+
"width": 16,
6+
"height": 16,
7+
"length": 16,
8+
"blockHeight": 3,
9+
"shownInRelease": true
10+
},
11+
{
12+
"id": "128x128",
13+
"width": 128,
14+
"height": 16,
15+
"length": 128,
16+
"blockHeight": 3,
17+
"shownInRelease": true
18+
},
19+
{
20+
"id": "256x256",
21+
"width": 256,
22+
"height": 16,
23+
"length": 256,
24+
"blockHeight": 3,
25+
"shownInRelease": true
26+
},
27+
{
28+
"id": "512x512",
29+
"width": 512,
30+
"height": 16,
31+
"length": 512,
32+
"blockHeight": 3,
33+
"shownInRelease": true
34+
}
35+
]
36+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"16x16-DEV": {
3+
"English": "16 x 16 - DEV"
4+
},
5+
"128x128": {
6+
"English": "128 x 128"
7+
},
8+
"256x256": {
9+
"English": "256 x 256"
10+
},
11+
"512x512": {
12+
"English": "512 x 512"
13+
}
14+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"id":"AdditionalMapSize",
3+
"version":"v0.0.1",
4+
"name": "Additional Map Sizes",
5+
"description": "Adds map sizes to the new-game map-selection screen.",
6+
"noCode": true
7+
}

BugReportDisablerPlugin/BugReportDisablerPlugin.cs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,45 @@
11
using System;
22
using GoingMedievalModLauncher;
33
using GoingMedievalModLauncher.plugins;
4+
using GoingMedievalModLauncher.util;
45
using HarmonyLib;
6+
using NLog;
7+
using NSMedieval;
58
using NSMedieval.Tools;
69
using NSMedieval.Tools.Debug;
10+
using NSMedieval.UI;
711
using UnityEngine;
8-
using Logger = GoingMedievalModLauncher.Logger;
912

1013
namespace BugReportDisabler
1114
{
1215

1316
public class BugReportDisablerPlugin : IPlugin
1417
{
15-
16-
public string Name => "Bug-Report Disabler";
1718

18-
public string Description => "Disables the sending of error-reports.";
19-
public string ID => "bugreport_begone";
20-
public string Version => "v0.0.2";
21-
public bool activeState { get; set; }
19+
internal NLog.Logger LOGGER = LoggingManager.GetLogger<BugReportDisablerPlugin>();
2220

2321
public void initialize()
2422
{
25-
activeState = true;
2623
}
2724

2825
public void start(MonoBehaviour root)
2926
{
30-
if(!activeState) return;
31-
3227
try
3328
{
3429
// disable the bug reporter
35-
Logger.Instance.info("Disabling error reports ...");
30+
LOGGER.Info("Disabling error reports ...");
3631

3732
var bugReporterManager = UnityEngine.GameObject.FindObjectOfType<BugReporterManager>();
33+
var settingsCont = UnityEngine.GameObject.FindObjectOfType<OptionsController>();
3834
Traverse.Create(bugReporterManager).Field("exceptionCaught").SetValue(true);
3935

40-
// TODO: GameSettings.sendAutoReports should also be interesting for this
36+
var globSettings = Traverse.Create(settingsCont).Field("globalSettings").GetValue() as GlobalSettings;
37+
globSettings?.SetSendAutoReports(false);
38+
4139
}
4240
catch (Exception e)
4341
{
44-
Logger.Instance.info(e.ToString());
42+
LOGGER.Info(e.ToString());
4543
throw;
4644
}
4745

@@ -58,16 +56,19 @@ public void disable(MonoBehaviour root)
5856
try
5957
{
6058
// disable the bug reporter
61-
Logger.Instance.info("Disabling error reports ...");
59+
LOGGER.Info("Disabling error reports ...");
6260

6361
var bugReporterManager = UnityEngine.GameObject.FindObjectOfType<BugReporterManager>();
62+
var settingsCont = UnityEngine.GameObject.FindObjectOfType<OptionsController>();
6463
Traverse.Create(bugReporterManager).Field("exceptionCaught").SetValue(false);
6564

66-
// TODO: GameSettings.sendAutoReports should also be interesting for this
65+
var globSettings = Traverse.Create(settingsCont).Field("globalSettings").GetValue() as GlobalSettings;
66+
globSettings?.SetSendAutoReports(true);
67+
6768
}
6869
catch (Exception e)
6970
{
70-
Logger.Instance.info(e.ToString());
71+
LOGGER.Info(e.ToString());
7172
throw;
7273
}
7374
}

BugReportDisablerPlugin/BugReportDisablerPlugin.csproj

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,43 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4-
<Import Project="$(MSBuildProjectDirectory)\..\Props\common.props"
5-
Condition="Exists('$(MSBuildProjectDirectory)\..\Props\common.props')" />
4+
<Import Project="$(MSBuildProjectDirectory)\..\Props\mod.props" Condition="Exists('$(MSBuildProjectDirectory)\..\Props\common.props')" />
65
<PropertyGroup>
7-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
96
<ProjectGuid>{6019B364-210A-45AB-9E74-192953A87867}</ProjectGuid>
10-
<OutputType>Library</OutputType>
11-
<AppDesignerFolder>Properties</AppDesignerFolder>
127
<RootNamespace>BugReportDisabler</RootNamespace>
138
<AssemblyName>BugReportDisablerPlugin</AssemblyName>
14-
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
15-
<FileAlignment>512</FileAlignment>
16-
</PropertyGroup>
17-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18-
<PlatformTarget>AnyCPU</PlatformTarget>
19-
<DebugSymbols>false</DebugSymbols>
20-
<DebugType>none</DebugType>
21-
<Optimize>false</Optimize>
22-
<OutputPath>$(GameDir)\mods\</OutputPath>
23-
<DefineConstants>DEBUG;TRACE</DefineConstants>
24-
<ErrorReport>prompt</ErrorReport>
25-
<WarningLevel>4</WarningLevel>
26-
</PropertyGroup>
27-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28-
<PlatformTarget>AnyCPU</PlatformTarget>
29-
<DebugType>pdbonly</DebugType>
30-
<Optimize>true</Optimize>
31-
<OutputPath>$(GameDir)\mods\</OutputPath>
32-
<DefineConstants>TRACE</DefineConstants>
33-
<ErrorReport>prompt</ErrorReport>
34-
<WarningLevel>4</WarningLevel>
359
</PropertyGroup>
3610
<ItemGroup>
37-
<Reference Include="0Harmony, Version=2.0.4.0, Culture=neutral, PublicKeyToken=null">
38-
<HintPath>..\GoingMedievalModLauncher\libs\0Harmony.dll</HintPath>
39-
<Private>False</Private>
40-
</Reference>
41-
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
42-
<HintPath>$(GameDir)\Going Medieval_Data\Managed\Assembly-CSharp.dll</HintPath>
43-
</Reference>
44-
<Reference Include="System" />
4511
<Reference Include="System.Core" />
4612
<Reference Include="System.Data" />
4713
<Reference Include="System.Xml" />
48-
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
49-
<HintPath>$(GameDir)\Going Medieval_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
50-
</Reference>
5114
</ItemGroup>
5215
<ItemGroup>
5316
<Compile Include="BugReportDisablerPlugin.cs" />
5417
<Compile Include="Properties\AssemblyInfo.cs" />
5518
</ItemGroup>
5619
<ItemGroup>
57-
<ProjectReference Include="..\GoingMedievalModLauncher\GoingMedievalModLauncher.csproj">
58-
<Project>{91aecc71-ab38-4e60-bc8d-34263b818a39}</Project>
59-
<Name>GoingMedievalModLauncher</Name>
60-
</ProjectReference>
20+
<Content Include="manifest.json" />
21+
<Content Include="readme.md" />
6122
</ItemGroup>
6223
<ItemGroup>
63-
<Content Include="readme.md" />
24+
<None Include="packages.config" />
6425
</ItemGroup>
6526
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
27+
<Target Name="CopyManifest" BeforeTargets="Build">
28+
<ItemGroup Condition="Exists(assets)">
29+
<ASSETS Include="assets\**\*.*" />
30+
</ItemGroup>
31+
<Copy SourceFiles="manifest.json" DestinationFolder="$(ModDir)" />
32+
<Copy SourceFiles="@(ASSETS)" DestinationFolder="$(Assets)\%(RecursiveDir)" Condition="Exists(assets)" />
33+
</Target>
34+
<ItemGroup>
35+
<ProjectReference Include="..\GoingMedievalModLauncher\GoingMedievalModLauncher.csproj">
36+
<Project>{91aecc71-ab38-4e60-bc8d-34263b818a39}</Project>
37+
<Name>GoingMedievalModLauncher</Name>
38+
<Private>False</Private>
39+
</ProjectReference>
40+
</ItemGroup>
6641
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
6742
Other similar extension points exist, see Microsoft.Common.targets.
6843
<Target Name="BeforeBuild">
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"id":"bugreport_begone",
3+
"version":"v0.0.2",
4+
"name": "Bug-Report Disabler",
5+
"description": "Disables the sending of error-reports.",
6+
"codeOnly": true
7+
}

0 commit comments

Comments
 (0)