mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2026-06-18 19:35:58 +00:00
110 lines
5.1 KiB
C#
110 lines
5.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Verse;
|
|
using UnityEngine;
|
|
using RimWorld;
|
|
|
|
namespace Rimworld_Animations {
|
|
|
|
public class RJWAnimationSettings : ModSettings {
|
|
|
|
public static bool soundOverride = true, hearts = true;
|
|
|
|
//probably move this setting to a different mod menu if moving rjw parts of code
|
|
public static bool playVoices = true, playSounds = true, playHumanlikeVoicesAsDefault = true, maleSounds, femaleSounds, maleAnalCanBeFucked = true;
|
|
public static float floatRangeInRenderTreeMenu = 1f, soundVolume = 1f, voicesVolume = 1f, voicesFrequencyTicks = 60f;
|
|
|
|
public static bool offsetTab = true, debugMode = false;
|
|
|
|
|
|
public static Dictionary<string, PawnScaledOffsets> offsets = new Dictionary<string, PawnScaledOffsets>();
|
|
|
|
|
|
public override void ExposeData()
|
|
{
|
|
|
|
base.ExposeData();
|
|
Scribe_Values.Look(ref playVoices, "RJWAnimations_PlayVoices", true);
|
|
Scribe_Values.Look(ref playSounds, "RJWAnimations_PlaySounds", true);
|
|
Scribe_Values.Look(ref playHumanlikeVoicesAsDefault, "RJWAnimations-playHumanlikeVoicesAsDefault", true);
|
|
Scribe_Values.Look(ref maleSounds, "RJWAnimations-maleSounds", true);
|
|
Scribe_Values.Look(ref femaleSounds, "RJWAnimations-femaleSounds", true);
|
|
Scribe_Values.Look(ref debugMode, "RJWAnimations-AnimsDebugMode", false);
|
|
Scribe_Values.Look(ref offsetTab, "RJWAnimations-EnableOffsetTab", false);
|
|
Scribe_Values.Look(ref hearts, "RJWAnimation-heartsOnLovin");
|
|
Scribe_Values.Look(ref soundOverride, "RJWAnimations-rjwAnimSoundOverride", true);
|
|
Scribe_Values.Look(ref maleAnalCanBeFucked, "RJWAnimations-maleAnalCanBeFucked", true);
|
|
|
|
Scribe_Values.Look(ref floatRangeInRenderTreeMenu, "RJWAnimations-FloatRangeRenderMenu", 1f);
|
|
Scribe_Values.Look(ref soundVolume, "RJWAnimations-soundVolume", 1f);
|
|
Scribe_Values.Look(ref voicesVolume, "RJWAnimations-voicesVolume", 1f);
|
|
Scribe_Values.Look(ref voicesFrequencyTicks, "RJWAnimations-voicesFrequencyTicks", 1f);
|
|
|
|
Scribe_Collections.Look(ref offsets, "RJWAnimations-animationScaledOffsets", LookMode.Value, LookMode.Deep);
|
|
|
|
|
|
//todo: save offsetsByDefName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public class RJW_Animations : Mod {
|
|
|
|
public RJW_Animations(ModContentPack content) : base(content) {
|
|
GetSettings<RJWAnimationSettings>();
|
|
|
|
}
|
|
|
|
public override void DoSettingsWindowContents(Rect inRect) {
|
|
|
|
Listing_Standard listingStandard = new Listing_Standard();
|
|
int bufferBetween = 10;
|
|
listingStandard.Begin(new Rect(inRect.x, inRect.y, inRect.width / 2 - bufferBetween, inRect.height));
|
|
|
|
|
|
listingStandard.CheckboxLabeled("RimAnim_HeartsDuringLovin".Translate(), ref RJWAnimationSettings.hearts);
|
|
listingStandard.CheckboxLabeled("RimAnim_MaleAnalCanBeFucked".Translate(), ref RJWAnimationSettings.maleAnalCanBeFucked);
|
|
|
|
//sounds settings
|
|
listingStandard.CheckboxLabeled("RimAnim_PlaySounds".Translate(), ref RJWAnimationSettings.playSounds);
|
|
listingStandard.Label("RimAnim_SoundsVolume".Translate());
|
|
RJWAnimationSettings.soundVolume = listingStandard.SliderLabeled((int)(RJWAnimationSettings.soundVolume * 100) + "%", RJWAnimationSettings.soundVolume, 0, 2, 0.1f);
|
|
|
|
//voices settings
|
|
listingStandard.CheckboxLabeled("RimAnim_Voices".Translate(), ref RJWAnimationSettings.playVoices);
|
|
listingStandard.Label("RimAnim_VoicesVolume".Translate());
|
|
RJWAnimationSettings.voicesVolume = listingStandard.SliderLabeled((int)(RJWAnimationSettings.voicesVolume * 100) + "%", RJWAnimationSettings.voicesVolume, 0, 2, 0.1f);
|
|
listingStandard.CheckboxLabeled("RimAnim_HumanlikeVoicesDefault".Translate(), ref RJWAnimationSettings.playHumanlikeVoicesAsDefault);
|
|
|
|
|
|
listingStandard.End();
|
|
|
|
//second section
|
|
listingStandard.Begin(new Rect(inRect.x + inRect.width / 2 + bufferBetween, inRect.y, inRect.width / 2 - bufferBetween, inRect.height));
|
|
|
|
listingStandard.CheckboxLabeled("RimAnim_AnimManagerTab".Translate(), ref RJWAnimationSettings.offsetTab);
|
|
listingStandard.CheckboxLabeled("RimAnim_DebugMode".Translate(), ref RJWAnimationSettings.debugMode);
|
|
listingStandard.Label("RimAnim_FloatRangeRenderTree".Translate() + RJWAnimationSettings.floatRangeInRenderTreeMenu);
|
|
RJWAnimationSettings.floatRangeInRenderTreeMenu = listingStandard.Slider(RJWAnimationSettings.floatRangeInRenderTreeMenu, 0.1f, 12f);
|
|
|
|
|
|
|
|
listingStandard.End();
|
|
base.DoSettingsWindowContents(inRect);
|
|
}
|
|
|
|
public override void WriteSettings() {
|
|
base.WriteSettings();
|
|
OffsetMainButtonDefOf.OffsetManager.buttonVisible = RJWAnimationSettings.offsetTab;
|
|
|
|
}
|
|
|
|
public override string SettingsCategory() {
|
|
return "RimAnim_ModSettings".Translate();
|
|
}
|
|
}
|
|
}
|