Decompiled source of ShlongsEnhanced v3.0.2
BepInEx/plugins/ShlonGroup-ShlongsEnhanced/AtlyssShlongs.dll
Decompiled a week ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; using AtlyssShlongs.Core; using AtlyssShlongs.Data; using AtlyssShlongs.Equipment; using AtlyssShlongs.Input; using AtlyssShlongs.Network; using AtlyssShlongs.Patches; using AtlyssShlongs.UI; using AtlyssShlongs.Util; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using CodeTalker.Networking; using CodeTalker.Packets; using HarmonyLib; using MonoMod.RuntimeDetour; using TemtemTests; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyFileVersion("3.0.2.0")] [assembly: AssemblyInformationalVersion("3.0.2")] [assembly: AssemblyCompany("AtlyssShlongs")] [assembly: AssemblyProduct("AtlyssShlongs")] [assembly: AssemblyTitle("AtlyssShlongs")] [assembly: AssemblyConfiguration("Debug")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.0.2.0")] [module: UnverifiableCode] namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace TemtemTests { [Flags] public enum SyncField : ushort { None = 0, Position = 1, Scale = 2, BallsSize = 4, Preset = 8, Arousal = 0x10, Futa = 0x20, Clothing = 0x40, Rotation = 0x80, ErectAngle = 0x100, Color = 0x200, BodyParts = 0x400, BallColor = 0x800, Hide = 0x1000, Bulge = 0x2000, All = 0x3FFF } public class ShlongSyncPacket : PacketBase { internal const int ColorWireOffset = 1000000; internal const int ColorWireScale = 10000; public override string PacketSourceGUID => "com.atlyss.shlongs"; public ushort ChangedFields { get; set; } public float DickOffsetX { get; set; } public float DickOffsetY { get; set; } public float DickSizeOffset { get; set; } public float BallsSizeOffset { get; set; } public int CurrentDick { get; set; } public float ArousalTarget { get; set; } public bool FutaToggle { get; set; } public bool ClothingOverride { get; set; } public float BaseRotationX { get; set; } public float BaseRotationY { get; set; } public float BaseRotationZ { get; set; } public float ErectAngleOffset { get; set; } public float ScaleX { get; set; } public float ScaleY { get; set; } public float ScaleZ { get; set; } public float ColorR { get; set; } = 1f; public float ColorG { get; set; } = 1f; public float ColorB { get; set; } = 1f; public int ColorMode { get; set; } public bool MatchBody { get; set; } public string BodyPartsData { get; set; } public float BallColorR { get; set; } = 1f; public float BallColorG { get; set; } = 1f; public float BallColorB { get; set; } = 1f; public int BallColorMode { get; set; } public bool BallMatchBody { get; set; } = true; public bool HideToggle { get; set; } public float BulgeAmount { get; set; } public float BulgePosition { get; set; } public float BulgeWidth { get; set; } = 1f; public float BulgeSharpness { get; set; } = 1f; public int ColorRWire { get; set; } public int ColorGWire { get; set; } public int ColorBWire { get; set; } public int BallColorRWire { get; set; } public int BallColorGWire { get; set; } public int BallColorBWire { get; set; } public int MatchBodyWire { get; set; } public int BallMatchBodyWire { get; set; } internal static int EncodeColorWire(float v) { float num = ((v < -100f) ? (-100f) : ((v > 100f) ? 100f : v)); return 1000000 + (int)Math.Round(num * 10000f); } internal static float DecodeColorWire(int encoded) { return (float)(encoded - 1000000) / 10000f; } internal static bool HasColorWire(int encoded) { return encoded != 0; } internal static int EncodeBoolWire(bool value) { return (!value) ? 1 : 2; } internal static bool HasBoolWire(int encoded) { return encoded == 1 || encoded == 2; } internal static bool DecodeBoolWire(int encoded, bool fallback) { return encoded switch { 1 => false, 2 => true, _ => fallback, }; } } } namespace AtlyssShlongs { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.atlyss.shlongs", "AtlyssShlongs", "3.0.2")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Log; internal static AssetManager Assets; internal static PresetRegistry Presets; internal static NetworkManager Network; internal static Dictionary<string, ShlongController> Controllers; internal static ProfileSaveData[] LoadedProfiles; internal static ConfigEntry<bool> DebugMode; internal static UserPresetManager UserPresets; internal static bool CharMenuON; internal static string LocalSteamId; private SettingsWindow _settingsWindow; private bool _runtimeHooksInstalled; private static bool _listenerRegistered; private float _lastUpdateTime; private bool _bundleLoaded; private static readonly object _logLimitLock = new object(); private static readonly Dictionary<string, int> _logLimitCounts = new Dictionary<string, int>(); internal static bool IsDebug => DebugMode != null && DebugMode.Value; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; LoadedProfiles = new ProfileSaveData[120]; UserPresets = new UserPresetManager(Paths.ConfigPath); CosmeticDisplayManager.Initialize(); PluginConfig.Initialize(((BaseUnityPlugin)this).Config); DebugMode = PluginConfig.DebugMode; InputManager.Initialize(((BaseUnityPlugin)this).Config); } private void Start() { Controllers = new Dictionary<string, ShlongController>(); Presets = new PresetRegistry(); bool flag = PluginConfig.EnableLifecycleDiagnostics != null && PluginConfig.EnableLifecycleDiagnostics.Value; bool flag2 = PluginConfig.BlockCloneRuntimeSpawnForDiagnostics != null && PluginConfig.BlockCloneRuntimeSpawnForDiagnostics.Value; if (PluginConfig.BlockCloneRuntimeSpawnForDiagnostics != null && !PluginConfig.BlockCloneRuntimeSpawnForDiagnostics.Value) { if (IsDebug) { Log.LogWarning((object)"Fix 101/102 diagnostic mode was disabled by the persisted config. Forcing BlockCloneRuntimeSpawnForDiagnostics=true so the attach-vs-spawn experiment is actually exercised."); } PluginConfig.BlockCloneRuntimeSpawnForDiagnostics.Value = true; ((BaseUnityPlugin)this).Config.Save(); } bool flag3 = PluginConfig.BlockCloneRuntimeSpawnForDiagnostics != null && PluginConfig.BlockCloneRuntimeSpawnForDiagnostics.Value; bool flag4 = PluginConfig.EnableLocalCosmeticDisplay != null && PluginConfig.EnableLocalCosmeticDisplay.Value; if (IsDebug) { LogDebug("Diagnostics config: Lifecycle=" + flag + ", RequestedBlockCloneRuntimeSpawn=" + flag2 + ", EffectiveBlockCloneRuntimeSpawn=" + flag3 + ", EnableLocalCosmeticDisplay=" + flag4); if (flag3) { LogDebug("Fix 105 diagnostic mitigation is ACTIVE: gameplay clone runtime rig creation will be blocked for both local and non-local players because the latest log showed local clone visibility restoration reintroduced the map-transition failure."); } } _settingsWindow = new SettingsWindow(); _settingsWindow.InitSectionConfig(((BaseUnityPlugin)this).Config); Assets = new AssetManager(Log); if (!Assets.LoadBundle(((BaseUnityPlugin)this).Info.Location)) { LogErrorLimited("plugin.bundle_load_failed", "AssetBundle load failed — plugin will not function.", 1); return; } _bundleLoaded = true; Assets.LoadPresetPrefabs(Presets.GetAllPresets()); Network = new NetworkManager(Controllers, Log); TryInitExtension("AtlyssShlongs.UI.ColorModeExtension"); LoadingDiagnostics.EnsureSceneHook(); TransitionWatchdog.Start(); LogDebug("AtlyssShlongs v3 plugin loaded!"); } private void Update() { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Invalid comparison between Unknown and I4 //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) try { if (_settingsWindow != null) { _settingsWindow.Update(); } else { LogWarningLimited("plugin.settings_window_null", "[GUI] SettingsWindow is null; GUI hotkey cannot open the window. Check AssetBundle load / Start() path.", 1); } } catch (Exception ex) { LogWarningLimited("plugin.settings_window_update", "[GUI] SettingsWindow.Update failed: " + ex.GetType().Name + ": " + ex.Message); } if (IsDebug && _lastUpdateTime > 0f) { float num = Time.unscaledTime - _lastUpdateTime; if (num > 5f) { LogDebug("[Stall] Update gap=" + num.ToString("F2") + "s frame=" + Time.frameCount); } } _lastUpdateTime = Time.unscaledTime; bool flag = (Object)(object)Player._mainPlayer != (Object)null && (int)Player._mainPlayer._currentGameCondition == 0; TransitionWatchdog.Tick(); if (flag) { return; } try { if ((Object)(object)Player._mainPlayer != (Object)null) { LocalSteamId = Player._mainPlayer.Network_steamID; } } catch { } Network?.ProcessPending(); if (IsDebug) { LoadingDiagnostics.PeriodicDump(); } if (!_runtimeHooksInstalled && ShouldInstallRuntimeHooks()) { InstallRuntimeHooks(); } if (Time.frameCount % 600 == 0) { CharMenuON = (Object)(object)Object.FindObjectOfType<CharacterCreationManager>() != (Object)null; } if (_runtimeHooksInstalled && Time.frameCount % 1800 == 0) { try { PlayerRaceModel[] array = Object.FindObjectsOfType<PlayerRaceModel>(); foreach (PlayerRaceModel val in array) { if (!((Object)(object)val == (Object)null) && (Object)(object)((Component)val).GetComponent<ShlongController>() == (Object)null) { RaceModelPatch.AttachToRaceModel(val); } } } catch (Exception ex2) { LogWarningLimited("plugin.sweep", "[Sweep] Exception: " + ex2.Message); } } if (_runtimeHooksInstalled && Time.frameCount % 600 == 0) { ModelAttacher.PurgeDestroyedEntries(); } if (DebugMode != null && DebugMode.Value && Time.frameCount % 600 == 0) { string[] obj2 = new string[15] { "[Heartbeat] frame=", Time.frameCount.ToString(), " controllers=", ((Controllers != null) ? Controllers.Count : 0).ToString(), " allInstances=", ShlongController.AllInstances.Count.ToString(), " activeDicks=", ModelAttacher.ActiveDickMeshObjects.Count.ToString(), " cosmeticRigs=", CosmeticDisplayManager.ActiveCount.ToString(), " gameCondition=", ((Object)(object)Player._mainPlayer != (Object)null) ? ((object)(GameCondition)(ref Player._mainPlayer._currentGameCondition)).ToString() : "null", " scene=", null, null }; Scene activeScene = SceneManager.GetActiveScene(); obj2[13] = ((Scene)(ref activeScene)).name; obj2[14] = LifecycleDiagnostics.BuildHeartbeatSnapshot(); LogDebug(string.Concat(obj2)); } CosmeticDisplayManager.Tick(); } private void OnGUI() { _settingsWindow?.OnGUI(); } private void LateUpdate() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 if (!((Object)(object)Player._mainPlayer != (Object)null) || (int)Player._mainPlayer._currentGameCondition != 0) { CosmeticDisplayManager.UpdateDisplay(); } } private bool ShouldInstallRuntimeHooks() { if (!_bundleLoaded) { return false; } return (Object)(object)Object.FindObjectOfType<CharacterCreationManager>() != (Object)null || (Object)(object)Object.FindObjectOfType<Player>() != (Object)null; } private void InstallRuntimeHooks() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("com.atlyss.shlongs.v3"); val.PatchAll(); RaceModelPatch.Install(); if (!_listenerRegistered && Network != null) { if (Network.RegisterListener()) { _listenerRegistered = true; LogDebug("CodeTalker listener registered"); } else { LogErrorLimited("plugin.codetlaker_listener", "Failed to register CodeTalker listener (duplicate?)"); } } PlayerRaceModel[] array = Object.FindObjectsOfType<PlayerRaceModel>(); foreach (PlayerRaceModel self in array) { RaceModelPatch.AttachToRaceModel(self); } _runtimeHooksInstalled = true; LogDebug("AtlyssShlongs v3 runtime hooks installed."); } private static void TryInitExtension(string fullTypeName) { try { Type type = FindTypeInAllAssemblies(fullTypeName); if (!(type == null)) { type.GetMethod("Initialize", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.Invoke(null, null); LogDebug("Extension initialized: " + fullTypeName); } } catch (Exception ex) { LogWarningLimited("plugin.extension." + fullTypeName, fullTypeName + " init failed: " + ex.Message); } } private static Type FindTypeInAllAssemblies(string fullTypeName) { Type type = Type.GetType(fullTypeName); if (type != null) { return type; } Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { type = assembly.GetType(fullTypeName); if (type != null) { return type; } } return null; } internal static void LogDebug(string message) { if (IsDebug && Log != null) { Log.LogInfo((object)("[DBG] " + message)); } } internal static void LogWarningLimited(string key, string message, int maxCount = 2) { if (Log == null) { return; } lock (_logLimitLock) { _logLimitCounts.TryGetValue(key, out var value); if (value >= maxCount) { return; } _logLimitCounts[key] = value + 1; } Log.LogWarning((object)message); } internal static void LogErrorLimited(string key, string message, int maxCount = 2) { if (Log == null) { return; } lock (_logLimitLock) { _logLimitCounts.TryGetValue(key, out var value); if (value >= maxCount) { return; } _logLimitCounts[key] = value + 1; } Log.LogError((object)message); } } public static class PluginConfig { public static ConfigEntry<bool> DebugMode; public static ConfigEntry<bool> EnableLifecycleDiagnostics; public static ConfigEntry<bool> BlockCloneRuntimeSpawnForDiagnostics; public static ConfigEntry<bool> EnableLocalCosmeticDisplay; public static ConfigEntry<bool> HotkeysEnabled; public static ConfigEntry<bool> EnableRemoteJiggleExperimental; public static ConfigEntry<float> RemoteJiggleStrength; public static ConfigEntry<float> RemoteJiggleStiffness; public static ConfigEntry<float> RemoteJiggleDamping; public static ConfigEntry<float> RemoteJiggleMaxDegrees; public static ConfigEntry<bool> EnableLocalCosmeticJiggleExperimental; public static ConfigEntry<bool> RemoteJiggleDebugPulse; public static ConfigEntry<bool> RemoteJiggleDebugPulseRoot; public static ConfigEntry<float> RemoteJiggleVelocityToDegrees; public static ConfigEntry<float> RemoteJiggleAngularToDegrees; public static ConfigEntry<float> RemoteJiggleMinimumKick; public static ConfigEntry<string> RemoteJiggleMode; public static ConfigEntry<bool> ApplyCharacterHbcToMatchedShlongs; public const string RemoteJiggleModeProcedural = "Procedural"; public const string RemoteJiggleModeNativeDynamicBone = "NativeDynamicBoneExperimental"; public static bool UseNativeRemoteDynamicBone => EnableRemoteJiggleExperimental != null && EnableRemoteJiggleExperimental.Value && RemoteJiggleMode != null && RemoteJiggleMode.Value == "NativeDynamicBoneExperimental"; public static void Initialize(ConfigFile config) { DebugMode = config.Bind<bool>("Debug", "Enable Debug Logging", false, "When enabled, detailed debug logs are written to the BepInEx console."); EnableLifecycleDiagnostics = config.Bind<bool>("Debug", "Enable Lifecycle Diagnostics", true, "Track attach/spawn/register/unregister lifecycle counters and include them in heartbeat logs."); BlockCloneRuntimeSpawnForDiagnostics = config.Bind<bool>("Debug", "Block Clone Runtime Spawn For Diagnostics", true, "Diagnostic mitigation: skip creating runtime dick rigs for all player clones during gameplay. Enabled by default because current evidence shows even the local gameplay clone rig can reintroduce map-transition failures."); EnableLocalCosmeticDisplay = config.Bind<bool>("Gameplay", "Enable Local Cosmetic Display", true, "Fix 126: When clone runtime spawn is blocked, show lightweight cosmetic-only rigs for all players (local + remote). CosmeticDisplayManager creates presentation-only display rigs that are architecturally isolated from ShlongController lifecycle (no AllInstances, no teardown participation, no respawn flag). Rigs are staggered at 2/frame to avoid GPU stalls."); HotkeysEnabled = config.Bind<bool>("Keybinds", "Enable Hotkeys", true, "When disabled, all hotkeys (except Open GUI) are ignored."); EnableRemoteJiggleExperimental = config.Bind<bool>("Debug", "Enable Remote Jiggle Experimental", true, "Enables remote cosmetic jiggle. Native DynamicBone test mode is now the recommended default; disable this to turn remote jiggle off."); RemoteJiggleMode = config.Bind<string>("Debug", "Remote Jiggle Mode", "NativeDynamicBoneExperimental", "Remote jiggle implementation. NativeDynamicBoneExperimental = recommended solo-style DynamicBone on cosmetic display rigs. Procedural = fallback custom simulation."); if (RemoteJiggleMode.Value != "Procedural" && RemoteJiggleMode.Value != "NativeDynamicBoneExperimental") { RemoteJiggleMode.Value = "Procedural"; } RemoteJiggleStrength = config.Bind<float>("Debug", "Remote Jiggle Strength", 4.53f, "Strength multiplier for fallback procedural remote jiggle. Clamped to 0..6. Default matches the Test Soft fallback preset."); RemoteJiggleStiffness = config.Bind<float>("Debug", "Remote Jiggle Stiffness", 30.7f, "Spring stiffness for fallback procedural remote jiggle. Default matches the Test Soft fallback preset."); RemoteJiggleDamping = config.Bind<float>("Debug", "Remote Jiggle Damping", 0.92f, "Spring damping for fallback procedural remote jiggle. Clamped to 0..1. Default matches the Test Soft fallback preset."); RemoteJiggleMaxDegrees = config.Bind<float>("Debug", "Remote Jiggle Max Degrees", 25.6f, "Maximum angular offset in degrees for fallback procedural remote jiggle. Clamped to 0..45. Default matches the Test Soft fallback preset."); EnableLocalCosmeticJiggleExperimental = config.Bind<bool>("Debug", "Enable Local Cosmetic Jiggle Experimental", false, "Experimental: also applies procedural jiggle to the local player's cosmetic display rig. Disabled by default to avoid double-jiggle if the local player already has a runtime rig."); RemoteJiggleDebugPulse = config.Bind<bool>("Debug", "Remote Jiggle Debug Pulse", false, "Debug: applies a visible sine-wave jiggle to cosmetic rigs to prove chain binding. If the rig visibly pulses, chains are bound. For testing only."); RemoteJiggleDebugPulseRoot = config.Bind<bool>("Debug", "Remote Jiggle Debug Pulse Root", false, "Debug: when true, applies a visible sine-wave rotation directly to the rig display root or size bone to confirm UpdateProceduralJiggle is running. Bone pulse invisible + Root pulse visible means chain binding is wrong. Default false."); RemoteJiggleVelocityToDegrees = config.Bind<float>("Debug", "Remote Jiggle Velocity To Degrees", 7.72f, "Scales player velocity into fallback procedural jiggle angular offset. Higher = more reaction to movement. Clamped to 0..8. Default matches the Test Soft fallback preset."); RemoteJiggleAngularToDegrees = config.Bind<float>("Debug", "Remote Jiggle Angular To Degrees", 3.47f, "Scales player rotation speed into fallback procedural jiggle angular offset. Clamped to 0..4. Default matches the Test Soft fallback preset."); RemoteJiggleMinimumKick = config.Bind<float>("Debug", "Remote Jiggle Minimum Kick", 2.6f, "Minimum fallback procedural jiggle kick applied when the player is moving but target magnitude is small. Clamped to 0..3. Default matches the Test Soft fallback preset."); ApplyCharacterHbcToMatchedShlongs = config.Bind<bool>("Color", "Apply Character Hue Brightness Contrast", true, "When enabled, matched-body shlong materials copy character hue/brightness/contrast/saturation-style shader properties from the player's body material. Disable for more texture-original color variety."); MigrateLegacyRemoteJiggleDefaults(config); } private static void MigrateLegacyRemoteJiggleDefaults(ConfigFile config) { if (EnableRemoteJiggleExperimental != null && !EnableRemoteJiggleExperimental.Value && RemoteJiggleMode != null && RemoteJiggleMode.Value == "Procedural" && Approximately(RemoteJiggleStrength, 0.35f) && Approximately(RemoteJiggleStiffness, 10f) && Approximately(RemoteJiggleDamping, 0.9f) && Approximately(RemoteJiggleMaxDegrees, 5f) && Approximately(RemoteJiggleVelocityToDegrees, 0.35f) && Approximately(RemoteJiggleAngularToDegrees, 0.1f) && Approximately(RemoteJiggleMinimumKick, 0.04f)) { EnableRemoteJiggleExperimental.Value = true; RemoteJiggleMode.Value = "NativeDynamicBoneExperimental"; RemoteJiggleStrength.Value = 4.53f; RemoteJiggleStiffness.Value = 30.7f; RemoteJiggleDamping.Value = 0.92f; RemoteJiggleMaxDegrees.Value = 25.6f; RemoteJiggleVelocityToDegrees.Value = 7.72f; RemoteJiggleAngularToDegrees.Value = 3.47f; RemoteJiggleMinimumKick.Value = 2.6f; config.Save(); if (Plugin.IsDebug) { Plugin.LogDebug("[ConfigMigration] Remote jiggle legacy defaults migrated to NativeDynamicBoneExperimental + Test Soft fallback values."); } } } private static bool Approximately(ConfigEntry<float> entry, float value) { if (entry == null) { return false; } return Math.Abs(entry.Value - value) < 0.0001f; } } } namespace AtlyssShlongs.Util { public static class TransformExtensions { public static Transform RecursiveFindChild(this Transform parent, string childName) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown foreach (Transform item in parent) { Transform val = item; if (((Object)val).name == childName) { return val; } Transform val2 = val.RecursiveFindChild(childName); if ((Object)(object)val2 != (Object)null) { return val2; } } return null; } } } namespace AtlyssShlongs.UI { internal static class ColorModeExtension { private const int MODE_TINT = 0; private const int MODE_RGB = 1; private const int MODE_HEX = 2; private const int MODE_PICKER = 3; private const int MODE_HSV = 4; private static readonly string[] TabLabels; private static readonly CultureInfo Cult; private static bool[] _pendingColorSync; private static float[] _lastColorChangeTime; private const int TARGET_DICK = 0; private const int TARGET_BALL = 1; private static int _editTarget; private static readonly string[] TargetLabels; private static readonly string[] _hexInputs; private static readonly float[] _hues; private static readonly float[] _sats; private static readonly float[] _vals; private static Texture2D _previewTex; private static Texture2D _svTex; private static Texture2D _hueTex; private static float _svTexHue; private static int _svSize; public static void Initialize() { SettingsWindow.OnDrawColorUI = DrawColorUI; ShlongController.OnApplySolidColor = ApplySolidColor; } private static bool ApplySolidColor(Material mat, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (ApplySolidToProperty(mat, "_Color", color)) { return true; } if (ApplySolidToProperty(mat, "_BaseColor", color)) { return true; } return ApplySolidFallback(mat, color); } private static bool ApplySolidToProperty(Material mat, string propName, Color color) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!mat.HasProperty(propName)) { return false; } Color color2 = mat.GetColor(propName); mat.SetColor(propName, new Color(color.r, color.g, color.b, color2.a)); return true; } private static bool ApplySolidFallback(Material mat, Color color) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) try { Shader shader = mat.shader; int propertyCount = shader.GetPropertyCount(); for (int i = 0; i < propertyCount; i++) { if ((int)shader.GetPropertyType(i) == 0) { string propertyName = shader.GetPropertyName(i); Color color2 = mat.GetColor(propertyName); mat.SetColor(propertyName, new Color(color.r, color.g, color.b, color2.a)); return true; } } } catch { } return false; } private static bool SupportsSeparateBallsSheathColor(ShlongController sc) { if ((Object)(object)sc == (Object)null) { return false; } if (Plugin.Presets != null) { PresetData preset = Plugin.Presets.GetPreset(sc.PresetIndex); if (preset != null && preset.AssetSource == PresetAssetSource.Test) { return true; } } if (sc.HasBallsSheathSlots) { return true; } return sc.BallMeshes != null && sc.BallMeshes.Length != 0; } private static void DrawColorUI(ShlongController sc) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) GUILayout.Label("Color", GUI.skin.box, Array.Empty<GUILayoutOption>()); if (SupportsSeparateBallsSheathColor(sc)) { _editTarget = GUILayout.Toolbar(_editTarget, TargetLabels, Array.Empty<GUILayoutOption>()); GUILayout.Label("Editing: " + TargetLabels[_editTarget], (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(16f) }); } else { _editTarget = 0; GUILayout.Label("Shlong / Shaft Color", GUI.skin.box, Array.Empty<GUILayoutOption>()); } GUILayout.Space(2f); bool flag = _editTarget == 0; Color val = (flag ? sc.ColorTint : sc.BallColorTint); int num = (flag ? sc.ColorMode : sc.BallColorMode); bool flag2 = (flag ? sc.MatchBody : sc.BallMatchBody); bool flag3 = flag2; flag2 = GUILayout.Toggle(flag2, " Match Body Color (additive tint)", Array.Empty<GUILayoutOption>()); if (flag2 != flag3) { if (flag) { sc.InvalidateColorMaterialCache(dick: true, balls: false); } else { sc.InvalidateColorMaterialCache(dick: false, balls: true); } if (flag2) { val = Color.white; } else { ((Color)(ref val))..ctor(Mathf.Clamp01(0.5f + (val.r - 1f)), Mathf.Clamp01(0.5f + (val.g - 1f)), Mathf.Clamp01(0.5f + (val.b - 1f))); } WriteTargetState(sc, flag, val, num, flag2); SyncHSVFromColor(val); SyncHexFromColor(val); ApplyTarget(sc, flag); bool hasBallsSheathSlots = sc.HasBallsSheathSlots; if (hasBallsSheathSlots) { CosmeticDisplayManager.ForceRefreshColorsFor(sc, dick: true, balls: true); } else { CosmeticDisplayManager.ForceRefreshColorsFor(sc, flag, !flag); } SyncField forceFields = (flag ? SyncField.Color : SyncField.BallColor); if (hasBallsSheathSlots) { forceFields = SyncField.Color | SyncField.BallColor; } if (Plugin.IsDebug) { string[] obj = new string[16] { "[ColorMatchToggle] group=", flag ? "shaft" : "balls", " split=", hasBallsSheathSlots.ToString(), " matchBody=", flag2.ToString(), " forceFields=", forceFields.ToString(), " color=", null, null, null, null, null, null, null }; int num2 = 9; Color val2 = sc.ColorTint; obj[num2] = ((object)(Color)(ref val2)).ToString(); obj[10] = " ballColor="; int num3 = 11; val2 = sc.BallColorTint; obj[num3] = ((object)(Color)(ref val2)).ToString(); obj[12] = " ballMatch="; obj[13] = sc.BallMatchBody.ToString(); obj[14] = " frame="; obj[15] = Time.frameCount.ToString(); Plugin.LogDebug(string.Concat(obj)); } _pendingColorSync[(!flag) ? 1 : 0] = false; sc.RequestSyncImmediate(forceSave: true, forceFields); } if (num < 0 || num >= TabLabels.Length) { num = 0; } int num4 = num; int num5 = GUILayout.Toolbar(num, TabLabels, Array.Empty<GUILayoutOption>()); if (num5 != num4) { val = ConvertColorForModeSwitch(val, num4, num5); num = num5; WriteTargetState(sc, flag, val, num, flag2); SyncHSVFromColor(val); SyncHexFromColor(val); ApplyTarget(sc, flag); SyncField forceFields2 = (flag ? SyncField.Color : SyncField.BallColor); _pendingColorSync[(!flag) ? 1 : 0] = false; sc.RequestSyncImmediate(forceSave: true, forceFields2); } GUILayout.Space(4f); switch (num) { case 0: DrawTintTab(sc, flag); break; case 1: DrawRGBTab(sc, flag); break; case 2: DrawHexTab(sc, flag); break; case 3: DrawPickerTab(sc, flag); break; case 4: DrawHSVTab(sc, flag); break; } GUILayout.Space(4f); DrawPreview(sc, flag); if (GUILayout.Button(flag ? "Reset Shlong / Shaft Color" : "Reset Balls & Sheath Color", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) })) { sc.InvalidateColorMaterialCache(flag, !flag); WriteTargetState(sc, flag, Color.white, 0, matchBody: true); _hexInputs[_editTarget] = "#FFFFFF"; _hues[_editTarget] = 0f; _sats[_editTarget] = 0f; _vals[_editTarget] = 1f; ApplyTarget(sc, flag); CosmeticDisplayManager.ForceRefreshColorsFor(sc, flag, !flag); SyncField forceFields3 = (flag ? SyncField.Color : SyncField.BallColor); _pendingColorSync[(!flag) ? 1 : 0] = false; if (Plugin.IsDebug) { string[] obj2 = new string[8] { "[ColorReset] group=", flag ? "shaft" : "balls", " color=", null, null, null, null, null }; Color white = Color.white; obj2[3] = ((object)(Color)(ref white)).ToString(); obj2[4] = " mode="; obj2[5] = 0.ToString(); obj2[6] = " matchBody=true forceFields="; obj2[7] = forceFields3.ToString(); Plugin.LogDebug(string.Concat(obj2)); } sc.RequestSyncImmediate(forceSave: true, forceFields3); } FlushColorSyncIfNeeded(sc, flag); } private static Color GetTargetColor(ShlongController sc, bool isDick) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return isDick ? sc.ColorTint : sc.BallColorTint; } private static void WriteTargetState(ShlongController sc, bool isDick, Color color, int mode, bool matchBody) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (isDick) { sc.ColorTint = color; sc.ColorMode = mode; sc.MatchBody = matchBody; } else { sc.BallColorTint = color; sc.BallColorMode = mode; sc.BallMatchBody = matchBody; } } private static void SetTargetColor(ShlongController sc, bool isDick, Color color) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (isDick) { sc.ColorTint = color; } else { sc.BallColorTint = color; } } private static void ApplyTarget(ShlongController sc, bool isDick) { if (isDick) { sc.ApplyColorTint(); } else { sc.ApplyBallColorTint(); } } private static Color ConvertColorForModeSwitch(Color curColor, int fromMode, int toMode) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) bool flag = fromMode == 0; bool flag2 = toMode == 0; if (flag && !flag2) { return new Color(Mathf.Clamp01(curColor.r), Mathf.Clamp01(curColor.g), Mathf.Clamp01(curColor.b)); } if (!flag && flag2) { return Color.white; } return curColor; } private static void DrawTintTab(ShlongController sc, bool isDick) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Color targetColor = GetTargetColor(sc, isDick); float r = targetColor.r; float g = targetColor.g; float b = targetColor.b; GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("R: " + (r - 1f).ToString("+0.00;-0.00", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float nr = GUILayout.HorizontalSlider(r, 0f, 2f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("G: " + (g - 1f).ToString("+0.00;-0.00", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float ng = GUILayout.HorizontalSlider(g, 0f, 2f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("B: " + (b - 1f).ToString("+0.00;-0.00", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float nb = GUILayout.HorizontalSlider(b, 0f, 2f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); HandleSliderSync(sc, isDick, r, g, b, nr, ng, nb); } private static void DrawRGBTab(ShlongController sc, bool isDick) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Color targetColor = GetTargetColor(sc, isDick); float num = Mathf.Clamp01(targetColor.r); float num2 = Mathf.Clamp01(targetColor.g); float num3 = Mathf.Clamp01(targetColor.b); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("R: " + num.ToString("F2", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float nr = GUILayout.HorizontalSlider(num, 0f, 1f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("G: " + num2.ToString("F2", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float ng = GUILayout.HorizontalSlider(num2, 0f, 1f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("B: " + num3.ToString("F2", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float nb = GUILayout.HorizontalSlider(num3, 0f, 1f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); HandleSliderSync(sc, isDick, num, num2, num3, nr, ng, nb); } private static void DrawHexTab(ShlongController sc, bool isDick) { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) int editTarget = _editTarget; GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("Hex:", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) }); string text = GUILayout.TextField(_hexInputs[editTarget], 9, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); if (text != _hexInputs[editTarget]) { _hexInputs[editTarget] = text; string text2 = (text.StartsWith("#") ? text : ("#" + text)); Color val = default(Color); if (ColorUtility.TryParseHtmlString(text2, ref val)) { SetTargetColor(sc, isDick, val); ApplyTarget(sc, isDick); SyncHSVFromColor(val); MarkColorChanged(isDick); } } GUILayout.Label("Current: #" + ColorUtility.ToHtmlStringRGB(GetTargetColor(sc, isDick)), Array.Empty<GUILayoutOption>()); } private static void DrawPickerTab(ShlongController sc, bool isDick) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Invalid comparison between Unknown and I4 //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) int editTarget = _editTarget; GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("H: " + (_hues[editTarget] * 360f).ToString("F0") + "°", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num = GUILayout.HorizontalSlider(_hues[editTarget], 0f, 1f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); EnsureHueTexture(); Rect rect = GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(12f) }); GUI.DrawTexture(rect, (Texture)(object)_hueTex); GUILayout.Space(4f); EnsureSVTexture(num); Rect rect2 = GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width((float)_svSize), GUILayout.Height((float)_svSize) }); GUI.DrawTexture(rect2, (Texture)(object)_svTex); Event current = Event.current; bool flag = false; if (((int)current.type == 0 || (int)current.type == 3) && ((Rect)(ref rect2)).Contains(current.mousePosition)) { _sats[editTarget] = Mathf.Clamp01((current.mousePosition.x - ((Rect)(ref rect2)).x) / ((Rect)(ref rect2)).width); _vals[editTarget] = 1f - Mathf.Clamp01((current.mousePosition.y - ((Rect)(ref rect2)).y) / ((Rect)(ref rect2)).height); flag = true; current.Use(); } float num2 = ((Rect)(ref rect2)).x + _sats[editTarget] * ((Rect)(ref rect2)).width - 4f; float num3 = ((Rect)(ref rect2)).y + (1f - _vals[editTarget]) * ((Rect)(ref rect2)).height - 4f; GUI.Label(new Rect(num2, num3, 9f, 9f), "◎"); bool flag2 = Mathf.Abs(num - _hues[editTarget]) > 0.001f; _hues[editTarget] = num; if (flag2 || flag) { Color val = Color.HSVToRGB(_hues[editTarget], _sats[editTarget], _vals[editTarget]); SetTargetColor(sc, isDick, val); ApplyTarget(sc, isDick); SyncHexFromColor(val); MarkColorChanged(isDick); } } private static void DrawHSVTab(ShlongController sc, bool isDick) { //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) int editTarget = _editTarget; GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("H: " + (_hues[editTarget] * 360f).ToString("F0") + "°", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num = GUILayout.HorizontalSlider(_hues[editTarget], 0f, 1f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("S: " + _sats[editTarget].ToString("F2", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num2 = GUILayout.HorizontalSlider(_sats[editTarget], 0f, 1f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("V: " + _vals[editTarget].ToString("F2", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num3 = GUILayout.HorizontalSlider(_vals[editTarget], 0f, 1f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); bool flag = Mathf.Abs(num - _hues[editTarget]) > 0.001f || Mathf.Abs(num2 - _sats[editTarget]) > 0.001f || Mathf.Abs(num3 - _vals[editTarget]) > 0.001f; _hues[editTarget] = num; _sats[editTarget] = num2; _vals[editTarget] = num3; if (flag) { Color val = Color.HSVToRGB(_hues[editTarget], _sats[editTarget], _vals[editTarget]); SetTargetColor(sc, isDick, val); ApplyTarget(sc, isDick); SyncHexFromColor(val); MarkColorChanged(isDick); } } private static void DrawPreview(ShlongController sc, bool isDick) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) EnsurePreviewTexture(); Color targetColor = GetTargetColor(sc, isDick); bool flag = (isDick ? sc.MatchBody : sc.BallMatchBody); int num = (isDick ? sc.ColorMode : sc.BallColorMode); if (flag && num == 0) { ((Color)(ref targetColor))..ctor(Mathf.Clamp01(0.5f + (targetColor.r - 1f)), Mathf.Clamp01(0.5f + (targetColor.g - 1f)), Mathf.Clamp01(0.5f + (targetColor.b - 1f))); } _previewTex.SetPixel(0, 0, targetColor); _previewTex.Apply(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("Preview:", Array.Empty<GUILayoutOption>()); Rect rect = GUILayoutUtility.GetRect(40f, 20f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) }); GUI.DrawTexture(rect, (Texture)(object)_previewTex); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } private static void MarkColorChanged(bool isDick) { int num = ((!isDick) ? 1 : 0); _pendingColorSync[num] = true; _lastColorChangeTime[num] = Time.unscaledTime; } private static void FlushColorSyncIfNeeded(ShlongController sc, bool isDick, bool forceNow = false) { int num = ((!isDick) ? 1 : 0); if (_pendingColorSync[num]) { bool flag = GUIUtility.hotControl != 0; bool flag2 = Time.unscaledTime - _lastColorChangeTime[num] >= 0.35f; if (!(!forceNow && flag) || flag2) { _pendingColorSync[num] = false; SyncField forceFields = (isDick ? SyncField.Color : SyncField.BallColor); sc.RequestSyncImmediate(forceSave: true, forceFields); } } } private static void HandleSliderSync(ShlongController sc, bool isDick, float or, float og, float ob, float nr, float ng, float nb) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Abs(nr - or) > 0.001f || Mathf.Abs(ng - og) > 0.001f || Mathf.Abs(nb - ob) > 0.001f) { Color val = default(Color); ((Color)(ref val))..ctor(nr, ng, nb); SetTargetColor(sc, isDick, val); ApplyTarget(sc, isDick); SyncHexFromColor(val); SyncHSVFromColor(val); MarkColorChanged(isDick); } } private static void SyncHSVFromColor(Color c) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) int editTarget = _editTarget; Color.RGBToHSV(c, ref _hues[editTarget], ref _sats[editTarget], ref _vals[editTarget]); } private static void SyncHexFromColor(Color c) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) _hexInputs[_editTarget] = "#" + ColorUtility.ToHtmlStringRGB(c); } private static void EnsurePreviewTexture() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown if (!((Object)(object)_previewTex != (Object)null)) { _previewTex = new Texture2D(1, 1, (TextureFormat)4, false) { filterMode = (FilterMode)0, wrapMode = (TextureWrapMode)1 }; } } private static void EnsureHueTexture() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_hueTex != (Object)null)) { int num = 256; _hueTex = new Texture2D(num, 1, (TextureFormat)4, false) { filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; for (int i = 0; i < num; i++) { float num2 = (float)i / (float)(num - 1); _hueTex.SetPixel(i, 0, Color.HSVToRGB(num2, 1f, 1f)); } _hueTex.Apply(); } } private static void EnsureSVTexture(float hue) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_svTex != (Object)null && Mathf.Abs(hue - _svTexHue) < 0.002f) { return; } _svTexHue = hue; if ((Object)(object)_svTex == (Object)null) { _svTex = new Texture2D(_svSize, _svSize, (TextureFormat)4, false) { filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1 }; } for (int i = 0; i < _svSize; i++) { float num = (float)i / (float)(_svSize - 1); for (int j = 0; j < _svSize; j++) { float num2 = (float)j / (float)(_svSize - 1); _svTex.SetPixel(j, i, Color.HSVToRGB(hue, num2, num)); } } _svTex.Apply(); } static ColorModeExtension() { TabLabels = new string[5] { "Tint", "RGB", "Hex", "Picker", "HSV" }; Cult = new CultureInfo("en-US"); _pendingColorSync = new bool[2]; _lastColorChangeTime = new float[2]; TargetLabels = new string[2] { "Shlong / Shaft", "Balls & Sheath" }; _hexInputs = new string[2] { "#FFFFFF", "#FFFFFF" }; _hues = new float[2]; _sats = new float[2] { 1f, 1f }; _vals = new float[2] { 1f, 1f }; _svTexHue = -1f; _svSize = 128; } } public class SettingsWindow { private enum ShortcutCapturePart { None, MainKey } private enum ShlongModelCategory { Original, Updated } [CompilerGenerated] private sealed class <GetShortcutEntries>d__88 : IEnumerable<ConfigEntry<KeyboardShortcut>>, IEnumerable, IEnumerator<ConfigEntry<KeyboardShortcut>>, IEnumerator, IDisposable { private int <>1__state; private ConfigEntry<KeyboardShortcut> <>2__current; private int <>l__initialThreadId; public SettingsWindow <>4__this; ConfigEntry<KeyboardShortcut> IEnumerator<ConfigEntry<KeyboardShortcut>>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GetShortcutEntries>d__88(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = InputManager.GetPrevDick(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = InputManager.GetNextDick(); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = InputManager.GetToggleHide(); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = InputManager.GetToggleFuta(); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = InputManager.GetToggleClothing(); <>1__state = 5; return true; case 5: <>1__state = -1; <>2__current = InputManager.GetCycleArousal(); <>1__state = 6; return true; case 6: <>1__state = -1; <>2__current = InputManager.GetToggleArousal(); <>1__state = 7; return true; case 7: <>1__state = -1; <>2__current = InputManager.GetIncreaseDick(); <>1__state = 8; return true; case 8: <>1__state = -1; <>2__current = InputManager.GetDecreaseDick(); <>1__state = 9; return true; case 9: <>1__state = -1; <>2__current = InputManager.GetIncreaseBalls(); <>1__state = 10; return true; case 10: <>1__state = -1; <>2__current = InputManager.GetDecreaseBalls(); <>1__state = 11; return true; case 11: <>1__state = -1; <>2__current = InputManager.GetManualSync(); <>1__state = 12; return true; case 12: <>1__state = -1; <>2__current = InputManager.GetAdjustOffset(); <>1__state = 13; return true; case 13: <>1__state = -1; <>2__current = InputManager.GetToggleGui(); <>1__state = 14; return true; case 14: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator<ConfigEntry<KeyboardShortcut>> IEnumerable<ConfigEntry<KeyboardShortcut>>.GetEnumerator() { <GetShortcutEntries>d__88 result; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; result = this; } else { result = new <GetShortcutEntries>d__88(0) { <>4__this = <>4__this }; } return result; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<ConfigEntry<KeyboardShortcut>>)this).GetEnumerator(); } } [CompilerGenerated] private sealed class <LogBulgeTestSpawnResult>d__79 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ShlongController sc; public int presetIndex; public string expectedId; private int <i>5__1; private PresetData <preset>5__2; private string <expectedMesh>5__3; private string <rootName>5__4; private StringBuilder <sb>5__5; private bool <isClone>5__6; private bool <blockEnabled>5__7; private SkinnedMeshRenderer[] <renderers>5__8; private int <i>5__9; private SkinnedMeshRenderer <r>5__10; private Exception <ex>5__11; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LogBulgeTestSpawnResult>d__79(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <preset>5__2 = null; <expectedMesh>5__3 = null; <rootName>5__4 = null; <sb>5__5 = null; <renderers>5__8 = null; <r>5__10 = null; <ex>5__11 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <i>5__1 = 0; break; case 1: <>1__state = -1; <i>5__1++; break; } if (<i>5__1 < 30) { if ((Object)(object)sc == (Object)null) { return false; } if (sc.PresetIndex != presetIndex || !((Object)(object)sc.InstanceRoot != (Object)null)) { <>2__current = null; <>1__state = 1; return true; } } if ((Object)(object)sc == (Object)null) { return false; } try { <preset>5__2 = ((Plugin.Presets != null) ? Plugin.Presets.GetPreset(presetIndex) : null); <expectedMesh>5__3 = ((<preset>5__2 != null) ? <preset>5__2.MeshName : "<unknown>"); <rootName>5__4 = (((Object)(object)sc.InstanceRoot != (Object)null) ? ((Object)sc.InstanceRoot).name : "<null>"); <sb>5__5 = new StringBuilder(); <sb>5__5.Append("[BulgeTest] Spawn result:"); <sb>5__5.Append(" expectedId=").Append(expectedId); <sb>5__5.Append(" presetIndex=").Append(sc.PresetIndex); <sb>5__5.Append(" controller=").Append(((Object)((Component)sc).gameObject).name); <isClone>5__6 = ((Object)((Component)sc).gameObject).name.Contains("(Clone)") && !((Object)((Component)sc).gameObject).name.Contains("equipDisplay"); <blockEnabled>5__7 = PluginConfig.BlockCloneRuntimeSpawnForDiagnostics != null && PluginConfig.BlockCloneRuntimeSpawnForDiagnostics.Value; <sb>5__5.Append(" clone=").Append(<isClone>5__6); <sb>5__5.Append(" cloneSpawnBlock=").Append(<blockEnabled>5__7); <sb>5__5.Append(" instanceRoot=").Append(<rootName>5__4); <sb>5__5.Append(" expectedMesh=").Append(<expectedMesh>5__3); <sb>5__5.Append(" dickMesh="); if ((Object)(object)sc.DickMesh != (Object)null) { <sb>5__5.Append(((Object)sc.DickMesh).name); <sb>5__5.Append(" sharedMesh="); <sb>5__5.Append(((Object)(object)sc.DickMesh.sharedMesh != (Object)null) ? ((Object)sc.DickMesh.sharedMesh).name : "<null>"); } else { <sb>5__5.Append("<null>"); } if ((Object)(object)sc.InstanceRoot != (Object)null) { <renderers>5__8 = sc.InstanceRoot.GetComponentsInChildren<SkinnedMeshRenderer>(true); <sb>5__5.Append(" renderers=").Append(<renderers>5__8.Length); <i>5__9 = 0; while (<i>5__9 < <renderers>5__8.Length) { <r>5__10 = <renderers>5__8[<i>5__9]; <sb>5__5.Append(" ["); <sb>5__5.Append(<i>5__9); <sb>5__5.Append("] name="); <sb>5__5.Append(((Object)(object)<r>5__10 != (Object)null) ? ((Object)<r>5__10).name : "<null>"); <sb>5__5.Append(" mesh="); <sb>5__5.Append(((Object)(object)<r>5__10 != (Object)null && (Object)(object)<r>5__10.sharedMesh != (Object)null) ? ((Object)<r>5__10.sharedMesh).name : "<null>"); <r>5__10 = null; <i>5__9++; } <renderers>5__8 = null; } Plugin.LogDebug(<sb>5__5.ToString()); <preset>5__2 = null; <expectedMesh>5__3 = null; <rootName>5__4 = null; <sb>5__5 = null; } catch (Exception ex) { <ex>5__11 = ex; Plugin.LogWarningLimited("bulge.spawn_result", "[BulgeTest] LogBulgeTestSpawnResult: " + <ex>5__11.Message); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly string[] ModifierOptionLabels; private static readonly KeyCode[] ModifierOptionKeys; public static bool IsHovered; internal static Action<ShlongController> OnDrawColorUI; private Rect _windowRect = new Rect(20f, 20f, 460f, 700f); private Vector2 _windowScroll; private bool _showGui; private bool _sliderWasActive; private bool _bulgeSliderWasActive; private bool _shaftColorSliderWasActive; private bool _ballColorSliderWasActive; private CursorLockMode _prevCursorLockState = (CursorLockMode)1; private bool _cursorStateChanged; private ConfigEntry<KeyboardShortcut> _pendingShortcut; private string _pendingShortcutLabel; private bool _pendingShortcutAllowUnbind = true; private ShortcutCapturePart _pendingShortcutPart; private ConfigEntry<KeyboardShortcut> _openModifierDropdown; private GUIStyle _bindLabelStyle; private GUIStyle _activeBindLabelStyle; private GUIStyle _activeBindButtonStyle; private ShlongModelCategory _selectedModelCategory = ShlongModelCategory.Original; private static readonly CultureInfo Cult; private string _presetNameInput = ""; private string[] _cachedPresetNames = Array.Empty<string>(); private float _lastPresetRefresh; private Vector2 _presetListScroll; private string _presetStatus; private ShlongController _cachedController; private float _lastControllerLookup; private ConfigEntry<bool> _secSliders; private ConfigEntry<bool> _secColor; private ConfigEntry<bool> _secActions; private ConfigEntry<bool> _secPresets; private ConfigEntry<bool> _secDebug; private ConfigEntry<bool> _secDevTools; private ConfigEntry<bool> _secModelPresets; private ConfigEntry<bool> _secBulgeTest; private ConfigEntry<bool> _secJiggleAdvanced; private ConfigEntry<float> _uiBodyOpacity; private GUIStyle _sectionHeaderStyle; private GUIStyle _transparentWindowStyle; private const float HeaderHeight = 22f; private const int ModelPresetColumns = 4; private Texture2D _transparentTex; public static bool IsRebindActive { get; private set; } internal void InitSectionConfig(ConfigFile config) { _secModelPresets = config.Bind<bool>("UI.Sections", "ModelPresetsExpanded", true, "Whether the Shlong Model Presets section is expanded"); _secSliders = config.Bind<bool>("UI.Sections", "SlidersExpanded", true, "Whether the Sliders section is expanded"); _secColor = config.Bind<bool>("UI.Sections", "ColorExpanded", true, "Whether the Color Tint section is expanded"); _secActions = config.Bind<bool>("UI.Sections", "ActionsExpanded", true, "Whether the Actions & Keybinds section is expanded"); _secPresets = config.Bind<bool>("UI.Sections", "PresetsExpanded", true, "Whether the User Presets section is expanded"); _secDebug = config.Bind<bool>("UI.Sections", "DebugExpanded", false, "Whether the Debug section is expanded"); _secDevTools = config.Bind<bool>("UI.Sections", "DevToolsExpanded", false, "Whether the Developer Tools sub-section is expanded"); _secBulgeTest = config.Bind<bool>("UI.Sections", "BulgeTestExpanded", false, "Whether the Bulge Test Lab section is expanded"); _secJiggleAdvanced = config.Bind<bool>("UI.Sections", "JiggleAdvancedExpanded", false, "Whether the Advanced Remote Jiggle sliders are expanded"); _uiBodyOpacity = config.Bind<float>("UI", "BodyBackgroundOpacity", 0.85f, "Opacity of the window body background. Does not affect the header."); } public void Update() { if (InputManager.IsToggleGuiPressed()) { _showGui = !_showGui; } } public void OnGUI() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Invalid comparison between Unknown and I4 //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Expected O, but got Unknown //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) CursorLockMode lockState = Cursor.lockState; _cursorStateChanged = lockState != _prevCursorLockState; _prevCursorLockState = lockState; if (!_showGui && _pendingShortcut == null) { IsHovered = false; return; } HandleShortcutCapture(Event.current); if (!_showGui) { IsHovered = false; return; } if (((Rect)(ref _windowRect)).width < 250f || ((Rect)(ref _windowRect)).height < 200f || float.IsNaN(((Rect)(ref _windowRect)).x) || float.IsNaN(((Rect)(ref _windowRect)).y) || float.IsNaN(((Rect)(ref _windowRect)).width) || float.IsNaN(((Rect)(ref _windowRect)).height) || ((Rect)(ref _windowRect)).x > (float)Screen.width - 40f || ((Rect)(ref _windowRect)).y > (float)Screen.height - 40f || ((Rect)(ref _windowRect)).x < 0f - ((Rect)(ref _windowRect)).width + 40f || ((Rect)(ref _windowRect)).y < -20f) { _windowRect = new Rect(20f, 20f, 460f, 700f); Plugin.LogWarningLimited("plugin.gui.window_rect_reset", "[GUI] Window rect was invalid/offscreen; reset to default.", 5); } try { _windowRect = GUILayout.Window(947561, _windowRect, new WindowFunction(DrawWindow), "", GetManualChromeWindowStyle(), Array.Empty<GUILayoutOption>()); } catch (Exception ex) { Plugin.LogWarningLimited("plugin.gui.draw_exception", "[GUI] SettingsWindow draw failed: " + ex.GetType().Name + ": " + ex.Message, 3); } IsHovered = (int)Cursor.lockState != 1 && ((Rect)(ref _windowRect)).Contains(Event.current.mousePosition); if (IsHovered) { Input.ResetInputAxes(); } } private void DrawWindow(int windowId) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) DrawWindowBackground(); DrawHeaderControlsLayout(); _windowScroll = GUILayout.BeginScrollView(_windowScroll, false, false, Array.Empty<GUILayoutOption>()); ShlongController activeController = GetActiveController(); if (HasUsableUpdatedModels()) { if (DrawSection("Shlong Model Presets", _secModelPresets)) { DrawModelPresetSection(activeController); } GUILayout.Space(4f); } else { ForceOriginalModelCategory(activeController); } if ((Object)(object)activeController != (Object)null) { if (DrawSection("Sliders", _secSliders)) { DrawSliders(activeController); } GUILayout.Space(4f); if (DrawSection("Color Tint", _secColor)) { DrawColorSliders(activeController); } GUILayout.Space(4f); } else { GUILayout.Label("No active ShlongController found.", Array.Empty<GUILayoutOption>()); GUILayout.Space(8f); } if (DrawSection("Actions & Keybinds", _secActions)) { DrawActionButtons(activeController); } GUILayout.Space(4f); if (DrawSection("User Presets", _secPresets)) { DrawUserPresets(activeController); } GUILayout.Space(4f); if (DrawSection("Debug", _secDebug)) { DrawDebugControls(activeController); } GUILayout.Space(20f); GUILayout.EndScrollView(); GUI.DragWindow(new Rect(0f, 0f, Mathf.Max(1f, ((Rect)(ref _windowRect)).width - 24f), 22f)); } private static bool HasUsableUpdatedModels() { return Plugin.Presets != null && Plugin.Presets.HasUsableTestPresets(); } private void ForceOriginalModelCategory(ShlongController sc) { _selectedModelCategory = ShlongModelCategory.Original; if (!((Object)(object)sc == (Object)null) && Plugin.Presets != null) { int num = Plugin.Presets.ResolvePresetForLocalAssets(sc.PresetIndex); if (num >= 0 && num != sc.PresetIndex) { sc.QueueInteractivePresetChange(num); } } } private void DrawModelPresetSection(ShlongController sc) { DrawModelCategoryTabsOnly(); if ((Object)(object)sc == (Object)null) { GUILayout.Label("No active ShlongController found.", Array.Empty<GUILayoutOption>()); } else { DrawModelPresetGrid(sc); } } private void DrawModelCategoryTabsOnly() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) bool flag = HasUsableUpdatedModels(); Color backgroundColor = GUI.backgroundColor; GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUI.backgroundColor = (Color)((_selectedModelCategory == ShlongModelCategory.Original) ? new Color(0.35f, 0.55f, 1f) : Color.white); if (GUILayout.Button("Original", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _selectedModelCategory = ShlongModelCategory.Original; } GUI.backgroundColor = (Color)((_selectedModelCategory == ShlongModelCategory.Updated) ? new Color(0.35f, 0.75f, 0.45f) : Color.white); bool enabled = GUI.enabled; GUI.enabled = flag; if (GUILayout.Button("Updated", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _selectedModelCategory = ShlongModelCategory.Updated; } GUI.enabled = enabled; GUI.backgroundColor = backgroundColor; GUILayout.EndHorizontal(); if (!flag && _selectedModelCategory == ShlongModelCategory.Updated) { _selectedModelCategory = ShlongModelCategory.Original; } if (!flag) { GUILayout.Label("Updated models require ShlongsPackage_test.unity3d next to the plugin DLL.", Array.Empty<GUILayoutOption>()); } } private void DrawModelPresetGrid(ShlongController sc) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Presets == null) { return; } PresetData[] all = Plugin.Presets.GetAllPresets(); bool flag = _selectedModelCategory == ShlongModelCategory.Updated; int presetIndex = sc.PresetIndex; List<int> list = new List<int>(); for (int i = 0; i < all.Length; i++) { PresetData presetData = all[i]; if (presetData != null) { bool flag2 = presetData.AssetSource == PresetAssetSource.Test; if (flag == flag2 && (!flag2 || Plugin.Presets.IsTestPresetUsableLocally(i))) { list.Add(i); } } } list.Sort(delegate(int a, int b) { PresetData presetData3 = all[a]; PresetData presetData4 = all[b]; string strA = ((presetData3 != null) ? (presetData3.FriendlyName ?? presetData3.DisplayName ?? presetData3.Id ?? "") : ""); string strB = ((presetData4 != null) ? (presetData4.FriendlyName ?? presetData4.DisplayName ?? presetData4.Id ?? "") : ""); int num3 = string.Compare(strA, strB, StringComparison.OrdinalIgnoreCase); return (num3 != 0) ? num3 : a.CompareTo(b); }); if (list.Count == 0) { GUILayout.Label(flag ? "Updated models are unavailable because ShlongsPackage_test.unity3d was not found." : "No original model presets found.", Array.Empty<GUILayoutOption>()); return; } GUILayout.Label(flag ? "Updated model presets:" : "Original model presets:", Array.Empty<GUILayoutOption>()); Color backgroundColor = GUI.backgroundColor; bool enabled = GUI.enabled; for (int j = 0; j < list.Count; j += 4) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); for (int k = 0; k < 4; k++) { int num = j + k; if (num >= list.Count) { GUILayout.Label("", (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(24f) }); continue; } int num2 = list[num]; PresetData presetData2 = all[num2]; bool flag3 = num2 == presetIndex; bool flag4 = (Object)(object)presetData2.LoadedPrefab != (Object)null; GUI.backgroundColor = (Color)(flag3 ? new Color(0.4f, 0.85f, 0.5f) : (flag4 ? Color.white : new Color(0.45f, 0.45f, 0.45f))); GUI.enabled = flag4 && !flag3; string text = presetData2.FriendlyName + (flag4 ? "" : " (unavail)"); if (GUILayout.Button(text, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Height(24f), GUILayout.ExpandWidth(true) })) { sc.QueueInteractivePresetChange(num2); } } GUILayout.EndHorizontal(); } GUI.backgroundColor = backgroundColor; GUI.enabled = enabled; GUILayout.Label("Each model keeps its own saved size, position, color, and Match Body settings.", Array.Empty<GUILayoutOption>()); } private Texture2D GetTransparentTexture() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_transparentTex == (Object)null) { _transparentTex = new Texture2D(1, 1, (TextureFormat)4, false); _transparentTex.SetPixel(0, 0, new Color(0f, 0f, 0f, 0f)); _transparentTex.Apply(); ((Object)_transparentTex).hideFlags = (HideFlags)61; } return _transparentTex; } private GUIStyle GetManualChromeWindowStyle() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown if (_transparentWindowStyle == null) { _transparentWindowStyle = new GUIStyle(GUI.skin.window); Texture2D transparentTexture = GetTransparentTexture(); _transparentWindowStyle.normal.background = transparentTexture; _transparentWindowStyle.onNormal.background = transparentTexture; _transparentWindowStyle.hover.background = transparentTexture; _transparentWindowStyle.active.background = transparentTexture; _transparentWindowStyle.focused.background = transparentTexture; _transparentWindowStyle.border = new RectOffset(0, 0, 0, 0); _transparentWindowStyle.padding = new RectOffset(0, 0, 0, 0); _transparentWindowStyle.margin = GUI.skin.window.margin; } return _transparentWindowStyle; } private void DrawWindowBackground() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) float num = ((_uiBodyOpacity != null) ? Mathf.Clamp01(_uiBodyOpacity.Value) : 0.85f); Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, ((Rect)(ref _windowRect)).width, 22f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(0f, 22f, ((Rect)(ref _windowRect)).width, Mathf.Max(0f, ((Rect)(ref _windowRect)).height - 22f)); Color color = GUI.color; GUI.color = new Color(0.08f, 0.08f, 0.08f, 1f); GUI.DrawTexture(val, (Texture)(object)Texture2D.whiteTexture); GUI.color = new Color(0.04f, 0.04f, 0.04f, num); GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture); GUI.color = color; } private void DrawHeaderControlsLayout() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }); Color color = GUI.color; GUI.color = Color.white; GUILayout.Label("AtlyssShlongs v3.0.2", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) }); GUILayout.FlexibleSpace(); GUILayout.Label("BG", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(22f) }); float num = ((_uiBodyOpacity != null) ? Mathf.Clamp01(_uiBodyOpacity.Value) : 0.85f); float num2 = GUILayout.HorizontalSlider(num, 0f, 1f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) }); if (_uiBodyOpacity != null && Mathf.Abs(num2 - num) > 0.001f) { _uiBodyOpacity.Value = Mathf.Clamp01(num2); } if (GUILayout.Button("X", (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(24f), GUILayout.Height(18f) })) { _showGui = false; } GUI.color = color; GUILayout.EndHorizontal(); } private bool DrawSection(string title, ConfigEntry<bool> state) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (_sectionHeaderStyle == null) { _sectionHeaderStyle = new GUIStyle(GUI.skin.box); _sectionHeaderStyle.alignment = (TextAnchor)3; _sectionHeaderStyle.fontStyle = (FontStyle)1; _sectionHeaderStyle.normal.textColor = Color.white; } bool flag = state?.Value ?? false; string text = (flag ? "▼ " : "▶ "); if (GUILayout.Button(text + title, _sectionHeaderStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }) && state != null) { state.Value = !state.Value; } return flag; } private void DrawSliders(ShlongController sc) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) PresetData preset = Plugin.Presets.GetPreset(sc.PresetIndex); Vector3 val = preset?.Rotation ?? Vector3.zero; Vector3 defPos = preset?.Position ?? Vector3.zero; if (GUILayout.Button("Reset All to Preset Default", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) })) { sc.ArousalTarget = 0f; sc.ScaleOffset = Vector3.zero; sc.BallsSizeOffset = 0f; sc.ErectAngleOffset = 0f; sc.PositionOffset = new Vector2(defPos.z, defPos.y); sc.BaseRotation = new Vector3(Mathf.Repeat(val.x, 360f), Mathf.Repeat(val.y, 360f), Mathf.Repeat(val.z, 360f)); sc.RefreshTransform(); sc.RequestSyncImmediate(forceSave: true, SyncField.Position | SyncField.Scale | SyncField.BallsSize | SyncField.Arousal | SyncField.Rotation | SyncField.ErectAngle); } DrawResetRow("Arousal: " + Mathf.RoundToInt(sc.ArousalTarget), delegate { sc.ArousalTarget = 0f; sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num = GUILayout.HorizontalSlider(sc.ArousalTarget, 0f, 100f, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); DrawResetRow("Length (Y): " + sc.ScaleOffset.y.ToString("0.000", Cult), delegate { sc.ScaleOffset.y = 0f; sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num2 = GUILayout.HorizontalSlider(sc.ScaleOffset.y, -1f, 10f, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); float x = sc.ScaleOffset.x; DrawResetRow("Girth (XZ): " + x.ToString("0.000", Cult), delegate { sc.ScaleOffset.x = 0f; sc.ScaleOffset.z = 0f; sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num3 = GUILayout.HorizontalSlider(x, -1f, 10f, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); DrawResetRow("Balls Size: " + sc.BallsSizeOffset.ToString("0.000", Cult), delegate { sc.BallsSizeOffset = 0f; sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num4 = GUILayout.HorizontalSlider(sc.BallsSizeOffset, -1f, 10f, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); string text = ((sc.ErectAngleOffset > 0.5f) ? " (down)" : ((sc.ErectAngleOffset < -0.5f) ? " (up)" : "")); DrawResetRow("Erect Direction: " + sc.ErectAngleOffset.ToString("0.0", Cult) + text, delegate { sc.ErectAngleOffset = 0f; sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num5 = GUILayout.HorizontalSlider(sc.ErectAngleOffset, -90f, 90f, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); DrawResetRow("Offset X: " + sc.PositionOffset.x.ToString("0.00000", Cult), delegate { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) sc.PositionOffset = new Vector2(defPos.z, sc.PositionOffset.y); sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num6 = GUILayout.HorizontalSlider(sc.PositionOffset.x, -0.05f, 0.05f, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); DrawResetRow("Offset Y: " + sc.PositionOffset.y.ToString("0.00000", Cult), delegate { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) sc.PositionOffset = new Vector2(sc.PositionOffset.x, defPos.y); sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num7 = GUILayout.HorizontalSlider(sc.PositionOffset.y, -0.05f, 0.05f, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); Vector3 rot = new Vector3(Mathf.Repeat(sc.BaseRotation.x, 360f), Mathf.Repeat(sc.BaseRotation.y, 360f), Mathf.Repeat(sc.BaseRotation.z, 360f)); Vector3 defRotW = new Vector3(Mathf.Repeat(val.x, 360f), Mathf.Repeat(val.y, 360f), Mathf.Repeat(val.z, 360f)); DrawResetRow("Angle X: " + rot.x.ToString("0.0", Cult), delegate { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) sc.BaseRotation = new Vector3(defRotW.x, rot.y, rot.z); sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num8 = GUILayout.HorizontalSlider(rot.x, 0f, 360f, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); DrawResetRow("Angle Y: " + rot.y.ToString("0.0", Cult), delegate { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) sc.BaseRotation = new Vector3(rot.x, defRotW.y, rot.z); sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num9 = GUILayout.HorizontalSlider(rot.y, 0f, 360f, Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); DrawResetRow("Angle Z: " + rot.z.ToString("0.0", Cult), delegate { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) sc.BaseRotation = new Vector3(rot.x, rot.y, defRotW.z); sc.RefreshTransform(); sc.RequestSyncImmediate(); }); float num10 = GUILayout.HorizontalSlider(rot.z, 0f, 360f, Array.Empty<GUILayoutOption>()); bool flag = !_cursorStateChanged && (Mathf.Abs(num - sc.ArousalTarget) > 0.001f || Mathf.Abs(num2 - sc.ScaleOffset.y) > 0.0001f || Mathf.Abs(num3 - x) > 0.0001f || Mathf.Abs(num4 - sc.BallsSizeOffset) > 0.0001f || Mathf.Abs(num5 - sc.ErectAngleOffset) > 0.01f || Mathf.Abs(num6 - sc.PositionOffset.x) > 1E-05f || Mathf.Abs(num7 - sc.PositionOffset.y) > 1E-05f || Mathf.Abs(num8 - rot.x) > 0.01f || Mathf.Abs(num9 - rot.y) > 0.01f || Mathf.Abs(num10 - rot.z) > 0.01f); bool flag2 = GUIUtility.hotControl != 0; if (flag) { sc.ArousalTarget = num; sc.ScaleOffset = new Vector3(num3, num2, num3); sc.BallsSizeOffset = num4; sc.ErectAngleOffset = num5; sc.PositionOffset = new Vector2(num6, num7); sc.BaseRotation = new Vector3(num8, num9, num10); sc.RefreshTransform(); } else if (_sliderWasActive && !flag2) { sc.RequestSyncImmediate(); } _sliderWasActive = flag2; } private static bool SupportsSeparateBallsSheathColor(ShlongController sc) { if ((Object)(object)sc == (Object)null) { return false; } if (Plugin.Presets != null) { PresetData preset = Plugin.Presets.GetPreset(sc.PresetIndex); if (preset != null && preset.AssetSource == PresetAssetSource.Test) { return true; } } if (sc.HasBallsSheathSlots) { return true; } return sc.BallMeshes != null && sc.BallMeshes.Length != 0; } internal static void DrawCharacterHbcToggle(ShlongController sc) { if (PluginConfig.ApplyCharacterHbcToMatchedShlongs == null) { return; } bool value = PluginConfig.ApplyCharacterHbcToMatchedShlongs.Value; bool flag = GUILayout.Toggle(value, " Apply Character Hue/Brightness/Contrast", Array.Empty<GUILayoutOption>()); if (flag != value) { PluginConfig.ApplyCharacterHbcToMatchedShlongs.Value = flag; if ((Object)(object)sc != (Object)null) { sc.ForceColorAdjustmentMaterialRefresh("ApplyCharacterHBC=" + flag); } CosmeticDisplayManager.RecreateAllDisplayRigsForConfigChange("ApplyCharacterHBC=" + flag); if (Plugin.IsDebug) { Plugin.LogDebug("[ColorHBC] ApplyCharacterHBC=" + flag + " frame=" + Time.frameCount); } } } private void DrawColorSliders(ShlongController sc) { //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) if (OnDrawColorUI != null) { OnDrawColorUI(sc); return; } bool flag = SupportsSeparateBallsSheathColor(sc); GUILayout.Label("Shlong / Shaft Color", GUI.skin.box, Array.Empty<GUILayoutOption>()); DrawCharacterHbcToggle(sc); float r = sc.ColorTint.r; float g = sc.ColorTint.g; float b = sc.ColorTint.b; GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("R: " + (r - 1f).ToString("+0.00;-0.00", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num = GUILayout.HorizontalSlider(r, 0f, 2f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("G: " + (g - 1f).ToString("+0.00;-0.00", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num2 = GUILayout.HorizontalSlider(g, 0f, 2f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("B: " + (b - 1f).ToString("+0.00;-0.00", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num3 = GUILayout.HorizontalSlider(b, 0f, 2f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); Color white; if (GUILayout.Button("Match Body (Reset)", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) })) { sc.InvalidateColorMaterialCache(dick: true, balls: false); sc.ColorTint = Color.white; sc.MatchBody = true; sc.ApplyColorTint(); CosmeticDisplayManager.ForceRefreshColorsFor(sc, dick: true, balls: false); if (Plugin.IsDebug) { white = Color.white; Plugin.LogDebug("[ColorReset] group=shaft color=" + ((object)(Color)(ref white)).ToString() + " matchBody=true forceFields=Color"); } sc.RequestSyncImmediate(forceSave: true, SyncField.Color); } bool flag2 = Mathf.Abs(num - r) > 0.001f || Mathf.Abs(num2 - g) > 0.001f || Mathf.Abs(num3 - b) > 0.001f; bool flag3 = GUIUtility.hotControl != 0; if (flag2) { sc.ColorTint = new Color(num, num2, num3); sc.ApplyColorTint(); } else if (_shaftColorSliderWasActive && !flag3) { sc.RequestSyncImmediate(forceSave: true, SyncField.Color); } _shaftColorSliderWasActive = flag3; GUILayout.Space(6f); GUILayout.Label("Balls & Sheath Color", GUI.skin.box, Array.Empty<GUILayoutOption>()); if (!flag) { GUI.enabled = false; GUILayout.Label(" (This preset has no separate Balls & Sheath material group.)", Array.Empty<GUILayoutOption>()); GUI.enabled = true; return; } float r2 = sc.BallColorTint.r; float g2 = sc.BallColorTint.g; float b2 = sc.BallColorTint.b; GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("R: " + (r2 - 1f).ToString("+0.00;-0.00", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num4 = GUILayout.HorizontalSlider(r2, 0f, 2f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("G: " + (g2 - 1f).ToString("+0.00;-0.00", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num5 = GUILayout.HorizontalSlider(g2, 0f, 2f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label("B: " + (b2 - 1f).ToString("+0.00;-0.00", Cult), (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); float num6 = GUILayout.HorizontalSlider(b2, 0f, 2f, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); if (GUILayout.Button("Match Body (Reset)", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) })) { sc.InvalidateColorMaterialCache(dick: false, balls: true); sc.BallColorTint = Color.white; sc.BallMatchBody = true; sc.ApplyBallColorTint(); CosmeticDisplayManager.ForceRefreshColorsFor(sc, dick: false, balls: true); if (Plugin.IsDebug) { white = Color.white; Plugin.LogDebug("[ColorReset] group=balls color=" + ((object)(Color)(ref white)).ToString() + " matchBody=true forceFields=BallColor"); } sc.RequestSyncImmediate(forceSave: true, SyncField.BallColor); } bool flag4 = Mathf.Abs(num4 - r2) > 0.001f || Mathf.Abs(num5 - g2) > 0.001f || Mathf.Abs(num6 - b2) > 0.001f; bool flag5 = GUIUtility.hotControl != 0; if (flag4) { sc.BallColorTint = new Color(num4, num5, num6); sc.ApplyBallColorTint(); } else if (_ballColorSliderWasActive && !flag5) { sc.RequestSyncImmediate(forceSave: true, SyncField.BallColor); } _ballColorSliderWasActive = flag5; } private void DrawActionButtons(ShlongController sc) { //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) if (PluginConfig.HotkeysEnabled != null) { bool flag = GUILayout.Toggle(PluginConfig.HotkeysEnabled.Value, "Enable Hotkeys", Array.Empty<GUILayoutOption>()); if (flag != PluginConfig.HotkeysEnabled.Value) { PluginConfig.HotkeysEnabled.Value = flag; } GUILayout.Space(4f); } GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); if (GUILayout.Button("Reset All Keybinds", (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(140f), GUILayout.Height(22f) })) { ResetAllShortcutsToDefault(); } GUILayout.EndHorizontal(); GUILayout.Space(4f); if ((Object)(object)sc != (Object)null) { PresetData preset = Plugin.Presets.GetPreset(sc.PresetIndex); string text = ((preset != null && preset.AssetSource == PresetAssetSource.Test) ? "Updated" : "Original"); GUILayout.Label("Active: [" + text + "] " + ((preset != null) ? preset.FriendlyName : sc.PresetIndex.ToString()), Array.Empty<GUILayoutOption>()); GUILayout.Space(2f); GUILayout.Label("<size=10><color=#aaaaaa>Prev/Next cycles through all model categories.</color></size>", Array.Empty<GUILayoutOption>()); DrawBindRow("Prev Dick", InputManager.GetPrevDick()); DrawBindRow("Next Dick", InputManager.GetNextDick()); GUILayout.Space(4f); DrawToggleActionRow("Hide Shlong", sc.HideToggle, InputManager.GetToggleHide(), delegate { sc.HideToggle = !sc.HideToggle; sc.RequestSyncImmediate(); }); DrawToggleActionRow("Futa Toggle", sc.FutaToggle, InputManager.GetToggleFuta(), delegate { sc.FutaToggle = !sc.FutaToggle; sc.RequestSyncImmediate(); }); DrawToggleActionRow("Clothing Override", sc.ClothingOverride, InputManager.GetToggleClothing(), delegate { sc.ClothingOverride = !sc.ClothingOverride; sc.RequestSyncImmediate(); }); DrawButtonActionRow("Arousal ◆ " + Mathf.RoundToInt(sc.ArousalTarget) + " → Cycle", InputManager.GetCycleArousal(), delegate { sc.CycleArousal(); }); DrawButtonActionRow("Toggle Arousal 0/100", InputManager.GetToggleArousal(), delegate { sc.ArousalTarget = ((sc.ArousalTarget == 0f) ? 100f : 0f); sc.RequestSyncImmediate(); }); GUILayout.Space(4f); DrawButtonActionRow("Dick Size +", InputManager.GetIncreaseDick(), delegate { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) float num4 = 0.06f + Mathf.Max(Mathf.Max(sc.ScaleOffset.x, sc.ScaleOffset.y), 0f) * 0.1f; float num5 = Mathf.Clamp(sc.ScaleOffset.x + num4, -1f, 10f); float num6 = Mathf.Clamp(sc.ScaleOffset.y + num4, -1f, 10f); sc.ScaleOffset = new Vector3(num5, num6, num5); sc.RefreshTransform(); sc.RequestSyncImmediate(); }); DrawButtonActionRow("Dick Size -", InputManager.GetDecreaseDick(), delegate { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) float num = 0.06f + Mathf.Max(Mathf.Max(sc.ScaleOffset.x, sc.ScaleOffset.y),