Skip to content

Commit 777ffe3

Browse files
author
Balint66
committed
Adding IDs to make mod structure organized
1 parent 2ffdd87 commit 777ffe3

7 files changed

Lines changed: 17 additions & 2 deletions

File tree

AdditionalMapSizesPlugin/AdditionalMapSizesPlugin.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class AdditionalMapSizesPlugin : IPlugin
1111
{
1212
public string Name => "Additional Map Sizes";
1313
public string Description => "Adds map sizes to the new-game map-selection screen.";
14+
public string ID => "AdditionalMapSize";
1415
public string Version => "v0.0.1";
1516
public bool activeState { get; set; }
1617
public void initialize()

BugReportDisablerPlugin/BugReportDisablerPlugin.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class BugReportDisablerPlugin : IPlugin
1515
public string Name => "Bug-Report Disabler";
1616

1717
public string Description => "Disables the sending of error-reports.";
18+
public string ID => "bugreport_begone";
1819
public string Version => "v0.0.2";
1920
public bool activeState { get; set; }
2021

CameraSettingsPlusPlusPlugin/CameraSettingsPlusPlus.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class CameraSettingsPlusPlus : IPlugin
1313
public string Name => "Camera-Settings";
1414

1515
public string Description => "Increases rendering-, zoom- & shadow-distance - may slow down performance.";
16+
public string ID => "cameraPlusPlus";
1617
public string Version => "v0.0.2";
1718

1819
public bool activeState { get; set; }

DeveloperConsoleEnablerPlugin/DeveloperConsoleEnablerPlugin.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class DeveloperConsoleEnablerPlugin : IPlugin
1212

1313
public string Name => "Developer-Console enabler";
1414
public string Description => "Enables the developer console.";
15+
public string ID => "DevConsoleEnabler";
1516

1617
public string Version => "v0.0.2";
1718

DummyPlugin/DummyPlugin.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public class DummyPlugin : IPlugin
88

99
public string Name => "Dummy-Plugin";
1010
public string Description => "This plugin is for testing purposes and doesn't do anything except having a ridiculous long description.";
11+
public string ID => "dummy";
1112
public string Version => "v0.0.1";
1213
public bool activeState { get; set; }
1314
public void initialize()

GoingMedievalModLauncher/src/plugins/IPlugin.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ public interface IPlugin
1313
/// <summary>
1414
/// A alphanumeric string which describes the functionality of the plugin / mod.
1515
/// </summary>
16-
string Description { get; }
16+
string Description { get; }
17+
18+
/// <summary>
19+
/// The Unique ID of the mod. Should only contain underscores and big or small english letters.
20+
/// TODO:Really test this case.
21+
/// </summary>
22+
string ID { get; }
1723

1824
/// <summary>
1925
/// A alphanumeric string which describes the version of the plugin / mod.

GoingMedievalModLauncher/src/plugins/PluginContainer.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ public bool loadLanguageFile()
8484
foreach ( var translation in node.Value )
8585
{
8686
var id = source.GetLanguageIndex(translation.Key);
87-
var term = source.AddTerm(node.Key);
87+
if ( id < 0 )
88+
{
89+
continue;
90+
}
91+
var term = source.AddTerm(plugin.ID + ":" + node.Key);
8892
term.SetTranslation(id, translation.Value);
8993
}
9094
}

0 commit comments

Comments
 (0)