mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
Rename source folder
This commit is contained in:
parent
0a412a0060
commit
a4c046a841
55 changed files with 0 additions and 0 deletions
58
Source/RJWSexperience/SexperienceMod.cs
Normal file
58
Source/RJWSexperience/SexperienceMod.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Verse;
|
||||
using RJWSexperience.Settings;
|
||||
|
||||
namespace RJWSexperience
|
||||
{
|
||||
public class SexperienceMod : Mod
|
||||
{
|
||||
private static Configurations settings;
|
||||
public static Configurations Settings { get => settings; }
|
||||
|
||||
public ITab CurrentTab { get; private set; }
|
||||
|
||||
private readonly List<TabRecord> tabRecords;
|
||||
|
||||
public SexperienceMod(ModContentPack content) : base(content)
|
||||
{
|
||||
settings = GetSettings<Configurations>();
|
||||
CurrentTab = settings;
|
||||
tabRecords = new List<TabRecord>();
|
||||
}
|
||||
|
||||
public override string SettingsCategory()
|
||||
{
|
||||
return Keyed.Mod_Title;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fills tabRecords list.
|
||||
/// This method cannot be called in constructor because at that stage language file is not loaded
|
||||
/// </summary>
|
||||
private void InitTabRecords()
|
||||
{
|
||||
List<ITab> tabs = new List<ITab>
|
||||
{
|
||||
settings,
|
||||
settings.History,
|
||||
settings.Debug
|
||||
};
|
||||
|
||||
foreach (ITab tab in tabs)
|
||||
tabRecords.Add(new TabRecord(tab.Label, delegate { this.CurrentTab = tab; }, delegate { return this?.CurrentTab == tab; }));
|
||||
}
|
||||
|
||||
public override void DoSettingsWindowContents(Rect inRect)
|
||||
{
|
||||
if (tabRecords.NullOrEmpty())
|
||||
InitTabRecords();
|
||||
|
||||
Rect contentRect = inRect.BottomPartPixels(inRect.height - TabDrawer.TabHeight);
|
||||
|
||||
_ = TabDrawer.DrawTabs(contentRect, tabRecords);
|
||||
|
||||
CurrentTab.DoTabContents(contentRect);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue