rimworld-blax-defaults/Source/BlaxDefaults/BlaxDefaultsMod.cs

35 lines
1.4 KiB
C#
Raw Permalink Normal View History

using UnityEngine;
using Verse;
namespace BlaxDefaults
{
public class BlaxDefaultsMod : Mod
{
public static BlaxDefaultsSettings Settings;
public BlaxDefaultsMod(ModContentPack content) : base(content)
{
Settings = GetSettings<BlaxDefaultsSettings>();
}
/// <summary>The master switch. True before the settings exist.</summary>
public static bool Enabled => Settings == null || Settings.enabled;
/// <summary>New stockpiles start from their type's default.</summary>
public static bool StockpilesOn => Enabled && (Settings == null || Settings.stockpileDefaults);
/// <summary>New storage buildings start from their kind's default.</summary>
public static bool StorageOn => Enabled && (Settings == null || Settings.storageDefaults);
/// <summary>New production bills get the values of "Every new bill".</summary>
public static bool BillsOn => Enabled && (Settings == null || Settings.billDefaults);
/// <summary>The forbid rules may act (each rule still needs its own switch and filter).</summary>
public static bool ForbidOn => Enabled && (Settings == null || Settings.forbidRules);
public override string SettingsCategory() => "Blax Defaults";
public override void DoSettingsWindowContents(Rect inRect) => SettingsPage.Draw(inRect);
}
}