RJW-Sexperience/Source/RJWSexperience/Settings/SettingsTabHistory.cs

75 lines
2.8 KiB
C#
Raw Normal View History

2022-05-09 03:16:51 +00:00
using RimWorld;
2023-03-24 15:22:54 +00:00
using System.Collections.Generic;
2022-05-09 03:16:51 +00:00
using UnityEngine;
using Verse;
namespace RJWSexperience.Settings
{
2023-03-24 15:22:54 +00:00
public class SettingsTabHistory : SettingsTab
2022-05-09 03:16:51 +00:00
{
2023-03-24 15:22:54 +00:00
public SettingsTabHistory(Configurations settings) : base(
settings,
Keyed.TabLabelHistory,
new List<ISettingHandle> {
settings.EnableRecordRandomizer,
settings.MaxLustDeviation,
settings.AvgLust,
settings.MaxSexCountDeviation,
settings.SexPerYear,
settings.MinSexableFromLifestage,
settings.MinSexablePercent,
settings.VirginRatio,
settings.SlavesBeenRapedExp,
settings.EnableSexHistory,
2023-03-25 09:17:47 +00:00
settings.HideGizmoWhenDrafted
2023-03-24 15:22:54 +00:00
}
) { }
2022-05-09 03:16:51 +00:00
2023-03-24 15:22:54 +00:00
public override void DoTabContents(Rect inRect)
2022-05-09 03:16:51 +00:00
{
const float lineHeight = SettingsWidgets.lineHeight;
Listing_Standard listmain = new Listing_Standard();
listmain.Begin(inRect);
2023-03-24 15:22:54 +00:00
listmain.CheckboxLabeled(Keyed.Option_1_Label, settings.EnableRecordRandomizer, Keyed.Option_1_Desc);
if (settings.EnableRecordRandomizer)
2022-05-09 03:16:51 +00:00
{
float sectionHeight = 12f;
2023-03-24 15:22:54 +00:00
if (!settings.MinSexableFromLifestage)
2022-05-09 03:16:51 +00:00
sectionHeight += 2f;
Listing_Standard section = listmain.BeginSection(lineHeight * sectionHeight);
2023-03-24 15:22:54 +00:00
section.SliderOption(Keyed.Option_3_Label + " {0}", Keyed.Option_3_Desc, settings.MaxLustDeviation, new FloatRange(0f, 1000f), 1f);
section.SliderOption(Keyed.Option_4_Label + " {0}", Keyed.Option_4_Desc, settings.AvgLust, new FloatRange(-200f, 200f), 1f);
section.SliderOption(Keyed.Option_5_Label + " {0}", Keyed.Option_5_Desc, settings.MaxSexCountDeviation, new FloatRange(0f, 1000f), 1f);
section.SliderOption(Keyed.Option_6_Label + " {0}", Keyed.Option_6_Desc, settings.SexPerYear, new FloatRange(0f, 2000f), 1f);
2022-05-09 03:16:51 +00:00
2023-03-24 15:22:54 +00:00
section.CheckboxLabeled(Keyed.Option_MinSexableFromLifestage_Label, settings.MinSexableFromLifestage, Keyed.Option_MinSexableFromLifestage_Desc);
2022-05-09 03:16:51 +00:00
2023-03-24 15:22:54 +00:00
if (!settings.MinSexableFromLifestage)
section.SliderOption($"{Keyed.Option_9_Label} {{0:P1}} {ThingDefOf.Human.race.lifeExpectancy * settings.MinSexablePercent} human years", Keyed.Option_9_Desc, settings.MinSexablePercent, FloatRange.ZeroToOne, 0.001f);
2022-05-09 03:16:51 +00:00
2023-03-24 15:22:54 +00:00
section.SliderOption(Keyed.Option_10_Label + " {0:P1}", Keyed.Option_10_Desc, settings.VirginRatio, FloatRange.ZeroToOne, 0.001f);
section.CheckboxLabeled(Keyed.Option_7_Label, settings.SlavesBeenRapedExp, Keyed.Option_7_Desc);
2022-05-09 03:16:51 +00:00
listmain.EndSection(section);
}
2023-03-24 15:22:54 +00:00
listmain.CheckboxLabeled(Keyed.Option_EnableSexHistory_Label, settings.EnableSexHistory, Keyed.Option_EnableSexHistory_Desc);
2022-06-07 03:46:19 +00:00
2023-03-24 15:22:54 +00:00
if (settings.EnableSexHistory)
2022-06-11 12:32:15 +00:00
{
2023-03-24 15:22:54 +00:00
listmain.CheckboxLabeled(Keyed.Option_HideGizmoWhenDrafted_Label, settings.HideGizmoWhenDrafted, Keyed.Option_HideGizmoWhenDrafted_Desc);
2022-06-11 12:32:15 +00:00
}
2022-05-09 03:16:51 +00:00
if (listmain.ButtonText(Keyed.Button_ResetToDefault))
{
Reset();
}
listmain.End();
}
}
}