Skip to content

Commit 76f44ce

Browse files
author
Balint66
committed
Syncing with upstream
2 parents fbb97cf + bffab1f commit 76f44ce

10 files changed

Lines changed: 50 additions & 83 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ obj/
55
/packages/
66
riderModule.iml
77
/_ReSharper.Caches/
8+
9+
/ExperimentalMod
10+
/ExperimentalMod/
11+
/ExperimentalMod/*
12+
/ExperimentalMod/*/*
13+
/ExperimentalMod/*/*/*

AdditionalMapSizesPlugin/AdditionalMapSizesPlugin.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ public void update(MonoBehaviour root)
3232

3333
public void start(MonoBehaviour root)
3434
{
35-
35+
add(create("16 x 16 - DEV", 16, 16, 16, 3));
3636
add(create("128 x 128", 128, 16, 128, 3));
3737
add(create("256 x 256", 256, 16, 256, 3));
3838
add(create("512 x 512", 512, 16, 512, 3));
39-
4039
}
4140

4241
public MapSize create(string name, int width, int height, int length, int blockHeight = 3)

CameraSettingsPlusPlusPlugin/CameraSettingsPlusPlus.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class CameraSettingsPlusPlus : IPlugin
2323
public void initialize()
2424
{
2525
activeState = true;
26+
2627
}
2728

2829
public void start(MonoBehaviour root)

GoingMedievalModLauncher.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdditionalMapSizesPlugin",
1212
EndProject
1313
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DummyPlugin", "DummyPlugin\DummyPlugin.csproj", "{7E2FAB97-5DB2-4683-A07D-3C35E5ED97C0}"
1414
EndProject
15+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExperimentalMod", "ExperimentalMod\ExperimentalMod.csproj", "{AFB3E9BE-3087-4033-8B07-E5F18D99A25F}"
16+
EndProject
1517
Global
1618
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1719
Debug|Any CPU = Debug|Any CPU
@@ -41,5 +43,9 @@ Global
4143
{7E2FAB97-5DB2-4683-A07D-3C35E5ED97C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4244
{7E2FAB97-5DB2-4683-A07D-3C35E5ED97C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
4345
{7E2FAB97-5DB2-4683-A07D-3C35E5ED97C0}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{AFB3E9BE-3087-4033-8B07-E5F18D99A25F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47+
{AFB3E9BE-3087-4033-8B07-E5F18D99A25F}.Debug|Any CPU.Build.0 = Debug|Any CPU
48+
{AFB3E9BE-3087-4033-8B07-E5F18D99A25F}.Release|Any CPU.ActiveCfg = Release|Any CPU
49+
{AFB3E9BE-3087-4033-8B07-E5F18D99A25F}.Release|Any CPU.Build.0 = Release|Any CPU
4450
EndGlobalSection
4551
EndGlobal

GoingMedievalModLauncher/src/ui/ModManagerLogWindow.cs

Lines changed: 10 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -19,101 +19,43 @@ public class ModManagerLogWindow : UIWindow
1919

2020
private string fileName = "mod_launcher.log";
2121

22+
private float calculatedMaxWindowHeight;
23+
2224
public void setup(string newFileName)
2325
{
2426
this.fileName = newFileName;
2527

2628
// buildLog();
2729
logOutput.Clear();
2830
logOutput.Append(File.ReadAllText(this.fileName));
31+
32+
// count the number of newlines from the log and multiply it by the line height
33+
calculatedMaxWindowHeight = logOutput.ToString().Split('\n').Length * 16;
2934
}
3035

3136
public new void Start()
3237
{
3338
this.windowTitle = "Going Medieval - Log";
3439
this.windowId = 2;
3540
this.windowRect = new Rect(20, 450, 800, 400);
36-
37-
// buildLog();
38-
logOutput.Clear();
39-
logOutput.Append(File.ReadAllText(this.fileName));
40-
base.Start();
41-
42-
43-
var manager = GameObject.FindObjectOfType<PromptPanelManager>();
44-
var descf = typeof(PromptPanelManager).GetField("description", BindingFlags.Instance | BindingFlags
45-
.NonPublic);
46-
var desc = (MonoBehaviour) descf.GetValue(manager);
47-
var components = desc.transform.parent.gameObject.GetComponents<MonoBehaviour>();
48-
Logger.Instance.info("" + components);
49-
Logger.Instance.info(sp.name);
50-
foreach ( var component in components )
51-
{
52-
if ( component is Image i)
53-
{
54-
Logger.Instance.info(i.sprite.texture.name);
55-
}
56-
else
57-
{
58-
Logger.Instance.info(component.ToString());
59-
}
60-
}
61-
41+
this.shown = true;
42+
43+
setup(this.fileName);
6244
}
6345

6446
public override void renderContent()
6547
{
6648

6749
// setup the scrollView dimensions based on the amount of loaded mods
6850
scrollViewRect.Set(1,20, windowRect.width-4, windowRect.height-2);
69-
scrollContentMaxSize.Set(0,0, windowRect.width, 9999);
51+
scrollContentMaxSize.Set(0,0, windowRect.width, calculatedMaxWindowHeight);
7052

71-
GUI.Label(new Rect(15, 30, windowRect.width - 10, windowRect.height - 10), logOutput.ToString());
53+
GUI.Label(new Rect(15, 30, windowRect.width - 10, calculatedMaxWindowHeight), logOutput.ToString());
7254

7355
// Make the windows be draggable.
7456
GUI.DragWindow(new Rect(0, 0, 10000, 10000));
7557
}
7658

7759

78-
public void buildLog()
79-
{
80-
// clear the log
81-
logOutput.Clear();
82-
83-
logOutput.AppendLine();
84-
85-
logOutput.Append("Game-Version: ");
86-
logOutput.Append(Application.version);
87-
logOutput.AppendLine();
88-
89-
logOutput.Append("Unity-Version: ");
90-
logOutput.Append(Application.unityVersion);
91-
logOutput.AppendLine();
92-
93-
logOutput.Append("Resolution: ");
94-
logOutput.Append(Screen.width);
95-
logOutput.Append(" x ");
96-
logOutput.Append(Screen.height);
97-
logOutput.Append(" @ ");
98-
logOutput.Append(Screen.dpi);
99-
logOutput.Append(" DPI");
100-
logOutput.AppendLine();
101-
102-
logOutput.Append("Current level: ");
103-
logOutput.Append(SceneManager.GetActiveScene().name);
104-
logOutput.AppendLine();
105-
106-
logOutput.Append("Mouse-Position: ");
107-
logOutput.Append(Input.mousePosition.ToString());
108-
logOutput.AppendLine();
109-
110-
logOutput.Append("Real time:");
111-
logOutput.Append(DateTime.Now.ToString("dd.MM.yyyy - HH:mm:ss"));
112-
logOutput.AppendLine();
113-
114-
logOutput.Append("Frames per second:");
115-
logOutput.Append((int) (1.0f / Time.smoothDeltaTime));
116-
logOutput.AppendLine();
117-
}
11860
}
11961
}

GoingMedievalModLauncher/src/ui/ModManagerWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public ModManagerWindow()
3232
private void Update()
3333
{
3434

35-
if (Input.GetKeyDown(KeyCode.F1))
35+
if (Input.GetKeyDown(KeyCode.F12))
3636
{
3737
// toggle the visibility via key-press
3838
shown = !shown;
@@ -67,7 +67,7 @@ public override void renderContent()
6767

6868
// Render a simple note for using the mod-loader manager
6969
Rect usageLabelRect = new Rect(150, 10, 250, 30);
70-
GUI.Label(usageLabelRect, "Toggle the Mod-Manager with F1.", bigFontSizeStyle);
70+
GUI.Label(usageLabelRect, "Toggle the Mod-Manager with F12.", bigFontSizeStyle);
7171

7272
// draw a line below the mod-log button and usage-note
7373
drawRect(new Rect(0, 40, windowRect.width , 2), lineColor );

docs/banner.xcf

-66.7 KB
Binary file not shown.

docs/camsettingspp.png

814 KB
Loading

docs/mod_manager.png

2.57 MB
Loading

readme.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
<img src="docs/banner.png">
22

33
# Going Medieval - Mod Loader & Plugin-API
4-
This project allows the development and loading of mods for Going Medieval, written in C#.
4+
This project allows the development and loading of mods for Going Medieval.
55

6-
The currently supported version is 0.5.28.6.
6+
**Note** \
7+
This project allows the modification of the gm runtime - this can lead to unexpected behaviour, errors or bugs.
8+
Be aware of this - **I don't take any responsibility for any damage or corrupted files** - you are on your own now 🐱‍👤.
9+
10+
Going Medieval is a product of the game development studio [Foxy Voxel](https://foxyvoxel.io/). All rights belong to them.
11+
This project uses [Harmony](https://harmony.pardeike.net/) and [Unity-Doorstop](https://github.com/NeighTools/UnityDoorstop).
712

813
## Features
914
The following features are supported by the Mod Launcher:
10-
- load C# based mods using a simple [Plugin-API](https://github.com/benjaminfoo/GoingMedievalModLauncher/blob/main/GoingMedievalModLauncher/src/plugins/IPlugin.cs)
11-
- access the native unity API / runtime
12-
- replace / patch methods by using [Harmony](https://harmony.pardeike.net/)
13-
- No manual editing / hacking of files - the games files don't get modified
15+
- Current support for version 0.5.28.6
16+
- Load C# based mods using a simple [Plugin-API](https://github.com/benjaminfoo/GoingMedievalModLauncher/blob/main/GoingMedievalModLauncher/src/plugins/IPlugin.cs)
17+
- Access the native unity API / runtime
18+
- Replace / patch methods by using [Harmony](https://harmony.pardeike.net/)
19+
- No manual editing of files
20+
- Mod-Manager User Interface for enabling / disabling a mod
1421
- Logging
1522
- ModLauncher / Plugin related logging within the 'mod_launcher.log' file
1623
- Unity related logging within the 'output_log' file
@@ -30,15 +37,21 @@ Increases rendering-, zoom- & shadow-distance - may slow down performance.
3037
[DeveloperConsole Enabler - Plugin](https://github.com/benjaminfoo/GoingMedievalModLauncher/tree/main/DeveloperConsoleEnablerPlugin)\
3138
Enables the Developer-Console by using L to open and K to close the UI.
3239

33-
## Installation:
40+
### Installation
3441
Download the latest release and drop it into your going medieval folder
3542

36-
## Technical
43+
### Technical
3744

3845
For technical information checkout the [wiki](https://github.com/benjaminfoo/GoingMedievalModLauncher/wiki/Technical) at the github-page.
3946

40-
## Additional
41-
- Unity-Doorstop for injecting code: https://github.com/NeighTools/UnityDoorstop
42-
- Harmony for runtime patching of code: https://harmony.pardeike.net/
47+
### Screenshots
48+
<img src="docs/mod_manager.png">
49+
<img src="docs/camsettingspp.png">
50+
51+
52+
### Additional Information
53+
- [Going Medieval](https://foxyvoxel.io/) as this project's target 🐱‍💻
54+
- [Unity-Doorstop](https://github.com/NeighTools/UnityDoorstop) for injecting code 💉
55+
- [Harmony](https://harmony.pardeike.net/) for runtime patching of code 🩹
4356

4457

0 commit comments

Comments
 (0)