-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
152 additions
and
93 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LanguageData> | ||
<SubcoreInfo>SubcoreInfo</SubcoreInfo> | ||
<Pattern>Pattern</Pattern> | ||
<Unknown>Unknown</Unknown> | ||
</LanguageData> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,53 @@ | ||
using Verse; | ||
using RimWorld; | ||
using UnityEngine; | ||
using Verse; | ||
|
||
namespace SubcoreInfo | ||
{ | ||
/// <summary> | ||
/// SubcoreInfo static class to load up the mod and initialise everything. | ||
/// </summary> | ||
[StaticConstructorOnStartup] | ||
public static class SubcoreInfo | ||
public class SubcoreInfo : Mod | ||
{ | ||
/// <summary> | ||
/// SubcoreInfo settings reference. | ||
/// </summary> | ||
internal static SubcoreInfoSettings settings; | ||
|
||
/// <summary> | ||
/// SubcoreInfo constructor to patch things using harmony. | ||
/// </summary> | ||
static SubcoreInfo() | ||
public SubcoreInfo(ModContentPack content) : base(content) | ||
{ | ||
settings = GetSettings<SubcoreInfoSettings>(); | ||
new HarmonyLib.Harmony("eth0net.SubcoreInfo").PatchAll(); | ||
} | ||
|
||
/// <summary> | ||
/// DoSettingsWindowContents configures the settings window. | ||
/// </summary> | ||
/// <param name="inRect"></param> | ||
public override void DoSettingsWindowContents(Rect inRect) | ||
{ | ||
Listing_Standard listing = new(); | ||
|
||
listing.Begin(inRect); | ||
|
||
listing.CheckboxLabeled("Separate subcore stacks by pattern", ref SubcoreInfoSettings.separatePatternStacks); | ||
listing.CheckboxLabeled("Random patterns on trader subcores", ref SubcoreInfoSettings.randomTraderPatterns); | ||
|
||
listing.End(); | ||
|
||
base.DoSettingsWindowContents(inRect); | ||
} | ||
|
||
/// <summary> | ||
/// SettingsCategory returns the name of the settings category. | ||
/// </summary> | ||
/// <returns></returns> | ||
public override string SettingsCategory() | ||
{ | ||
var harmony = new HarmonyLib.Harmony("eth0net.SubcoreInfo.harmony"); | ||
harmony.PatchAll(); | ||
return "SubcoreInfo".Translate(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Verse; | ||
|
||
namespace SubcoreInfo | ||
{ | ||
internal class SubcoreInfoSettings : ModSettings | ||
{ | ||
/// <summary> | ||
/// Separate subcore stacks by pattern. | ||
/// </summary> | ||
public static bool separatePatternStacks = true; | ||
|
||
/// <summary> | ||
/// Generate random patterns for trader subcores. | ||
/// </summary> | ||
public static bool randomTraderPatterns = true; | ||
|
||
/// <summary> | ||
/// ExposeData saves and loads the settings. | ||
/// </summary> | ||
public override void ExposeData() | ||
{ | ||
Scribe_Values.Look(ref separatePatternStacks, "separatePatternStacks", true, true); | ||
Scribe_Values.Look(ref randomTraderPatterns, "randomTraderPatterns", true, true); | ||
base.ExposeData(); | ||
} | ||
} | ||
} |