using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using HarmonyLib; using MenuLib; using MenuLib.MonoBehaviors; using MenuLib.Structs; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour; using Photon.Pun; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("Zichen-REPOSettings-1.0.1")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+d762a9c70329ce4b425fe1bbc7d98036ebaf2167")] [assembly: AssemblyProduct("Zichen-REPOSettings-1.0.1")] [assembly: AssemblyTitle("Zichen-REPOSettings-1.0.1")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace REPOSettings { [BepInPlugin("zichen.reposettings", "REPOSettings", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public sealed class Plugin : BaseUnityPlugin { private sealed class CompatibilityReport { private readonly List _disabledFeatures = new List(); private readonly List _details = new List(); public bool HasIssues => _disabledFeatures.Count > 0; public static CompatibilityReport CreateHealthy() { return new CompatibilityReport(); } public static CompatibilityReport Build() { CompatibilityReport compatibilityReport = new CompatibilityReport(); RequireType(typeof(MenuPageMain), "主菜单入口", compatibilityReport, "主菜单入口"); RequireType(typeof(MenuPageEsc), "ESC 菜单入口", compatibilityReport, "ESC 菜单入口"); RequireType(typeof(MenuManager), "菜单管理器", compatibilityReport, "菜单页开关与弹窗"); RequireType(typeof(MenuPage), "菜单页面", compatibilityReport, "菜单页开关与弹窗"); RequireType(typeof(MenuButton), "菜单按钮", compatibilityReport, "菜单按钮行为"); RequireType(typeof(MapToolController), "地图工具", compatibilityReport, "地图开合动画"); RequireType(typeof(SemiUI), "半屏 UI", compatibilityReport, "准备界面与提示 UI"); RequireType(typeof(WorldSpaceUIParent), "世界空间 UI", compatibilityReport, "世界空间 UI 动画"); RequireField(typeof(GameManager), "connectRandom", compatibilityReport, "公开房/私人房确认跳过"); RequireField(typeof(MenuManager), "currentMenuPageIndex", compatibilityReport, "大厅与联机提示识别"); RequireField(typeof(MenuManager), "currentMenuPage", compatibilityReport, "菜单关闭动画"); RequireField(typeof(MenuPage), "originalPosition", compatibilityReport, "菜单打开动画"); RequireField(typeof(MenuPage), "popUpAnimation", compatibilityReport, "菜单开关动画"); RequireField(typeof(MenuPage), "rectTransform", compatibilityReport, "菜单开关动画"); RequireField(typeof(MenuElementServer), "introDone", compatibilityReport, "房间列表入场动画"); RequireField(typeof(MenuElementRegion), "introLerp", compatibilityReport, "地区列表入场动画"); RequireMethod(typeof(MenuManager), "PagePopUpTwoOptions", new Type[11] { typeof(MenuButtonPopUp), typeof(string), typeof(LocalizedAsset), typeof(Color), typeof(string), typeof(LocalizedAsset), typeof(string), typeof(LocalizedAsset), typeof(string), typeof(LocalizedAsset), typeof(bool) }, compatibilityReport, "公开房/私人房确认跳过"); RequireMethod(typeof(MenuPageMain), "Start", Type.EmptyTypes, compatibilityReport, "主菜单入口"); RequireMethod(typeof(MenuPageEsc), "Start", Type.EmptyTypes, compatibilityReport, "ESC 菜单入口"); RequireMethod(typeof(MenuPage), "StateOpening", Type.EmptyTypes, compatibilityReport, "菜单打开动画"); RequireMethod(typeof(MenuPage), "StateClosing", Type.EmptyTypes, compatibilityReport, "菜单关闭动画"); RequireMethod(typeof(MenuButton), "OnHovering", Type.EmptyTypes, compatibilityReport, "菜单按钮位移动画"); RequireMethod(typeof(MapToolController), "Update", Type.EmptyTypes, compatibilityReport, "地图开合动画"); DetectLoadedCompanions(compatibilityReport); return compatibilityReport; } public void AddPatchFailure(string featureName, string patchName, string reason) { AddDisabledFeature(featureName); _details.Add("Patch failed: " + patchName + " -> " + reason); } public string BuildLogMessage() { if (!HasIssues) { return "Compatibility self-check passed."; } string text = ((_disabledFeatures.Count == 0) ? "暂无明确功能降级" : string.Join(";", _disabledFeatures.Distinct().ToArray())); return "Compatibility self-check found possible game API changes. Affected features: " + text; } public string BuildPopupMessage(bool english) { if (!HasIssues) { return null; } if (english) { string text = "REPOSettings detected possible game API changes and entered compatibility mode.\nPotentially affected features:"; foreach (string item in _disabledFeatures.Distinct().Take(6)) { text = text + "\n- " + item; } if (_disabledFeatures.Count == 0) { text += "\n- Some menu or effect features may be limited"; } return text + "\n\nPlease wait for an updated version if something does not work as expected."; } string text2 = "检测到游戏接口可能已变化,REPOSettings 已进入兼容模式。\n以下功能可能受影响:"; foreach (string item2 in _disabledFeatures.Distinct().Take(6)) { text2 = text2 + "\n- " + item2; } if (_disabledFeatures.Count == 0) { text2 += "\n- 部分菜单或特效功能可能受限"; } return text2 + "\n\n如遇异常,请等待新版本适配。"; } public IEnumerable GetDetailMessages() { return _details.Distinct().ToArray(); } private static void RequireType(Type type, string apiName, CompatibilityReport report, string affectedFeature) { if (!(type != null)) { report.AddDisabledFeature(affectedFeature); report._details.Add("Missing type: " + apiName); } } private static void RequireField(Type type, string fieldName, CompatibilityReport report, string affectedFeature) { if (!(AccessTools.Field(type, fieldName) != null)) { report.AddDisabledFeature(affectedFeature); report._details.Add("Missing field: " + type.FullName + "." + fieldName); } } private static void RequireMethod(Type type, string methodName, Type[] parameterTypes, CompatibilityReport report, string affectedFeature) { if (!(type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, parameterTypes ?? Type.EmptyTypes, null) != null)) { report.AddDisabledFeature(affectedFeature); string text = ((parameterTypes == null || parameterTypes.Length == 0) ? "()" : ("(" + string.Join(", ", parameterTypes.Select((Type parameterType) => parameterType.Name).ToArray()) + ")")); report._details.Add("Missing method: " + type.FullName + "." + methodName + text); } } private static void DetectLoadedCompanions(CompatibilityReport report) { try { if (Chainloader.PluginInfos.ContainsKey("nickklmao.repoconfig")) { report._details.Add("Detected REPOConfig: menu entry will coexist with Mods."); } if (Chainloader.PluginInfos.ContainsKey("zichen.moreui")) { report._details.Add("Detected MoreUI: some local UI/effect toggles may overlap."); } } catch (Exception ex) { report._details.Add("Failed to scan loaded plugins: " + ex.Message); } } private void AddDisabledFeature(string feature) { if (!_disabledFeatures.Contains(feature)) { _disabledFeatures.Add(feature); } } } [HarmonyPatch(typeof(MenuManager), "Start")] private static class MenuManagerStartPatch { private static bool _done; private static void Postfix() { if (!_done) { _done = true; TryShowCompatibilityPopup(); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static BuilderDelegate <>9__18_0; public static Func <>9__21_0; public static Func <>9__22_0; public static Func <>9__22_1; public static ShouldCloseMenuDelegate <>9__26_0; public static ScrollViewBuilderDelegate <>9__26_1; public static Func, bool> <>9__26_2; public static Func, string> <>9__32_0; public static Func, string> <>9__32_3; public static Func, ConfigEntryBase> <>9__33_0; public static Func, bool> <>9__33_1; public static Func, bool> <>9__33_2; public static Func <>9__49_0; public static Converter <>9__225_0; internal void b__18_0(Transform parent) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) REPOButton button = MenuAPI.CreateREPOButton(GetLocalizedText("更多设置", "More Settings"), (Action)OpenQuickSettingsPage, parent, new Vector2(0f, 0f)); ((MonoBehaviour)_instance).StartCoroutine(AdjustEscapeButtonPosition(parent, button)); } internal bool b__21_0(Transform child) { if (!((Object)child).name.Contains("Menu Button")) { return false; } TextMeshProUGUI componentInChildren = ((Component)child).GetComponentInChildren(true); return string.Equals((componentInChildren == null) ? null : ((TMP_Text)componentInChildren).text?.Trim(), "设置", StringComparison.Ordinal); } internal bool b__22_0(Transform transform) { return ((Object)transform).name.Contains("Menu Button"); } internal float b__22_1(Transform transform) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return transform.localPosition.y; } internal bool b__26_0() { return true; } internal RectTransform b__26_1(Transform scrollView) { //IL_0014: 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) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 18f); return ((REPOElement)MenuAPI.CreateREPOSpacer(scrollView, default(Vector2), val)).rectTransform; } internal bool b__26_2(ConfigEntry entry) { if (((ConfigEntryBase)entry).Definition.Section == "版本信息") { return ((ConfigEntryBase)entry).Definition.Key == "语言/Language"; } return false; } internal string b__32_0(ConfigEntry entry) { return ((ConfigEntryBase)entry).Definition.Section; } internal string b__32_3(ConfigEntry entry) { return ((ConfigEntryBase)entry).Definition.Section; } internal ConfigEntryBase b__33_0(KeyValuePair configEntry) { return configEntry.Value; } internal bool b__33_1(ConfigEntry entry) { return ((ConfigEntryBase)entry).Definition.Section != "基础配置"; } internal bool b__33_2(ConfigEntry entry) { return ((ConfigEntryBase)entry).Definition.Section != "I.性能优化"; } internal bool b__49_0(Type type) { return type != null; } internal string b__225_0(Component component) { if (!((Object)(object)component == (Object)null)) { return ((object)component).GetType().Name; } return "null"; } } [CompilerGenerated] private sealed class d__21 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Transform parent; public REPOButton button; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: { <>1__state = -1; if ((Object)(object)parent == (Object)null || (Object)(object)button == (Object)null) { return false; } Transform val = ResolveButtonParent(parent); if ((Object)(object)val == (Object)null) { return false; } Transform val2 = ((IEnumerable)val).Cast().FirstOrDefault((Func)delegate(Transform child) { if (!((Object)child).name.Contains("Menu Button")) { return false; } TextMeshProUGUI componentInChildren = ((Component)child).GetComponentInChildren(true); return string.Equals((componentInChildren == null) ? null : ((TMP_Text)componentInChildren).text?.Trim(), "设置", StringComparison.Ordinal); }); if ((Object)(object)val2 == (Object)null) { Plugin instance = _instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)"REPOSettings: ESC settings button not found, keeping default position"); } return false; } Vector3 localPosition = val2.localPosition; ((Component)button).transform.localPosition = new Vector3(localPosition.x + 96f, localPosition.y, localPosition.z); Plugin instance2 = _instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogInfo((object)$"REPOSettings: adjusted escape button next to settings at pos={((Component)button).transform.localPosition}"); } 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(); } } [CompilerGenerated] private sealed class d__53 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public string compatibilityMessage; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__53(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = Time.unscaledTime + 15f; break; case 1: <>1__state = -1; break; } if (!_compatibilityPopupShown && Time.unscaledTime < 5__2) { MenuManager instance = MenuManager.instance; if ((Object)(object)instance != (Object)null && !IsPopupSlotBusy(instance)) { _compatibilityPopupShown = true; _compatibilityPopupWaiting = false; instance.PagePopUp(GetLocalizedText("兼容模式提示", "Compatibility Notice"), Color.yellow, compatibilityMessage, "OK", false); return false; } <>2__current = null; <>1__state = 1; return true; } _compatibilityPopupWaiting = false; 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(); } } public const string PluginGuid = "zichen.reposettings"; public const string PluginName = "REPOSettings"; public const string PluginVersion = "1.0.1"; private const string SettingsButtonText = "更多设置"; private const string SettingsButtonTextEnglish = "More Settings"; private const float MainMenuRowStepY = 30f; private static readonly Vector2 QuickSettingsBackButtonPosition = new Vector2(66f, 18f); private static readonly Vector2 QuickSettingsResetButtonPosition = new Vector2(138f, 265f); private const string VersionInfoSection = "版本信息"; private const string LanguageKey = "语言/Language"; private static readonly Dictionary SectionEnglishNames = new Dictionary { ["版本信息"] = "Version Info", ["A.启动与切场"] = "A.Startup & Transitions", ["B.大厅与联机"] = "B.Lobby & Online", ["C.屏幕与镜头效果"] = "C.Screen & Camera", ["D.武器与手臂表现"] = "D.Weapons & Arms", ["E.摔倒与动作表现"] = "E.Tumble & Motion", ["F.开枪表现"] = "F.Gunfire Effects", ["G.死亡与状态表现"] = "G.Death & Status", ["H.贵重物表现"] = "H.Valuable Effects", ["J.世界空间UI"] = "J.World Space UI", ["K.升级台演出"] = "K.Upgrade Stand", ["L.外观机演出"] = "L.Cosmetic Machine", ["M.结算演出"] = "M.Result Screen", ["N.UI与提示"] = "N.UI & Prompts" }; private static readonly Dictionary InfoEnglishNames = new Dictionary { ["模组名称"] = "Mod Name", ["模组版本号"] = "Mod Version", ["REPO交流QQ群"] = "QQ Group" }; private static readonly Dictionary KeyEnglishNames = new Dictionary { ["配置生效"] = "Enable Config", ["显示FPS数值"] = "Show FPS Counter", ["界面语言"] = "UI Language", ["关闭启动画面"] = "Disable Splash Screen", ["关闭开场手臂动画"] = "Disable Arm Intro", ["关闭加载与切场动画"] = "Disable Loading & Transition", ["关闭大厅页面切换动画"] = "Disable Lobby Page Animation", ["关闭按钮弹窗动画"] = "Disable Popup Animation", ["关闭房间列表入场动画"] = "Disable Server List Intro", ["关闭地区列表入场动画"] = "Disable Region List Intro", ["关闭菜单加载图标动画"] = "Disable Menu Loading Icon", ["关闭主菜单按钮位移动画"] = "Disable Main Menu Motion", ["关闭加入玩家提示淡入"] = "Disable Join Prompt Fade", ["关闭左侧准备界面淡入动画"] = "Disable Prep UI Fade", ["关闭结算页淡入淡出"] = "Disable Result Fade", ["关闭月相变化界面"] = "Disable Moon Phase UI", ["关闭主菜单卡车动画"] = "Disable Truck Menu Animation", ["跳过公开游戏加入确认"] = "Skip Public Join Confirm", ["跳过私人游戏默认确认"] = "Skip Private Host Confirm", ["跳过公开/私人游戏区服前提示"] = "Skip Region Entry Prompt", ["关闭屏幕噪点遮罩"] = "Disable Screen Overlay", ["关闭镜头噪声"] = "Disable Camera Noise", ["关闭第一人称镜头动画"] = "Disable Camera Motion", ["关闭镜头震动"] = "Disable Camera Shake", ["关闭屏幕故障闪屏"] = "Disable Camera Glitch", ["关闭影怪血管屏幕特效"] = "Disable Shadow Vein Effect", ["关闭临时后处理特效"] = "Disable Post Processing", ["关闭低血量红框"] = "Disable Hurt Vignette", ["关闭打开地图动画"] = "Disable Map Open Animation", ["关闭第一人称手臂动作"] = "Disable Arm Animation", ["关闭摔倒特效"] = "Disable Tumble Effects", ["关闭开枪扳机动画"] = "Disable Trigger Animation", ["关闭开枪震动"] = "Disable Gunfire Shake", ["关闭开枪后坐力"] = "Disable Recoil", ["关闭开枪枪口特效"] = "Disable Muzzle Effects", ["关闭开枪黑烟特效"] = "Disable Gun Smoke", ["关闭死亡与复活特效"] = "Disable Death & Revive Effects", ["关闭蜘蛛贴脸屏幕效果"] = "Disable Spider Screen Effect", ["关闭地图贵重物标记"] = "Disable Valuable Map Markers", ["关闭贵重物发现提示"] = "Disable Valuable Discover Prompt", ["关闭贵重物动态灯光与粒子"] = "Disable Valuable Effects", ["关闭世界空间UI动画"] = "Disable World Space UI Motion", ["关闭升级台镜头震动"] = "Disable Upgrade Stand Shake", ["关闭升级台粒子与灯光"] = "Disable Upgrade Stand Effects", ["关闭升级台滚动与舱门动画"] = "Disable Upgrade Stand Animations", ["关闭升级台损坏起火特效"] = "Disable Upgrade Stand Fire", ["关闭外观机抓取光束与粒子"] = "Disable Cosmetic Grab Beam", ["关闭外观机镜头震动"] = "Disable Cosmetic Machine Shake", ["关闭外观机转盘与屏幕动画"] = "Disable Cosmetic Screen Motion", ["关闭外观机循环灯光与音效"] = "Disable Cosmetic Loop Effects", ["关闭结算页抖动"] = "Disable Result Shake", ["关闭结算页代币粒子"] = "Disable Result Token Particles", ["快速跳过结算演出"] = "Quick Skip Result Screen", ["关闭电池UI弹跳与闪烁"] = "Disable Battery UI Motion", ["关闭手电开关动画"] = "Disable Flashlight Animation", ["关闭手电闪烁表现"] = "Disable Flashlight Flicker", ["关闭大厅聊天跳动动画"] = "Disable Lobby Chat Motion", ["关闭指引箭头"] = "Disable Guide Arrow", ["关闭大字提示"] = "Disable Big Messages", ["关闭载具速度粒子"] = "Disable Vehicle Speed Particles", ["关闭铀伤害屏幕特效"] = "Disable Uranium Effect", ["关闭翻滚翅膀UI"] = "Disable Tumble Wings UI", ["关闭教程提示"] = "Disable Tutorial Tips", ["关闭竞技场大字提示"] = "Disable Arena Messages", ["关闭竞技场警示灯"] = "Disable Arena Warning Lights", ["关闭竞速计时器动画"] = "Disable Race Timer Motion", ["关闭卡车屏幕加载条动画"] = "Disable Truck Loading Bar", ["关闭卡车聊天框动画"] = "Disable Truck Chat Motion", ["关闭电池条浮动特效"] = "Disable Battery Bar Effect", ["关闭价值屏幕跳字特效"] = "Disable Value Screen Effect", ["关闭教程UI动画"] = "Disable Tutorial UI Motion" }; private static Plugin _instance; private static REPOPopupPage _currentSettingsPage; private static REPOPopupPage _currentSectionPage; private static string _currentSectionName; private static Hook _mainMenuStartHook; private static CompatibilityReport _compatibilityReport = CompatibilityReport.CreateHealthy(); private static bool _compatibilityPopupShown; private static bool _compatibilityPopupWaiting; private static readonly FieldRef PagePopUpScheduledRef = AccessTools.FieldRefAccess("pagePopUpScheduled"); private static readonly FieldRef CurrentMenuPageIndexRef = AccessTools.FieldRefAccess("currentMenuPageIndex"); private const string ModuleDisplayName = "更多设置选项"; private static Harmony _harmony; private static ConfigEntry _cfgShowFpsCounter; private static ConfigEntry _cfgModEnabled; private static ConfigEntry _cfgUseEnglishUi; private static ConfigEntry _cfgDisableSplashScreen; private static ConfigEntry _cfgDisableArmIntroAnimation; private static ConfigEntry _cfgDisableLoadingAnimation; private static ConfigEntry _cfgDisableVideoOverlay; private static ConfigEntry _cfgDisableCameraNoise; private static ConfigEntry _cfgDisableCameraAnimation; private static ConfigEntry _cfgDisableCameraShake; private static ConfigEntry _cfgDisableCameraGlitch; private static ConfigEntry _cfgDisableEnemyShadowVeinScreenEffect; private static ConfigEntry _cfgDisablePostProcessingOverrides; private static ConfigEntry _cfgDisableHurtVignette; private static ConfigEntry _cfgDisableMapOpenAnimation; private static ConfigEntry _cfgDisableFirstPersonArmAnimations; private static ConfigEntry _cfgDisableGunTriggerAnimation; private static ConfigEntry _cfgDisableGunFireShake; private static ConfigEntry _cfgDisableGunRecoil; private static ConfigEntry _cfgDisableGunMuzzleEffects; private static ConfigEntry _cfgDisableGunSmokeEffects; private static ConfigEntry _cfgDisableDeathAndReviveEffects; private static ConfigEntry _cfgDisableSpiderScreenEffects; private static ConfigEntry _cfgDisableTumbleVisualEffects; private static ConfigEntry _cfgDisablePhysImpactVisualEffects; private static ConfigEntry _cfgThrottleValuableExtractionTracking; private static ConfigEntry _cfgThrottleEnemyInvestigate; private static ConfigEntry _cfgSkipPublicGameJoinConfirm; private static ConfigEntry _cfgSkipPrivateGameConfirm; private static ConfigEntry _cfgDisableLobbyPageAnimations; private static ConfigEntry _cfgDisablePopupAnimations; private static ConfigEntry _cfgDisableServerListEntryAnimations; private static ConfigEntry _cfgDisableRegionListEntryAnimations; private static ConfigEntry _cfgDisableMenuLoadingGraphicsAnimations; private static ConfigEntry _cfgDisableMenuButtonMotion; private static ConfigEntry _cfgEnableValuableMapMarkers; private static ConfigEntry _cfgEnableValuableDiscoverPrompts; private static ConfigEntry _cfgEnableValuableDynamicEffects; private static ConfigEntry _cfgDisableWorldSpaceUiAnimations; private static ConfigEntry _cfgDisableUpgradeStandCameraShake; private static ConfigEntry _cfgDisableUpgradeStandEffects; private static ConfigEntry _cfgDisableUpgradeStandAnimations; private static ConfigEntry _cfgDisableUpgradeStandBrokenFireEffects; private static ConfigEntry _cfgDisableCosmeticMachineGrabBeamEffects; private static ConfigEntry _cfgDisableCosmeticMachineCameraShake; private static ConfigEntry _cfgDisableCosmeticMachineScreenAnimations; private static ConfigEntry _cfgDisableCosmeticMachineLoopEffects; private static ConfigEntry _cfgDisableResultScreenFade; private static ConfigEntry _cfgDisableResultScreenShake; private static ConfigEntry _cfgDisableResultScreenTokenParticles; private static ConfigEntry _cfgQuickSkipResultScreen; private static ConfigEntry _cfgDisableBatteryUiAnimations; private static ConfigEntry _cfgDisableFlashlightAnimations; private static ConfigEntry _cfgDisableFlashlightFlicker; private static ConfigEntry _cfgDisableLobbyChatAnimations; private static ConfigEntry _cfgDisableLobbyJoiningPromptFade; private static ConfigEntry _cfgDisableLeftPrepUiFade; private static ConfigEntry _cfgSkipRegionEntryPrompt; private static ConfigEntry _cfgDisableMoonPhaseUi; private static ConfigEntry _cfgDisableMainMenuTruckAnimation; private static ConfigEntry _cfgDisableGuideArrowUi; private static ConfigEntry _cfgDisableBigMessageUi; private static ConfigEntry _cfgDisableVehicleSpeedParticles; private static ConfigEntry _cfgDisableUraniumScreenEffects; private static ConfigEntry _cfgDisableTumbleWingsUi; private static ConfigEntry _cfgDisableTutorialTips; private static ConfigEntry _cfgDisableArenaMessages; private static ConfigEntry _cfgDisableArenaWarningLights; private static ConfigEntry _cfgDisableArenaRaceTimerAnimations; private static ConfigEntry _cfgDisableTruckScreenLoadingBarAnimation; private static ConfigEntry _cfgDisableTruckScreenChatAnimations; private static ConfigEntry _cfgDisableBatteryBarEffects; private static ConfigEntry _cfgDisableValueScreenEffects; private static ConfigEntry _cfgDisableTutorialUiAnimations; private static readonly Dictionary ValuableTrackingNextRunTimes = new Dictionary(); private static readonly Dictionary ImpactInvestigateNextRunTimes = new Dictionary(); private static float _nextGlobalInvestigateTime; private static GUIStyle _fpsLabelStyle; private static float _fpsAccumulatedTime; private static int _fpsAccumulatedFrames; private static float _fpsDisplayValue; public static Plugin Instance => _instance; private void Awake() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown _instance = this; InitializeIntegratedFeatures(); _mainMenuStartHook = new Hook((MethodBase)AccessTools.Method(typeof(MenuPageMain), "Start", (Type[])null, (Type[])null), typeof(Plugin).GetMethod("MenuPageMainStartHook", BindingFlags.Static | BindingFlags.NonPublic)); object obj = <>c.<>9__18_0; if (obj == null) { BuilderDelegate val = delegate(Transform parent) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) REPOButton button = MenuAPI.CreateREPOButton(GetLocalizedText("更多设置", "More Settings"), (Action)OpenQuickSettingsPage, parent, new Vector2(0f, 0f)); ((MonoBehaviour)_instance).StartCoroutine(AdjustEscapeButtonPosition(parent, button)); }; <>c.<>9__18_0 = val; obj = (object)val; } MenuAPI.AddElementToEscapeMenu((BuilderDelegate)obj); ((BaseUnityPlugin)this).Logger.LogInfo((object)"REPOSettings: side-button mode active"); ((BaseUnityPlugin)this).Logger.LogInfo((object)"REPOSettings v1.0.1 loaded."); } private void OnDestroy() { Hook mainMenuStartHook = _mainMenuStartHook; if (mainMenuStartHook != null) { mainMenuStartHook.Dispose(); } } private static void MenuPageMainStartHook(Action orig, MenuPageMain self) { orig(self); CreateMainMenuButton(((Component)self).transform); TryShowCompatibilityPopup(); } [IteratorStateMachine(typeof(d__21))] private static IEnumerator AdjustEscapeButtonPosition(Transform parent, REPOButton button) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { parent = parent, button = button }; } private static void CreateMainMenuButton(Transform parent) { //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)parent == (Object)null) { Plugin instance = _instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)"REPOSettings: main parent missing"); } return; } Transform val = ResolveButtonParent(parent); if ((Object)(object)val == (Object)null) { Plugin instance2 = _instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogWarning((object)("REPOSettings: main button parent missing, root=" + ((Object)parent).name)); } return; } if ((Object)(object)((Component)val).GetComponent() == (Object)null) { VerticalLayoutGroup obj = ((Component)val).gameObject.AddComponent(); ((HorizontalOrVerticalLayoutGroup)obj).childControlWidth = false; ((HorizontalOrVerticalLayoutGroup)obj).childForceExpandWidth = false; } Transform val2 = FindOrCleanupManagedButton(val); if ((Object)(object)val2 != (Object)null) { TextMeshProUGUI componentInChildren = ((Component)val2).GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).text = GetLocalizedText("更多设置", "More Settings"); } Plugin instance3 = _instance; if (instance3 != null) { ((BaseUnityPlugin)instance3).Logger.LogInfo((object)$"REPOSettings: main button already exists at pos={val2.localPosition}"); } return; } REPOButton val3 = MenuAPI.CreateREPOButton(GetLocalizedText("更多设置", "More Settings"), (Action)OpenQuickSettingsPage, val, new Vector2(0f, 0f)); List list = (from Transform transform in (IEnumerable)val where ((Object)transform).name.Contains("Menu Button") orderby transform.localPosition.y descending select transform).ToList(); int index = Math.Max(list.Count - 2, 0); list.Insert(index, ((Component)val3).transform); Transform val4 = list[list.Count - 1]; ((Component)val3).transform.SetSiblingIndex(val4.GetSiblingIndex()); float num = 230f; foreach (Transform item in list) { item.localPosition = new Vector3(item.localPosition.x, num, item.localPosition.z); num -= 30f; } Plugin instance4 = _instance; if (instance4 != null) { ((BaseUnityPlugin)instance4).Logger.LogInfo((object)$"REPOSettings: inserted main default button at pos={((Component)val3).transform.localPosition}"); } } private static Transform ResolveButtonParent(Transform root) { if ((Object)(object)root == (Object)null) { return null; } Transform val = root.Find("Buttons"); if ((Object)(object)val != (Object)null) { return val; } return root; } private static Transform FindOrCleanupManagedButton(Transform parent) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown List list = new List(); foreach (Transform item in parent) { Transform val = item; if (((Object)val).name.Contains("Menu Button")) { TextMeshProUGUI componentInChildren = ((Component)val).GetComponentInChildren(true); string a = ((!((Object)(object)componentInChildren != (Object)null)) ? string.Empty : ((TMP_Text)componentInChildren).text?.Trim()); if (string.Equals(a, "更多设置", StringComparison.Ordinal) || string.Equals(a, "More Settings", StringComparison.Ordinal)) { list.Add(val); } } } if (list.Count <= 1) { return list.FirstOrDefault(); } Transform result = list[0]; for (int i = 1; i < list.Count; i++) { Object.Destroy((Object)(object)((Component)list[i]).gameObject); } Plugin instance = _instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)$"REPOSettings: cleaned duplicate settings buttons, removed={list.Count - 1}"); } return result; } private static void OpenQuickSettingsPage() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown Plugin instance = _instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)"REPOSettings: OpenQuickSettingsPage invoked"); } string localizedText = GetLocalizedText("更多设置", "More Settings"); REPOPopupPage page = MenuAPI.CreateREPOPopupPage(localizedText, (PresetSide)0, false, true, 0f); _currentSettingsPage = page; page.scrollView.scrollSpeed = 3f; REPOPopupPage obj = page; Padding maskPadding = page.maskPadding; maskPadding.top = 35f; obj.maskPadding = maskPadding; page.AddElement((BuilderDelegate)delegate(Transform parent) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton(GetLocalizedText("返回", "Back"), (Action)delegate { page.ClosePage(true); }, parent, QuickSettingsBackButtonPosition); ((TMP_Text)MenuAPI.CreateREPOButton(GetLocalizedText("重置全部设置", "Reset All Settings"), (Action)ConfirmResetAllManagedEntries, parent, QuickSettingsResetButtonPosition).labelTMP).fontStyle = (FontStyles)0; }); foreach (IGrouping> fpsPlusBoolSectionEntry in GetFpsPlusBoolSectionEntries()) { string sectionName = fpsPlusBoolSectionEntry.Key; page.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform scrollView) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) REPOButton obj2 = MenuAPI.CreateREPOButton(GetDisplaySectionName(sectionName), (Action)delegate { OpenSectionPage(sectionName); }, scrollView, default(Vector2)); ((TMP_Text)obj2.labelTMP).fontStyle = (FontStyles)0; return ((REPOElement)obj2).rectTransform; }, 0f, 0f); } page.OpenPage(false); Plugin instance2 = _instance; if (instance2 != null) { ((BaseUnityPlugin)instance2).Logger.LogInfo((object)"REPOSettings: popup opened"); } } private static void OpenSectionPage(string sectionName) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown MenuAPI.CloseAllPagesAddedOnTop(); REPOPopupPage val = (_currentSectionPage = MenuAPI.CreateREPOPopupPage(GetDisplaySectionName(sectionName), (PresetSide)1, false, false, 8f)); _currentSectionName = sectionName; val.scrollView.scrollSpeed = 3f; object obj = <>c.<>9__26_0; if (obj == null) { ShouldCloseMenuDelegate val2 = () => true; <>c.<>9__26_0 = val2; obj = (object)val2; } val.onEscapePressed = (ShouldCloseMenuDelegate)obj; if (sectionName == "版本信息") { AddInfoField(val, "模组名称", GetInfoEntryValue("模组名称")); AddInfoField(val, "模组版本号", GetInfoEntryValue("模组版本号")); AddInfoField(val, "REPO交流QQ群", GetInfoEntryValue("REPO交流QQ群")); object obj2 = <>c.<>9__26_1; if (obj2 == null) { ScrollViewBuilderDelegate val3 = delegate(Transform scrollView) { //IL_0014: 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) Vector2 val5 = default(Vector2); ((Vector2)(ref val5))..ctor(0f, 18f); return ((REPOElement)MenuAPI.CreateREPOSpacer(scrollView, default(Vector2), val5)).rectTransform; }; <>c.<>9__26_1 = val3; obj2 = (object)val3; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj2, 0f, 0f); ConfigEntry val4 = GetDisplayedFpsPlusBoolEntries().FirstOrDefault((Func, bool>)((ConfigEntry entry) => ((ConfigEntryBase)entry).Definition.Section == "版本信息" && ((ConfigEntryBase)entry).Definition.Key == "语言/Language")); if (val4 != null) { AddBoolToggle(val, val4); } } foreach (ConfigEntry item in from entry in GetDisplayedFpsPlusBoolEntries() where ((ConfigEntryBase)entry).Definition.Section == sectionName select entry) { if (!(sectionName == "版本信息") || !(((ConfigEntryBase)item).Definition.Key == "语言/Language")) { AddBoolToggle(val, item); } } val.OpenPage(true); Plugin instance = _instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogInfo((object)("REPOSettings: section page opened -> " + sectionName)); } } private static void ConfirmResetAllManagedEntries() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) MenuAPI.OpenPopup(GetLocalizedText("重置全部配置", "Reset All Settings"), Color.red, GetLocalizedText("确定将这页里的所有配置恢复为默认值吗?", "Reset all settings on this page to their defaults?"), (Action)ResetAllManagedEntries, (Action)null); } private static void ResetAllManagedEntries() { foreach (ConfigEntry displayedFpsPlusBoolEntry in GetDisplayedFpsPlusBoolEntries()) { ((ConfigEntryBase)displayedFpsPlusBoolEntry).BoxedValue = ((ConfigEntryBase)displayedFpsPlusBoolEntry).DefaultValue; } Plugin instance = _instance; if (instance != null) { ConfigFile config = ((BaseUnityPlugin)instance).Config; if (config != null) { config.Save(); } } if ((Object)(object)_currentSectionPage != (Object)null && !string.IsNullOrWhiteSpace(_currentSectionName)) { _currentSectionPage.ClosePage(true); _currentSectionPage = null; OpenSectionPage(_currentSectionName); return; } REPOPopupPage currentSettingsPage = _currentSettingsPage; if (currentSettingsPage != null) { currentSettingsPage.ClosePage(true); } _currentSettingsPage = null; OpenQuickSettingsPage(); } private static void AddBoolToggle(REPOPopupPage page, ConfigEntry entry) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown page.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform scrollView) { //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) bool isLanguageEntry = ((ConfigEntryBase)entry).Definition.Key == "语言/Language"; string text = (isLanguageEntry ? "中文" : GetLocalizedText("开", "On")); string text2 = (isLanguageEntry ? "English" : GetLocalizedText("关", "Off")); bool flag = (isLanguageEntry ? (!entry.Value) : entry.Value); string displayKeyName = GetDisplayKeyName(((ConfigEntryBase)entry).Definition.Key); Action obj = delegate(bool value) { entry.Value = (isLanguageEntry ? (!value) : value); SavePluginConfig("zichen.reposettings"); if (isLanguageEntry) { RefreshSettingsPages(); } }; bool flag2 = flag; string text3 = text; string text4 = text2; REPOToggle obj2 = MenuAPI.CreateREPOToggle(displayKeyName, obj, scrollView, default(Vector2), text3, text4, flag2); ((TMP_Text)obj2.labelTMP).fontSize = 24f; return ((REPOElement)obj2).rectTransform; }, 0f, 0f); } private static void AddInfoField(REPOPopupPage page, string labelText, string valueText) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown page.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform scrollView) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) string stableValue = valueText ?? string.Empty; REPOInputField inputField = null; inputField = MenuAPI.CreateREPOInputField(labelText, (Action)delegate(string value) { if ((Object)(object)inputField != (Object)null && value != stableValue) { inputField.inputStringSystem.SetValue(stableValue, false); } }, scrollView, Vector2.zero, false, string.Empty, stableValue); ((TMP_Text)inputField.labelTMP).text = GetDisplayInfoName(labelText); ((TMP_Text)inputField.labelTMP).fontStyle = (FontStyles)0; inputField.inputStringSystem.inputTMP.fontStyle = (FontStyles)0; inputField.inputStringSystem.SetValue(stableValue, false); return ((REPOElement)inputField).rectTransform; }, 0f, 0f); } private static void RefreshSettingsPages() { string currentSectionName = _currentSectionName; bool num = (Object)(object)_currentSectionPage != (Object)null && !string.IsNullOrWhiteSpace(currentSectionName); REPOPopupPage currentSectionPage = _currentSectionPage; if (currentSectionPage != null) { currentSectionPage.ClosePage(true); } _currentSectionPage = null; REPOPopupPage currentSettingsPage = _currentSettingsPage; if (currentSettingsPage != null) { currentSettingsPage.ClosePage(true); } _currentSettingsPage = null; OpenQuickSettingsPage(); if (num) { OpenSectionPage(currentSectionName); } } private static IEnumerable>> GetFpsPlusBoolSectionEntries() { List> entries = GetDisplayedFpsPlusBoolEntries().ToList(); return from section in entries.Select((ConfigEntry entry) => ((ConfigEntryBase)entry).Definition.Section).Distinct().ToList() select (from entry in entries where ((ConfigEntryBase)entry).Definition.Section == section group entry by ((ConfigEntryBase)entry).Definition.Section).First(); } private static IEnumerable> GetDisplayedFpsPlusBoolEntries() { Plugin instance = _instance; if (((instance != null) ? ((BaseUnityPlugin)instance).Config : null) == null) { return Enumerable.Empty>(); } return from entry in ((IEnumerable>)((BaseUnityPlugin)_instance).Config).Select((KeyValuePair configEntry) => configEntry.Value).OfType>() where ((ConfigEntryBase)entry).Definition.Section != "基础配置" where ((ConfigEntryBase)entry).Definition.Section != "I.性能优化" select entry; } private static string GetInfoEntryValue(string key) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown Plugin instance = _instance; if (((instance != null) ? ((BaseUnityPlugin)instance).Config : null) == null) { return string.Empty; } ConfigEntry val = default(ConfigEntry); if (((BaseUnityPlugin)_instance).Config.TryGetEntry(new ConfigDefinition("基础配置", key), ref val) && val != null) { return val.Value; } return string.Empty; } private static string GetDisplaySectionName(string rawSectionName) { return GetLocalizedMappedText(rawSectionName, SectionEnglishNames); } private static string GetDisplayKeyName(string rawKeyName) { if (rawKeyName == "语言/Language") { return "语言 / Language"; } return GetLocalizedMappedText(rawKeyName, KeyEnglishNames); } private static string GetDisplayInfoName(string rawKeyName) { return GetLocalizedMappedText(rawKeyName, InfoEnglishNames); } private static string GetLocalizedMappedText(string chineseText, Dictionary englishMap) { if (!IsEnglishUiEnabled()) { return chineseText; } if (!englishMap.TryGetValue(chineseText, out var value)) { return chineseText; } return value; } private static string GetLocalizedText(string chineseText, string englishText) { if (!IsEnglishUiEnabled()) { return chineseText; } return englishText; } private static void SavePluginConfig(string pluginGuid) { if (Chainloader.PluginInfos.TryGetValue(pluginGuid, out var value)) { object obj; if (value == null) { obj = null; } else { BaseUnityPlugin instance = value.Instance; obj = ((instance != null) ? instance.Config : null); } if (obj != null) { value.Instance.Config.Save(); } } } private static void PatchHarmonySafely() { foreach (Type loadableType in GetLoadableTypes(typeof(Plugin).Assembly)) { if (loadableType == null || !loadableType.GetCustomAttributes(typeof(HarmonyPatch), inherit: true).Any()) { continue; } try { _harmony.CreateClassProcessor(loadableType).Patch(); } catch (Exception ex) { string patchFeatureName = GetPatchFeatureName(loadableType); _compatibilityReport.AddPatchFailure(patchFeatureName, loadableType.Name, ex.Message); Plugin instance = _instance; if (instance != null) { ((BaseUnityPlugin)instance).Logger.LogWarning((object)("Skipped Harmony patch " + loadableType.FullName + ": " + ex.Message)); } } } } private static string GetPatchFeatureName(Type patchType) { string text = patchType?.Name ?? "未知功能"; if (text.IndexOf("Menu", StringComparison.OrdinalIgnoreCase) >= 0) { return "菜单与界面"; } if (text.IndexOf("Camera", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("PostProcessing", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("Vignette", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("MapTool", StringComparison.OrdinalIgnoreCase) >= 0) { return "屏幕与镜头效果"; } if (text.IndexOf("Gun", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("Arm", StringComparison.OrdinalIgnoreCase) >= 0) { return "武器与手臂表现"; } if (text.IndexOf("Valuable", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("Phys", StringComparison.OrdinalIgnoreCase) >= 0) { return "贵重物与表现优化"; } if (text.IndexOf("WorldSpace", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("Tutorial", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("Message", StringComparison.OrdinalIgnoreCase) >= 0 || text.IndexOf("UI", StringComparison.OrdinalIgnoreCase) >= 0) { return "UI 与提示"; } return text; } private static IEnumerable GetLoadableTypes(Assembly assembly) { try { return assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { return ex.Types.Where((Type type) => type != null); } } private static void TryShowCompatibilityPopup() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (_compatibilityPopupShown || !_compatibilityReport.HasIssues || (Object)(object)MenuManager.instance == (Object)null) { return; } string text = _compatibilityReport.BuildPopupMessage(IsEnglishUiEnabled()); if (!string.IsNullOrWhiteSpace(text)) { if (IsPopupSlotBusy(MenuManager.instance)) { StartCompatibilityPopupWait(text); return; } _compatibilityPopupShown = true; MenuManager.instance.PagePopUpScheduled(GetLocalizedText("兼容模式提示", "Compatibility Notice"), Color.yellow, text, "OK", false); } } private static bool IsPopupSlotBusy(MenuManager menuManager) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Invalid comparison between Unknown and I4 if ((Object)(object)menuManager == (Object)null) { return true; } if (PagePopUpScheduledRef.Invoke(menuManager)) { return true; } MenuPageIndex val = CurrentMenuPageIndexRef.Invoke(menuManager); if ((int)val != 9) { return (int)val == 7; } return true; } private static void StartCompatibilityPopupWait(string compatibilityMessage) { if (!_compatibilityPopupWaiting && !((Object)(object)_instance == (Object)null)) { _compatibilityPopupWaiting = true; ((MonoBehaviour)_instance).StartCoroutine(WaitAndShowCompatibilityPopup(compatibilityMessage)); } } [IteratorStateMachine(typeof(d__53))] private static IEnumerator WaitAndShowCompatibilityPopup(string compatibilityMessage) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__53(0) { compatibilityMessage = compatibilityMessage }; } public static bool IsStaticModEnabled() { if (_cfgModEnabled != null) { return _cfgModEnabled.Value; } return false; } public static bool IsEnglishUiEnabled() { if (_cfgUseEnglishUi != null) { return _cfgUseEnglishUi.Value; } return false; } private void InitializeIntegratedFeatures() { DetachFromManager(); ResetConfigIfVersionChanged(); BindConfig(); CleanupLegacyConfigFile(); _compatibilityReport = CompatibilityReport.Build(); ApplyPatches(); if (_compatibilityReport.HasIssues) { ((BaseUnityPlugin)this).Logger.LogWarning((object)_compatibilityReport.BuildLogMessage()); foreach (string detailMessage in _compatibilityReport.GetDetailMessages()) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Compatibility detail: " + detailMessage)); } } ((BaseUnityPlugin)this).Logger.LogInfo((object)"更多设置选项 integrated into REPOSettings v1.0.1."); } private void Update() { UpdateFpsCounter(); if (IsStaticModEnabled()) { if (DisableCameraAnimationEnabled() && (Object)(object)GameplayManager.instance != (Object)null) { GameplayManager.instance.OverrideCameraAnimation(0f, 0.2f); } if (DisableCameraNoiseEnabled() && (Object)(object)GameplayManager.instance != (Object)null) { GameplayManager.instance.OverrideCameraNoise(0f, 0.2f); } } } private void OnGUI() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (IsStaticModEnabled() && _cfgShowFpsCounter != null && _cfgShowFpsCounter.Value) { EnsureFpsLabelStyle(); GUI.Label(new Rect(12f, 12f, 160f, 28f), $"FPS: {Mathf.RoundToInt(_fpsDisplayValue)}", _fpsLabelStyle); } } private void BindConfig() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown ((BaseUnityPlugin)this).Config.Bind("基础配置", "模组名称", "更多设置选项", new ConfigDescription("", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = 1000, ReadOnly = true } })); ((BaseUnityPlugin)this).Config.Bind("基础配置", "模组版本号", "1.0.1", new ConfigDescription("", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = 990, ReadOnly = true } })); ((BaseUnityPlugin)this).Config.Bind("基础配置", "REPO交流QQ群", "824639225", new ConfigDescription("", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = 980, ReadOnly = true } })); _cfgModEnabled = ((BaseUnityPlugin)this).Config.Bind("版本信息", "配置生效", true, "总开关"); _cfgShowFpsCounter = ((BaseUnityPlugin)this).Config.Bind("版本信息", "显示FPS数值", true, "左上角实时显示FPS"); _cfgUseEnglishUi = ((BaseUnityPlugin)this).Config.Bind("版本信息", "语言/Language", false, "选择游戏内显示文本的语言。默认中文,English 会把更多设置里的分类名和开关名切换为英文。"); _cfgDisableSplashScreen = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭启动画面", true, "关闭启动画面"); _cfgDisableArmIntroAnimation = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭开场手臂动画", false, "关闭开场手臂"); _cfgDisableLoadingAnimation = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭加载与切场动画", false, "关闭加载切场"); _cfgDisableLobbyPageAnimations = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭大厅页面切换动画", false, "关闭大厅页面切换动画"); _cfgDisablePopupAnimations = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭按钮弹窗动画", false, "关闭按钮弹窗动画"); _cfgDisableServerListEntryAnimations = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭房间列表入场动画", false, "关闭房间列表入场动画"); _cfgDisableRegionListEntryAnimations = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭地区列表入场动画", false, "关闭地区列表入场动画"); _cfgDisableMenuLoadingGraphicsAnimations = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭菜单加载图标动画", false, "关闭菜单加载图标动画"); _cfgDisableMenuButtonMotion = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭主菜单按钮位移动画", false, "关闭主菜单按钮位移动画"); _cfgDisableLobbyJoiningPromptFade = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭加入玩家提示淡入", false, "关闭加入玩家提示淡入"); _cfgDisableLeftPrepUiFade = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭左侧准备界面淡入动画", false, "关闭左侧准备界面淡入动画"); _cfgDisableResultScreenFade = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭结算页淡入淡出", false, "关闭结算页淡入淡出"); _cfgDisableMoonPhaseUi = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭月相变化界面", false, "关闭月相变化界面"); _cfgDisableMainMenuTruckAnimation = ((BaseUnityPlugin)this).Config.Bind("A.启动与切场", "关闭主菜单卡车动画", false, "关闭主菜单卡车动画"); _cfgSkipPublicGameJoinConfirm = ((BaseUnityPlugin)this).Config.Bind("B.大厅与联机", "跳过公开游戏加入确认", true, "跳过公开房加入提示"); _cfgSkipPrivateGameConfirm = ((BaseUnityPlugin)this).Config.Bind("B.大厅与联机", "跳过私人游戏默认确认", true, "跳过私人房默认提示"); _cfgSkipRegionEntryPrompt = ((BaseUnityPlugin)this).Config.Bind("B.大厅与联机", "跳过公开/私人游戏区服前提示", false, "跳过区服前提示"); _cfgDisableVideoOverlay = ((BaseUnityPlugin)this).Config.Bind("C.屏幕与镜头效果", "关闭屏幕噪点遮罩", false, "关闭噪点遮罩"); _cfgDisableCameraNoise = ((BaseUnityPlugin)this).Config.Bind("C.屏幕与镜头效果", "关闭镜头噪声", false, "关闭镜头噪声"); _cfgDisableCameraAnimation = ((BaseUnityPlugin)this).Config.Bind("C.屏幕与镜头效果", "关闭第一人称镜头动画", false, "关闭走路跳跃镜头动画"); _cfgDisableCameraShake = ((BaseUnityPlugin)this).Config.Bind("C.屏幕与镜头效果", "关闭镜头震动", false, "关闭镜头震动"); _cfgDisableCameraGlitch = ((BaseUnityPlugin)this).Config.Bind("C.屏幕与镜头效果", "关闭屏幕故障闪屏", false, "关闭故障闪屏"); _cfgDisableEnemyShadowVeinScreenEffect = ((BaseUnityPlugin)this).Config.Bind("C.屏幕与镜头效果", "关闭影怪血管屏幕特效", false, "关闭影怪血管屏幕特效"); _cfgDisablePostProcessingOverrides = ((BaseUnityPlugin)this).Config.Bind("C.屏幕与镜头效果", "关闭临时后处理特效", false, "关闭临时后处理"); _cfgDisableHurtVignette = ((BaseUnityPlugin)this).Config.Bind("C.屏幕与镜头效果", "关闭低血量红框", false, "关闭低血量红框"); _cfgDisableMapOpenAnimation = ((BaseUnityPlugin)this).Config.Bind("C.屏幕与镜头效果", "关闭打开地图动画", false, "关闭地图开合动画"); _cfgDisableFirstPersonArmAnimations = ((BaseUnityPlugin)this).Config.Bind("D.武器与手臂表现", "关闭第一人称手臂动作", false, "关闭手臂摆动"); _cfgDisableTumbleVisualEffects = ((BaseUnityPlugin)this).Config.Bind("E.摔倒与动作表现", "关闭摔倒特效", false, "关闭摔倒粒子"); _cfgDisableGunTriggerAnimation = ((BaseUnityPlugin)this).Config.Bind("F.开枪表现", "关闭开枪扳机动画", false, "关闭扳机动画"); _cfgDisableGunFireShake = ((BaseUnityPlugin)this).Config.Bind("F.开枪表现", "关闭开枪震动", false, "关闭开枪震动"); _cfgDisableGunRecoil = ((BaseUnityPlugin)this).Config.Bind("F.开枪表现", "关闭开枪后坐力", false, "关闭开枪后坐力"); _cfgDisableGunMuzzleEffects = ((BaseUnityPlugin)this).Config.Bind("F.开枪表现", "关闭开枪枪口特效", false, "关闭枪口火焰火花"); _cfgDisableGunSmokeEffects = ((BaseUnityPlugin)this).Config.Bind("F.开枪表现", "关闭开枪黑烟特效", false, "关闭枪口和落点黑烟"); _cfgDisableDeathAndReviveEffects = ((BaseUnityPlugin)this).Config.Bind("G.死亡与状态表现", "关闭死亡与复活特效", false, "关闭死亡复活特效"); _cfgDisableSpiderScreenEffects = ((BaseUnityPlugin)this).Config.Bind("G.死亡与状态表现", "关闭蜘蛛贴脸屏幕效果", false, "关闭蜘蛛贴脸效果"); _cfgEnableValuableMapMarkers = ((BaseUnityPlugin)this).Config.Bind("H.贵重物表现", "关闭地图贵重物标记", false, "关闭地图贵重物标记"); _cfgEnableValuableDiscoverPrompts = ((BaseUnityPlugin)this).Config.Bind("H.贵重物表现", "关闭贵重物发现提示", false, "关闭贵重物发现提示"); _cfgEnableValuableDynamicEffects = ((BaseUnityPlugin)this).Config.Bind("H.贵重物表现", "关闭贵重物动态灯光与粒子", false, "关闭贵重物灯光粒子"); _cfgDisablePhysImpactVisualEffects = ((BaseUnityPlugin)this).Config.Bind("I.性能优化", "关闭物体碰撞粒子与灯光", false, "关闭碰撞粒子灯光"); _cfgThrottleValuableExtractionTracking = ((BaseUnityPlugin)this).Config.Bind("I.性能优化", "贵重物距离跟踪降频", false, "降低距离跟踪频率"); _cfgThrottleEnemyInvestigate = ((BaseUnityPlugin)this).Config.Bind("I.性能优化", "敌人调查触发节流", false, "限制高频调查触发"); _cfgDisableWorldSpaceUiAnimations = ((BaseUnityPlugin)this).Config.Bind("J.世界空间UI", "关闭世界空间UI动画", false, "关闭名字弹字和TTS动画"); _cfgDisableUpgradeStandCameraShake = ((BaseUnityPlugin)this).Config.Bind("K.升级台演出", "关闭升级台镜头震动", false, "关闭升级台镜头震动"); _cfgDisableUpgradeStandEffects = ((BaseUnityPlugin)this).Config.Bind("K.升级台演出", "关闭升级台粒子与灯光", false, "关闭升级台粒子灯光"); _cfgDisableUpgradeStandAnimations = ((BaseUnityPlugin)this).Config.Bind("K.升级台演出", "关闭升级台滚动与舱门动画", false, "关闭升级台滚动舱门动画"); _cfgDisableUpgradeStandBrokenFireEffects = ((BaseUnityPlugin)this).Config.Bind("K.升级台演出", "关闭升级台损坏起火特效", false, "关闭升级台起火特效"); _cfgDisableCosmeticMachineGrabBeamEffects = ((BaseUnityPlugin)this).Config.Bind("L.外观机演出", "关闭外观机抓取光束与粒子", false, "关闭外观机抓取光束粒子"); _cfgDisableCosmeticMachineCameraShake = ((BaseUnityPlugin)this).Config.Bind("L.外观机演出", "关闭外观机镜头震动", false, "关闭外观机镜头震动"); _cfgDisableCosmeticMachineScreenAnimations = ((BaseUnityPlugin)this).Config.Bind("L.外观机演出", "关闭外观机转盘与屏幕动画", false, "关闭外观机转盘屏幕动画"); _cfgDisableCosmeticMachineLoopEffects = ((BaseUnityPlugin)this).Config.Bind("L.外观机演出", "关闭外观机循环灯光与音效", false, "关闭外观机循环灯光音效"); _cfgDisableResultScreenShake = ((BaseUnityPlugin)this).Config.Bind("M.结算演出", "关闭结算页抖动", false, "关闭结算页抖动"); _cfgDisableResultScreenTokenParticles = ((BaseUnityPlugin)this).Config.Bind("M.结算演出", "关闭结算页代币粒子", false, "关闭结算页代币粒子"); _cfgQuickSkipResultScreen = ((BaseUnityPlugin)this).Config.Bind("M.结算演出", "快速跳过结算演出", false, "快速跳过结算演出"); _cfgDisableBatteryUiAnimations = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭电池UI弹跳与闪烁", false, "关闭电池UI弹跳闪烁"); _cfgDisableFlashlightAnimations = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭手电开关动画", false, "关闭手电开关动画"); _cfgDisableFlashlightFlicker = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭手电闪烁表现", false, "关闭手电闪烁表现"); _cfgDisableLobbyChatAnimations = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭大厅聊天跳动动画", false, "关闭大厅聊天跳动动画"); _cfgDisableGuideArrowUi = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭指引箭头", false, "关闭指引箭头"); _cfgDisableBigMessageUi = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭大字提示", false, "关闭大字提示"); _cfgDisableVehicleSpeedParticles = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭载具速度粒子", false, "关闭载具速度粒子"); _cfgDisableUraniumScreenEffects = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭铀伤害屏幕特效", false, "关闭铀伤害屏幕特效"); _cfgDisableTumbleWingsUi = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭翻滚翅膀UI", false, "关闭翻滚翅膀UI"); _cfgDisableTutorialTips = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭教程提示", false, "关闭教程提示"); _cfgDisableArenaMessages = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭竞技场大字提示", false, "关闭竞技场大字提示"); _cfgDisableArenaWarningLights = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭竞技场警示灯", false, "关闭竞技场警示灯"); _cfgDisableArenaRaceTimerAnimations = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭竞速计时器动画", false, "关闭竞速计时器动画"); _cfgDisableTruckScreenLoadingBarAnimation = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭卡车屏幕加载条动画", false, "关闭卡车屏幕加载条动画"); _cfgDisableTruckScreenChatAnimations = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭卡车聊天框动画", false, "关闭卡车聊天框动画"); _cfgDisableBatteryBarEffects = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭电池条浮动特效", false, "关闭电池条浮动特效"); _cfgDisableValueScreenEffects = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭价值屏幕跳字特效", false, "关闭价值屏幕跳字特效"); _cfgDisableTutorialUiAnimations = ((BaseUnityPlugin)this).Config.Bind("N.UI与提示", "关闭教程UI动画", false, "关闭教程UI动画"); } private void ResetConfigIfVersionChanged() { try { string configFilePath = ((BaseUnityPlugin)this).Config.ConfigFilePath; string text = ReadConfigPluginVersion(configFilePath); if (!string.IsNullOrWhiteSpace(text) && !(text == "1.0.1")) { ((BaseUnityPlugin)this).Config.Clear(); if (File.Exists(configFilePath)) { File.Delete(configFilePath); } ((BaseUnityPlugin)this).Config.Reload(); ((BaseUnityPlugin)this).Logger.LogWarning((object)"Config version changed. Old config was reset to defaults."); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Failed to reset config by version: " + ex.Message)); } } private static string ReadConfigPluginVersion(string configPath) { if (!File.Exists(configPath)) { return null; } Match match = Regex.Match(File.ReadAllText(configPath), "(?m)^模组版本号\\s*=\\s*(.+?)\\s*$"); if (!match.Success) { return null; } return match.Groups[1].Value.Trim(); } private void CleanupLegacyConfigFile() { try { string configFilePath = ((BaseUnityPlugin)this).Config.ConfigFilePath; if (File.Exists(configFilePath)) { string text = File.ReadAllText(configFilePath); if (text.Contains("[全局设置]") || text.Contains("[显示]") || text.Contains("[模组信息]") || text.Contains("[增加UI]") || text.Contains("[A.启动与切场]") || text.Contains("[B.屏幕与镜头效果]") || text.Contains("[C.武器与手臂表现]") || text.Contains("[D.摔倒与动作表现]") || text.Contains("[E.开枪表现]") || text.Contains("[F.死亡与状态表现]") || text.Contains("[G.贵重物表现]") || text.Contains("[H.性能优化]") || text.Contains("[I.大厅与联机]") || text.Contains("[J.大厅与菜单动画]") || text.Contains("[K.世界空间UI]") || text.Contains("[L.升级台演出]") || text.Contains("[M.外观机演出]") || text.Contains("[N.结算演出]") || text.Contains("[O.UI与提示]") || Regex.IsMatch(text, "(?m)^模组启用\\s*=") || Regex.IsMatch(text, "(?m)^界面语言\\s*=") || text.Contains("[B.启动与切场]") || text.Contains("[C.屏幕与镜头效果]") || text.Contains("[D.武器与手臂表现]") || text.Contains("[E.摔倒与动作表现]") || text.Contains("[F.开枪表现]") || text.Contains("[G.死亡与状态表现]") || text.Contains("[H.贵重物表现]") || text.Contains("[J.世界空间UI]") || text.Contains("[K.升级台演出]") || text.Contains("[L.外观机演出]") || text.Contains("[M.结算演出]") || text.Contains("[N.UI与提示]")) { File.Delete(configFilePath); ((BaseUnityPlugin)this).Config.Save(); ((BaseUnityPlugin)this).Logger.LogWarning((object)"Legacy config layout detected and rebuilt to current structure."); } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("Failed to cleanup legacy config: " + ex.Message)); } } private void DetachFromManager() { ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); } private static void ApplyPatches() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown if (_harmony == null) { _harmony = new Harmony("zichen.reposettings"); PatchHarmonySafely(); } } private static bool IsFeatureEnabled(ConfigEntry configEntry) { if (IsStaticModEnabled() && configEntry != null) { return configEntry.Value; } return false; } private static void EnsureFpsLabelStyle() { //IL_0012: 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) //IL_0024: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (_fpsLabelStyle == null) { _fpsLabelStyle = new GUIStyle(GUI.skin.label) { fontSize = 18 }; _fpsLabelStyle.normal.textColor = Color.white; } } private static void UpdateFpsCounter() { _fpsAccumulatedTime += Time.unscaledDeltaTime; _fpsAccumulatedFrames++; if (!(_fpsAccumulatedTime < 1f)) { _fpsDisplayValue = (float)_fpsAccumulatedFrames / _fpsAccumulatedTime; _fpsAccumulatedTime = 0f; _fpsAccumulatedFrames = 0; } } internal static bool DisableSplashScreenEnabled() { return IsFeatureEnabled(_cfgDisableSplashScreen); } internal static bool DisableArmIntroAnimationEnabled() { return IsFeatureEnabled(_cfgDisableArmIntroAnimation); } internal static bool DisableLoadingAnimationEnabled() { return IsFeatureEnabled(_cfgDisableLoadingAnimation); } internal static bool DisableVideoOverlayEnabled() { return IsFeatureEnabled(_cfgDisableVideoOverlay); } internal static bool DisableCameraNoiseEnabled() { return IsFeatureEnabled(_cfgDisableCameraNoise); } internal static bool DisableCameraAnimationEnabled() { return IsFeatureEnabled(_cfgDisableCameraAnimation); } internal static bool DisableCameraShakeEnabled() { return IsFeatureEnabled(_cfgDisableCameraShake); } internal static bool DisableCameraGlitchEnabled() { return IsFeatureEnabled(_cfgDisableCameraGlitch); } internal static bool DisableEnemyShadowVeinScreenEffectEnabled() { return IsFeatureEnabled(_cfgDisableEnemyShadowVeinScreenEffect); } internal static bool DisablePostProcessingOverridesEnabled() { return IsFeatureEnabled(_cfgDisablePostProcessingOverrides); } internal static bool DisableHurtVignetteEnabled() { return IsFeatureEnabled(_cfgDisableHurtVignette); } internal static bool DisableMapOpenAnimationEnabled() { return IsFeatureEnabled(_cfgDisableMapOpenAnimation); } internal static bool DisableFirstPersonArmAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableFirstPersonArmAnimations); } internal static bool DisableGunTriggerAnimationEnabled() { return IsFeatureEnabled(_cfgDisableGunTriggerAnimation); } internal static bool DisableGunFireShakeEnabled() { return IsFeatureEnabled(_cfgDisableGunFireShake); } internal static bool DisableGunRecoilEnabled() { return IsFeatureEnabled(_cfgDisableGunRecoil); } internal static bool DisableGunMuzzleEffectsEnabled() { return IsFeatureEnabled(_cfgDisableGunMuzzleEffects); } internal static bool DisableGunSmokeEffectsEnabled() { return IsFeatureEnabled(_cfgDisableGunSmokeEffects); } internal static bool DisableDeathAndReviveEffectsEnabled() { return IsFeatureEnabled(_cfgDisableDeathAndReviveEffects); } internal static bool DisableSpiderScreenEffectsEnabled() { return IsFeatureEnabled(_cfgDisableSpiderScreenEffects); } internal static bool DisableTumbleVisualEffectsEnabled() { return IsFeatureEnabled(_cfgDisableTumbleVisualEffects); } internal static bool DisablePhysImpactVisualEffectsEnabled() { return IsFeatureEnabled(_cfgDisablePhysImpactVisualEffects); } internal static bool ThrottleValuableExtractionTrackingEnabled() { return IsFeatureEnabled(_cfgThrottleValuableExtractionTracking); } internal static bool ThrottleEnemyInvestigateEnabled() { return IsFeatureEnabled(_cfgThrottleEnemyInvestigate); } internal static bool SkipPublicGameJoinConfirmEnabled() { return IsFeatureEnabled(_cfgSkipPublicGameJoinConfirm); } internal static bool SkipPrivateGameConfirmEnabled() { return IsFeatureEnabled(_cfgSkipPrivateGameConfirm); } internal static bool DisableLobbyPageAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableLobbyPageAnimations); } internal static bool DisablePopupAnimationsEnabled() { return IsFeatureEnabled(_cfgDisablePopupAnimations); } internal static bool DisableServerListEntryAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableServerListEntryAnimations); } internal static bool DisableRegionListEntryAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableRegionListEntryAnimations); } internal static bool DisableMenuLoadingGraphicsAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableMenuLoadingGraphicsAnimations); } internal static bool DisableMenuButtonMotionEnabled() { return IsFeatureEnabled(_cfgDisableMenuButtonMotion); } internal static bool EnableValuableMapMarkersEnabled() { return !IsFeatureEnabled(_cfgEnableValuableMapMarkers); } internal static bool EnableValuableDiscoverPromptsEnabled() { return !IsFeatureEnabled(_cfgEnableValuableDiscoverPrompts); } internal static bool EnableValuableDynamicEffectsEnabled() { return !IsFeatureEnabled(_cfgEnableValuableDynamicEffects); } internal static bool DisableWorldSpaceUiAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableWorldSpaceUiAnimations); } internal static bool DisableUpgradeStandCameraShakeEnabled() { return IsFeatureEnabled(_cfgDisableUpgradeStandCameraShake); } internal static bool DisableUpgradeStandEffectsEnabled() { return IsFeatureEnabled(_cfgDisableUpgradeStandEffects); } internal static bool DisableUpgradeStandAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableUpgradeStandAnimations); } internal static bool DisableUpgradeStandBrokenFireEffectsEnabled() { return IsFeatureEnabled(_cfgDisableUpgradeStandBrokenFireEffects); } internal static bool DisableCosmeticMachineGrabBeamEffectsEnabled() { return IsFeatureEnabled(_cfgDisableCosmeticMachineGrabBeamEffects); } internal static bool DisableCosmeticMachineCameraShakeEnabled() { return IsFeatureEnabled(_cfgDisableCosmeticMachineCameraShake); } internal static bool DisableCosmeticMachineScreenAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableCosmeticMachineScreenAnimations); } internal static bool DisableCosmeticMachineLoopEffectsEnabled() { return IsFeatureEnabled(_cfgDisableCosmeticMachineLoopEffects); } internal static bool DisableResultScreenFadeEnabled() { return IsFeatureEnabled(_cfgDisableResultScreenFade); } internal static bool DisableResultScreenShakeEnabled() { return IsFeatureEnabled(_cfgDisableResultScreenShake); } internal static bool DisableResultScreenTokenParticlesEnabled() { return IsFeatureEnabled(_cfgDisableResultScreenTokenParticles); } internal static bool QuickSkipResultScreenEnabled() { return IsFeatureEnabled(_cfgQuickSkipResultScreen); } internal static bool DisableBatteryUiAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableBatteryUiAnimations); } internal static bool DisableFlashlightAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableFlashlightAnimations); } internal static bool DisableFlashlightFlickerEnabled() { return IsFeatureEnabled(_cfgDisableFlashlightFlicker); } internal static bool DisableLobbyChatAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableLobbyChatAnimations); } internal static bool DisableLobbyJoiningPromptFadeEnabled() { return IsFeatureEnabled(_cfgDisableLobbyJoiningPromptFade); } internal static bool DisableLeftPrepUiFadeEnabled() { return IsFeatureEnabled(_cfgDisableLeftPrepUiFade); } internal static bool SkipRegionEntryPromptEnabled() { return IsFeatureEnabled(_cfgSkipRegionEntryPrompt); } internal static bool DisableMoonPhaseUiEnabled() { return IsFeatureEnabled(_cfgDisableMoonPhaseUi); } internal static bool DisableMainMenuTruckAnimationEnabled() { return IsFeatureEnabled(_cfgDisableMainMenuTruckAnimation); } internal static bool DisableGuideArrowUiEnabled() { return IsFeatureEnabled(_cfgDisableGuideArrowUi); } internal static bool DisableBigMessageUiEnabled() { return IsFeatureEnabled(_cfgDisableBigMessageUi); } internal static bool DisableVehicleSpeedParticlesEnabled() { return IsFeatureEnabled(_cfgDisableVehicleSpeedParticles); } internal static bool DisableUraniumScreenEffectsEnabled() { return IsFeatureEnabled(_cfgDisableUraniumScreenEffects); } internal static bool DisableTumbleWingsUiEnabled() { return IsFeatureEnabled(_cfgDisableTumbleWingsUi); } internal static bool DisableTutorialTipsEnabled() { return IsFeatureEnabled(_cfgDisableTutorialTips); } internal static bool DisableArenaMessagesEnabled() { return IsFeatureEnabled(_cfgDisableArenaMessages); } internal static bool DisableArenaWarningLightsEnabled() { return IsFeatureEnabled(_cfgDisableArenaWarningLights); } internal static bool DisableArenaRaceTimerAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableArenaRaceTimerAnimations); } internal static bool DisableTruckScreenLoadingBarAnimationEnabled() { return IsFeatureEnabled(_cfgDisableTruckScreenLoadingBarAnimation); } internal static bool DisableTruckScreenChatAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableTruckScreenChatAnimations); } internal static bool DisableBatteryBarEffectsEnabled() { return IsFeatureEnabled(_cfgDisableBatteryBarEffects); } internal static bool DisableValueScreenEffectsEnabled() { return IsFeatureEnabled(_cfgDisableValueScreenEffects); } internal static bool DisableTutorialUiAnimationsEnabled() { return IsFeatureEnabled(_cfgDisableTutorialUiAnimations); } internal static void LogPopupEvent(string stage, MenuButtonPopUp menuButtonPopUp, string detail = null) { if (!((Object)(object)Instance == (Object)null) && !((Object)(object)menuButtonPopUp == (Object)null)) { string text = "Unknown"; if ((Object)(object)MenuManager.instance != (Object)null) { text = Traverse.Create((object)MenuManager.instance).Field("currentMenuPageIndex").GetValue()?.ToString() ?? "Unknown"; } string transformPath = GetTransformPath(((Component)menuButtonPopUp).transform); string text2 = (string.IsNullOrWhiteSpace(menuButtonPopUp.headerText) ? "" : menuButtonPopUp.headerText); string text3 = (string.IsNullOrWhiteSpace(menuButtonPopUp.bodyText) ? "" : menuButtonPopUp.bodyText); string text4 = (string.IsNullOrWhiteSpace(menuButtonPopUp.option1Text) ? "" : menuButtonPopUp.option1Text); string text5 = (string.IsNullOrWhiteSpace(menuButtonPopUp.option2Text) ? "" : menuButtonPopUp.option2Text); string text6 = string.Join(",", Array.ConvertAll(((Component)menuButtonPopUp).GetComponents(), (Component component) => (!((Object)(object)component == (Object)null)) ? ((object)component).GetType().Name : "null")); ((BaseUnityPlugin)Instance).Logger.LogInfo((object)("[Popup:" + stage + "] page=" + text + " path=" + transformPath + " header=" + text2 + " body=" + text3 + " option1=" + text4 + " option2=" + text5 + " components=[" + text6 + "] detail=" + (detail ?? ""))); } } private static string GetTransformPath(Transform transform) { if ((Object)(object)transform == (Object)null) { return ""; } string text = ((Object)transform).name; Transform parent = transform.parent; while ((Object)(object)parent != (Object)null) { text = ((Object)parent).name + "/" + text; parent = parent.parent; } return text; } internal static bool IsLeftPrepSemiUi(SemiUI semiUi) { if (!(semiUi is LevelUI) && !(semiUi is GoalUI) && !(semiUi is HaulUI) && !(semiUi is StatsUI)) { return semiUi is MissionUI; } return true; } internal static void SnapSemiUiVisible(SemiUI semiUi) { //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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)semiUi == (Object)null)) { Vector2 value = Traverse.Create((object)semiUi).Field("showPosition").GetValue(); Traverse.Create((object)semiUi).Field("showTimer").SetValue((object)0f); Traverse.Create((object)semiUi).Field("hideTimer").SetValue((object)0f); Traverse.Create((object)semiUi).Field("hidePositionCurrent").SetValue((object)value); Traverse.Create((object)semiUi).Field("showAnimationEvaluation").SetValue((object)1f); Traverse.Create((object)semiUi).Field("hideAnimationEvaluation").SetValue((object)0f); Traverse.Create((object)semiUi).Field("animationEval").SetValue((object)1f); RectTransform value2 = Traverse.Create((object)semiUi).Field("textRectTransform").GetValue(); if ((Object)(object)value2 != (Object)null) { ((Transform)value2).localPosition = Vector2.op_Implicit(value); } Component value3 = Traverse.Create((object)semiUi).Field("uiText").GetValue(); if ((Object)(object)value3 != (Object)null) { Traverse.Create((object)value3).Property("enabled", (object[])null).SetValue((object)true); } Traverse.Create((object)semiUi).Field("isHidden").SetValue((object)false); } } internal static bool ShouldRunValuableTracking(ValuableObject valuableObject) { if (!ThrottleValuableExtractionTrackingEnabled() || (Object)(object)valuableObject == (Object)null) { return true; } int instanceID = ((Object)valuableObject).GetInstanceID(); float unscaledTime = Time.unscaledTime; if (ValuableTrackingNextRunTimes.TryGetValue(instanceID, out var value) && unscaledTime < value) { return false; } ValuableTrackingNextRunTimes[instanceID] = unscaledTime + 0.75f; return true; } internal static bool ShouldRunImpactInvestigate(PhysGrabObjectImpactDetector impactDetector, float radius) { if (!ThrottleEnemyInvestigateEnabled() || (Object)(object)impactDetector == (Object)null) { return true; } float num = ((radius >= 10f) ? 0.2f : ((radius >= 3f) ? 0.35f : 0.5f)); int instanceID = ((Object)impactDetector).GetInstanceID(); float unscaledTime = Time.unscaledTime; if (ImpactInvestigateNextRunTimes.TryGetValue(instanceID, out var value) && unscaledTime < value) { return false; } ImpactInvestigateNextRunTimes[instanceID] = unscaledTime + num; return true; } internal static bool ShouldRunGlobalInvestigate(float radius, bool pathfindOnly) { if (!ThrottleEnemyInvestigateEnabled() || pathfindOnly || radius > 5f) { return true; } float unscaledTime = Time.unscaledTime; if (unscaledTime < _nextGlobalInvestigateTime) { return false; } _nextGlobalInvestigateTime = unscaledTime + 0.2f; return true; } internal static bool ShouldAllowCameraShakeAtPosition(Vector3 position) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0077: Unknown result type (might be due to invalid IL or missing references) if (DisableCameraShakeEnabled()) { return false; } if (DisableUpgradeStandCameraShakeEnabled()) { UpgradeStand[] array = Object.FindObjectsOfType(); foreach (UpgradeStand val in array) { if ((Object)(object)val != (Object)null && Vector3.Distance(((Component)val).transform.position, position) <= 12f) { return false; } } } if (DisableCosmeticMachineCameraShakeEnabled()) { CosmeticShopMachine[] array2 = Object.FindObjectsOfType(); foreach (CosmeticShopMachine val2 in array2) { if ((Object)(object)val2 != (Object)null && Vector3.Distance(((Component)val2).transform.position, position) <= 10f) { return false; } } } return true; } internal static void CompleteSplashScreen() { SemiFunc.SplashScreenCompleted(); if ((Object)(object)SplashScreenUI.instance != (Object)null) { ((Component)SplashScreenUI.instance).gameObject.SetActive(false); } long num = 0L; if ((Object)(object)SteamManager.instance != (Object)null && Traverse.Create((object)SteamManager.instance).Field("lobbyIdToAutoJoin").GetValue() is long num2) { num = num2; } if ((Object)(object)SteamManager.instance != (Object)null && num != 0L) { SteamManager.instance.StartAutoJoiningLobby(); return; } if ((Object)(object)RunManager.instance != (Object)null) { Traverse.Create((object)RunManager.instance).Field("skipLoadingUI").SetValue((object)true); } if ((Object)(object)GameDirector.instance != (Object)null) { GameDirector.instance.OutroStart(); } if ((Object)(object)ResultScreenUI.instance != (Object)null) { ResultScreenUI.instance.Disable(); } if ((Object)(object)NetworkManager.instance != (Object)null) { Traverse.Create((object)NetworkManager.instance).Field("leavePhotonRoom").SetValue((object)true); } } } [HarmonyPatch(typeof(SplashScreen), "StateWait")] internal static class SplashScreenStateWaitPatch { private static bool Prefix(SplashScreen __instance) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 if (!Plugin.DisableSplashScreenEnabled()) { return true; } if ((Object)(object)VideoOverlay.Instance != (Object)null) { VideoOverlay.Instance.Override(0.01f, 0f, 30f); } if ((Object)(object)GameDirector.instance == (Object)null || (int)GameDirector.instance.currentState != 2) { return false; } Plugin.CompleteSplashScreen(); Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } } [HarmonyPatch(typeof(ArmIntroController), "Start")] internal static class ArmIntroControllerStartPatch { private static void Postfix(ArmIntroController __instance) { if (Plugin.DisableArmIntroAnimationEnabled()) { Object.Destroy((Object)(object)((Component)__instance).gameObject); } } } [HarmonyPatch(typeof(LoadingUI), "StartLoading")] internal static class LoadingUIStartLoadingPatch { private static bool Prefix(LoadingUI __instance) { if (!Plugin.DisableLoadingAnimationEnabled()) { return true; } Traverse.Create((object)__instance).Field("levelAnimationStarted").SetValue((object)true); Traverse.Create((object)__instance).Field("levelAnimationCompleted").SetValue((object)true); if ((Object)(object)RunManager.instance != (Object)null) { Traverse.Create((object)RunManager.instance).Field("skipLoadingUI").SetValue((object)true); } ((Component)__instance).gameObject.SetActive(false); return false; } } [HarmonyPatch(typeof(LoadingUI), "LevelAnimationStart")] internal static class LoadingUILevelAnimationStartPatch { private static bool Prefix(LoadingUI __instance) { if (!Plugin.DisableLoadingAnimationEnabled()) { return true; } Traverse.Create((object)__instance).Field("levelAnimationStarted").SetValue((object)true); Traverse.Create((object)__instance).Field("levelAnimationCompleted").SetValue((object)true); ((Component)__instance).gameObject.SetActive(false); if ((Object)(object)PlayerController.instance != (Object)null && (Object)(object)PlayerController.instance.playerAvatarScript != (Object)null) { PlayerController.instance.playerAvatarScript.LoadingLevelAnimationCompleted(); } return false; } } [HarmonyPatch(typeof(LoadingUI), "LateUpdate")] internal static class LoadingUILateUpdatePatch { private static bool Prefix(LoadingUI __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableLoadingAnimationEnabled()) { return true; } if ((Object)(object)__instance.fadeImage != (Object)null) { ((Graphic)__instance.fadeImage).color = Color.clear; } if ((Object)(object)__instance.fadeBehindImage != (Object)null) { ((Component)__instance.fadeBehindImage).gameObject.SetActive(false); } return false; } } [HarmonyPatch(typeof(VideoOverlay), "Update")] internal static class VideoOverlayUpdatePatch { private static bool Prefix(VideoOverlay __instance) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableVideoOverlayEnabled()) { return true; } if ((Object)(object)__instance.RawImage != (Object)null) { ((Graphic)__instance.RawImage).color = new Color(1f, 1f, 1f, 0f); } return false; } } [HarmonyPatch(typeof(CameraShake), "Shake")] internal static class CameraShakeShakePatch { private static bool Prefix() { return !Plugin.DisableCameraShakeEnabled(); } } [HarmonyPatch(typeof(CameraShake), "ShakeDistance")] internal static class CameraShakeShakeDistancePatch { private static bool Prefix(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return Plugin.ShouldAllowCameraShakeAtPosition(position); } } [HarmonyPatch(typeof(CameraBob), "Update")] internal static class CameraBobUpdatePatch { private static void Postfix(CameraBob __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableCameraAnimationEnabled()) { ((Component)__instance).transform.localPosition = Vector3.zero; ((Component)__instance).transform.localRotation = Quaternion.identity; } } } [HarmonyPatch(typeof(CameraJump), "Update")] internal static class CameraJumpUpdatePatch { private static void Postfix(CameraJump __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableCameraAnimationEnabled()) { ((Component)__instance).transform.localPosition = Vector3.zero; ((Component)__instance).transform.localRotation = Quaternion.identity; } } } [HarmonyPatch(typeof(CameraCrouchPosition), "Update")] internal static class CameraCrouchPositionUpdatePatch { private static void Postfix(CameraCrouchPosition __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableCameraAnimationEnabled()) { ((Component)__instance).transform.localPosition = Vector3.zero; } } } [HarmonyPatch(typeof(CameraCrawlPosition), "Update")] internal static class CameraCrawlPositionUpdatePatch { private static void Postfix(CameraCrawlPosition __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableCameraAnimationEnabled()) { ((Component)__instance).transform.localPosition = Vector3.zero; } } } [HarmonyPatch(typeof(CameraCrouchRotation), "Update")] internal static class CameraCrouchRotationUpdatePatch { private static void Postfix(CameraCrouchRotation __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableCameraAnimationEnabled()) { ((Component)__instance).transform.localRotation = Quaternion.identity; } } } [HarmonyPatch(typeof(CameraGlitch), "Update")] internal static class CameraGlitchUpdatePatch { private static bool Prefix(CameraGlitch __instance) { if (!Plugin.DisableCameraGlitchEnabled()) { return true; } if ((Object)(object)__instance.ActiveParent != (Object)null) { __instance.ActiveParent.SetActive(false); } Sound doNotLookEffectSound = __instance.doNotLookEffectSound; if (doNotLookEffectSound != null) { doNotLookEffectSound.PlayLoop(false, 2f, 1f, 1f, 1f); } Traverse.Create((object)__instance).Field("doNotLookEffectTimer").SetValue((object)0f); Traverse.Create((object)__instance).Field("doNotLookEffectImpulseTimer").SetValue((object)0f); return false; } } [HarmonyPatch(typeof(CameraGlitch), "DoNotLookEffectSet")] internal static class CameraGlitchDoNotLookEffectSetPatch { private static bool Prefix() { return !Plugin.DisableCameraGlitchEnabled(); } } [HarmonyPatch(typeof(CameraGlitch), "PlayLong")] internal static class CameraGlitchPlayLongPatch { private static bool Prefix() { return !Plugin.DisableCameraGlitchEnabled(); } } [HarmonyPatch(typeof(CameraGlitch), "PlayShort")] internal static class CameraGlitchPlayShortPatch { private static bool Prefix() { return !Plugin.DisableCameraGlitchEnabled(); } } [HarmonyPatch(typeof(CameraGlitch), "PlayTiny")] internal static class CameraGlitchPlayTinyPatch { private static bool Prefix() { return !Plugin.DisableCameraGlitchEnabled(); } } [HarmonyPatch(typeof(CameraGlitch), "PlayLongHurt")] internal static class CameraGlitchPlayLongHurtPatch { private static bool Prefix() { return !Plugin.DisableCameraGlitchEnabled(); } } [HarmonyPatch(typeof(CameraGlitch), "PlayShortHurt")] internal static class CameraGlitchPlayShortHurtPatch { private static bool Prefix() { return !Plugin.DisableCameraGlitchEnabled(); } } [HarmonyPatch(typeof(CameraGlitch), "PlayLongHeal")] internal static class CameraGlitchPlayLongHealPatch { private static bool Prefix() { return !Plugin.DisableCameraGlitchEnabled(); } } [HarmonyPatch(typeof(CameraGlitch), "PlayShortHeal")] internal static class CameraGlitchPlayShortHealPatch { private static bool Prefix() { return !Plugin.DisableCameraGlitchEnabled(); } } [HarmonyPatch(typeof(CameraGlitch), "PlayUpgrade")] internal static class CameraGlitchPlayUpgradePatch { private static bool Prefix() { return !Plugin.DisableCameraGlitchEnabled(); } } [HarmonyPatch(typeof(PostProcessing), "LensDistortionOverride")] internal static class PostProcessingLensDistortionOverridePatch { private static bool Prefix() { return !Plugin.DisablePostProcessingOverridesEnabled(); } } [HarmonyPatch(typeof(PostProcessing), "VignetteOverride")] internal static class PostProcessingVignetteOverridePatch { private static bool Prefix() { return !Plugin.DisablePostProcessingOverridesEnabled(); } } [HarmonyPatch(typeof(PostProcessing), "BloomOverride")] internal static class PostProcessingBloomOverridePatch { private static bool Prefix() { return !Plugin.DisablePostProcessingOverridesEnabled(); } } [HarmonyPatch(typeof(PostProcessing), "SaturationOverride")] internal static class PostProcessingSaturationOverridePatch { private static bool Prefix() { return !Plugin.DisablePostProcessingOverridesEnabled(); } } [HarmonyPatch(typeof(PostProcessing), "ContrastOverride")] internal static class PostProcessingContrastOverridePatch { private static bool Prefix() { return !Plugin.DisablePostProcessingOverridesEnabled(); } } [HarmonyPatch(typeof(PostProcessing), "ResolutionOverride")] internal static class PostProcessingResolutionOverridePatch { private static bool Prefix() { return !Plugin.DisablePostProcessingOverridesEnabled(); } } [HarmonyPatch(typeof(PostProcessing), "GrainIntensityOverride")] internal static class PostProcessingGrainIntensityOverridePatch { private static bool Prefix() { return !Plugin.DisablePostProcessingOverridesEnabled(); } } [HarmonyPatch(typeof(HurtVignette), "Update")] internal static class HurtVignetteUpdatePatch { private static bool Prefix(HurtVignette __instance) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableHurtVignetteEnabled()) { return true; } if ((Object)(object)__instance.image != (Object)null) { ((Graphic)__instance.image).color = __instance.inactiveColor; } if ((Object)(object)__instance.rectTransform != (Object)null) { ((Transform)__instance.rectTransform).localScale = Vector3.one * __instance.inactiveScale; } return false; } } [HarmonyPatch(typeof(PlayerAvatarRightArm), "Update")] internal static class PlayerAvatarRightArmUpdatePatch { private static void Postfix(PlayerAvatarRightArm __instance) { //IL_001d: 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_004b: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableFirstPersonArmAnimationsEnabled()) { if ((Object)(object)__instance.rightArmTransform != (Object)null) { __instance.rightArmTransform.localEulerAngles = __instance.basePose; } if ((Object)(object)__instance.rightArmParentTransform != (Object)null) { __instance.rightArmParentTransform.localRotation = Quaternion.identity; __instance.rightArmParentTransform.localScale = Vector3.one; } } } } [HarmonyPatch(typeof(PlayerAvatarLeftArm), "Update")] internal static class PlayerAvatarLeftArmUpdatePatch { private static void Postfix(PlayerAvatarLeftArm __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableFirstPersonArmAnimationsEnabled() && (Object)(object)__instance.leftArmTransform != (Object)null) { __instance.leftArmTransform.localEulerAngles = __instance.basePose; } } } [HarmonyPatch(typeof(PlayerArmBackaway), "Update")] internal static class PlayerArmBackawayUpdatePatch { private static void Postfix(PlayerArmBackaway __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableFirstPersonArmAnimationsEnabled()) { ((Component)__instance).transform.localPosition = Vector3.zero; } } } [HarmonyPatch(typeof(ItemGun), "MuzzleFlash")] internal static class ItemGunMuzzleFlashPatch { private static bool Prefix() { return !Plugin.DisableGunMuzzleEffectsEnabled(); } } [HarmonyPatch(typeof(ItemGunMuzzleFlash), "ActivateAllEffects")] internal static class ItemGunMuzzleFlashActivateAllEffectsPatch { private static void Postfix(ItemGunMuzzleFlash __instance) { if (!Plugin.DisableGunSmokeEffectsEnabled()) { return; } Transform val = ((Component)__instance).transform.Find("Particle Smoke"); if (!((Object)(object)val == (Object)null)) { ParticleSystem component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.Stop(true, (ParticleSystemStopBehavior)0); ((Component)component).gameObject.SetActive(false); } } } } [HarmonyPatch(typeof(ItemGun), "StartTriggerAnimation")] internal static class ItemGunStartTriggerAnimationPatch { private static bool Prefix() { return !Plugin.DisableGunTriggerAnimationEnabled(); } } [HarmonyPatch(typeof(ItemGunBullet), "ActivateAll")] internal static class ItemGunBulletActivateAllPatch { private static void Postfix(ItemGunBullet __instance) { if (!Plugin.DisableGunSmokeEffectsEnabled()) { return; } Transform val = ((Component)__instance).transform.Find("Hit Effect"); if ((Object)(object)val == (Object)null) { return; } Transform val2 = val.Find("Particle Smoke"); if (!((Object)(object)val2 == (Object)null)) { ParticleSystem component = ((Component)val2).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.Stop(true, (ParticleSystemStopBehavior)0); ((Component)component).gameObject.SetActive(false); } } } } [HarmonyPatch(typeof(ItemGun), "ShootRPC")] internal static class ItemGunShootRpcPatch { private struct GunShootState { internal float GunRecoilForce; internal float CameraShakeMultiplier; } private static void Prefix(ItemGun __instance, ref GunShootState __state) { __state = new GunShootState { GunRecoilForce = __instance.gunRecoilForce, CameraShakeMultiplier = __instance.cameraShakeMultiplier }; if (Plugin.DisableGunRecoilEnabled()) { __instance.gunRecoilForce = 0f; } if (Plugin.DisableGunFireShakeEnabled()) { __instance.cameraShakeMultiplier = 0f; } } private static void Postfix(ItemGun __instance, GunShootState __state) { __instance.gunRecoilForce = __state.GunRecoilForce; __instance.cameraShakeMultiplier = __state.CameraShakeMultiplier; } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Start")] internal static class PhysGrabObjectImpactDetectorStartPatch { private static void Postfix(PhysGrabObjectImpactDetector __instance) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown if (Plugin.DisablePhysImpactVisualEffectsEnabled()) { if ((Object)(object)__instance.particles != (Object)null) { ((Component)__instance.particles).gameObject.SetActive(false); } __instance.onImpactLight = new UnityEvent(); __instance.onBreakLight = new UnityEvent(); } } } [HarmonyPatch(typeof(PhysObjectParticles), "ImpactSmoke")] internal static class PhysObjectParticlesImpactSmokePatch { private static bool Prefix() { return !Plugin.DisablePhysImpactVisualEffectsEnabled(); } } [HarmonyPatch(typeof(PhysObjectParticles), "DestroyParticles", new Type[] { typeof(Vector3), typeof(Vector3), typeof(bool) })] internal static class PhysObjectParticlesDestroyParticlesPatch { private static bool Prefix() { return !Plugin.DisablePhysImpactVisualEffectsEnabled(); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "ImpactEffectRPC")] internal static class PhysGrabObjectImpactDetectorImpactEffectRpcPatch { private static bool Prefix() { return !Plugin.DisablePhysImpactVisualEffectsEnabled(); } } [HarmonyPatch(typeof(ValuableObject), "UpdateExtractionTracking")] internal static class ValuableObjectUpdateExtractionTrackingPatch { private static bool Prefix(ValuableObject __instance) { return Plugin.ShouldRunValuableTracking(__instance); } } [HarmonyPatch(typeof(Map), "AddValuable")] internal static class MapAddValuablePatch { private static bool Prefix() { return Plugin.EnableValuableMapMarkersEnabled(); } } [HarmonyPatch(typeof(MenuManager), "PagePopUpTwoOptions")] internal static class MenuManagerPagePopUpTwoOptionsPatch { private static readonly FieldRef ConnectRandomRef = AccessTools.FieldRefAccess("connectRandom"); private static readonly FieldRef CurrentMenuPageIndexRef = AccessTools.FieldRefAccess("currentMenuPageIndex"); private static bool Prefix(MenuButtonPopUp menuButtonPopUp, string popUpHeader, Color popUpHeaderColor, string popUpText, string option1Text, string option2Text, bool richText) { if ((Object)(object)menuButtonPopUp == (Object)null) { return true; } string arg = (((Object)(object)MenuManager.instance != (Object)null) ? ((object)(MenuPageIndex)(ref CurrentMenuPageIndexRef.Invoke(MenuManager.instance))).ToString() : "Unknown"); string arg2 = (((Object)(object)GameManager.instance != (Object)null) ? ConnectRandomRef.Invoke(GameManager.instance).ToString() : "Unknown"); Plugin.LogPopupEvent("Seen", menuButtonPopUp, $"currentPage={arg}, multiplayer={SemiFunc.MainMenuIsMultiplayer()}, connectRandom={arg2}"); string header = (popUpHeader ?? string.Empty).ToLowerInvariant(); string body = (popUpText ?? string.Empty).ToLowerInvariant(); if (Plugin.SkipPublicGameJoinConfirmEnabled()) { MenuElementServer component = ((Component)menuButtonPopUp).GetComponent(); if ((Object)(object)component != (Object)null) { Plugin.LogPopupEvent("AutoSkipPublic", menuButtonPopUp, "source=MenuElementServer"); component.OnButton(); return false; } if (IsPublicGamePopup(header, body)) { Plugin.LogPopupEvent("AutoSkipPublic", menuButtonPopUp, "reason=public_popup_text_rule"); UnityEvent option1Event = menuButtonPopUp.option1Event; if (option1Event != null) { option1Event.Invoke(); } return false; } } if (Plugin.SkipPrivateGameConfirmEnabled() && IsPrivateGamePopup(header, body)) { Plugin.LogPopupEvent("AutoSkipPrivate", menuButtonPopUp, "reason=private_popup_text_rule"); UnityEvent option1Event2 = menuButtonPopUp.option1Event; if (option1Event2 != null) { option1Event2.Invoke(); } return false; } return true; } private static bool IsPrivateGamePopup(string header, string body) { if (!header.Contains("host") && !body.Contains("best computer")) { return body.Contains("are you this friend"); } return true; } private static bool IsPublicGamePopup(string header, string body) { if (!header.Contains("warning") && !body.Contains("random players")) { return body.Contains("mean people"); } return true; } } [HarmonyPatch(typeof(MenuPageEsc), "ButtonEventQuitToMenu")] internal static class MenuPageEscQuitToMenuPatch { private static void Prefix() { if (Plugin.DisableLoadingAnimationEnabled() && !((Object)(object)RunManager.instance == (Object)null)) { Traverse.Create((object)RunManager.instance).Field("skipLoadingUI").SetValue((object)true); } } } [HarmonyPatch(typeof(MenuPageLobby), "ButtonLeave")] internal static class MenuPageLobbyButtonLeavePatch { private static void Prefix() { if (Plugin.DisableLoadingAnimationEnabled() && !((Object)(object)RunManager.instance == (Object)null)) { Traverse.Create((object)RunManager.instance).Field("skipLoadingUI").SetValue((object)true); } } } [HarmonyPatch(typeof(RunManager), "LeaveToMainMenu")] internal static class RunManagerLeaveToMainMenuPatch { private static void Prefix() { if (Plugin.DisableLoadingAnimationEnabled() && !((Object)(object)RunManager.instance == (Object)null)) { Traverse.Create((object)RunManager.instance).Field("skipLoadingUI").SetValue((object)true); } } } [HarmonyPatch(typeof(MenuPage), "StateOpening")] internal static class MenuPageStateOpeningPatch { private static readonly FieldRef OriginalPositionRef = AccessTools.FieldRefAccess("originalPosition"); private static readonly FieldRef PopUpAnimationRef = AccessTools.FieldRefAccess("popUpAnimation"); private static readonly FieldRef RectTransformRef = AccessTools.FieldRefAccess("rectTransform"); private static bool Prefix(MenuPage __instance) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) bool num = (PopUpAnimationRef.Invoke(__instance) ? Plugin.DisablePopupAnimationsEnabled() : Plugin.DisableLobbyPageAnimationsEnabled()); RectTransform val = RectTransformRef.Invoke(__instance); if (!num || (Object)(object)val == (Object)null) { return true; } ((Transform)val).localPosition = Vector2.op_Implicit(OriginalPositionRef.Invoke(__instance)); __instance.PageStateSet((PageState)1); return false; } } [HarmonyPatch(typeof(MenuPage), "StateClosing")] internal static class MenuPageStateClosingPatch { private static readonly FieldRef CurrentMenuPageRef = AccessTools.FieldRefAccess("currentMenuPage"); private static readonly FieldRef PopUpAnimationRef = AccessTools.FieldRefAccess("popUpAnimation"); private static bool Prefix(MenuPage __instance) { if (!(PopUpAnimationRef.Invoke(__instance) ? Plugin.DisablePopupAnimationsEnabled() : Plugin.DisableLobbyPageAnimationsEnabled())) { return true; } if ((Object)(object)MenuManager.instance != (Object)null && (Object)(object)CurrentMenuPageRef.Invoke(MenuManager.instance) == (Object)(object)__instance) { CurrentMenuPageRef.Invoke(MenuManager.instance) = null; } UnityEvent onPageEnd = __instance.onPageEnd; if (onPageEnd != null) { onPageEnd.Invoke(); } MenuManager instance = MenuManager.instance; if (instance != null) { instance.PageRemove(__instance); } Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } } [HarmonyPatch(typeof(MenuElementServer), "UpdateIntro")] internal static class MenuElementServerUpdateIntroPatch { private static readonly FieldRef IntroDoneRef = AccessTools.FieldRefAccess("introDone"); private static bool Prefix(MenuElementServer __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableServerListEntryAnimationsEnabled()) { return true; } if ((Object)(object)__instance.animationTransform != (Object)null) { __instance.animationTransform.anchoredPosition = Vector2.zero; } IntroDoneRef.Invoke(__instance) = true; return false; } } [HarmonyPatch(typeof(MenuElementRegion), "UpdateIntro")] internal static class MenuElementRegionUpdateIntroPatch { private static readonly FieldRef IntroLerpRef = AccessTools.FieldRefAccess("introLerp"); private static bool Prefix(MenuElementRegion __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableRegionListEntryAnimationsEnabled()) { return true; } if ((Object)(object)__instance.animationTransform != (Object)null) { __instance.animationTransform.anchoredPosition = Vector2.zero; } IntroLerpRef.Invoke(__instance) = 1f; __instance.animationSkip = true; return false; } } [HarmonyPatch(typeof(MenuLoadingGraphics), "Update")] internal static class MenuLoadingGraphicsUpdatePatch { private static bool Prefix(MenuLoadingGraphics __instance) { //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableMenuLoadingGraphicsAnimationsEnabled()) { return true; } Component value = Traverse.Create((object)__instance).Field("loadingCanvasGroup").GetValue(); if ((Object)(object)value == (Object)null) { return true; } if (!Traverse.Create((object)__instance).Field("loadingActive").GetValue()) { return false; } if (Traverse.Create((object)__instance).Field("loadingDone").GetValue()) { float num = Traverse.Create((object)value).Property("alpha", (object[])null).GetValue() - Time.deltaTime * 5f; Traverse.Create((object)value).Property("alpha", (object[])null).SetValue((object)num); if (num <= 0.01f) { Traverse.Create((object)value).Property("alpha", (object[])null).SetValue((object)0f); value.gameObject.SetActive(false); Traverse.Create((object)__instance).Field("loadingActive").SetValue((object)false); } } else { float value2 = Traverse.Create((object)value).Property("alpha", (object[])null).GetValue(); Traverse.Create((object)value).Property("alpha", (object[])null).SetValue((object)Mathf.Clamp01(value2 + Time.deltaTime * 5f)); } if ((Object)(object)__instance.loadingCircle != (Object)null) { ((Transform)__instance.loadingCircle).localEulerAngles = Vector3.zero; } if ((Object)(object)__instance.loadingHourglass != (Object)null) { ((Transform)__instance.loadingHourglass).localEulerAngles = Vector3.zero; } Traverse.Create((object)__instance).Field("hourglassLerp").SetValue((object)0f); return false; } } [HarmonyPatch(typeof(MenuButton), "OnHovering")] internal static class MenuButtonOnHoveringPatch { private static readonly FieldRef ButtonTextSelectedOriginalPosRef = AccessTools.FieldRefAccess("buttonTextSelectedOriginalPos"); private static void Postfix(MenuButton __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableMenuButtonMotionEnabled() && !((Object)(object)__instance == (Object)null)) { Component value = Traverse.Create((object)__instance).Field("buttonText").GetValue(); if (!((Object)(object)value == (Object)null)) { value.transform.localPosition = ButtonTextSelectedOriginalPosRef.Invoke(__instance); } } } } [HarmonyPatch(typeof(MapToolController), "Update")] internal static class MapToolControllerUpdatePatch { private static readonly FieldRef ActiveRef = AccessTools.FieldRefAccess("Active"); private static readonly FieldRef HideLerpRef = AccessTools.FieldRefAccess("HideLerp"); private static readonly FieldRef PhotonViewRef = AccessTools.FieldRefAccess("photonView"); private static void Postfix(MapToolController __instance) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableMapOpenAnimationEnabled() || (Object)(object)__instance == (Object)null) { return; } PhotonView val = PhotonViewRef.Invoke(__instance); int num; float num2; if (GameManager.Multiplayer()) { if ((Object)(object)val != (Object)null) { num = (val.IsMine ? 1 : 0); if (num != 0) { goto IL_0044; } } else { num = 0; } num2 = 0f; goto IL_0049; } num = 1; goto IL_0044; IL_0049: float num3 = num2; Vector3 localScale = Vector3.one; bool flag = ActiveRef.Invoke(__instance); if (num == 0 && (Object)(object)__instance.FollowTransformClient != (Object)null) { localScale = __instance.FollowTransformClient.localScale; } HideLerpRef.Invoke(__instance) = (flag ? 0f : 1f); if (flag) { ((Component)__instance).transform.parent.localScale = localScale; if ((Object)(object)__instance.LocalShadowsParent != (Object)null) { __instance.LocalShadowsParent.transform.localScale = localScale; } if ((Object)(object)__instance.HideTransform != (Object)null) { __instance.HideTransform.localRotation = Quaternion.identity; } } else { ((Component)__instance).transform.parent.localScale = Vector3.zero; if ((Object)(object)__instance.LocalShadowsParent != (Object)null) { __instance.LocalShadowsParent.transform.localScale = Vector3.zero; } if ((Object)(object)__instance.HideTransform != (Object)null) { __instance.HideTransform.localRotation = Quaternion.Euler(num3, 0f, 0f); } } return; IL_0044: num2 = 90f; goto IL_0049; } } [HarmonyPatch(typeof(ValuableDiscover), "New")] internal static class ValuableDiscoverNewPatch { private static bool Prefix() { return Plugin.EnableValuableDiscoverPromptsEnabled(); } } [HarmonyPatch(typeof(ValuableFlashlight), "Update")] internal static class ValuableFlashlightUpdatePatch { private static void Postfix(ValuableFlashlight __instance) { if (!Plugin.EnableValuableDynamicEffectsEnabled() && (Object)(object)__instance.bigLight != (Object)null) { __instance.bigLight.SetActive(false); } } } [HarmonyPatch(typeof(ValuableStarWand), "SparklesVFX")] internal static class ValuableStarWandSparklesVfxPatch { private static bool Prefix(ValuableStarWand __instance) { if (Plugin.EnableValuableDynamicEffectsEnabled()) { return true; } if ((Object)(object)__instance.particle != (Object)null && __instance.particle.isPlaying) { __instance.particle.Stop(true); } return false; } } [HarmonyPatch(typeof(ValuableWizardTimeGlass), "Update")] internal static class ValuableWizardTimeGlassUpdatePatch { private static void Postfix(ValuableWizardTimeGlass __instance) { if (!Plugin.EnableValuableDynamicEffectsEnabled()) { Sound soundTimeGlassLoop = __instance.soundTimeGlassLoop; if (soundTimeGlassLoop != null) { soundTimeGlassLoop.PlayLoop(false, 0.8f, 0.8f, 1f, 1f); } if ((Object)(object)__instance.particleSystemGlitter != (Object)null && __instance.particleSystemGlitter.isPlaying) { __instance.particleSystemGlitter.Stop(true); } if ((Object)(object)__instance.particleSystemSwirl != (Object)null && __instance.particleSystemSwirl.isPlaying) { __instance.particleSystemSwirl.Stop(true); } if ((Object)(object)__instance.timeGlassLight != (Object)null) { __instance.timeGlassLight.intensity = 0f; ((Component)__instance.timeGlassLight).gameObject.SetActive(false); } } } } [HarmonyPatch(typeof(ValuableLovePotion), "Update")] internal static class ValuableLovePotionUpdatePatch { private static void Postfix(ValuableLovePotion __instance) { if (!Plugin.EnableValuableDynamicEffectsEnabled()) { ParticleSystem componentInChildren = ((Component)__instance).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.isPlaying) { componentInChildren.Stop(true); } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "EnemyInvestigate")] internal static class PhysGrabObjectImpactDetectorEnemyInvestigatePatch { private static bool Prefix(PhysGrabObjectImpactDetector __instance, float radius) { return Plugin.ShouldRunImpactInvestigate(__instance, radius); } } [HarmonyPatch(typeof(EnemyDirector), "SetInvestigate")] internal static class EnemyDirectorSetInvestigatePatch { private static bool Prefix(float radius, bool pathfindOnly = false) { return Plugin.ShouldRunGlobalInvestigate(radius, pathfindOnly); } } [HarmonyPatch(typeof(PlayerDeathEffects), "Trigger")] internal static class PlayerDeathEffectsTriggerPatch { private static bool Prefix(PlayerDeathEffects __instance) { if (!Plugin.DisableDeathAndReviveEffectsEnabled()) { return true; } ((Component)__instance).gameObject.SetActive(false); return false; } } [HarmonyPatch(typeof(ReviveScreenEffect), "Active")] internal static class ReviveScreenEffectActivePatch { private static bool Prefix(ReviveScreenEffect __instance) { if (!Plugin.DisableDeathAndReviveEffectsEnabled()) { return true; } Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } } [HarmonyPatch(typeof(ScreenSpiderEffect), "Update")] internal static class ScreenSpiderEffectUpdatePatch { private static bool Prefix(ScreenSpiderEffect __instance) { if (!Plugin.DisableSpiderScreenEffectsEnabled()) { return true; } Sound spiderLoop = __instance.spiderLoop; if (spiderLoop != null) { spiderLoop.PlayLoop(false, 10f, 1f, 1f, 1f); } Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "PowerupJumpEffect")] internal static class PlayerAvatarVisualsPowerupJumpEffectPatch { private static bool Prefix() { return !Plugin.DisableTumbleVisualEffectsEnabled(); } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "TumbleBreakFreeEffect")] internal static class PlayerAvatarVisualsTumbleBreakFreeEffectPatch { private static bool Prefix() { return !Plugin.DisableTumbleVisualEffectsEnabled(); } } [HarmonyPatch(typeof(PlayerTumble), "TumbleImpactRPC")] internal static class PlayerTumbleImpactRpcPatch { private static void Postfix(PlayerTumble __instance) { if (Plugin.DisableTumbleVisualEffectsEnabled() && (Object)(object)__instance.impactParticle != (Object)null) { __instance.impactParticle.Stop(true, (ParticleSystemStopBehavior)0); ((Component)__instance.impactParticle).gameObject.SetActive(false); } } } [HarmonyPatch(typeof(WorldSpaceUIParent), "Update")] internal static class WorldSpaceUIParentUpdatePatch { private static readonly FieldRef HideTimerRef = AccessTools.FieldRefAccess("hideTimer"); private static void Postfix(WorldSpaceUIParent __instance) { if (Plugin.DisableWorldSpaceUiAnimationsEnabled() && !((Object)(object)__instance == (Object)null)) { Component value = Traverse.Create((object)__instance).Field("canvasGroup").GetValue(); if (!((Object)(object)value == (Object)null)) { float num = ((HideTimerRef.Invoke(__instance) > 0f) ? 0f : 1f); Traverse.Create((object)__instance).Field("hideAlpha").SetValue((object)num); Traverse.Create((object)value).Property("alpha", (object[])null).SetValue((object)num); } } } } [HarmonyPatch(typeof(WorldSpaceUIValue), "Update")] internal static class WorldSpaceUIValueUpdatePatch { private static readonly FieldRef ShowTimerRef = AccessTools.FieldRefAccess("showTimer"); private static readonly FieldRef ScaleRef = AccessTools.FieldRefAccess("scale"); private static readonly FieldRef CurveLerpRef = AccessTools.FieldRefAccess("curveLerp"); private static readonly FieldRef CurrentPhysGrabObjectRef = AccessTools.FieldRefAccess("currentPhysGrabObject"); private static readonly FieldRef CurrentStaticGrabObjectRef = AccessTools.FieldRefAccess("currentStaticGrabObject"); private static void Postfix(WorldSpaceUIValue __instance) { //IL_0068: 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) if (Plugin.DisableWorldSpaceUiAnimationsEnabled() && !((Object)(object)__instance == (Object)null)) { if (ShowTimerRef.Invoke(__instance) > 0f) { CurveLerpRef.Invoke(__instance) = 1f; ((Component)__instance).transform.localScale = ScaleRef.Invoke(__instance); return; } CurveLerpRef.Invoke(__instance) = 0f; ((Component)__instance).transform.localScale = Vector3.zero; CurrentPhysGrabObjectRef.Invoke(__instance) = null; CurrentStaticGrabObjectRef.Invoke(__instance) = null; } } } [HarmonyPatch(typeof(WorldSpaceUIValueLost), "Update")] internal static class WorldSpaceUIValueLostUpdatePatch { private static readonly FieldRef TimerRef = AccessTools.FieldRefAccess("timer"); private static readonly FieldRef ScaleRef = AccessTools.FieldRefAccess("scale"); private static void Postfix(WorldSpaceUIValueLost __instance) { //IL_0021: 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) if (Plugin.DisableWorldSpaceUiAnimationsEnabled() && !((Object)(object)__instance == (Object)null)) { Traverse.Create((object)__instance).Field("positionOffset").SetValue((object)Vector3.zero); if (TimerRef.Invoke(__instance) > 0f) { ((Component)__instance).transform.localScale = ScaleRef.Invoke(__instance); return; } (((Object)(object)WorldSpaceUIParent.instance == (Object)null) ? null : Traverse.Create((object)WorldSpaceUIParent.instance).Field("valueLostList").GetValue>())?.Remove(__instance); Object.Destroy((Object)(object)((Component)__instance).gameObject); } } } [HarmonyPatch(typeof(WorldSpaceUITTS), "Update")] internal static class WorldSpaceUITTSUpdatePatch { private static readonly FieldRef FollowTransformRef = AccessTools.FieldRefAccess("followTransform"); private static readonly FieldRef FollowPositionRef = AccessTools.FieldRefAccess("followPosition"); private static readonly FieldRef OffsetPositionRef = AccessTools.FieldRefAccess("offsetPosition"); private static readonly FieldRef TextAlphaTargetRef = AccessTools.FieldRefAccess("textAlphaTarget"); private static readonly FieldRef TextAlphaRef = AccessTools.FieldRefAccess("textAlpha"); private static readonly FieldRef CurveLerpRef = AccessTools.FieldRefAccess("curveLerp"); private static void Postfix(WorldSpaceUITTS __instance) { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableWorldSpaceUiAnimationsEnabled() || (Object)(object)__instance == (Object)null) { return; } Component value = Traverse.Create((object)__instance).Field("text").GetValue(); if (!((Object)(object)value == (Object)null)) { Transform val = FollowTransformRef.Invoke(__instance); if ((Object)(object)val != (Object)null) { Vector3 val2 = val.position + OffsetPositionRef.Invoke(__instance); FollowPositionRef.Invoke(__instance) = val2; Traverse.Create((object)__instance).Field("worldPosition").SetValue((object)val2); } CurveLerpRef.Invoke(__instance) = 1f; TextAlphaRef.Invoke(__instance) = TextAlphaTargetRef.Invoke(__instance); Traverse.Create((object)value).Property("color", (object[])null).SetValue((object)new Color(1f, 1f, 1f, TextAlphaRef.Invoke(__instance))); } } } [HarmonyPatch(typeof(WorldSpaceUIPlayerName), "Update")] internal static class WorldSpaceUIPlayerNameUpdatePatch { private static readonly FieldRef PlayerAvatarRef = AccessTools.FieldRefAccess("playerAvatar"); private static readonly FieldRef ShowTimerRef = AccessTools.FieldRefAccess("showTimer"); private static readonly FieldRef FollowTargetRef = AccessTools.FieldRefAccess("followTarget"); private static readonly FieldRef FollowTargetYRef = AccessTools.FieldRefAccess("followTargetY"); private static void Postfix(WorldSpaceUIPlayerName __instance) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) //IL_00b6: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableWorldSpaceUiAnimationsEnabled() || (Object)(object)__instance == (Object)null) { return; } PlayerAvatar val = PlayerAvatarRef.Invoke(__instance); Component value = Traverse.Create((object)__instance).Field("text").GetValue(); if (!((Object)(object)val == (Object)null) && !((Object)(object)value == (Object)null)) { Vector3 position = val.playerAvatarVisuals.headLookAtTransform.position; position.y = ((Component)val.playerAvatarVisuals).transform.position.y; if ((Object)(object)val == (Object)(object)SessionManager.instance.CrownedPlayerGet()) { position.y += 0.02f; } float num = val.playerAvatarVisuals.headLookAtTransform.position.y - ((Component)val.playerAvatarVisuals).transform.position.y + 0.35f; FollowTargetRef.Invoke(__instance) = position; FollowTargetYRef.Invoke(__instance) = num; Traverse.Create((object)__instance).Field("worldPosition").SetValue((object)(position + Vector3.up * num)); bool value2 = Traverse.Create((object)val).Field("isDisabled").GetValue(); bool flag = !Object.op_Implicit((Object)(object)SpectateCamera.instance) && !value2 && ShowTimerRef.Invoke(__instance) > 0f; Traverse.Create((object)value).Property("color", (object[])null).SetValue((object)new Color(1f, 1f, 1f, flag ? 0.5f : 0f)); } } } [HarmonyPatch(typeof(UpgradeStand), "Update")] internal static class UpgradeStandUpdatePatch { private static void Postfix(UpgradeStand __instance) { //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: 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) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return; } if (Plugin.DisableUpgradeStandEffectsEnabled()) { ParticleSystem hatchParticles = __instance.hatchParticles; if (hatchParticles != null) { hatchParticles.Stop(true); } ParticleSystem rollingParticles = __instance.rollingParticles; if (rollingParticles != null) { rollingParticles.Stop(true); } ParticleSystem buildUpParticles = __instance.buildUpParticles; if (buildUpParticles != null) { buildUpParticles.Stop(true); } Sound soundBuildUpLoop = __instance.soundBuildUpLoop; if (soundBuildUpLoop != null) { soundBuildUpLoop.Stop(); } if ((Object)(object)__instance.buildUpLight != (Object)null) { __instance.buildUpLight.intensity = 0f; ((Component)__instance.buildUpLight).gameObject.SetActive(false); } } if (Plugin.DisableUpgradeStandBrokenFireEffectsEnabled()) { ParticleSystem particleButtonBreak = __instance.particleButtonBreak; if (particleButtonBreak != null) { particleButtonBreak.Stop(true); } ParticleSystem particleFireLoop = __instance.particleFireLoop; if (particleFireLoop != null) { particleFireLoop.Stop(true); } Sound soundLilButtonFire = __instance.soundLilButtonFire; if (soundLilButtonFire != null) { soundLilButtonFire.Stop(); } if ((Object)(object)__instance.fireLight != (Object)null) { __instance.fireLight.intensity = 0f; ((Component)__instance.fireLight).gameObject.SetActive(false); } } if (Plugin.DisableUpgradeStandAnimationsEnabled()) { string text = ((object)(State)(ref __instance.currentState)).ToString(); Vector3 value = Traverse.Create((object)__instance).Field("hatchOriginalPosition").GetValue(); Vector3 value2 = Traverse.Create((object)__instance).Field("hatchOriginalScale").GetValue(); Quaternion value3 = Traverse.Create((object)__instance).Field("compartmentOriginalRotation").GetValue(); Vector3 value4 = Traverse.Create((object)__instance).Field("allMeshesOriginalPosition").GetValue(); Quaternion value5 = Traverse.Create((object)__instance).Field("allMeshesOriginalRotation").GetValue(); int num; switch (text) { default: num = ((text == "RerollRollEnd") ? 1 : 0); break; case "RerollCloseHatch": case "RerollRollStart": case "RerollRolling": num = 1; break; } bool flag = (byte)num != 0; if ((Object)(object)__instance.hatch != (Object)null) { __instance.hatch.localPosition = (Vector3)(flag ? new Vector3(value.x, -0.146f, value.z) : value); __instance.hatch.localScale = (flag ? new Vector3(value2.x, 1f, value2.z) : new Vector3(value2.x, 0.655f, value2.z)); } if ((Object)(object)__instance.upgradeCompartment != (Object)null) { __instance.upgradeCompartment.localRotation = value3; } if ((Object)(object)__instance.allMeshesTransform != (Object)null) { __instance.allMeshesTransform.localPosition = value4; __instance.allMeshesTransform.localRotation = value5; } } } } [HarmonyPatch(typeof(CosmeticShopMachineAnimator), "GrabBeamLogic")] internal static class CosmeticShopMachineAnimatorGrabBeamLogicPatch { private static bool Prefix(CosmeticShopMachineAnimator __instance) { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableCosmeticMachineGrabBeamEffectsEnabled() || (Object)(object)__instance == (Object)null) { return true; } List value = Traverse.Create((object)__instance).Field("grabBeamRenderers").GetValue>(); List value2 = Traverse.Create((object)__instance).Field("grabOrbTransforms").GetValue>(); List value3 = Traverse.Create((object)__instance).Field("grabOrbParticles").GetValue>(); if (value != null) { foreach (LineRenderer item in value) { if ((Object)(object)item != (Object)null) { ((Renderer)item).enabled = false; item.widthMultiplier = 0f; } } } if (value2 != null) { foreach (Transform item2 in value2) { if ((Object)(object)item2 != (Object)null) { item2.localScale = Vector3.zero; ((Component)item2).gameObject.SetActive(false); } } } if (value3 != null) { foreach (ParticleSystem item3 in value3) { if (item3 != null) { item3.Stop(true); } } } Traverse.Create((object)__instance).Field("grabBeamActive").SetValue((object)false); Traverse.Create((object)__instance).Field("grabBeamScaleLerp").SetValue((object)0f); return false; } } [HarmonyPatch(typeof(CosmeticShopMachineAnimator), "TokenParticlesStart")] internal static class CosmeticShopMachineAnimatorTokenParticlesStartPatch { private static bool Prefix(CosmeticShopMachineAnimator __instance) { if (!Plugin.DisableCosmeticMachineGrabBeamEffectsEnabled()) { return true; } ParticleSystem tokenParticleSparkles = __instance.tokenParticleSparkles; if (tokenParticleSparkles != null) { tokenParticleSparkles.Stop(true); } return false; } } [HarmonyPatch(typeof(CosmeticShopMachineAnimator), "ArrowLogic")] internal static class CosmeticShopMachineAnimatorArrowLogicPatch { private static bool Prefix(CosmeticShopMachineAnimator __instance) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableCosmeticMachineLoopEffectsEnabled() || (Object)(object)__instance == (Object)null) { return true; } Material value = Traverse.Create((object)__instance).Field("arrowMaterial").GetValue(); int value2 = Traverse.Create((object)__instance).Field("shaderEmissionColor").GetValue(); if ((Object)(object)value != (Object)null) { value.SetColor(value2, Color.black); } Traverse.Create((object)__instance).Field("arrowEmissionLerp").SetValue((object)1f); return false; } } [HarmonyPatch(typeof(CosmeticShopMachineAnimator), "PlateLogic")] internal static class CosmeticShopMachineAnimatorPlateLogicPatch { private static bool Prefix(CosmeticShopMachineAnimator __instance) { if (!Plugin.DisableCosmeticMachineLoopEffectsEnabled() || (Object)(object)__instance == (Object)null) { return true; } List value = Traverse.Create((object)__instance).Field("plateLights").GetValue>(); if (value != null) { foreach (Light item in value) { if ((Object)(object)item != (Object)null) { item.intensity = 0f; } } } Traverse.Create((object)__instance).Field("plateEmissionLerp").SetValue((object)0f); Traverse.Create((object)__instance).Field("plateLightLerp").SetValue((object)0f); return false; } } [HarmonyPatch(typeof(CosmeticShopMachineAnimator), "AudioLogic")] internal static class CosmeticShopMachineAnimatorAudioLogicPatch { private static bool Prefix(CosmeticShopMachineAnimator __instance) { if (!Plugin.DisableCosmeticMachineLoopEffectsEnabled() || (Object)(object)__instance == (Object)null) { return true; } object value = Traverse.Create((object)__instance).Field("soundBaseIdleLoop").GetValue(); object value2 = Traverse.Create((object)__instance).Field("soundBaseShakeLoop").GetValue(); Traverse.Create(value).Method("Stop", Array.Empty()).GetValue(); Traverse.Create(value2).Method("Stop", Array.Empty()).GetValue(); return false; } } [HarmonyPatch(typeof(CosmeticShopMachine), "ScreenSpinLogic")] internal static class CosmeticShopMachineScreenSpinLogicPatch { private static bool Prefix(CosmeticShopMachine __instance) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableCosmeticMachineScreenAnimationsEnabled() || (Object)(object)__instance == (Object)null) { return true; } Traverse.Create((object)__instance).Field("screenSpinningFast").SetValue((object)false); if ((Object)(object)__instance.screenSpinTransform != (Object)null) { __instance.screenSpinTransform.localRotation = Quaternion.identity; } if ((Object)(object)__instance.screenSpinSettleTransform != (Object)null) { __instance.screenSpinSettleTransform.localRotation = Quaternion.identity; } Traverse.Create((object)__instance).Field("screenSpinStopped").SetValue((object)true); Traverse.Create((object)__instance).Field("screenSpinStarted").SetValue((object)false); Traverse.Create((object)__instance).Field("screenSpinSpeed").SetValue((object)0f); Traverse.Create((object)__instance).Field("screenSpinSettleLerp").SetValue((object)1f); return false; } } [HarmonyPatch(typeof(CosmeticShopMachine), "ScreenBaseIconAnimation")] internal static class CosmeticShopMachineScreenBaseIconAnimationPatch { private static bool Prefix(CosmeticShopMachine __instance) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableCosmeticMachineScreenAnimationsEnabled() || (Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)__instance.screenBaseIconTransform != (Object)null) { __instance.screenBaseIconTransform.localPosition = Vector3.zero; } Traverse.Create((object)__instance).Field("screenBaseIconTransformLerp").SetValue((object)1f); return false; } } [HarmonyPatch(typeof(CosmeticShopMachine), "ScreenCurrencyIconAnimation")] internal static class CosmeticShopMachineScreenCurrencyIconAnimationPatch { private static bool Prefix(CosmeticShopMachine __instance) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) if (!Plugin.DisableCosmeticMachineScreenAnimationsEnabled() || (Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)__instance.screenCurrencyIconTransform != (Object)null) { __instance.screenCurrencyIconTransform.localPosition = Vector3.zero; } if ((Object)(object)__instance.screenCurrencyIconImpulseTransform != (Object)null) { __instance.screenCurrencyIconImpulseTransform.localPosition = Vector3.zero; __instance.screenCurrencyIconImpulseTransform.localScale = Vector3.one; } Traverse.Create((object)__instance).Field("screenCurrencyIconTransformLerp").SetValue((object)1f); Traverse.Create((object)__instance).Field("screenCurrencyIconImpulseLerp").SetValue((object)0f); return false; } } [HarmonyPatch(typeof(CosmeticShopMachine), "ScreenCosmeticAnimation")] internal static class CosmeticShopMachineScreenCosmeticAnimationPatch { private static bool Prefix(CosmeticShopMachine __instance) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableCosmeticMachineScreenAnimationsEnabled() || (Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)__instance.cosmeticTransform != (Object)null) { __instance.cosmeticTransform.localPosition = Vector3.zero; } if ((Object)(object)__instance.playerTransform != (Object)null) { __instance.playerTransform.localPosition = Vector3.zero; __instance.playerTransform.localRotation = Quaternion.identity; __instance.playerTransform.localScale = Vector3.one; } if ((Object)(object)__instance.playerSpinTransform != (Object)null) { __instance.playerSpinTransform.localEulerAngles = Vector3.zero; } Traverse.Create((object)__instance).Field("cosmeticTransformLerp").SetValue((object)1f); Traverse.Create((object)__instance).Field("playerPoseLerp").SetValue((object)0f); Traverse.Create((object)__instance).Field("playerSpinLerp").SetValue((object)1f); return false; } } [HarmonyPatch(typeof(ResultScreenUI), "Update")] internal static class ResultScreenUiUpdatePatch { private static void Postfix(ResultScreenUI __instance) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 if (Plugin.QuickSkipResultScreenEnabled() && !((Object)(object)__instance == (Object)null) && !((Object)(object)GameDirector.instance == (Object)null) && (int)GameDirector.instance.currentState == 4) { Traverse.Create((object)__instance).Method("FinishResultScreen", Array.Empty()).GetValue(); } } } [HarmonyPatch(typeof(ResultScreenUI), "FadeLogic")] internal static class ResultScreenUiFadeLogicPatch { private static bool Prefix(ResultScreenUI __instance) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableResultScreenFadeEnabled() || (Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)__instance.fadeImage != (Object)null) { ((Graphic)__instance.fadeImage).color = Color.clear; } return false; } } [HarmonyPatch(typeof(ResultScreenUI), "ShakeLogic")] internal static class ResultScreenUiShakeLogicPatch { private static bool Prefix(ResultScreenUI __instance) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableResultScreenShakeEnabled() || (Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)__instance.shakeTransformBack != (Object)null) { __instance.shakeTransformBack.anchoredPosition = Vector2.zero; } if ((Object)(object)__instance.shakeTransformFront != (Object)null) { __instance.shakeTransformFront.anchoredPosition = Vector2.zero; } if ((Object)(object)__instance.shakeTransformRotation != (Object)null) { ((Transform)__instance.shakeTransformRotation).localRotation = Quaternion.identity; } return false; } } [HarmonyPatch(typeof(ResultScreenUI), "AnimationEventTokenParticles")] internal static class ResultScreenUiAnimationEventTokenParticlesPatch { private static bool Prefix(ResultScreenUI __instance) { if (!Plugin.DisableResultScreenTokenParticlesEnabled() || (Object)(object)__instance == (Object)null) { return true; } ParticleSystem tokenTrailParticle = __instance.tokenTrailParticle; if (tokenTrailParticle != null) { tokenTrailParticle.Stop(true); } return false; } } [HarmonyPatch(typeof(BatteryVisualLogic), "Update")] internal static class BatteryVisualLogicUpdatePatch { private static void Postfix(BatteryVisualLogic __instance) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableBatteryUiAnimationsEnabled() && !((Object)(object)__instance == (Object)null)) { Vector3 value = Traverse.Create((object)__instance).Field("targetPosition").GetValue(); float value2 = Traverse.Create((object)__instance).Field("targetScaleOriginal").GetValue(); float value3 = Traverse.Create((object)__instance).Field("targetRotationOriginal").GetValue(); ((Component)__instance).transform.localPosition = value; ((Component)__instance).transform.localRotation = Quaternion.Euler(0f, 0f, value3); ((Component)__instance).transform.localScale = Vector3.one * value2; RawImage value4 = Traverse.Create((object)__instance).Field("batteryDrain").GetValue(); RawImage value5 = Traverse.Create((object)__instance).Field("batteryCharge").GetValue(); GameObject value6 = Traverse.Create((object)__instance).Field("batteryOutVisual").GetValue(); GameObject value7 = Traverse.Create((object)__instance).Field("batteryChargeNeededVisual").GetValue(); if (value4 != null) { ((Component)value4).gameObject.SetActive(false); } if (value5 != null) { ((Component)value5).gameObject.SetActive(false); } if (value6 != null) { value6.SetActive(false); } if (value7 != null) { value7.SetActive(false); } } } } [HarmonyPatch(typeof(FlashlightController), "Update")] internal static class FlashlightControllerUpdatePatch { private static void Postfix(FlashlightController __instance) { //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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) if ((Object)(object)__instance == (Object)null) { return; } if (Plugin.DisableFlashlightFlickerEnabled()) { Traverse.Create((object)__instance).Field("flickerIntensity").SetValue((object)0f); Traverse.Create((object)__instance).Field("flickerLerp").SetValue((object)0f); Traverse.Create((object)__instance).Field("flickerMultiplier").SetValue((object)1f); Traverse.Create((object)__instance).Field("flickerMultiplierTarget").SetValue((object)1f); } if (!Plugin.DisableFlashlightAnimationsEnabled()) { return; } if (Traverse.Create((object)__instance).Field("active").GetValue()) { if ((Object)(object)__instance.mesh != (Object)null) { ((Renderer)__instance.mesh).enabled = true; } if ((Object)(object)__instance.meshShadows != (Object)null) { ((Renderer)__instance.meshShadows).enabled = true; } if ((Object)(object)__instance.spotlight != (Object)null) { ((Behaviour)__instance.spotlight).enabled = true; } if ((Object)(object)__instance.halo != (Object)null) { __instance.halo.enabled = true; } if ((Object)(object)__instance.hideTransform != (Object)null) { __instance.hideTransform.localPosition = Vector3.zero; __instance.hideTransform.localRotation = Quaternion.identity; } if ((Object)(object)__instance.clickTransform != (Object)null) { __instance.clickTransform.localRotation = Quaternion.identity; } Traverse.Create((object)__instance).Field("hiddenScale").SetValue((object)1f); Traverse.Create((object)__instance).Field("baseIntensity").SetValue((object)1f); Traverse.Create((object)__instance).Field("click").SetValue((object)false); Traverse.Create((object)__instance).Field("currentState").SetValue((object)3); } else { if ((Object)(object)__instance.mesh != (Object)null) { ((Renderer)__instance.mesh).enabled = false; } if ((Object)(object)__instance.meshShadows != (Object)null) { ((Renderer)__instance.meshShadows).enabled = false; } if ((Object)(object)__instance.spotlight != (Object)null) { ((Behaviour)__instance.spotlight).enabled = false; } if ((Object)(object)__instance.halo != (Object)null) { __instance.halo.enabled = false; } Traverse.Create((object)__instance).Field("hiddenScale").SetValue((object)0f); Traverse.Create((object)__instance).Field("currentState").SetValue((object)0); } } } [HarmonyPatch(typeof(LobbyChatUI), "Update")] internal static class LobbyChatUiUpdatePatch { private static void Postfix(LobbyChatUI __instance) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableLobbyChatAnimationsEnabled() && !((Object)(object)__instance == (Object)null)) { Component value = Traverse.Create((object)__instance).Field("uiText").GetValue(); if ((Object)(object)value != (Object)null) { Traverse.Create((object)value).Property("color", (object[])null).SetValue((object)Color.white); } } } } [HarmonyPatch(typeof(MenuPageLobby), "Update")] internal static class MenuPageLobbyUpdatePatch { private static void Postfix(MenuPageLobby __instance) { if (Plugin.DisableLobbyJoiningPromptFadeEnabled() && !((Object)(object)__instance == (Object)null)) { Component value = Traverse.Create((object)__instance).Field("joiningPlayersCanvasGroup").GetValue(); if (!((Object)(object)value == (Object)null)) { List value2 = Traverse.Create((object)__instance).Field("joiningPlayers").GetValue>(); float value3 = Traverse.Create((object)__instance).Field("joiningPlayersEndTimer").GetValue(); float num = (((value2 != null && value2.Count > 0) || value3 > 0f) ? 1f : 0f); Traverse.Create((object)value).Property("alpha", (object[])null).SetValue((object)num); } } } } [HarmonyPatch(typeof(SemiUI), "Show")] internal static class SemiUiShowPatch { private static void Postfix(SemiUI __instance) { if (Plugin.DisableLeftPrepUiFadeEnabled() && Plugin.IsLeftPrepSemiUi(__instance)) { Plugin.SnapSemiUiVisible(__instance); } } } [HarmonyPatch(typeof(MoonUI), "Check")] internal static class MoonUiCheckPatch { private static bool Prefix(MoonUI __instance) { if (!Plugin.DisableMoonPhaseUiEnabled()) { return true; } if ((Object)(object)RunManager.instance != (Object)null) { Traverse.Create((object)RunManager.instance).Field("moonLevelChanged").SetValue((object)false); } if ((Object)(object)__instance != (Object)null) { __instance.SetState((State)0); if ((Object)(object)__instance.objectActive != (Object)null) { __instance.objectActive.SetActive(false); } } return false; } } [HarmonyPatch(typeof(ArrowUI), "ArrowShow")] internal static class ArrowUiArrowShowPatch { private static bool Prefix(ArrowUI __instance) { if (!Plugin.DisableGuideArrowUiEnabled()) { return true; } if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.arrowMesh != (Object)null) { ((Renderer)__instance.arrowMesh).enabled = false; } return false; } } [HarmonyPatch(typeof(ArrowUI), "ArrowShowWorldPos")] internal static class ArrowUiArrowShowWorldPosPatch { private static bool Prefix(ArrowUI __instance) { if (!Plugin.DisableGuideArrowUiEnabled()) { return true; } if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.arrowMesh != (Object)null) { ((Renderer)__instance.arrowMesh).enabled = false; } return false; } } [HarmonyPatch(typeof(BigMessageUI), "BigMessage")] internal static class BigMessageUiBigMessagePatch { private static bool Prefix(BigMessageUI __instance) { if (!Plugin.DisableBigMessageUiEnabled() || (Object)(object)__instance == (Object)null) { return true; } Traverse.Create((object)__instance).Field("bigMessageTimer").SetValue((object)0f); Traverse.Create((object)__instance).Method("Hide", Array.Empty()).GetValue(); return false; } } [HarmonyPatch(typeof(VehicleUI), "ShowSpeed")] internal static class VehicleUiShowSpeedPatch { private static void Postfix(VehicleUI __instance) { if (Plugin.DisableVehicleSpeedParticlesEnabled() && !((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.speedParticles == (Object)null)) { __instance.speedParticles.Stop(true, (ParticleSystemStopBehavior)0); } } } [HarmonyPatch(typeof(UraniumHurtVignette), "HurtVignette")] internal static class UraniumHurtVignettePatch { private static bool Prefix() { return !Plugin.DisableUraniumScreenEffectsEnabled(); } } [HarmonyPatch(typeof(TumbleWingsUI), "Update")] internal static class TumbleWingsUiUpdatePatch { private static bool Prefix(TumbleWingsUI __instance) { if (!Plugin.DisableTumbleWingsUiEnabled() || (Object)(object)__instance == (Object)null) { return true; } Traverse.Create((object)__instance).Method("Hide", Array.Empty()).GetValue(); return false; } } [HarmonyPatch(typeof(TruckMenuAnimated), "Update")] internal static class TruckMenuAnimatedUpdatePatch { private static bool Prefix(TruckMenuAnimated __instance) { if (!Plugin.DisableMainMenuTruckAnimationEnabled() || (Object)(object)__instance == (Object)null) { return true; } Sound soundLoop = __instance.soundLoop; if (soundLoop != null) { soundLoop.PlayLoop(false, 2f, 2f, 1f, 1f); } ParticleSystem particleSkeletonBitsFirst = __instance.particleSkeletonBitsFirst; if (particleSkeletonBitsFirst != null) { particleSkeletonBitsFirst.Stop(true, (ParticleSystemStopBehavior)0); } ParticleSystem particleSkeletonSmokeFirst = __instance.particleSkeletonSmokeFirst; if (particleSkeletonSmokeFirst != null) { particleSkeletonSmokeFirst.Stop(true, (ParticleSystemStopBehavior)0); } ParticleSystem particleSkeletonBitsLast = __instance.particleSkeletonBitsLast; if (particleSkeletonBitsLast != null) { particleSkeletonBitsLast.Stop(true, (ParticleSystemStopBehavior)0); } ParticleSystem particleSkeletonSmokeLast = __instance.particleSkeletonSmokeLast; if (particleSkeletonSmokeLast != null) { particleSkeletonSmokeLast.Stop(true, (ParticleSystemStopBehavior)0); } return false; } } [HarmonyPatch(typeof(TutorialDirector), "ActivateTip")] internal static class TutorialDirectorActivateTipPatch { private static bool Prefix() { return !Plugin.DisableTutorialTipsEnabled(); } } [HarmonyPatch(typeof(TutorialDirector), "ScheduleTip")] internal static class TutorialDirectorScheduleTipPatch { private static bool Prefix() { return !Plugin.DisableTutorialTipsEnabled(); } } [HarmonyPatch(typeof(ArenaMessageUI), "ArenaText")] internal static class ArenaMessageUiArenaTextPatch { private static bool Prefix(ArenaMessageUI __instance) { if (!Plugin.DisableArenaMessagesEnabled() || (Object)(object)__instance == (Object)null) { return true; } Traverse.Create((object)__instance).Method("Hide", Array.Empty()).GetValue(); return false; } } [HarmonyPatch(typeof(ArenaMessageWinUI), "ArenaText")] internal static class ArenaMessageWinUiArenaTextPatch { private static bool Prefix(ArenaMessageWinUI __instance) { if (!Plugin.DisableArenaMessagesEnabled() || (Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)__instance.kingObject != (Object)null) { __instance.kingObject.SetActive(false); } if ((Object)(object)__instance.loserObject != (Object)null) { __instance.loserObject.SetActive(false); } if ((Object)(object)__instance.backgroundObject != (Object)null) { __instance.backgroundObject.SetActive(false); } Traverse.Create((object)__instance).Method("Hide", Array.Empty()).GetValue(); return false; } } [HarmonyPatch(typeof(ArenaLight), "TurnOnArenaWarningLight")] internal static class ArenaLightTurnOnArenaWarningLightPatch { private static bool Prefix(ArenaLight __instance) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableArenaWarningLightsEnabled() || (Object)(object)__instance == (Object)null) { return true; } Traverse obj = Traverse.Create((object)__instance); Light value = obj.Field("arenaLight").GetValue(); MeshRenderer value2 = obj.Field("meshRenderer").GetValue(); if ((Object)(object)value != (Object)null) { ((Behaviour)value).enabled = false; value.intensity = 0f; } if ((Object)(object)value2 != (Object)null) { ((Renderer)value2).material.SetColor("_EmissionColor", Color.black); } return false; } } [HarmonyPatch(typeof(ArenaLight), "PulsateLight")] internal static class ArenaLightPulsateLightPatch { private static bool Prefix(ArenaLight __instance) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.DisableArenaWarningLightsEnabled() || (Object)(object)__instance == (Object)null) { return true; } Traverse obj = Traverse.Create((object)__instance); Light value = obj.Field("arenaLight").GetValue(); MeshRenderer value2 = obj.Field("meshRenderer").GetValue(); if ((Object)(object)value != (Object)null) { ((Behaviour)value).enabled = false; value.intensity = 0f; } if ((Object)(object)value2 != (Object)null) { ((Renderer)value2).material.SetColor("_EmissionColor", Color.black); } return false; } } [HarmonyPatch(typeof(ArenaLight), "Update")] internal static class ArenaLightUpdatePatch { private static void Postfix(ArenaLight __instance) { if (Plugin.DisableArenaWarningLightsEnabled() && !((Object)(object)__instance == (Object)null)) { DisableArenaLightVisuals(__instance); } } private static void DisableArenaLightVisuals(ArenaLight instance) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) Traverse obj = Traverse.Create((object)instance); Light value = obj.Field("arenaLight").GetValue(); MeshRenderer value2 = obj.Field("meshRenderer").GetValue(); if ((Object)(object)value != (Object)null) { ((Behaviour)value).enabled = false; value.intensity = 0f; } if ((Object)(object)value2 != (Object)null) { ((Renderer)value2).material.SetColor("_EmissionColor", Color.black); } } } [HarmonyPatch(typeof(ArenaRaceTimerUI), "Update")] internal static class ArenaRaceTimerUiUpdatePatch { private static void Postfix(ArenaRaceTimerUI __instance) { if (Plugin.DisableArenaRaceTimerAnimationsEnabled() && !((Object)(object)__instance == (Object)null)) { ResetArenaRaceTimerAnimationState(__instance); } } private static void ResetArenaRaceTimerAnimationState(ArenaRaceTimerUI instance) { //IL_0109: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_020c: 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) Traverse val = Traverse.Create((object)instance); val.Field("countdownScaleSpringTime").SetValue((object)val.Field("countdownScaleSpringDuration").GetValue()); val.Field("clearedScaleSpringTime").SetValue((object)val.Field("clearedScaleSpringDuration").GetValue()); val.Field("progressScaleSpringTime").SetValue((object)val.Field("progressScaleSpringDuration").GetValue()); val.Field("placeScaleSpringTime").SetValue((object)val.Field("placeScaleSpringDuration").GetValue()); val.Field("trackPieceScaleSpringTime").SetValue((object)val.Field("trackPieceScaleSpringDuration").GetValue()); val.Field("placeFlashTimer").SetValue((object)0f); float[] value = val.Field("segmentFlashTimers").GetValue(); if (value != null) { Array.Clear(value, 0, value.Length); } Vector3 value2 = val.Field("countdownBaseScale").GetValue(); Vector3 value3 = val.Field("clearedBaseScale").GetValue(); Vector3 value4 = val.Field("progressBaseScale").GetValue(); Vector3 value5 = val.Field("placeBaseScale").GetValue(); Vector3 value6 = val.Field("trackPieceBaseScale").GetValue(); if ((Object)(object)instance.secondsText != (Object)null) { ((TMP_Text)instance.secondsText).transform.localScale = value2; ((Graphic)instance.secondsText).color = Color.white; } if ((Object)(object)instance.hundredthsText != (Object)null) { ((TMP_Text)instance.hundredthsText).transform.localScale = value2; ((Graphic)instance.hundredthsText).color = Color.white; } if ((Object)(object)instance.clearedText != (Object)null) { ((TMP_Text)instance.clearedText).transform.localScale = value3; } if ((Object)(object)instance.progressText != (Object)null) { ((TMP_Text)instance.progressText).transform.localScale = value4; } if ((Object)(object)instance.placeText != (Object)null) { ((TMP_Text)instance.placeText).transform.localScale = value5; } if ((Object)(object)instance.trackPieceText != (Object)null) { ((TMP_Text)instance.trackPieceText).transform.localScale = value6; } } } [HarmonyPatch(typeof(EnemyShadowScreenVeinEffect), "Active")] internal static class EnemyShadowScreenVeinEffectActivePatch { private static bool Prefix(EnemyShadowScreenVeinEffect __instance) { if (!Plugin.DisableEnemyShadowVeinScreenEffectEnabled() || (Object)(object)__instance == (Object)null) { return true; } Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } } [HarmonyPatch(typeof(EnemyShadowScreenVeinEffect), "Update")] internal static class EnemyShadowScreenVeinEffectUpdatePatch { private static bool Prefix(EnemyShadowScreenVeinEffect __instance) { if (!Plugin.DisableEnemyShadowVeinScreenEffectEnabled() || (Object)(object)__instance == (Object)null) { return true; } Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } } [HarmonyPatch(typeof(TruckScreenText), "Update")] internal static class TruckScreenTextUpdatePatch { private static void Postfix(TruckScreenText __instance) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return; } Traverse val = Traverse.Create((object)__instance); Transform value = val.Field("chatMessageLoadingBar").GetValue(); float value2 = val.Field("chatMessageTimer").GetValue(); float value3 = val.Field("chatMessageTimerMax").GetValue(); if (Plugin.DisableTruckScreenLoadingBarAnimationEnabled() && (Object)(object)value != (Object)null && value3 > 0f) { float num = Mathf.Clamp01(value2 / value3); value.localScale = new Vector3(num, value.localScale.y, value.localScale.z); } if (!Plugin.DisableTruckScreenChatAnimationsEnabled()) { return; } if ((Object)(object)__instance.chatMessage != (Object)null) { string value4 = val.Field("chatMessageIdleString1").GetValue(); if (!string.IsNullOrEmpty(value4)) { val.Field("chatMessageIdleStringCurrent").SetValue((object)value4); } } val.Field("chatMessageIdleStringTimer").SetValue((object)0f); val.Field("chatActiveTimer").SetValue((object)0f); if ((Object)(object)value != (Object)null && value3 > 0f) { float num2 = Mathf.Clamp01(value2 / value3); value.localScale = new Vector3(num2, value.localScale.y, value.localScale.z); } Transform value5 = val.Field("chatMessageResultBar").GetValue(); Light value6 = val.Field("chatMessageResultBarLight").GetValue(); if ((Object)(object)value5 != (Object)null) { ((Component)value5).gameObject.SetActive(false); } if ((Object)(object)value6 != (Object)null) { ((Behaviour)value6).enabled = false; } val.Field("chatMessageResultBarTimer").SetValue((object)(-123f)); } } [HarmonyPatch(typeof(BatteryBarEffect), "Update")] internal static class BatteryBarEffectUpdatePatch { private static bool Prefix(BatteryBarEffect __instance) { if (!Plugin.DisableBatteryBarEffectsEnabled() || (Object)(object)__instance == (Object)null) { return true; } Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } } [HarmonyPatch(typeof(ValueScreen), "UpdateValue")] internal static class ValueScreenUpdateValuePatch { private static bool Prefix(ValueScreen __instance, int newValue) { if (!Plugin.DisableValueScreenEffectsEnabled() || (Object)(object)__instance == (Object)null) { return true; } Traverse.Create((object)__instance).Field("valuePrevious").SetValue((object)newValue); Traverse.Create((object)__instance).Field("valueCurrent").SetValue((object)newValue); Traverse.Create((object)__instance).Field("updateEffectTimer").SetValue((object)0f); Traverse.Create((object)__instance).Field("resetText").SetValue((object)false); Traverse.Create((object)__instance).Method("SetValueText", Array.Empty()).GetValue(); return false; } } [HarmonyPatch(typeof(TutorialUI), "Update")] internal static class TutorialUiUpdatePatch { private static void Postfix(TutorialUI __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (Plugin.DisableTutorialUiAnimationsEnabled() && !((Object)(object)__instance == (Object)null)) { if ((Object)(object)__instance.videoTransform != (Object)null) { __instance.videoTransform.localScale = Vector3.one; } if ((Object)(object)__instance.videoImage != (Object)null) { Color color = ((Graphic)__instance.videoImage).color; ((Graphic)__instance.videoImage).color = new Color(color.r, color.g, color.b, 1f); } if ((Object)(object)__instance.progressBar != (Object)null) { float value = Traverse.Create((object)__instance).Field("progressBarTarget").GetValue(); __instance.progressBar.localScale = new Vector3(value, 1f, 1f); } Traverse.Create((object)__instance).Field("dummyTextAnimationEval").SetValue((object)1f); Traverse.Create((object)__instance).Field("animationCurveEval").SetValue((object)1f); ((Component)__instance).transform.localScale = new Vector3(1f, 1f, 1f); } } } internal sealed class ConfigurationManagerAttributes { public int? Order; public Action CustomDrawer; public bool? ReadOnly; public bool? Browsable; } }