rimworld-animations-patch_m.../Source/Scripts/Settings/BasicSettings.cs

134 lines
5.6 KiB
C#
Raw Normal View History

2022-09-10 01:22:08 +00:00
using System;
using System.Linq;
using System.Collections.Generic;
using UnityEngine;
using Verse;
2022-09-11 06:05:16 +00:00
using RimWorld;
2022-09-10 01:22:08 +00:00
namespace Rimworld_Animations_Patch
{
public class BasicSettings : ModSettings
{
public static bool autoscaleDeltaPos = true;
public static bool linkChanges = false;
public static bool needPrivacy = true;
public static float chanceForOtherToJoinInSex = 0.25f;
public static bool hideNamesForSex = false;
public static bool debugMode = false;
public static bool showHands = true;
2022-09-11 06:05:16 +00:00
public static bool redrawHair = true;
2022-09-10 01:22:08 +00:00
public static bool worryAboutInfidelity = true;
public static bool worryAboutBeastiality = true;
public static bool worryAboutRape = true;
public static bool worryAboutNecro = true;
public static bool worryAboutXeno = true;
public static bool ignoreSlaveRape = false;
public static bool majorTabooCanStartFights = false;
public static float genitalMasturbationChance = 1.0f;
public static float analMasturbationChance = 0.25f;
public static float breastsMasturbationChance = 0.5f;
public static float humpingMasturbationChance = 0.25f;
public static float otherMasturbationChance = 0.2f;
public override void ExposeData()
{
base.ExposeData();
Scribe_Values.Look(ref autoscaleDeltaPos, "autoscaleDeltaPos", true);
Scribe_Values.Look(ref linkChanges, "linkChanges", false);
Scribe_Values.Look(ref needPrivacy, "needPrivacy", true);
Scribe_Values.Look(ref chanceForOtherToJoinInSex, "chanceForSexExtra", 0.25f);
Scribe_Values.Look(ref hideNamesForSex, "hideNamesForSex", false);
Scribe_Values.Look(ref debugMode, "debugMode", false);
Scribe_Values.Look(ref showHands, "showHands", true);
2022-09-11 06:05:16 +00:00
Scribe_Values.Look(ref redrawHair, "redrawHair", true);
2022-09-10 01:22:08 +00:00
Scribe_Values.Look(ref worryAboutInfidelity, "worryAboutInfidelity", true);
Scribe_Values.Look(ref worryAboutBeastiality, "worryAboutBeastiality", true);
Scribe_Values.Look(ref worryAboutRape, "worryAboutRape", true);
Scribe_Values.Look(ref worryAboutNecro, "worryAboutNecro", true);
Scribe_Values.Look(ref worryAboutXeno, "worryAboutXeno", true);
Scribe_Values.Look(ref ignoreSlaveRape, "ignoreSlaveRape", false);
Scribe_Values.Look(ref majorTabooCanStartFights, "majorTabooCanStartFights", false);
}
}
public class BasicSettingsDisplay : Mod
{
public BasicSettingsDisplay(ModContentPack content) : base(content)
{
GetSettings<BasicSettings>();
}
public override void WriteSettings()
{
base.WriteSettings();
ApplySettings();
}
// Update all humanlike pawn graphics when settings window is closed
public void ApplySettings()
{
if (Current.ProgramState == ProgramState.Playing)
{
foreach (Pawn pawn in Current.Game.CurrentMap.mapPawns.AllPawns)
{
2022-09-11 06:05:16 +00:00
pawn.Drawer.renderer.graphics.ResolveAllGraphics();
PortraitsCache.SetDirty(pawn);
GlobalTextureAtlasManager.TryMarkPawnFrameSetDirty(pawn);
2022-09-10 01:22:08 +00:00
}
}
}
public override void DoSettingsWindowContents(Rect inRect)
{
Listing_Standard listingStandard;
listingStandard = new Listing_Standard();
listingStandard.Begin(inRect);
listingStandard.Gap(10f);
listingStandard.Label("rimworld_animation_patch_general".Translate());
listingStandard.Gap(5f);
listingStandard.CheckboxLabeled("need_privacy".Translate(), ref BasicSettings.needPrivacy, "need_privacy_desc".Translate());
listingStandard.CheckboxLabeled("worry_about_infidelity".Translate(), ref BasicSettings.worryAboutInfidelity, "worry_about_infidelity_desc".Translate());
listingStandard.CheckboxLabeled("worry_about_beastiality".Translate(), ref BasicSettings.worryAboutBeastiality, "worry_about_beastiality_desc".Translate());
listingStandard.CheckboxLabeled("worry_about_rape".Translate(), ref BasicSettings.worryAboutRape, "worry_about_rape_desc".Translate());
if (BasicSettings.worryAboutRape)
{
listingStandard.CheckboxLabeled("ignore_slave_rape".Translate(), ref BasicSettings.ignoreSlaveRape);
}
listingStandard.CheckboxLabeled("worry_about_necro".Translate(), ref BasicSettings.worryAboutNecro, "worry_about_necro_desc".Translate());
listingStandard.CheckboxLabeled("worry_about_xeno".Translate(), ref BasicSettings.worryAboutXeno, "worry_about_xeno_desc".Translate());
listingStandard.CheckboxLabeled("major_taboo_can_start_fights".Translate(), ref BasicSettings.majorTabooCanStartFights, "major_taboo_can_start_fights_desc".Translate());
listingStandard.Label("chance_for_other_to_join_in_sex".Translate() + ": " + BasicSettings.chanceForOtherToJoinInSex.ToString("F"), -1f, "chance_for_other_to_join_in_sex_desc".Translate());
BasicSettings.chanceForOtherToJoinInSex = listingStandard.Slider(BasicSettings.chanceForOtherToJoinInSex, 0f, 1f);
2022-09-11 06:05:16 +00:00
2022-09-10 01:22:08 +00:00
listingStandard.CheckboxLabeled("hide_names_for_sex".Translate(), ref BasicSettings.hideNamesForSex, "hide_names_for_sex_desc".Translate());
listingStandard.CheckboxLabeled("debug_mode".Translate(), ref BasicSettings.debugMode, "debug_mode_desc".Translate());
listingStandard.Gap(10f);
listingStandard.Label("rimworld_animation_patch_animation".Translate());
listingStandard.Gap(5f);
listingStandard.CheckboxLabeled("autoscale_delta_pos".Translate(), ref BasicSettings.autoscaleDeltaPos, "autoscale_delta_pos_desc".Translate());
listingStandard.CheckboxLabeled("show_hands".Translate(), ref BasicSettings.showHands, "show_hands_desc".Translate());
2022-09-11 06:05:16 +00:00
listingStandard.CheckboxLabeled("redraw_hair".Translate(), ref BasicSettings.redrawHair, "redraw_hair_desc".Translate());
2022-09-10 01:22:08 +00:00
listingStandard.End();
base.DoSettingsWindowContents(inRect);
}
public sealed override string SettingsCategory()
{
return "rimworld_animation_patch_basicsettings".Translate();
}
}
}