Skip to content

Commit b2ebc17

Browse files
committed
-Added references to Harmony and SharpZipLib
-Reworked patching system. Mods can now designate methods to be called before or after any game functions, and optionally update it's IL code -Hid annoucement by default (this can be re-enabled by mods) -Updated the title game state to add registered title buttons to the left side of the screen, without replacing the entire game state -Update the project to use the correct version of .NET to match Unity (3.5, runtime 2.0.0.0) -Added MIT license -Updated ModBase to auto load embedded resources from mods. Zips will be extracted. -Renamed the mod list class to capitalize the "L" -Updated mod loader to treat the framework as any other mod (no more code explicitly initializing the framework) -Removed unused references -Removed references to other proejcts in the solution -Added ReSharper settings to ignore certain words from spellcheck -Removed unused code in the TitleButton class -Added comments to Utils class and switched to string interpolation
1 parent a239c0c commit b2ebc17

26 files changed

+503
-456
lines changed

App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<configuration>
33
<startup>
44

5-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup>
5+
<supportedRuntime version="v2.0.50727"/></startup>
66
</configuration>

ChallengesTitleButton.cs

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

ContinueGameTitleButton.cs

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

FrameworkMod.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
using System;
22
using System.Reflection;
33
using Planetbase;
4+
using UnityEngine;
45

56
namespace PlanetbaseFramework
67
{
78
public class FrameworkMod : ModBase
89
{
9-
public override Version ModVersion => Assembly.GetExecutingAssembly().GetName().Version;
10+
public new static Version ModVersion => Assembly.GetExecutingAssembly().GetName().Version;
1011

1112
public FrameworkMod()
1213
{
1314
Utils.ErrorTexture = ModTextures.Find(x => x.name.Equals("error.png"));
1415
}
1516

16-
public override string ModName => "Planetbase Framework";
17+
public override string ModName { get; } = "Planetbase Framework";
1718

1819
public override void Init()
1920
{
20-
ModTitleButton modTitleButton = new ModTitleButton();
21+
RegisterTitleButton(new ModTitleButton());
22+
23+
InjectPatches();
24+
}
25+
26+
public static void Callback(string condition, string stackTrace, LogType type)
27+
{
28+
2129
}
2230

2331
private class ModTitleButton : TitleButton
2432
{
25-
public ModTitleButton() : base("mod_titlemenu", true)
26-
{
27-
}
33+
public ModTitleButton() : base("mod_titlemenu") { }
2834

2935
public override void HandleAction(GameStateTitle gst)
3036
{

GameStateTitleReplacement.cs

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

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 solidDoWant
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

LoadGameTitleButton.cs

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

0 commit comments

Comments
 (0)