using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Text; using BepInEx; using BepInEx.Logging; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] internal static class BirdieGrantBridge { private const string CommandMethodName = "System.Void PlayerInventory::BirdieCmdGrantItem(System.Int32)"; private static bool initialized; private static float _nextRetry = -1f; private static ushort registeredCommandHash; private static Type mirrorNbType; private static Type mirrorReaderType; private static Type mirrorConnType; private static Type mirrorRpcType; private static Type mirrorRcdType; private static Type mirrorRctType; private static Type mirrorCmdMsgType; private static Type mirrorNcType; private static Type mirrorNwpType; private static Type mirrorNwExtType; private static Type mirrorNrExtType; private static MethodInfo mirrorRegisterDelegate; private static MethodInfo mirrorNcSend; private static MethodInfo mirrorWriterExtWriteInt; private static MethodInfo mirrorWriterPoolGet; private static MethodInfo mirrorWriterPoolReturn; private static MethodInfo mirrorWriterToArraySegment; private static MethodInfo mirrorReaderExtReadInt; private static PropertyInfo mirrorNbNetId; private static PropertyInfo mirrorNbComponentIndex; private static FieldInfo mirrorCmdNetId; private static FieldInfo mirrorCmdComponentIndex; private static FieldInfo mirrorCmdFunctionHash; private static FieldInfo mirrorCmdPayload; private static MethodInfo cachedServerTryAddItemMethod; private static Type cachedItemTypeEnumType; private static PropertyInfo cachedAllItemsProperty; private static MethodInfo cachedTryGetItemDataMethod; private static PropertyInfo cachedItemDataMaxUsesProperty; internal static bool IsReady() { if (initialized) { return registeredCommandHash != 0; } return false; } internal static void EnsureInitialized() { if (initialized) { return; } float time = Time.time; if (time < _nextRetry) { return; } _nextRetry = time + 2f; try { if (CollectReflectionCaches()) { RegisterCommandHandler(); if (registeredCommandHash != 0) { initialized = true; BirdieLog.Msg("[Birdie] Grant bridge ready."); } } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Grant bridge init: " + ex.Message); } } internal static void RequestGrant(Component inventory, int itemTypeInt) { EnsureInitialized(); if (registeredCommandHash == 0 || mirrorNbNetId == null || mirrorNbComponentIndex == null || mirrorCmdMsgType == null || mirrorNcSend == null || mirrorWriterExtWriteInt == null || mirrorWriterPoolGet == null || mirrorWriterPoolReturn == null || mirrorWriterToArraySegment == null) { BirdieLog.Warning("[Birdie] Item spawner: grant bridge not ready (reflection incomplete)."); return; } try { uint num = (uint)mirrorNbNetId.GetValue(inventory, null); byte b = (byte)mirrorNbComponentIndex.GetValue(inventory, null); object obj = mirrorWriterPoolGet.Invoke(null, null); mirrorWriterExtWriteInt.Invoke(null, new object[2] { obj, itemTypeInt }); ArraySegment arraySegment = (ArraySegment)mirrorWriterToArraySegment.Invoke(obj, null); object obj2 = Activator.CreateInstance(mirrorCmdMsgType); mirrorCmdNetId.SetValue(obj2, num); mirrorCmdComponentIndex.SetValue(obj2, b); mirrorCmdFunctionHash.SetValue(obj2, registeredCommandHash); mirrorCmdPayload.SetValue(obj2, arraySegment); mirrorNcSend.Invoke(null, new object[2] { obj2, 0 }); mirrorWriterPoolReturn.Invoke(null, new object[1] { obj }); } catch (Exception ex) { BirdieLog.Warning("[Birdie] Item spawner (client bridge): " + ex.Message); } } private static void ServerHandleGrantItem(object nbObj, object readerObj, object connObj) { try { if (nbObj == null || readerObj == null) { return; } if (mirrorReaderExtReadInt == null || cachedServerTryAddItemMethod == null || cachedItemTypeEnumType == null) { BirdieLog.Warning("[Birdie] Grant bridge server handler: reflection incomplete."); return; } int num = (int)mirrorReaderExtReadInt.Invoke(null, new object[1] { readerObj }); object obj = Enum.ToObject(cachedItemTypeEnumType, num); int num2 = GetItemMaxUses(num); if (num2 <= 0) { num2 = 1; } if (!(bool)cachedServerTryAddItemMethod.Invoke(nbObj, new object[2] { obj, num2 })) { BirdieLog.Warning("[Birdie] Item spawner (bridge server): inventory full or item invalid."); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Grant bridge server handler: " + ex.Message); } } private static bool CollectReflectionCaches() { Assembly assembly = null; Assembly assembly2 = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly3 in assemblies) { switch (assembly3.GetName().Name) { case "Mirror": assembly = assembly3; break; case "Assembly-CSharp": case "GameAssembly": assembly2 = assembly3; break; } } if (assembly == null || assembly2 == null) { return false; } mirrorNbType = assembly.GetType("Mirror.NetworkBehaviour"); mirrorReaderType = assembly.GetType("Mirror.NetworkReader"); mirrorConnType = assembly.GetType("Mirror.NetworkConnectionToClient"); mirrorRpcType = assembly.GetType("Mirror.RemoteCalls.RemoteProcedureCalls"); mirrorRcdType = assembly.GetType("Mirror.RemoteCalls.RemoteCallDelegate"); mirrorRctType = assembly.GetType("Mirror.RemoteCalls.RemoteCallType"); mirrorCmdMsgType = assembly.GetType("Mirror.CommandMessage"); mirrorNcType = assembly.GetType("Mirror.NetworkClient"); mirrorNwpType = assembly.GetType("Mirror.NetworkWriterPool"); mirrorNwExtType = assembly.GetType("Mirror.NetworkWriterExtensions"); mirrorNrExtType = assembly.GetType("Mirror.NetworkReaderExtensions"); if (mirrorNbType == null || mirrorReaderType == null || mirrorConnType == null || mirrorRpcType == null || mirrorRcdType == null || mirrorRctType == null || mirrorCmdMsgType == null || mirrorNcType == null || mirrorNwpType == null || mirrorNwExtType == null || mirrorNrExtType == null) { return false; } mirrorRegisterDelegate = mirrorRpcType.GetMethod("RegisterDelegate", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); MethodInfo method = mirrorNcType.GetMethod("Send", BindingFlags.Static | BindingFlags.Public); if (method != null) { mirrorNcSend = method.MakeGenericMethod(mirrorCmdMsgType); } mirrorWriterExtWriteInt = mirrorNwExtType.GetMethod("WriteInt", BindingFlags.Static | BindingFlags.Public); mirrorWriterPoolGet = mirrorNwpType.GetMethod("Get", BindingFlags.Static | BindingFlags.Public); mirrorWriterPoolReturn = mirrorNwpType.GetMethod("Return", BindingFlags.Static | BindingFlags.Public); Type type = assembly.GetType("Mirror.NetworkWriter"); if (type != null) { mirrorWriterToArraySegment = type.GetMethod("ToArraySegment", BindingFlags.Instance | BindingFlags.Public); } mirrorReaderExtReadInt = mirrorNrExtType.GetMethod("ReadInt", BindingFlags.Static | BindingFlags.Public); mirrorNbNetId = mirrorNbType.GetProperty("netId", BindingFlags.Instance | BindingFlags.Public); mirrorNbComponentIndex = mirrorNbType.GetProperty("ComponentIndex", BindingFlags.Instance | BindingFlags.Public); mirrorCmdNetId = mirrorCmdMsgType.GetField("netId"); mirrorCmdComponentIndex = mirrorCmdMsgType.GetField("componentIndex"); mirrorCmdFunctionHash = mirrorCmdMsgType.GetField("functionHash"); mirrorCmdPayload = mirrorCmdMsgType.GetField("payload"); Type type2 = assembly2.GetType("PlayerInventory"); cachedItemTypeEnumType = assembly2.GetType("ItemType"); if (type2 != null) { cachedServerTryAddItemMethod = type2.GetMethod("ServerTryAddItem", BindingFlags.Instance | BindingFlags.Public); } Type type3 = assembly2.GetType("ItemCollection"); if (type3 != null) { cachedTryGetItemDataMethod = type3.GetMethod("TryGetItemData", BindingFlags.Instance | BindingFlags.Public); } Type type4 = assembly2.GetType("ItemData"); if (type4 != null) { cachedItemDataMaxUsesProperty = type4.GetProperty("MaxUses", BindingFlags.Instance | BindingFlags.Public); } Type type5 = assembly2.GetType("GameManager"); if (type5 != null) { cachedAllItemsProperty = type5.GetProperty("AllItems", BindingFlags.Static | BindingFlags.Public); } if (mirrorRegisterDelegate != null && mirrorNcSend != null && mirrorWriterExtWriteInt != null && mirrorWriterPoolGet != null && mirrorWriterToArraySegment != null && mirrorReaderExtReadInt != null && mirrorNbNetId != null && mirrorNbComponentIndex != null && mirrorCmdNetId != null && type2 != null && cachedServerTryAddItemMethod != null) { return cachedItemTypeEnumType != null; } return false; } private static void RegisterCommandHandler() { if (mirrorRegisterDelegate == null || mirrorRcdType == null || mirrorNbType == null || mirrorReaderType == null || mirrorConnType == null || mirrorRctType == null) { return; } Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("PlayerInventory"); if (type != null) { break; } } if (type == null) { BirdieLog.Warning("[Birdie] Grant bridge: PlayerInventory type not found."); return; } DynamicMethod dynamicMethod = new DynamicMethod("BirdieGrantItemCommandHandler", typeof(void), new Type[3] { mirrorNbType, mirrorReaderType, mirrorConnType }, typeof(BirdieGrantBridge).Module, skipVisibility: true); MethodInfo method = typeof(BirdieGrantBridge).GetMethod("ServerHandleGrantItem", BindingFlags.Static | BindingFlags.NonPublic); if (method == null) { BirdieLog.Warning("[Birdie] Grant bridge: ServerHandleGrantItem not found via reflection."); return; } ILGenerator iLGenerator = dynamicMethod.GetILGenerator(); iLGenerator.Emit(OpCodes.Ldarg_0); iLGenerator.Emit(OpCodes.Ldarg_1); iLGenerator.Emit(OpCodes.Ldarg_2); iLGenerator.Emit(OpCodes.Call, method); iLGenerator.Emit(OpCodes.Ret); Delegate @delegate = dynamicMethod.CreateDelegate(mirrorRcdType); object obj = Enum.Parse(mirrorRctType, "Command"); registeredCommandHash = (ushort)mirrorRegisterDelegate.Invoke(null, new object[5] { type, "System.Void PlayerInventory::BirdieCmdGrantItem(System.Int32)", obj, @delegate, false }); if (registeredCommandHash == 0) { BirdieLog.Warning("[Birdie] Grant bridge: RegisterDelegate returned hash 0 — may indicate a collision."); } } private static int GetItemMaxUses(int itemTypeInt) { try { if (cachedAllItemsProperty == null || cachedTryGetItemDataMethod == null || cachedItemDataMaxUsesProperty == null || cachedItemTypeEnumType == null) { return 1; } object value = cachedAllItemsProperty.GetValue(null, null); if (value == null) { return 1; } object obj = Enum.ToObject(cachedItemTypeEnumType, itemTypeInt); object[] array = new object[2] { obj, null }; if (!(bool)cachedTryGetItemDataMethod.Invoke(value, array) || array[1] == null) { return 1; } return (int)cachedItemDataMaxUsesProperty.GetValue(array[1], null); } catch { return 1; } } } internal static class BirdieHostBridge { private const string RpcMethodName = "System.Void PlayerInventory::BirdieCmdSyncHostConfig(System.Boolean,System.UInt64)"; internal static bool IsUnderHostControl; internal static ulong ReceivedFeatureMask; private static bool initialized; private static float _nextRetry = -1f; private static ushort registeredRpcHash; internal static bool FlagExpandedSlotsForClient; private static Type mirrorNbType; private static Type mirrorReaderType; private static Type mirrorConnType; private static Type mirrorRpcType; private static Type mirrorRcdType; private static Type mirrorRctType; private static Type mirrorRpcMsgType; private static Type mirrorNsType; private static Type mirrorNwpType; private static Type mirrorNwExtType; private static Type mirrorNrExtType; private static MethodInfo mirrorRegisterDelegate; private static MethodInfo mirrorNsSendToAll; private static MethodInfo mirrorWriterExtWriteBool; private static MethodInfo mirrorWriterExtWriteULong; private static MethodInfo mirrorWriterPoolGet; private static MethodInfo mirrorWriterPoolReturn; private static MethodInfo mirrorWriterToArraySegment; private static MethodInfo mirrorReaderExtReadBool; private static MethodInfo mirrorReaderExtReadULong; private static PropertyInfo mirrorNbNetId; private static PropertyInfo mirrorNbComponentIndex; private static FieldInfo mirrorRpcNetId; private static FieldInfo mirrorRpcComponentIndex; private static FieldInfo mirrorRpcFunctionHash; private static FieldInfo mirrorRpcPayload; private static PropertyInfo cachedLocalPlayerInventoryProperty; internal static void EnsureHandlersRegistered() { if (initialized) { return; } float time = Time.time; if (time < _nextRetry) { return; } _nextRetry = time + 2f; try { if (CollectReflectionCaches()) { RegisterRpcHandler(); if (registeredRpcHash != 0) { initialized = true; BirdieLog.Msg("[Birdie] Host bridge ready."); } } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Host bridge init: " + ex.Message); } } internal static void BroadcastToClients(bool active, ulong featureMask) { EnsureHandlersRegistered(); try { Type type = mirrorNsType; if (type != null) { PropertyInfo property = type.GetProperty("active", BindingFlags.Static | BindingFlags.Public); if (property != null && !(bool)property.GetValue(null, null)) { BirdieLog.Warning("[Birdie] Host bridge: NetworkServer is not active — cannot broadcast."); return; } } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Host bridge (server check): " + ex.Message); return; } if (registeredRpcHash == 0 || mirrorNbNetId == null || mirrorNbComponentIndex == null || mirrorRpcMsgType == null || mirrorNsSendToAll == null || mirrorWriterExtWriteBool == null || mirrorWriterExtWriteULong == null || mirrorWriterPoolGet == null || mirrorWriterPoolReturn == null || mirrorWriterToArraySegment == null || cachedLocalPlayerInventoryProperty == null) { BirdieLog.Warning("[Birdie] Host bridge: broadcast not ready (reflection incomplete)."); return; } try { object? value = cachedLocalPlayerInventoryProperty.GetValue(null, null); Component val = (Component)((value is Component) ? value : null); if ((Object)(object)val == (Object)null) { BirdieLog.Warning("[Birdie] Host bridge: LocalPlayerInventory is null."); return; } uint num = (uint)mirrorNbNetId.GetValue(val, null); byte b = (byte)mirrorNbComponentIndex.GetValue(val, null); ulong num2 = (active ? featureMask : ulong.MaxValue); object obj = mirrorWriterPoolGet.Invoke(null, null); mirrorWriterExtWriteBool.Invoke(null, new object[2] { obj, active }); mirrorWriterExtWriteULong.Invoke(null, new object[2] { obj, num2 }); ArraySegment arraySegment = (ArraySegment)mirrorWriterToArraySegment.Invoke(obj, null); object obj2 = Activator.CreateInstance(mirrorRpcMsgType); mirrorRpcNetId.SetValue(obj2, num); mirrorRpcComponentIndex.SetValue(obj2, b); mirrorRpcFunctionHash.SetValue(obj2, registeredRpcHash); mirrorRpcPayload.SetValue(obj2, arraySegment); mirrorNsSendToAll.Invoke(null, new object[2] { obj2, 0 }); mirrorWriterPoolReturn.Invoke(null, new object[1] { obj }); } catch (Exception ex2) { BirdieLog.Warning("[Birdie] Host bridge (broadcast): " + ex2.Message); } } private static void ClientHandleSyncHostConfig(object nbObj, object readerObj, object connObj) { try { if (readerObj == null) { return; } if (mirrorReaderExtReadBool == null || mirrorReaderExtReadULong == null) { BirdieLog.Warning("[Birdie] Host bridge client handler: reflection incomplete."); return; } bool flag = (bool)mirrorReaderExtReadBool.Invoke(null, new object[1] { readerObj }); ulong num = (ulong)mirrorReaderExtReadULong.Invoke(null, new object[1] { readerObj }); if (flag) { IsUnderHostControl = true; ReceivedFeatureMask = num; if ((num & 0x1000) != 0L) { FlagExpandedSlotsForClient = true; } BirdieLog.Msg("[Birdie] Host bridge: host control active, featureMask=0x" + num.ToString("X16")); } else { IsUnderHostControl = false; ReceivedFeatureMask = ulong.MaxValue; BirdieLog.Msg("[Birdie] Host bridge: host control deactivated (all features unlocked)."); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Host bridge client handler: " + ex.Message); } } private static bool CollectReflectionCaches() { Assembly assembly = null; Assembly assembly2 = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly3 in assemblies) { switch (assembly3.GetName().Name) { case "Mirror": assembly = assembly3; break; case "Assembly-CSharp": case "GameAssembly": assembly2 = assembly3; break; } } if (assembly == null || assembly2 == null) { return false; } mirrorNbType = assembly.GetType("Mirror.NetworkBehaviour"); mirrorReaderType = assembly.GetType("Mirror.NetworkReader"); mirrorConnType = assembly.GetType("Mirror.NetworkConnectionToClient"); mirrorRpcType = assembly.GetType("Mirror.RemoteCalls.RemoteProcedureCalls"); mirrorRcdType = assembly.GetType("Mirror.RemoteCalls.RemoteCallDelegate"); mirrorRctType = assembly.GetType("Mirror.RemoteCalls.RemoteCallType"); mirrorRpcMsgType = assembly.GetType("Mirror.RpcMessage"); mirrorNsType = assembly.GetType("Mirror.NetworkServer"); mirrorNwpType = assembly.GetType("Mirror.NetworkWriterPool"); mirrorNwExtType = assembly.GetType("Mirror.NetworkWriterExtensions"); mirrorNrExtType = assembly.GetType("Mirror.NetworkReaderExtensions"); if (mirrorNbType == null || mirrorReaderType == null || mirrorConnType == null || mirrorRpcType == null || mirrorRcdType == null || mirrorRctType == null || mirrorRpcMsgType == null || mirrorNsType == null || mirrorNwpType == null || mirrorNwExtType == null || mirrorNrExtType == null) { return false; } mirrorRegisterDelegate = mirrorRpcType.GetMethod("RegisterDelegate", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); MethodInfo method = mirrorNsType.GetMethod("SendToAll", BindingFlags.Static | BindingFlags.Public); if (method != null) { mirrorNsSendToAll = method.MakeGenericMethod(mirrorRpcMsgType); } mirrorWriterExtWriteBool = mirrorNwExtType.GetMethod("WriteBool", BindingFlags.Static | BindingFlags.Public); mirrorWriterExtWriteULong = mirrorNwExtType.GetMethod("WriteULong", BindingFlags.Static | BindingFlags.Public); mirrorWriterPoolGet = mirrorNwpType.GetMethod("Get", BindingFlags.Static | BindingFlags.Public); mirrorWriterPoolReturn = mirrorNwpType.GetMethod("Return", BindingFlags.Static | BindingFlags.Public); Type type = assembly.GetType("Mirror.NetworkWriter"); if (type != null) { mirrorWriterToArraySegment = type.GetMethod("ToArraySegment", BindingFlags.Instance | BindingFlags.Public); } mirrorReaderExtReadBool = mirrorNrExtType.GetMethod("ReadBool", BindingFlags.Static | BindingFlags.Public); mirrorReaderExtReadULong = mirrorNrExtType.GetMethod("ReadULong", BindingFlags.Static | BindingFlags.Public); mirrorNbNetId = mirrorNbType.GetProperty("netId", BindingFlags.Instance | BindingFlags.Public); mirrorNbComponentIndex = mirrorNbType.GetProperty("ComponentIndex", BindingFlags.Instance | BindingFlags.Public); mirrorRpcNetId = mirrorRpcMsgType.GetField("netId"); mirrorRpcComponentIndex = mirrorRpcMsgType.GetField("componentIndex"); mirrorRpcFunctionHash = mirrorRpcMsgType.GetField("functionHash"); mirrorRpcPayload = mirrorRpcMsgType.GetField("payload"); Type type2 = assembly2.GetType("PlayerInventory"); Type type3 = assembly2.GetType("GameManager"); if (type3 != null) { cachedLocalPlayerInventoryProperty = type3.GetProperty("LocalPlayerInventory", BindingFlags.Static | BindingFlags.Public); } if (mirrorRegisterDelegate != null && mirrorNsSendToAll != null && mirrorWriterExtWriteBool != null && mirrorWriterExtWriteULong != null && mirrorWriterPoolGet != null && mirrorWriterToArraySegment != null && mirrorReaderExtReadBool != null && mirrorReaderExtReadULong != null && mirrorNbNetId != null && mirrorNbComponentIndex != null && mirrorRpcNetId != null) { return type2 != null; } return false; } private static void RegisterRpcHandler() { if (mirrorRegisterDelegate == null || mirrorRcdType == null || mirrorNbType == null || mirrorReaderType == null || mirrorConnType == null || mirrorRctType == null) { return; } Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("PlayerInventory"); if (type != null) { break; } } if (type == null) { BirdieLog.Warning("[Birdie] Host bridge: PlayerInventory type not found."); return; } DynamicMethod dynamicMethod = new DynamicMethod("BirdieHostConfigRpcHandler", typeof(void), new Type[3] { mirrorNbType, mirrorReaderType, mirrorConnType }, typeof(BirdieHostBridge).Module, skipVisibility: true); MethodInfo method = typeof(BirdieHostBridge).GetMethod("ClientHandleSyncHostConfig", BindingFlags.Static | BindingFlags.NonPublic); if (method == null) { BirdieLog.Warning("[Birdie] Host bridge: ClientHandleSyncHostConfig not found via reflection."); return; } ILGenerator iLGenerator = dynamicMethod.GetILGenerator(); iLGenerator.Emit(OpCodes.Ldarg_0); iLGenerator.Emit(OpCodes.Ldarg_1); iLGenerator.Emit(OpCodes.Ldarg_2); iLGenerator.Emit(OpCodes.Call, method); iLGenerator.Emit(OpCodes.Ret); Delegate @delegate = dynamicMethod.CreateDelegate(mirrorRcdType); object obj = Enum.Parse(mirrorRctType, "ClientRpc"); registeredRpcHash = (ushort)mirrorRegisterDelegate.Invoke(null, new object[5] { type, "System.Void PlayerInventory::BirdieCmdSyncHostConfig(System.Boolean,System.UInt64)", obj, @delegate, false }); if (registeredRpcHash == 0) { BirdieLog.Warning("[Birdie] Host bridge: RegisterDelegate returned hash 0 — may indicate a collision."); } } } [BepInPlugin("com.cb12438.birdiemod", "Birdie Mod", "1.3.3")] public class BirdieMod : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__633_2; internal void b__633_2() { Application.OpenURL("https://discord.gg/EaCRS6TBH9"); } } private ManualLogSource Logger; private readonly string[] cosmeticUnlockFlagNames = new string[3] { "everythingUnlocked", "forceUnlocked", "isCursorForceUnlocked" }; private readonly string[] cosmeticRefreshMethodNames = new string[6] { "LoadCosmetics", "SaveCosmetics", "ListCosmeticsUnlocks", "RefreshOptions", "UpdateCosmeticsButtons", "UpdateLoadoutToggles" }; private Component playerMovement; private Component playerGolfer; private Component golfBall; private readonly Dictionary playerGolferProperties = new Dictionary(8); private readonly Dictionary playerGolferFields = new Dictionary(4); private MethodInfo addSpeedBoostMethod; private FieldInfo swingNormalizedPowerBackingField; private bool playerFound; private bool assistEnabled; private bool isLeftMousePressed; private bool isRightMousePressed; private bool autoReleaseTriggeredThisCharge; private bool autoChargeSequenceStarted; private int lastAutoSwingReleaseFrame = -1; private float nextTryStartChargingTime; private readonly float tryStartChargingInterval = 0.05f; private float idealSwingPower; private float idealSwingPitch; private Vector3 flagPosition = Vector3.zero; private Vector3 holePosition = Vector3.zero; private Vector3 currentAimTargetPosition = Vector3.zero; private Vector3 currentSwingOriginPosition = Vector3.zero; private Vector3 aimTargetOffsetLocal = Vector3.zero; private readonly Vector3 swingOriginLocalOffset = new Vector3(0.86f, 0.05f, -0.12f); private string cachedLocalPlayerDisplayName = ""; private float nextDisplayNameRefreshTime; private readonly float displayNameRefreshInterval = 0.5f; private int cachedAllGameObjectsFrame = -1; private GameObject[] cachedAllGameObjects; private int cachedAllComponentsFrame = -1; private Component[] cachedAllComponents; private float nextPlayerSearchTime; private float nextHoleSearchTime; private float nextIdealSwingCalculationTime; private float nextBallResolveTime; private readonly float playerSearchInterval = 1f; private readonly float holeSearchInterval = 0.5f; private readonly float idealSwingCalculationInterval = 0.25f; private readonly float ballResolveInterval = 0.2f; private readonly float puttDistanceThreshold = 12f; private bool hadResolvedPlayerContext; private bool hadResolvedBallContext; private string lastBallResolveSource = "missing"; private Component initializedPlayerGolfer; private GameObject hudCanvas; private TextMeshProUGUI leftHudText; private TextMeshProUGUI centerHudText; private TextMeshProUGUI rightHudText; private TextMeshProUGUI bottomHudText; private bool isAimModeActive; private bool wasAimRequestedLastFrame; private bool reflectionCacheInitialized; private MethodInfo cachedTryGetMethod; private MethodInfo cachedOrbitSetYawMethod; private MethodInfo cachedOrbitSetPitchMethod; private MethodInfo cachedOrbitForceUpdateMethod; private MethodInfo cachedEnterSwingAimCameraMethod; private MethodInfo cachedExitSwingAimCameraMethod; private MethodInfo cachedReachOrbitSteadyStateMethod; private Component initializedYawPlayerMovement; private PropertyInfo cachedPlayerMovementYawProperty; private FieldInfo cachedPlayerMovementYawField; private Component initializedYawPlayerGolfer; private PropertyInfo cachedPlayerGolferYawProperty; private FieldInfo cachedPlayerGolferYawField; private bool cameraAimSmoothingInitialized; private float smoothedOrbitYaw; private float smoothedOrbitPitch; private float orbitYawVelocity; private float orbitPitchVelocity; private readonly float orbitAimSmoothTime = 0.02f; private readonly float orbitAimMaxSpeed = 2160f; private readonly object[] cachedOrbitModuleQueryArgs = new object[1]; private readonly object[] cachedOrbitYawArgs = new object[1]; private readonly object[] cachedOrbitPitchArgs = new object[1]; private bool swingMathReflectionInitialized; private PropertyInfo cachedGolfSettingsProperty; private object cachedGolfSettingsObject; private PropertyInfo cachedGolfBallSettingsProperty; private object cachedGolfBallSettingsObject; private MethodInfo cachedBMathEaseInMethod; private MethodInfo cachedUpdateSwingNormalizedPowerMethod; private bool matchSetupRulesReflectionInitialized; private Type cachedMatchSetupRuleEnumType; private MethodInfo cachedMatchSetupGetValueMethod; private object cachedMatchSetupSwingPowerRuleValue; private PropertyInfo cachedLocalPlayerAsGolferProperty; private bool localGolferResolverInitialized; private MethodInfo cachedTryStartChargingSwingMethod; private MethodInfo cachedSetIsChargingSwingMethod; private MethodInfo cachedReleaseSwingChargeMethod; private float lastObservedSwingPower; private readonly float[] launchModelPowers = new float[4] { 0.1f, 0.5f, 1f, 1.15f }; private readonly float[] launchModelSpeeds = new float[4] { 17f, 85f, 170f, 195.5f }; private readonly float launchModelReferenceSrvMul = 2f; private bool golfBallVelocityReflectionInitialized; private Type cachedGolfBallTypeForVelocity; private PropertyInfo cachedGolfBallRigidbodyProperty; private bool rigidbodyVelocityReflectionInitialized; private PropertyInfo cachedRigidbodyLinearVelocityProperty; private readonly float trajectoryGravity = 9.81f; private bool windReflectionInitialized; private PropertyInfo cachedWindManagerWindProperty; private float windFactor = 1f; private float crossWindFactor = 1f; private bool swingHittableReflectionInitialized; private Component cachedGolfBallForHittable; private float cachedMaxPowerSwingHitSpeed = 85f; private float cachedMaxPowerPuttHitSpeed = 15f; private Vector3 windAimOffset = Vector3.zero; private GameObject shotPathObject; private LineRenderer shotPathLine; private Material shotPathMaterial; private GameObject predictedPathObject; private LineRenderer predictedPathLine; private Material predictedPathMaterial; private GameObject frozenPredictedPathObject; private LineRenderer frozenPredictedPathLine; private Material frozenPredictedPathMaterial; private readonly List shotPathPoints = new List(768); private readonly List predictedPathPoints = new List(384); private readonly List frozenPredictedPathPoints = new List(384); private bool predictedImpactPreviewValid; private Vector3 predictedImpactPreviewPoint = Vector3.zero; private Vector3 predictedImpactPreviewApproachDirection = Vector3.forward; private bool frozenImpactPreviewValid; private Vector3 frozenImpactPreviewPoint = Vector3.zero; private Vector3 frozenImpactPreviewApproachDirection = Vector3.forward; private bool lockLivePredictedPath; private bool observedBallMotionSinceLastShot; private bool isRecordingShotPath; private float predictedTrajectoryHideStartTime; private float nextPredictedPathRefreshTime; private Vector3 lastShotPathBallPosition = Vector3.zero; private float lastShotPathMoveTime; private readonly float predictedUnlockSpeedThreshold = 0.12f; private readonly float shotPathHeightOffset = 0.14f; private readonly float shotPathMoveThreshold = 0.004f; private readonly float shotPathPointSpacing = 0.012f; private readonly int shotPathMaxPoints = 3072; private readonly float shotPathStationaryDelay = 0.65f; private readonly int predictedPathMaxSteps = 360; private readonly float predictedPathMaxTime = 7.2f; private readonly float predictedPathPointSpacing = 0.3f; private readonly float predictedPathRefreshInterval = 0.05f; private readonly float predictedTrajectoryUnlockFallbackDelay = 0.75f; private bool predictedPathCacheValid; private Component cachedPredictedPathBall; private Vector3 cachedPredictedShotOrigin = Vector3.zero; private Vector3 cachedPredictedAimTargetPosition = Vector3.zero; private float cachedPredictedSwingPower; private float cachedPredictedSwingPitch; private readonly float predictedPathRebuildDistanceEpsilon = 0.015f; private readonly float predictedPathRebuildPowerEpsilon = 0.0025f; private readonly float predictedPathRebuildPitchEpsilon = 0.05f; private readonly string configPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Mods", "BirdieMod.cfg"); private string assistToggleKeyName = "F"; private string coffeeBoostKeyName = "F2"; private string nearestBallModeKeyName = "F3"; private string unlockAllCosmeticsKeyName = "F4"; private string itemSpawnerKeyName = "F5"; private string hudToggleKeyName = "H"; private string randomItemKeyName = "G"; private string assistToggleKeyLabel = "F"; private string coffeeBoostKeyLabel = "F2"; private string nearestBallModeKeyLabel = "F3"; private string unlockAllCosmeticsKeyLabel = "F4"; private string itemSpawnerKeyLabel = "F5"; private string hudToggleKeyLabel = "H"; private string randomItemKeyLabel = "G"; private Key assistToggleKey = (Key)20; private Key coffeeBoostKey = (Key)95; private Key nearestBallModeKey = (Key)96; private Key unlockAllCosmeticsKey = (Key)97; private Key itemSpawnerKey = (Key)98; private Key hudToggleKey = (Key)22; private Key randomItemKey = (Key)21; private bool hudVisible = true; private bool itemMenuOpen; private GameObject itemMenuPanelObject; private TextMeshProUGUI itemMenuText; private bool actualTrailEnabled = true; private bool predictedTrailEnabled = true; private bool frozenTrailEnabled = true; private bool impactPreviewEnabled = true; private float impactPreviewTargetFps; private int impactPreviewTextureWidth = 640; private int impactPreviewTextureHeight = 360; private float actualTrailStartWidth = 0.22f; private float actualTrailEndWidth = 0.18f; private float predictedTrailStartWidth = 0.18f; private float predictedTrailEndWidth = 0.14f; private float frozenTrailStartWidth = 0.2f; private float frozenTrailEndWidth = 0.16f; private Color actualTrailColor = new Color(1f, 0.58f, 0.2f, 1f); private Color predictedTrailColor = new Color(0.36f, 0.95f, 0.46f, 0.95f); private Color frozenTrailColor = new Color(0.36f, 0.74f, 1f, 0.92f); private bool visualsInitialized; private readonly float visualsInitializationDelay = 2.5f; private bool trailVisualSettingsDirty = true; private bool actualTrailLineDirty = true; private bool predictedTrailLineDirty = true; private bool frozenTrailLineDirty = true; private bool hudDirty = true; private float nextHudRefreshTime; private readonly float hudRefreshInterval = 0.1f; private string cachedLeftHudText = ""; private string cachedCenterHudText = ""; private string cachedRightHudText = ""; private string cachedBottomHudText = ""; private bool nearestAnyBallModeEnabled; private float nextNearestAnyBallResolveTime; private readonly float nearestAnyBallResolveInterval = 0.1f; private readonly List cachedGolfBalls = new List(64); private float nextGolfBallCacheRefreshTime; private readonly float golfBallCacheRefreshInterval = 0.75f; private readonly float emptyGolfBallCacheRefreshInterval = 2f; private float nextImpactPreviewRenderTime; private Camera cachedImpactPreviewReferenceCamera; private float nextImpactPreviewReferenceCameraRefreshTime; private readonly float impactPreviewReferenceCameraRefreshInterval = 1f; private readonly float impactPreviewAutoTargetFps = 60f; private readonly RaycastHit[] impactPreviewRaycastHits = (RaycastHit[])(object)new RaycastHit[24]; private readonly RaycastHit[] impactPreviewGroundProbeHits = (RaycastHit[])(object)new RaycastHit[24]; private readonly object[] cachedSpeedBoostArgs = new object[1]; private readonly object[] cachedEaseInArgs = new object[1]; private readonly object[] cachedMatchSetupGetValueArgs = new object[1]; private readonly object[] cachedChargingStateArgs = new object[1]; private readonly object[] cachedUpdateSwingPowerArgs = new object[2] { true, false }; private string iceToggleKeyName = "I"; private string iceToggleKeyLabel = "I"; private Key iceToggleKey = (Key)23; private bool iceImmunityEnabled; private bool iceReflectionInitialized; private FieldInfo cachedHorizontalDragField; private PropertyInfo cachedPlayerMovementSettingsProperty; private float normalHorizontalDragValue = 10f; private string settingsKeyName = "F6"; private string settingsKeyLabel = "F6"; private Key settingsKey = (Key)99; private bool settingsPanelOpen; private int settingsTabIndex; private bool keybindRebindMode; private int keybindRebindIndex = -1; private GameObject settingsPanelObject; private static Sprite s_roundedLg = null; private static Sprite s_roundedMd = null; private static Sprite s_roundedSm = null; private static Sprite s_pillSprite = null; private static Sprite s_circleSprite = null; private Button[] settingsV2NavButtons = (Button[])(object)new Button[5]; private GameObject[] settingsV2TabPanels = (GameObject[])(object)new GameObject[5]; private Button[] settingsKeybindRowButtons; private Image[] settingsHudTogglePillBgs; private TMP_InputField settingsCreditsInputField; private TextMeshProUGUI settingsKeybindRebindStatusLabel; private bool settingsInputReflectionInitialized; private MethodInfo cachedCursorSetForceUnlockedMethod; private MethodInfo cachedInputManagerEnableModeMethod; private MethodInfo cachedInputManagerDisableModeMethod; private object cachedInputModePausedValue; private int creditsGrantAmount = 1000; private bool creditsReflectionInitialized; private MethodInfo cachedRewardCreditsMethod; private bool hudShowBottomBar = true; private bool hudShowBallDistance = true; private bool hudShowIceIndicator = true; private bool hudShowCenterTitle = true; private bool hudShowPlayerInfo = true; private bool tracersEnabled = true; private string noWindKeyName = "F7"; private string noWindKeyLabel = "F7"; private Key noWindKey = (Key)100; private bool noWindEnabled; private bool windExtrasReflectionInitialized; private object cachedWindSettingsInstance; private FieldInfo cachedWindForceScaleField; private float savedWindForceScale = 1f; private string perfectShotKeyName = "F8"; private string perfectShotKeyLabel = "F8"; private Key perfectShotKey = (Key)101; private bool perfectShotEnabled; private string noAirDragKeyName = "F9"; private string noAirDragKeyLabel = "F9"; private Key noAirDragKey = (Key)102; private bool noAirDragEnabled; private bool airDragExtrasReflectionInitialized; private FieldInfo cachedLinearAirDragField; private float savedLinearAirDrag = 0.01f; private string speedMultiplierKeyName = "F10"; private string speedMultiplierKeyLabel = "F10"; private Key speedMultiplierKey = (Key)103; private bool speedMultiplierEnabled; private float speedMultiplierFactor = 2f; private bool moveSpeedExtrasReflectionInitialized; private PropertyInfo cachedPlayerMovSettingsProperty; private FieldInfo cachedDefaultMoveSpeedField; private float savedDefaultMoveSpeed = 7f; private string infiniteAmmoKeyName = "F11"; private string infiniteAmmoKeyLabel = "F11"; private Key infiniteAmmoKey = (Key)104; private bool infiniteAmmoEnabled; private bool ammoInventoryReflectionReady; private FieldInfo cachedInventorySlotsSyncListField; private FieldInfo cachedInventoryOverridesDictField; private FieldInfo cachedInvSlotItemTypeField; private ConstructorInfo cachedInvSlotConstructor; private readonly Dictionary ammoItemTypeBackup = new Dictionary(); private string noRecoilKeyName = "F12"; private string noRecoilKeyLabel = "F12"; private Key noRecoilKey = (Key)105; private bool noRecoilEnabled; private bool screenshakeExtrasReflectionInitialized; private object cachedScreenshakeOwner; private FieldInfo cachedScreenshakeFactorField; private float savedScreenshakeFactor = 1f; private string noKnockbackKeyName = "N"; private string noKnockbackKeyLabel = "N"; private Key noKnockbackKey = (Key)28; private bool noKnockbackEnabled; private bool knockbackImmunityReflectionReady; private FieldInfo cachedKnockoutImmunityStatusField; private FieldInfo cachedHasImmunityField; private Component localPlayerHittable; private string landmineImmunityKeyName = "M"; private string landmineImmunityKeyLabel = "M"; private Key landmineImmunityKey = (Key)27; private bool landmineImmunityEnabled; private string lockOnAnyDistanceKeyName = "L"; private string lockOnAnyDistanceKeyLabel = "L"; private Key lockOnAnyDistanceKey = (Key)26; private bool lockOnAnyDistanceEnabled; private bool lockOnReflectionInitialized; private FieldInfo cachedLockOnMaxDistanceField; private float savedLockOnMaxDistance = 60f; private string expandedSlotsKeyName = "U"; private string expandedSlotsKeyLabel = "U"; private Key expandedSlotsKey = (Key)35; private bool expandedSlotsEnabled; private bool expandedSlotsAllPlayers = true; private const int ExpandedSlotsTarget = 7; private bool expandedSlotsReflectionInitialized; private object cachedExpandedHotkeysInstance; private FieldInfo cachedHotkeyUisField; private object cachedExpandedPlayerInvSettings; private FieldInfo cachedMaxItemsBackingField; private int savedOriginalMaxItems = 3; private Array savedOriginalHotkeyUisArray; private List spawnedExtraHotkeyUiObjects = new List(); private Vector2 savedSlotParentSizeDelta; private bool savedSlotParentMaskEnabled; private Transform savedSlotParentTransform; private bool hostControlsActive; private ulong hostAllowedFeatureMask = 65535uL; private byte _hostSelectedWeather; private bool _hostWeatherRunning; private static bool _perfectShotLogged; private GameObject impactPreviewPanelObject; private RawImage impactPreviewRawImage; private RenderTexture impactPreviewTexture; private GameObject impactPreviewCameraObject; private Camera impactPreviewCamera; private readonly float impactPreviewLookHeightOffset = 0.65f; private readonly float impactPreviewProbeHeight = 36f; private readonly float impactPreviewCameraMinDistance = 9.5f; private readonly float impactPreviewCameraMaxDistance = 20f; private readonly float impactPreviewCameraMinHeight = 6.2f; private readonly float impactPreviewCameraMaxHeight = 12.5f; private readonly float impactPreviewFieldOfView = 52f; private readonly float impactPreviewOrbitDegreesPerSecond = 26f; private readonly float impactPreviewGroundClearance = 1.85f; private readonly float impactPreviewMinVerticalLookOffset = 2.25f; private const int CoffeeItemTypeInt = 1; private static readonly int[] SpawnableItemTypeInts = new int[12] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; private static readonly string[] SpawnableItemNames = new string[12] { "Coffee", "Dueling Pistol", "Elephant Gun", "Airhorn", "Spring Boots", "Golf Cart", "Rocket Launcher", "Landmine", "Electromagnet", "Orbital Laser", "Rocket Driver", "Freeze Bomb" }; private static readonly Key[] SpawnableItemKeys; private static readonly string[] SpawnableItemKeyLabels; private bool itemSpawnerReflectionInitialized; private bool dispenserReflectionInitialized; private Type cachedItemDispenserType; private FieldInfo cachedItemDispenserItemTypeField; private PropertyInfo cachedItemDispenserIsEnabledProperty; private MethodInfo cachedItemDispenserCmdDispenseMethod; private Type cachedPhysicalItemType; private FieldInfo cachedPhysicalItemItemTypeField; private MethodInfo cachedCmdGiveToPlayerMethod; private bool dispenserPickupPending; private int dispenserPickupItemTypeInt; private Component dispenserPickupLocalInventory; private float dispenserPickupDeadline; private const float dispenserPickupTimeout = 2.5f; private bool crateReflectionInitialized; private bool pendingCrateTeleport; private float pendingCrateTeleportExpiry; private const float crateTeleportConfirmWindow = 3f; private bool crateReturnPending; private Vector3 crateReturnPosition; private Type cachedItemSpawnerType; private FieldInfo cachedItemSpawnerSettingsField; private PropertyInfo cachedItemSpawnerNetHasItemBoxProp; private Type cachedItemSpawnerSettingsType; private MethodInfo cachedGetRandomItemForMethod; private PropertyInfo cachedInventoryPlayerInfoProp; private PropertyInfo cachedNetworkServerActiveProperty; private bool cachedNetworkServerPropertyInit; private PropertyInfo cachedLocalPlayerInventoryProperty; private PropertyInfo cachedAllItemsProperty; private MethodInfo cachedTryGetItemDataMethod; private PropertyInfo cachedItemDataMaxUsesProperty; private Type cachedItemTypeEnumType; private MethodInfo cachedServerTryAddItemMethod; private Rect _imRect; private bool _imRectInit; private Vector2 _imFeaturesScroll; private Vector2 _imKeysScroll; private bool _imStylesReady; private GUIStyle _imWindowStyle; private GUIStyle _imTitleStyle; private GUIStyle _imTabActive; private GUIStyle _imTabIdle; private GUIStyle _imSectionLabel; private GUIStyle _imToggleOn; private GUIStyle _imToggleOff; private GUIStyle _imActionLabel; private GUIStyle _imKeyBadge; private GUIStyle _imRebindActive; private GUIStyle _imButton; private GUIStyle _imCloseBtn; private GUIStyle _imInfoLabel; private GUIStyle _imDescLabel; private Texture2D _imTxDark; private Texture2D _imTxBlue; private Texture2D _imTxGrey; private Texture2D _imTxDarker; private Texture2D _imTxRed; private Texture2D _imTxGreen; private Texture2D _imTxSeparator; private Vector2 _imItemsScroll; private Vector2 _imNetScroll; private static readonly string[] SettingsKeybindDisplayNames; private static readonly Key[] SettingsSelectionKeys; private byte _currentWeatherType; private bool _weatherPhysicsApplied; private float _originalLinearAirDrag; private bool _originalAirDragCached; private float _originalWindForceScale; private bool _originalWindForceScaleCached; private float _nextLightningTime; private float _nextGustTime; private float _tornadoMoveTimer; private Vector3 _tornadoWorldPosition; private bool _tornadoPositionSet; private float _lightningFlashEndTime; private bool _lightningStrikePending; private Vector3 _pendingLightningStrikePosition; internal bool autoWeatherEnabled; internal int autoWeatherChance = 40; internal int[] autoWeatherChances = new int[8] { 50, 35, 20, 40, 25, 10, 15, 5 }; private bool _holeEventSubscribed; private float _tornadoFlingNextTime; private bool _wAirDragReady; private FieldInfo _wAirDragField; private object _wBallSettings; private bool _wWindReady; private object _wWindSettings; private FieldInfo _wWindScaleField; private bool _wWmReady; private Type _wWmType; private PropertyInfo _wWmSpeedProp; private PropertyInfo _wWmAngleProp; private bool _gustRunning; private bool _lightningRunning; private float _currentRainDragMul = 1f; private float _nextWindDragUpdateTime; private float _nextErraticWindShiftTime; private object _cachedWmObject; private float _nextWmCacheRefreshTime; private readonly List _weatherMaterials = new List(); private GameObject _weatherVfxRoot; private ParticleSystem _rainPs; private ParticleSystem _tornadoPs; private Light _lightningLight; private AudioSource _weatherAudio; private bool _lightningScreenFlash; private float _lightningScreenFlashEnd; private bool _playerStruckFlash; private float _playerStruckFlashEnd; private AudioSource _weatherAudio2; private AudioClip _clipRainLoop; private AudioClip _clipWindLoop; private AudioClip _clipWindGust; private AudioClip _clipThunderCrack; private AudioClip _clipTornadoLoop; private bool _soundsLoaded; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; BirdieLog.MsgImpl = delegate(string s) { Logger.LogInfo((object)s); }; BirdieLog.WarnImpl = delegate(string s) { Logger.LogWarning((object)s); }; BirdieCoroutine.StartImpl = delegate(IEnumerator e) { ((MonoBehaviour)this).StartCoroutine(e); }; BirdieInit(); } private void Update() { BirdieUpdate(); } private void LateUpdate() { BirdieLateUpdate(); } private void OnGUI() { BirdieOnGUI(); } private void InitializeReflectionCache() { if (reflectionCacheInitialized) { return; } try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { if (cachedTryGetMethod == null) { Type type = assembly.GetType("CameraModuleController"); if (type != null) { cachedTryGetMethod = type.GetMethod("TryGetOrbitModule", BindingFlags.Static | BindingFlags.Public); } } if (cachedEnterSwingAimCameraMethod == null) { Type type2 = assembly.GetType("GameplayCameraManager"); if (type2 != null) { cachedEnterSwingAimCameraMethod = type2.GetMethod("EnterSwingAimCamera", BindingFlags.Static | BindingFlags.Public); cachedExitSwingAimCameraMethod = type2.GetMethod("ExitSwingAimCamera", BindingFlags.Static | BindingFlags.Public); cachedReachOrbitSteadyStateMethod = type2.GetMethod("ReachOrbitCameraSteadyState", BindingFlags.Static | BindingFlags.Public); } } if (cachedTryGetMethod != null && cachedEnterSwingAimCameraMethod != null) { break; } } object obj = TryGetOrbitModule(); if (obj != null) { Type type3 = obj.GetType(); cachedOrbitSetYawMethod = type3.GetMethod("SetYaw", BindingFlags.Instance | BindingFlags.Public); cachedOrbitSetPitchMethod = type3.GetMethod("SetPitch", BindingFlags.Instance | BindingFlags.Public); cachedOrbitForceUpdateMethod = type3.GetMethod("ForceUpdateModule", BindingFlags.Instance | BindingFlags.Public); } } catch { } reflectionCacheInitialized = true; } private object TryGetOrbitModule() { if (cachedTryGetMethod == null) { return null; } try { cachedOrbitModuleQueryArgs[0] = null; return ((bool)cachedTryGetMethod.Invoke(null, cachedOrbitModuleQueryArgs)) ? cachedOrbitModuleQueryArgs[0] : null; } catch { return null; } } private FieldInfo FindYawField(Type componentType) { FieldInfo field = componentType.GetField("targetYaw", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (!(field != null) || !(field.FieldType == typeof(float))) { return null; } return field; } private void CacheYawAccessorsForComponent(Component component, ref Component initializedComponent, ref PropertyInfo yawProperty, ref FieldInfo yawField) { if ((Object)(object)component == (Object)null) { initializedComponent = null; yawProperty = null; yawField = null; } else if (initializedComponent != component) { initializedComponent = component; Type type = ((object)component).GetType(); yawProperty = type.GetProperty("Yaw", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); yawField = FindYawField(type); } } private void EnsureAimYawAccessors() { CacheYawAccessorsForComponent(playerMovement, ref initializedYawPlayerMovement, ref cachedPlayerMovementYawProperty, ref cachedPlayerMovementYawField); CacheYawAccessorsForComponent(playerGolfer, ref initializedYawPlayerGolfer, ref cachedPlayerGolferYawProperty, ref cachedPlayerGolferYawField); } private void ApplyYawToAimComponent(Component component, PropertyInfo yawProperty, FieldInfo yawField, float targetYaw) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)component == (Object)null) { return; } try { if (yawProperty != null && yawProperty.CanWrite && yawProperty.PropertyType == typeof(float)) { yawProperty.SetValue(component, targetYaw, null); } } catch { } try { if (yawField != null && yawField.FieldType == typeof(float)) { yawField.SetValue(component, targetYaw); } } catch { } try { component.transform.rotation = Quaternion.Euler(0f, targetYaw, 0f); } catch { } } private void ApplyAimDirectionToSwingSubject(float targetYaw) { EnsureAimYawAccessors(); ApplyYawToAimComponent(playerMovement, cachedPlayerMovementYawProperty, cachedPlayerMovementYawField, targetYaw); if (playerGolfer != playerMovement) { ApplyYawToAimComponent(playerGolfer, cachedPlayerGolferYawProperty, cachedPlayerGolferYawField, targetYaw); } } private void SetSwingAimCameraState(bool enabled) { if (enabled == wasAimRequestedLastFrame) { return; } wasAimRequestedLastFrame = enabled; MethodInfo methodInfo = (enabled ? cachedEnterSwingAimCameraMethod : cachedExitSwingAimCameraMethod); if (methodInfo == null) { return; } try { methodInfo.Invoke(null, null); if (enabled && cachedReachOrbitSteadyStateMethod != null) { cachedReachOrbitSteadyStateMethod.Invoke(null, null); } } catch { } } private void DisableAutoAimCamera() { isAimModeActive = false; cameraAimSmoothingInitialized = false; orbitYawVelocity = 0f; orbitPitchVelocity = 0f; SetSwingAimCameraState(enabled: false); } private bool IsPlayerAimingSwing() { if ((Object)(object)playerGolfer == (Object)null) { return false; } if (!playerGolferProperties.TryGetValue("IsAimingSwing", out var value) || value == null) { return false; } try { return Convert.ToBoolean(value.GetValue(playerGolfer, null)); } catch { return false; } } private void AutoAimCamera() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) if (!assistEnabled || (!isLeftMousePressed && !isRightMousePressed) || !IsPlayerAimingSwing() || (Object)(object)playerGolfer == (Object)null || holePosition == Vector3.zero) { DisableAutoAimCamera(); return; } try { InitializeReflectionCache(); object obj = TryGetOrbitModule(); if (obj == null || cachedOrbitSetYawMethod == null || cachedOrbitSetPitchMethod == null) { DisableAutoAimCamera(); return; } SetSwingAimCameraState(enabled: true); Vector3 position = playerGolfer.transform.position; Vector3 playerPosition = (((Object)(object)golfBall != (Object)null) ? golfBall.transform.position : position); currentAimTargetPosition = GetAimTargetPosition(playerPosition) + windAimOffset; currentSwingOriginPosition = GetSwingOriginPosition(); if (currentAimTargetPosition == Vector3.zero || currentSwingOriginPosition == Vector3.zero) { DisableAutoAimCamera(); return; } Vector3 val = currentAimTargetPosition - currentSwingOriginPosition; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { DisableAutoAimCamera(); return; } float num = Mathf.Atan2(val.x, val.z) * 57.29578f; float magnitude = ((Vector3)(ref val)).magnitude; float num2 = Mathf.Clamp(magnitude * 0.9f, 4f, 15f); float num3 = Mathf.Lerp(3.25f, 8f, Mathf.InverseLerp(0f, 25f, magnitude)); Vector3 val2 = position - ((Vector3)(ref val)).normalized * num2; val2.y += num3; Vector3 val3 = currentAimTargetPosition - val2; float num4 = (0f - Mathf.Asin(Mathf.Clamp(((Vector3)(ref val3)).normalized.y, -0.999f, 0.999f))) * 57.29578f; if (!cameraAimSmoothingInitialized || !isAimModeActive) { smoothedOrbitYaw = num; smoothedOrbitPitch = num4; orbitYawVelocity = 0f; orbitPitchVelocity = 0f; cameraAimSmoothingInitialized = true; } else { float num5 = Mathf.Max(0.0001f, Time.deltaTime); smoothedOrbitYaw = Mathf.SmoothDampAngle(smoothedOrbitYaw, num, ref orbitYawVelocity, orbitAimSmoothTime, orbitAimMaxSpeed, num5); smoothedOrbitPitch = Mathf.SmoothDampAngle(smoothedOrbitPitch, num4, ref orbitPitchVelocity, orbitAimSmoothTime, orbitAimMaxSpeed, num5); } ApplyAimDirectionToSwingSubject(smoothedOrbitYaw); cachedOrbitYawArgs[0] = smoothedOrbitYaw; cachedOrbitPitchArgs[0] = smoothedOrbitPitch; cachedOrbitSetYawMethod.Invoke(obj, cachedOrbitYawArgs); cachedOrbitSetPitchMethod.Invoke(obj, cachedOrbitPitchArgs); if (cachedOrbitForceUpdateMethod != null) { cachedOrbitForceUpdateMethod.Invoke(obj, null); } isAimModeActive = true; } catch { DisableAutoAimCamera(); } } private void LoadOrCreateConfig() { ApplyDefaultConfig(); try { string directoryName = Path.GetDirectoryName(configPath); if (!string.IsNullOrEmpty(directoryName)) { Directory.CreateDirectory(directoryName); } if (!File.Exists(configPath)) { File.WriteAllText(configPath, BuildDefaultConfigText(), Encoding.ASCII); } else { LoadConfigFromFile(configPath); } } catch { } UpdateConfigLabels(); MarkHudDirty(); MarkTrailVisualSettingsDirty(); nextImpactPreviewRenderTime = 0f; } private void ApplyDefaultConfig() { //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) assistToggleKeyName = "F1"; coffeeBoostKeyName = "F2"; nearestBallModeKeyName = "F3"; unlockAllCosmeticsKeyName = "F4"; itemSpawnerKeyName = "F5"; hudToggleKeyName = "H"; randomItemKeyName = "G"; iceToggleKeyName = "I"; settingsKeyName = "F6"; noWindKeyName = "W"; perfectShotKeyName = "P"; noAirDragKeyName = "D"; speedMultiplierKeyName = "S"; speedMultiplierFactor = 2f; infiniteAmmoKeyName = "A"; noRecoilKeyName = "R"; noKnockbackKeyName = "K"; landmineImmunityKeyName = "M"; lockOnAnyDistanceKeyName = "L"; expandedSlotsKeyName = "U"; hudShowBottomBar = true; hudShowBallDistance = true; hudShowIceIndicator = true; hudShowCenterTitle = true; hudShowPlayerInfo = true; tracersEnabled = true; creditsGrantAmount = 1000; actualTrailEnabled = true; predictedTrailEnabled = true; frozenTrailEnabled = true; impactPreviewEnabled = true; impactPreviewTargetFps = impactPreviewAutoTargetFps; impactPreviewTextureWidth = 640; impactPreviewTextureHeight = 360; actualTrailStartWidth = 0.22f; actualTrailEndWidth = 0.18f; predictedTrailStartWidth = 0.18f; predictedTrailEndWidth = 0.14f; frozenTrailStartWidth = 0.2f; frozenTrailEndWidth = 0.16f; actualTrailColor = new Color(1f, 0.58f, 0.2f, 1f); predictedTrailColor = new Color(0.36f, 0.95f, 0.46f, 0.95f); frozenTrailColor = new Color(0.36f, 0.74f, 1f, 0.92f); hostAllowedFeatureMask = 16383uL; } private void LoadConfigFromFile(string path) { //IL_0bee: Unknown result type (might be due to invalid IL or missing references) //IL_0bf3: Unknown result type (might be due to invalid IL or missing references) //IL_0bf8: Unknown result type (might be due to invalid IL or missing references) //IL_0bc2: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Unknown result type (might be due to invalid IL or missing references) //IL_0bcc: Unknown result type (might be due to invalid IL or missing references) //IL_0bd8: Unknown result type (might be due to invalid IL or missing references) //IL_0bdd: Unknown result type (might be due to invalid IL or missing references) //IL_0be2: Unknown result type (might be due to invalid IL or missing references) string[] array = File.ReadAllLines(path); foreach (string text in array) { if (string.IsNullOrWhiteSpace(text)) { continue; } string text2 = text.Trim(); if (text2.StartsWith("#", StringComparison.Ordinal) || text2.StartsWith(";", StringComparison.Ordinal)) { continue; } int num = text2.IndexOf('='); if (num <= 0) { continue; } string text3 = text2.Substring(0, num).Trim().ToLowerInvariant(); string text4 = text2.Substring(num + 1).Trim(); switch (text3) { case "assist_toggle_key": assistToggleKeyName = ParseKeyNameOrDefault(text4, assistToggleKeyName); break; case "coffee_boost_key": coffeeBoostKeyName = ParseKeyNameOrDefault(text4, coffeeBoostKeyName); break; case "nearest_ball_mode_key": nearestBallModeKeyName = ParseKeyNameOrDefault(text4, nearestBallModeKeyName); break; case "unlock_all_cosmetics_key": unlockAllCosmeticsKeyName = ParseKeyNameOrDefault(text4, unlockAllCosmeticsKeyName); break; case "item_spawner_key": itemSpawnerKeyName = ParseKeyNameOrDefault(text4, itemSpawnerKeyName); break; case "hud_toggle_key": hudToggleKeyName = ParseKeyNameOrDefault(text4, hudToggleKeyName); break; case "random_item_key": randomItemKeyName = ParseKeyNameOrDefault(text4, randomItemKeyName); break; case "ice_toggle_key": iceToggleKeyName = ParseKeyNameOrDefault(text4, iceToggleKeyName); break; case "settings_key": settingsKeyName = ParseKeyNameOrDefault(text4, settingsKeyName); break; case "no_wind_key": noWindKeyName = ParseKeyNameOrDefault(text4, noWindKeyName); break; case "perfect_shot_key": perfectShotKeyName = ParseKeyNameOrDefault(text4, perfectShotKeyName); break; case "no_air_drag_key": noAirDragKeyName = ParseKeyNameOrDefault(text4, noAirDragKeyName); break; case "speed_multiplier_key": speedMultiplierKeyName = ParseKeyNameOrDefault(text4, speedMultiplierKeyName); break; case "speed_multiplier_factor": speedMultiplierFactor = ParseFloatOrDefault(text4, speedMultiplierFactor, 0.1f, 20f); break; case "infinite_ammo_key": infiniteAmmoKeyName = ParseKeyNameOrDefault(text4, infiniteAmmoKeyName); break; case "no_recoil_key": noRecoilKeyName = ParseKeyNameOrDefault(text4, noRecoilKeyName); break; case "no_knockback_key": noKnockbackKeyName = ParseKeyNameOrDefault(text4, noKnockbackKeyName); break; case "landmine_immunity_key": landmineImmunityKeyName = ParseKeyNameOrDefault(text4, landmineImmunityKeyName); break; case "lock_on_any_distance_key": lockOnAnyDistanceKeyName = ParseKeyNameOrDefault(text4, lockOnAnyDistanceKeyName); break; case "expanded_slots_key": expandedSlotsKeyName = ParseKeyNameOrDefault(text4, expandedSlotsKeyName); break; case "expanded_slots_all_players": expandedSlotsAllPlayers = ParseBoolOrDefault(text4, expandedSlotsAllPlayers); break; case "hud_show_bottom_bar": hudShowBottomBar = ParseBoolOrDefault(text4, hudShowBottomBar); break; case "hud_show_ball_distance": hudShowBallDistance = ParseBoolOrDefault(text4, hudShowBallDistance); break; case "hud_show_ice_indicator": hudShowIceIndicator = ParseBoolOrDefault(text4, hudShowIceIndicator); break; case "hud_show_center_title": hudShowCenterTitle = ParseBoolOrDefault(text4, hudShowCenterTitle); break; case "hud_show_player_info": hudShowPlayerInfo = ParseBoolOrDefault(text4, hudShowPlayerInfo); break; case "tracers_enabled": tracersEnabled = ParseBoolOrDefault(text4, tracersEnabled); break; case "credits_grant_amount": creditsGrantAmount = ParseIntOrDefault(text4, creditsGrantAmount, 0, 999999); break; case "actual_trail_enabled": actualTrailEnabled = ParseBoolOrDefault(text4, actualTrailEnabled); break; case "predicted_trail_enabled": predictedTrailEnabled = ParseBoolOrDefault(text4, predictedTrailEnabled); break; case "frozen_trail_enabled": frozenTrailEnabled = ParseBoolOrDefault(text4, frozenTrailEnabled); break; case "impact_preview_enabled": impactPreviewEnabled = ParseBoolOrDefault(text4, impactPreviewEnabled); break; case "impact_preview_fps": impactPreviewTargetFps = ParseFloatOrDefault(text4, impactPreviewTargetFps, 0f, 360f); break; case "impact_preview_width": impactPreviewTextureWidth = ParseIntOrDefault(text4, impactPreviewTextureWidth, 320, 3840); break; case "impact_preview_height": impactPreviewTextureHeight = ParseIntOrDefault(text4, impactPreviewTextureHeight, 180, 2160); break; case "actual_trail_start_width": actualTrailStartWidth = ParseFloatOrDefault(text4, actualTrailStartWidth, 0.005f, 1f); break; case "actual_trail_end_width": actualTrailEndWidth = ParseFloatOrDefault(text4, actualTrailEndWidth, 0.005f, 1f); break; case "predicted_trail_start_width": predictedTrailStartWidth = ParseFloatOrDefault(text4, predictedTrailStartWidth, 0.005f, 1f); break; case "predicted_trail_end_width": predictedTrailEndWidth = ParseFloatOrDefault(text4, predictedTrailEndWidth, 0.005f, 1f); break; case "frozen_trail_start_width": frozenTrailStartWidth = ParseFloatOrDefault(text4, frozenTrailStartWidth, 0.005f, 1f); break; case "frozen_trail_end_width": frozenTrailEndWidth = ParseFloatOrDefault(text4, frozenTrailEndWidth, 0.005f, 1f); break; case "actual_trail_color": actualTrailColor = ParseColorOrDefault(text4, actualTrailColor); break; case "predicted_trail_color": predictedTrailColor = ParseColorOrDefault(text4, predictedTrailColor); break; case "frozen_trail_color": frozenTrailColor = ParseColorOrDefault(text4, frozenTrailColor); break; case "hostallowedfeaturemask": { if (ulong.TryParse(text4, NumberStyles.Integer, CultureInfo.InvariantCulture, out var result)) { hostAllowedFeatureMask = result; } break; } } } } private string BuildDefaultConfigText() { StringBuilder stringBuilder = new StringBuilder(512); stringBuilder.AppendLine("# Birdie Mod config"); stringBuilder.AppendLine("# Restart the game after editing this file for trail/visual settings."); stringBuilder.AppendLine("# Keybind and HUD changes can also be made in-game via the settings panel (F6)."); stringBuilder.AppendLine(); stringBuilder.AppendLine("assist_toggle_key=F1"); stringBuilder.AppendLine("coffee_boost_key=F2"); stringBuilder.AppendLine("nearest_ball_mode_key=F3"); stringBuilder.AppendLine("unlock_all_cosmetics_key=F4"); stringBuilder.AppendLine("item_spawner_key=F5"); stringBuilder.AppendLine("hud_toggle_key=H"); stringBuilder.AppendLine("random_item_key=G"); stringBuilder.AppendLine("ice_toggle_key=I"); stringBuilder.AppendLine("settings_key=F6"); stringBuilder.AppendLine(); stringBuilder.AppendLine("no_wind_key=W"); stringBuilder.AppendLine("perfect_shot_key=P"); stringBuilder.AppendLine("no_air_drag_key=D"); stringBuilder.AppendLine("speed_multiplier_key=S"); stringBuilder.AppendLine("speed_multiplier_factor=2.0"); stringBuilder.AppendLine("infinite_ammo_key=A"); stringBuilder.AppendLine("no_recoil_key=R"); stringBuilder.AppendLine("no_knockback_key=K"); stringBuilder.AppendLine("landmine_immunity_key=M"); stringBuilder.AppendLine("lock_on_any_distance_key=L"); stringBuilder.AppendLine("expanded_slots_key=U"); stringBuilder.AppendLine(); stringBuilder.AppendLine("hud_show_bottom_bar=true"); stringBuilder.AppendLine("hud_show_ball_distance=true"); stringBuilder.AppendLine("hud_show_ice_indicator=true"); stringBuilder.AppendLine("hud_show_center_title=true"); stringBuilder.AppendLine("hud_show_player_info=true"); stringBuilder.AppendLine("tracers_enabled=true"); stringBuilder.AppendLine(); stringBuilder.AppendLine("credits_grant_amount=1000"); stringBuilder.AppendLine(); stringBuilder.AppendLine("actual_trail_enabled=true"); stringBuilder.AppendLine("actual_trail_start_width=0.22"); stringBuilder.AppendLine("actual_trail_end_width=0.18"); stringBuilder.AppendLine("actual_trail_color=#FF9433"); stringBuilder.AppendLine(); stringBuilder.AppendLine("predicted_trail_enabled=true"); stringBuilder.AppendLine("predicted_trail_start_width=0.18"); stringBuilder.AppendLine("predicted_trail_end_width=0.14"); stringBuilder.AppendLine("predicted_trail_color=#39F26E"); stringBuilder.AppendLine(); stringBuilder.AppendLine("frozen_trail_enabled=true"); stringBuilder.AppendLine("frozen_trail_start_width=0.20"); stringBuilder.AppendLine("frozen_trail_end_width=0.16"); stringBuilder.AppendLine("frozen_trail_color=#53ACFF"); stringBuilder.AppendLine(); stringBuilder.AppendLine("impact_preview_enabled=true"); stringBuilder.AppendLine("impact_preview_fps=60"); stringBuilder.AppendLine("impact_preview_width=640"); stringBuilder.AppendLine("impact_preview_height=360"); return stringBuilder.ToString(); } private string ParseKeyNameOrDefault(string value, string fallbackValue) { string text = ((value == null) ? "" : value.Trim()); if (!string.IsNullOrEmpty(text)) { return text; } return fallbackValue; } private bool ParseBoolOrDefault(string value, bool fallbackValue) { if (!bool.TryParse(value, out var result)) { return fallbackValue; } return result; } private float ParseFloatOrDefault(string value, float fallbackValue, float minValue, float maxValue) { if (!float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { return fallbackValue; } return Mathf.Clamp(result, minValue, maxValue); } private int ParseIntOrDefault(string value, int fallbackValue, int minValue, int maxValue) { if (!int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var result)) { return fallbackValue; } return Mathf.Clamp(result, minValue, maxValue); } private Color ParseColorOrDefault(string value, Color fallbackValue) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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) Color result = default(Color); if (ColorUtility.TryParseHtmlString(value, ref result)) { return result; } string[] array = value.Split(new char[1] { ',' }); if (array.Length >= 3 && array.Length <= 4) { float[] array2 = new float[4] { fallbackValue.r, fallbackValue.g, fallbackValue.b, fallbackValue.a }; for (int i = 0; i < array.Length; i++) { if (!float.TryParse(array[i].Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out var result2)) { return fallbackValue; } array2[i] = ((result2 > 1f) ? Mathf.Clamp01(result2 / 255f) : Mathf.Clamp01(result2)); } return new Color(array2[0], array2[1], array2[2], array2[3]); } return fallbackValue; } private void UpdateConfigLabels() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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) //IL_0023: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0073: 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) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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_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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) assistToggleKey = ParseConfiguredKey(assistToggleKeyName, (Key)94); coffeeBoostKey = ParseConfiguredKey(coffeeBoostKeyName, (Key)95); nearestBallModeKey = ParseConfiguredKey(nearestBallModeKeyName, (Key)96); unlockAllCosmeticsKey = ParseConfiguredKey(unlockAllCosmeticsKeyName, (Key)97); itemSpawnerKey = ParseConfiguredKey(itemSpawnerKeyName, (Key)98); hudToggleKey = ParseConfiguredKey(hudToggleKeyName, (Key)22); randomItemKey = ParseConfiguredKey(randomItemKeyName, (Key)21); iceToggleKey = ParseConfiguredKey(iceToggleKeyName, (Key)23); settingsKey = ParseConfiguredKey(settingsKeyName, (Key)99); noWindKey = ParseConfiguredKey(noWindKeyName, (Key)37); perfectShotKey = ParseConfiguredKey(perfectShotKeyName, (Key)30); noAirDragKey = ParseConfiguredKey(noAirDragKeyName, (Key)18); speedMultiplierKey = ParseConfiguredKey(speedMultiplierKeyName, (Key)33); infiniteAmmoKey = ParseConfiguredKey(infiniteAmmoKeyName, (Key)15); noRecoilKey = ParseConfiguredKey(noRecoilKeyName, (Key)32); noKnockbackKey = ParseConfiguredKey(noKnockbackKeyName, (Key)25); landmineImmunityKey = ParseConfiguredKey(landmineImmunityKeyName, (Key)27); lockOnAnyDistanceKey = ParseConfiguredKey(lockOnAnyDistanceKeyName, (Key)26); expandedSlotsKey = ParseConfiguredKey(expandedSlotsKeyName, (Key)35); assistToggleKeyLabel = FormatKeyLabel(assistToggleKeyName); coffeeBoostKeyLabel = FormatKeyLabel(coffeeBoostKeyName); nearestBallModeKeyLabel = FormatKeyLabel(nearestBallModeKeyName); unlockAllCosmeticsKeyLabel = FormatKeyLabel(unlockAllCosmeticsKeyName); itemSpawnerKeyLabel = FormatKeyLabel(itemSpawnerKeyName); hudToggleKeyLabel = FormatKeyLabel(hudToggleKeyName); randomItemKeyLabel = FormatKeyLabel(randomItemKeyName); iceToggleKeyLabel = FormatKeyLabel(iceToggleKeyName); settingsKeyLabel = FormatKeyLabel(settingsKeyName); noWindKeyLabel = FormatKeyLabel(noWindKeyName); perfectShotKeyLabel = FormatKeyLabel(perfectShotKeyName); noAirDragKeyLabel = FormatKeyLabel(noAirDragKeyName); speedMultiplierKeyLabel = FormatKeyLabel(speedMultiplierKeyName); infiniteAmmoKeyLabel = FormatKeyLabel(infiniteAmmoKeyName); noRecoilKeyLabel = FormatKeyLabel(noRecoilKeyName); noKnockbackKeyLabel = FormatKeyLabel(noKnockbackKeyName); landmineImmunityKeyLabel = FormatKeyLabel(landmineImmunityKeyName); lockOnAnyDistanceKeyLabel = FormatKeyLabel(lockOnAnyDistanceKeyName); expandedSlotsKeyLabel = FormatKeyLabel(expandedSlotsKeyName); } private void SaveCurrentConfig() { try { string directoryName = Path.GetDirectoryName(configPath); if (!string.IsNullOrEmpty(directoryName)) { Directory.CreateDirectory(directoryName); } File.WriteAllText(configPath, BuildCurrentConfigText(), Encoding.ASCII); } catch { } } private string BuildCurrentConfigText() { //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(1024); stringBuilder.AppendLine("# Birdie Mod config"); stringBuilder.AppendLine("# Restart the game after editing this file for trail/visual settings."); stringBuilder.AppendLine("# Keybind and HUD changes can also be made in-game via the settings panel."); stringBuilder.AppendLine(); stringBuilder.AppendLine("assist_toggle_key=" + assistToggleKeyName); stringBuilder.AppendLine("coffee_boost_key=" + coffeeBoostKeyName); stringBuilder.AppendLine("nearest_ball_mode_key=" + nearestBallModeKeyName); stringBuilder.AppendLine("unlock_all_cosmetics_key=" + unlockAllCosmeticsKeyName); stringBuilder.AppendLine("item_spawner_key=" + itemSpawnerKeyName); stringBuilder.AppendLine("hud_toggle_key=" + hudToggleKeyName); stringBuilder.AppendLine("random_item_key=" + randomItemKeyName); stringBuilder.AppendLine("ice_toggle_key=" + iceToggleKeyName); stringBuilder.AppendLine("settings_key=" + settingsKeyName); stringBuilder.AppendLine(); stringBuilder.AppendLine("no_wind_key=" + noWindKeyName); stringBuilder.AppendLine("perfect_shot_key=" + perfectShotKeyName); stringBuilder.AppendLine("no_air_drag_key=" + noAirDragKeyName); stringBuilder.AppendLine("speed_multiplier_key=" + speedMultiplierKeyName); stringBuilder.AppendLine("speed_multiplier_factor=" + speedMultiplierFactor.ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine("infinite_ammo_key=" + infiniteAmmoKeyName); stringBuilder.AppendLine("no_recoil_key=" + noRecoilKeyName); stringBuilder.AppendLine("no_knockback_key=" + noKnockbackKeyName); stringBuilder.AppendLine("landmine_immunity_key=" + landmineImmunityKeyName); stringBuilder.AppendLine("lock_on_any_distance_key=" + lockOnAnyDistanceKeyName); stringBuilder.AppendLine("expanded_slots_key=" + expandedSlotsKeyName); stringBuilder.AppendLine("expanded_slots_all_players=" + expandedSlotsAllPlayers.ToString().ToLowerInvariant()); stringBuilder.AppendLine(); stringBuilder.AppendLine("hud_show_bottom_bar=" + hudShowBottomBar.ToString().ToLowerInvariant()); stringBuilder.AppendLine("hud_show_ball_distance=" + hudShowBallDistance.ToString().ToLowerInvariant()); stringBuilder.AppendLine("hud_show_ice_indicator=" + hudShowIceIndicator.ToString().ToLowerInvariant()); stringBuilder.AppendLine("hud_show_center_title=" + hudShowCenterTitle.ToString().ToLowerInvariant()); stringBuilder.AppendLine("hud_show_player_info=" + hudShowPlayerInfo.ToString().ToLowerInvariant()); stringBuilder.AppendLine("tracers_enabled=" + tracersEnabled.ToString().ToLowerInvariant()); stringBuilder.AppendLine(); stringBuilder.AppendLine("credits_grant_amount=" + creditsGrantAmount); stringBuilder.AppendLine(); stringBuilder.AppendLine("actual_trail_enabled=" + actualTrailEnabled.ToString().ToLowerInvariant()); stringBuilder.AppendLine("actual_trail_start_width=" + actualTrailStartWidth.ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine("actual_trail_end_width=" + actualTrailEndWidth.ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine("actual_trail_color=#" + ColorUtility.ToHtmlStringRGB(actualTrailColor)); stringBuilder.AppendLine(); stringBuilder.AppendLine("predicted_trail_enabled=" + predictedTrailEnabled.ToString().ToLowerInvariant()); stringBuilder.AppendLine("predicted_trail_start_width=" + predictedTrailStartWidth.ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine("predicted_trail_end_width=" + predictedTrailEndWidth.ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine("predicted_trail_color=#" + ColorUtility.ToHtmlStringRGB(predictedTrailColor)); stringBuilder.AppendLine(); stringBuilder.AppendLine("frozen_trail_enabled=" + frozenTrailEnabled.ToString().ToLowerInvariant()); stringBuilder.AppendLine("frozen_trail_start_width=" + frozenTrailStartWidth.ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine("frozen_trail_end_width=" + frozenTrailEndWidth.ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine("frozen_trail_color=#" + ColorUtility.ToHtmlStringRGB(frozenTrailColor)); stringBuilder.AppendLine(); stringBuilder.AppendLine("impact_preview_enabled=" + impactPreviewEnabled.ToString().ToLowerInvariant()); stringBuilder.AppendLine("impact_preview_fps=" + ((int)impactPreviewTargetFps).ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine("impact_preview_width=" + impactPreviewTextureWidth.ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine("impact_preview_height=" + impactPreviewTextureHeight.ToString(CultureInfo.InvariantCulture)); stringBuilder.AppendLine(); stringBuilder.AppendLine("hostAllowedFeatureMask=" + hostAllowedFeatureMask.ToString(CultureInfo.InvariantCulture)); return stringBuilder.ToString(); } private Key ParseConfiguredKey(string configuredKeyName, Key fallbackKey) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (string.IsNullOrWhiteSpace(configuredKeyName)) { return fallbackKey; } if (!Enum.TryParse(configuredKeyName.Trim(), ignoreCase: true, out Key result) || (int)result == 0) { return fallbackKey; } return result; } private string FormatKeyLabel(string configuredKeyName) { if (string.IsNullOrWhiteSpace(configuredKeyName)) { return "?"; } string text = configuredKeyName.Trim(); if (Enum.TryParse(text, ignoreCase: true, out Key result)) { text = ((object)(Key)(ref result)).ToString(); } if (text.StartsWith("Digit", StringComparison.OrdinalIgnoreCase)) { return text.Substring("Digit".Length); } return text.ToUpperInvariant(); } private bool WasConfiguredKeyPressed(Key configuredKey) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Keyboard current = Keyboard.current; if (current == null || (int)configuredKey == 0) { return false; } try { return current[configuredKey] != null && ((ButtonControl)current[configuredKey]).wasPressedThisFrame; } catch { return false; } } private Color BrightenColor(Color color, float factor) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) return new Color(Mathf.Clamp01(color.r * factor), Mathf.Clamp01(color.g * factor), Mathf.Clamp01(color.b * factor), color.a); } private Color DarkenColor(Color color, float factor) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) return new Color(Mathf.Clamp01(color.r * factor), Mathf.Clamp01(color.g * factor), Mathf.Clamp01(color.b * factor), color.a); } private Gradient CreateTrailGradient(Color baseColor, float startFactor, float midFactor, float endFactor, float startAlpha, float midAlpha, float endAlpha) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) Color val = BrightenColor(baseColor, startFactor); Color val2 = BrightenColor(baseColor, midFactor); Color val3 = DarkenColor(baseColor, endFactor); Gradient val4 = new Gradient(); val4.colorKeys = (GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(val, 0f), new GradientColorKey(val2, 0.55f), new GradientColorKey(val3, 1f) }; val4.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(Mathf.Clamp01(startAlpha), 0f), new GradientAlphaKey(Mathf.Clamp01(midAlpha), 0.6f), new GradientAlphaKey(Mathf.Clamp01(endAlpha), 1f) }; return val4; } private void ApplyTrailVisualSettings() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) ApplyTrailVisualSettings(shotPathLine, shotPathMaterial, actualTrailEnabled, actualTrailStartWidth, actualTrailEndWidth, actualTrailColor, 1.2f, 1f, 0.78f, 0.96f, 0.8f, 0.62f); ApplyTrailVisualSettings(predictedPathLine, predictedPathMaterial, predictedTrailEnabled, predictedTrailStartWidth, predictedTrailEndWidth, predictedTrailColor, 1.15f, 1f, 0.82f, 0.94f, 0.78f, 0.55f); ApplyTrailVisualSettings(frozenPredictedPathLine, frozenPredictedPathMaterial, frozenTrailEnabled, frozenTrailStartWidth, frozenTrailEndWidth, frozenTrailColor, 1.18f, 1f, 0.8f, 0.92f, 0.76f, 0.52f); } private void ApplyTrailVisualSettings(LineRenderer lineRenderer, Material material, bool enabled, float startWidth, float endWidth, Color baseColor, float startFactor, float midFactor, float endFactor, float startAlpha, float midAlpha, float endAlpha) { //IL_0023: 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) if (!((Object)(object)lineRenderer == (Object)null)) { lineRenderer.startWidth = startWidth; lineRenderer.endWidth = endWidth; ((Renderer)lineRenderer).enabled = enabled; lineRenderer.colorGradient = CreateTrailGradient(baseColor, startFactor, midFactor, endFactor, startAlpha, midAlpha, endAlpha); if (!enabled) { lineRenderer.positionCount = 0; } if ((Object)(object)material != (Object)null) { material.color = baseColor; } } } private void ResolvePlayerContext() { Component val = playerMovement; Component val2 = playerGolfer; TryResolveLocalPlayerGolferViaGameManager(); if ((Object)(object)playerMovement == (Object)null) { GameObject[] array = FindAllGameObjects(); for (int i = 0; i < array.Length; i++) { GameObject val3 = array[i]; if ((Object)(object)val3 == (Object)null) { continue; } Component[] components = val3.GetComponents(); foreach (Component val4 in components) { if (!((Object)(object)val4 == (Object)null) && !(((object)val4).GetType().Name != "PlayerMovement") && IsLocalPlayerMovement(val4)) { playerMovement = val4; addSpeedBoostMethod = ((object)val4).GetType().GetMethod("AddSpeedBoost", BindingFlags.Instance | BindingFlags.NonPublic); i = array.Length; break; } } } } else if (addSpeedBoostMethod == null) { addSpeedBoostMethod = ((object)playerMovement).GetType().GetMethod("AddSpeedBoost", BindingFlags.Instance | BindingFlags.NonPublic); } EnsureLocalGolfBallReference(force: true); playerFound = (Object)(object)playerMovement != (Object)null && (Object)(object)playerGolfer != (Object)null; if (((Object)(object)val != (Object)null && val != playerMovement) || ((Object)(object)val2 != (Object)null && val2 != playerGolfer)) { ClearRuntimeState(); } hadResolvedPlayerContext = (Object)(object)playerMovement != (Object)null && (Object)(object)playerGolfer != (Object)null; } private bool IsLocalPlayerMovement(Component component) { try { PropertyInfo property = ((object)component).GetType().GetProperty("isLocalPlayer", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); return property != null && property.PropertyType == typeof(bool) && (bool)property.GetValue(component, null); } catch { return false; } } private void CachePlayerGolferAccessors(Component golfer) { if (!((Object)(object)golfer == (Object)null)) { EnsurePlayerGolferMetadataCached(golfer); } } private void EnsurePlayerGolferMetadataCached(Component golfer) { if ((Object)(object)golfer == (Object)null || initializedPlayerGolfer == golfer) { return; } initializedPlayerGolfer = golfer; playerGolferProperties.Clear(); playerGolferFields.Clear(); cachedTryStartChargingSwingMethod = null; cachedSetIsChargingSwingMethod = null; cachedReleaseSwingChargeMethod = null; cachedUpdateSwingNormalizedPowerMethod = null; swingNormalizedPowerBackingField = null; try { Type type = ((object)golfer).GetType(); BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; string[] array = new string[6] { "SwingNormalizedPower", "SwingPitch", "IsChargingSwing", "IsSwinging", "IsAimingSwing", "OwnBall" }; for (int i = 0; i < array.Length; i++) { PropertyInfo property = type.GetProperty(array[i], bindingAttr); if (property != null) { playerGolferProperties[array[i]] = property; } } string[] array2 = new string[1] { "swingPowerTimestamp" }; for (int j = 0; j < array2.Length; j++) { FieldInfo field = type.GetField(array2[j], bindingAttr); if (field != null) { playerGolferFields[array2[j]] = field; } } cachedTryStartChargingSwingMethod = type.GetMethod("TryStartChargingSwing", bindingAttr); cachedSetIsChargingSwingMethod = type.GetMethod("SetIsChargingSwing", BindingFlags.Instance | BindingFlags.NonPublic); cachedReleaseSwingChargeMethod = type.GetMethod("ReleaseSwingCharge", bindingAttr); cachedUpdateSwingNormalizedPowerMethod = type.GetMethod("UpdateSwingNormalizedPower", BindingFlags.Instance | BindingFlags.NonPublic); } catch { } } private bool TryGetCurrentSwingValues(out float swingPower, out float swingPitch, out bool isChargingSwing, out bool isSwinging) { swingPower = idealSwingPower; swingPitch = idealSwingPitch; isChargingSwing = false; isSwinging = false; if ((Object)(object)playerGolfer == (Object)null) { return false; } try { if (!playerGolferProperties.TryGetValue("SwingNormalizedPower", out var value) || !playerGolferProperties.TryGetValue("SwingPitch", out var value2) || !playerGolferProperties.TryGetValue("IsChargingSwing", out var value3) || !playerGolferProperties.TryGetValue("IsSwinging", out var value4)) { return false; } swingPower = Convert.ToSingle(value.GetValue(playerGolfer, null)); swingPitch = Convert.ToSingle(value2.GetValue(playerGolfer, null)); isChargingSwing = Convert.ToBoolean(value3.GetValue(playerGolfer, null)); isSwinging = Convert.ToBoolean(value4.GetValue(playerGolfer, null)); return true; } catch { return false; } } private void InitializeLocalGolferResolver() { if (localGolferResolverInitialized) { return; } localGolferResolverInitialized = true; try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { Type type = assemblies[i].GetType("GameManager"); if (!(type == null)) { PropertyInfo property = type.GetProperty("LocalPlayerAsGolfer", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { cachedLocalPlayerAsGolferProperty = property; break; } } } } catch { } } private bool TryResolveLocalPlayerGolferViaGameManager() { InitializeLocalGolferResolver(); if (cachedLocalPlayerAsGolferProperty == null) { return false; } try { object? value = cachedLocalPlayerAsGolferProperty.GetValue(null, null); Component val = (Component)((value is Component) ? value : null); if ((Object)(object)val == (Object)null) { return false; } if (playerGolfer != val) { playerGolfer = val; CachePlayerGolferAccessors(val); } return true; } catch { return false; } } private bool EnsureLocalGolfBallReference(bool force) { if (nearestAnyBallModeEnabled) { return EnsureNearestAnyGolfBallReference(force); } if (!force && (Object)(object)golfBall != (Object)null && (Object)(object)golfBall.gameObject != (Object)null) { hadResolvedBallContext = true; return true; } float time = Time.time; if (!force && time < nextBallResolveTime) { return (Object)(object)golfBall != (Object)null; } nextBallResolveTime = time + ballResolveInterval; Component ownBall = null; string text = "missing"; TryResolveLocalPlayerGolferViaGameManager(); if (TryGetOwnBallFromGolfer(playerGolfer, out ownBall)) { text = "OwnBall"; } if ((Object)(object)ownBall == (Object)null) { HandleTrackedGolfBallChanged(golfBall, null); golfBall = null; lastBallResolveSource = "missing"; hadResolvedBallContext = false; return false; } HandleTrackedGolfBallChanged(golfBall, ownBall); golfBall = ownBall; lastBallResolveSource = text; hadResolvedBallContext = true; return true; } private bool EnsureNearestAnyGolfBallReference(bool force) { if ((Object)(object)playerMovement == (Object)null && (Object)(object)playerGolfer == (Object)null) { golfBall = null; lastBallResolveSource = "missing"; hadResolvedBallContext = false; return false; } float time = Time.time; if (!force && (Object)(object)golfBall != (Object)null && (Object)(object)golfBall.gameObject != (Object)null && time < nextNearestAnyBallResolveTime) { hadResolvedBallContext = true; return true; } nextNearestAnyBallResolveTime = time + nearestAnyBallResolveInterval; Component val = FindNearestGolfBallToPlayer(force); if ((Object)(object)val == (Object)null) { HandleTrackedGolfBallChanged(golfBall, null); golfBall = null; lastBallResolveSource = "missing"; hadResolvedBallContext = false; return false; } HandleTrackedGolfBallChanged(golfBall, val); golfBall = val; lastBallResolveSource = "nearest-any"; hadResolvedBallContext = true; return true; } private void HandleTrackedGolfBallChanged(Component previousBall, Component nextBall) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (previousBall != nextBall) { ResetTrailState(); HideImpactPreview(); nextPredictedPathRefreshTime = 0f; swingHittableReflectionInitialized = false; lastShotPathBallPosition = (((Object)(object)nextBall != (Object)null) ? (nextBall.transform.position + Vector3.up * shotPathHeightOffset) : Vector3.zero); } } private void RefreshGolfBallCache(bool force) { float time = Time.time; if (!force && time < nextGolfBallCacheRefreshTime) { return; } cachedGolfBalls.Clear(); Component[] array = FindAllComponents(); foreach (Component val in array) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val.gameObject == (Object)null) && !(((object)val).GetType().Name != "GolfBall")) { cachedGolfBalls.Add(val); } } nextGolfBallCacheRefreshTime = time + ((cachedGolfBalls.Count > 0) ? golfBallCacheRefreshInterval : emptyGolfBallCacheRefreshInterval); } private Component FindNearestGolfBallToPlayer(bool forceRefreshCache) { //IL_0019: 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) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) Vector3 position; if ((Object)(object)playerMovement != (Object)null) { position = playerMovement.transform.position; } else { if (!((Object)(object)playerGolfer != (Object)null)) { return null; } position = playerGolfer.transform.position; } RefreshGolfBallCache(forceRefreshCache); Component result = null; float num = float.MaxValue; for (int num2 = cachedGolfBalls.Count - 1; num2 >= 0; num2--) { Component val = cachedGolfBalls[num2]; if ((Object)(object)val == (Object)null || (Object)(object)val.gameObject == (Object)null) { cachedGolfBalls.RemoveAt(num2); } else { Vector3 val2 = val.transform.position - position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = val; } } } return result; } private bool TryGetOwnBallFromGolfer(Component golfer, out Component ownBall) { ownBall = null; if ((Object)(object)golfer == (Object)null) { return false; } try { if (playerGolferProperties.TryGetValue("OwnBall", out var value) && value != null) { object? value2 = value.GetValue(golfer, null); ownBall = (Component)((value2 is Component) ? value2 : null); return (Object)(object)ownBall != (Object)null; } } catch { } return false; } private bool TryResolveDisplayNameFromObject(object source, out string displayName) { displayName = null; if (source == null) { return false; } BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; Type type = source.GetType(); string[] array = new string[4] { "PlayerName", "displayName", "playerNickname", "NetworkplayerName" }; foreach (string name in array) { PropertyInfo property = type.GetProperty(name, bindingAttr); if (property != null && property.PropertyType == typeof(string) && property.GetIndexParameters().Length == 0) { try { if (ModTextHelper.TryGetValidDisplayName(property.GetValue(source, null) as string, out displayName)) { return true; } } catch { } } FieldInfo field = type.GetField(name, bindingAttr); if (!(field != null) || !(field.FieldType == typeof(string))) { continue; } try { if (ModTextHelper.TryGetValidDisplayName(field.GetValue(source) as string, out displayName)) { return true; } } catch { } } return false; } private string GetLocalPlayerDisplayName() { if ((Object)(object)playerMovement == (Object)null) { return "Searching..."; } float time = Time.time; if (time < nextDisplayNameRefreshTime && !string.IsNullOrEmpty(cachedLocalPlayerDisplayName)) { return cachedLocalPlayerDisplayName; } nextDisplayNameRefreshTime = time + displayNameRefreshInterval; if (TryResolveDisplayNameFromObject(playerMovement, out var displayName)) { cachedLocalPlayerDisplayName = displayName; return cachedLocalPlayerDisplayName; } GameObject gameObject = playerMovement.gameObject; if ((Object)(object)gameObject != (Object)null) { Component[] components = gameObject.GetComponents(); foreach (Component val in components) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)playerMovement) && TryResolveDisplayNameFromObject(val, out displayName)) { cachedLocalPlayerDisplayName = displayName; return cachedLocalPlayerDisplayName; } } string value = ModTextHelper.NormalizeDisplayName(((Object)gameObject).name); if (!string.IsNullOrEmpty(value)) { cachedLocalPlayerDisplayName = value; return cachedLocalPlayerDisplayName; } } cachedLocalPlayerDisplayName = "Unknown"; return cachedLocalPlayerDisplayName; } private GameObject[] FindAllGameObjects() { int frameCount = Time.frameCount; if (cachedAllGameObjects == null || cachedAllGameObjectsFrame != frameCount) { cachedAllGameObjects = Object.FindObjectsByType((FindObjectsSortMode)0); cachedAllGameObjectsFrame = frameCount; } return cachedAllGameObjects; } private Component[] FindAllComponents() { int frameCount = Time.frameCount; if (cachedAllComponents == null || cachedAllComponentsFrame != frameCount) { cachedAllComponents = Object.FindObjectsByType((FindObjectsSortMode)0); cachedAllComponentsFrame = frameCount; } return cachedAllComponents; } private void UnlockAllCosmetics() { bool flag = false; bool flag2 = false; try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly obj in assemblies) { Type type = obj.GetType("CosmeticsUnlocksManager"); if (type != null) { flag |= ApplyCosmeticsUnlocksToType(type); flag2 |= InvokeCosmeticsRefreshMethods(type); } Type type2 = obj.GetType("PlayerCosmetics"); if (type2 != null) { flag |= ApplyCosmeticsUnlocksToType(type2); flag2 |= InvokeCosmeticsRefreshMethods(type2); } Type type3 = obj.GetType("PlayerCustomizationMenu"); if (type3 != null) { flag |= ApplyCosmeticsUnlocksToType(type3); flag2 |= InvokeCosmeticsRefreshMethods(type3); } } Component[] array = FindAllComponents(); foreach (Component val in array) { if (!((Object)(object)val == (Object)null)) { string name = ((object)val).GetType().Name; if (name.IndexOf("Cosmetic", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("Customization", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("Unlock", StringComparison.OrdinalIgnoreCase) >= 0) { flag |= ApplyCosmeticsUnlocksToObject(val, ((object)val).GetType()); flag2 |= InvokeCosmeticsRefreshMethods(val, ((object)val).GetType()); } } } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Cosmetic unlock failed: " + ex.Message); } if (flag) { BirdieLog.Msg("[Birdie] Cosmetics unlock applied."); } else if (flag2) { BirdieLog.Msg("[Birdie] Cosmetics UI refresh triggered."); } else { BirdieLog.Warning("[Birdie] Cosmetics manager not found."); } } private bool ApplyCosmeticsUnlocksToType(Type type) { if (type == null) { return false; } bool flag = false; flag |= ApplyCosmeticsUnlocksToObject(null, type); object obj = ResolveSingletonInstance(type); if (obj != null) { flag |= ApplyCosmeticsUnlocksToObject(obj, type); } return flag; } private bool ApplyCosmeticsUnlocksToObject(object target, Type type) { if (type == null) { return false; } bool flag = false; for (int i = 0; i < cosmeticUnlockFlagNames.Length; i++) { flag |= TrySetBoolMember(type, target, cosmeticUnlockFlagNames[i], value: true); } return flag; } private bool InvokeCosmeticsRefreshMethods(Type type) { if (type == null) { return false; } bool flag = false; flag |= InvokeCosmeticsRefreshMethods(null, type); object obj = ResolveSingletonInstance(type); if (obj != null) { flag |= InvokeCosmeticsRefreshMethods(obj, type); } return flag; } private bool InvokeCosmeticsRefreshMethods(object target, Type type) { if (type == null) { return false; } bool flag = false; for (int i = 0; i < cosmeticRefreshMethodNames.Length; i++) { flag |= InvokeParameterlessMethodIfExists(type, target, cosmeticRefreshMethodNames[i]); } return flag; } private object ResolveSingletonInstance(Type type) { if (type == null) { return null; } BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; string[] array = new string[6] { "Instance", "instance", "Singleton", "singleton", "Current", "current" }; for (int i = 0; i < array.Length; i++) { try { PropertyInfo property = type.GetProperty(array[i], bindingAttr); if (property != null && property.GetIndexParameters().Length == 0 && property.GetMethod != null && property.GetMethod.IsStatic) { object value = property.GetValue(null, null); if (value != null) { return value; } } } catch { } try { FieldInfo field = type.GetField(array[i], bindingAttr); if (field != null && field.IsStatic) { object value2 = field.GetValue(null); if (value2 != null) { return value2; } } } catch { } } Component[] array2 = FindAllComponents(); foreach (Component val in array2) { if ((Object)(object)val != (Object)null && ((object)val).GetType() == type) { return val; } } return null; } private bool TrySetBoolMember(Type type, object target, string memberName, bool value) { if (type == null || string.IsNullOrEmpty(memberName)) { return false; } BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; try { FieldInfo field = type.GetField(memberName, bindingAttr); if (field != null && field.FieldType == typeof(bool)) { object obj = (field.IsStatic ? null : target); if (field.IsStatic || obj != null) { field.SetValue(obj, value); return true; } } } catch { } try { PropertyInfo property = type.GetProperty(memberName, bindingAttr); if (property != null && property.PropertyType == typeof(bool) && property.CanWrite && property.GetIndexParameters().Length == 0) { MethodInfo setMethod = property.GetSetMethod(nonPublic: true); object obj3 = ((setMethod != null && setMethod.IsStatic) ? null : target); if ((setMethod != null && setMethod.IsStatic) || obj3 != null) { property.SetValue(obj3, value, null); return true; } } } catch { } return false; } private bool InvokeParameterlessMethodIfExists(Type type, object target, string methodName) { if (type == null || string.IsNullOrEmpty(methodName)) { return false; } BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic; try { MethodInfo method = type.GetMethod(methodName, bindingAttr, null, Type.EmptyTypes, null); if (method == null) { return false; } object obj = (method.IsStatic ? null : target); if (!method.IsStatic && obj == null) { return false; } method.Invoke(obj, null); return true; } catch { return false; } } private bool IsFeatureAllowed(int featureBit) { if (!BirdieHostBridge.IsUnderHostControl) { return true; } if (featureBit < 0) { return true; } return (BirdieHostBridge.ReceivedFeatureMask & (ulong)(1L << featureBit)) != 0; } private void SetHostControlsActive(bool active) { hostControlsActive = active; BirdieHostBridge.BroadcastToClients(active, active ? hostAllowedFeatureMask : ulong.MaxValue); MarkHudDirty(); } private void SetHostFeatureBit(int bit, bool enabled) { if (enabled) { hostAllowedFeatureMask |= (ulong)(1L << bit); } else { hostAllowedFeatureMask &= (ulong)(~(1L << bit)); } if (hostControlsActive) { BirdieHostBridge.BroadcastToClients(active: true, hostAllowedFeatureMask); } } private void InitializeWindExtrasReflection() { if (windExtrasReflectionInitialized) { return; } windExtrasReflectionInitialized = true; try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("WindManager"); if (type != null) { break; } } if (type == null) { BirdieLog.Warning("[Birdie] WindManager type not found"); return; } Object val = Object.FindObjectOfType(type); if (val == (Object)null) { BirdieLog.Warning("[Birdie] WindManager not found in scene"); return; } FieldInfo field = type.GetField("windSettings", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field == null) { BirdieLog.Warning("[Birdie] WindManager.windSettings field not found"); return; } object value = field.GetValue(val); if (value == null) { BirdieLog.Warning("[Birdie] WindManager.windSettings value is null"); return; } cachedWindForceScaleField = value.GetType().GetField("forceScale", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (cachedWindForceScaleField != null && cachedWindForceScaleField.FieldType == typeof(float)) { savedWindForceScale = (float)cachedWindForceScaleField.GetValue(value); cachedWindSettingsInstance = value; } else { BirdieLog.Warning("[Birdie] WindSettings.forceScale field not found"); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Wind reflection error: " + ex.Message); } } private void ToggleNoWind() { if (IsFeatureAllowed(3)) { noWindEnabled = !noWindEnabled; InitializeWindExtrasReflection(); BirdieLog.Msg(string.Format("[Birdie] No Wind {0} | ws={1} field={2}", noWindEnabled ? "ON" : "OFF", (cachedWindSettingsInstance != null) ? "OK" : "NULL", (cachedWindForceScaleField != null) ? cachedWindForceScaleField.Name : "NULL")); if (noWindEnabled) { ApplyNoWindState(); } else { RestoreWindState(); } MarkHudDirty(); } } private void ApplyNoWindState() { if (cachedWindSettingsInstance == null || cachedWindForceScaleField == null) { return; } try { cachedWindForceScaleField.SetValue(cachedWindSettingsInstance, 0f); } catch { } } private void RestoreWindState() { if (cachedWindSettingsInstance == null || cachedWindForceScaleField == null) { return; } try { cachedWindForceScaleField.SetValue(cachedWindSettingsInstance, savedWindForceScale); } catch { } } private void TogglePerfectShot() { if (IsFeatureAllowed(4)) { perfectShotEnabled = !perfectShotEnabled; BirdieLog.Msg(perfectShotEnabled ? "[Birdie] Perfect Shot ON" : "[Birdie] Perfect Shot OFF"); MarkHudDirty(); } } private void ApplyPerfectShotForcing() { if (!perfectShotEnabled || (Object)(object)playerGolfer == (Object)null || !isLeftMousePressed) { return; } try { if (swingNormalizedPowerBackingField == null) { swingNormalizedPowerBackingField = ((object)playerGolfer).GetType().GetField("k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic); if (swingNormalizedPowerBackingField == null) { FieldInfo[] fields = ((object)playerGolfer).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.FieldType == typeof(float)) { string text = fieldInfo.Name.ToLower(); if (text.Contains("swing") && text.Contains("power")) { swingNormalizedPowerBackingField = fieldInfo; break; } } } } if (!_perfectShotLogged) { _perfectShotLogged = true; BirdieLog.Msg("[Birdie] Perfect Shot backing field: " + ((swingNormalizedPowerBackingField != null) ? swingNormalizedPowerBackingField.Name : "NOT FOUND") + " | type=" + ((object)playerGolfer).GetType().Name); FieldInfo[] fields = ((object)playerGolfer).GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo2 in fields) { if (fieldInfo2.FieldType == typeof(float)) { BirdieLog.Msg("[Birdie] float field: " + fieldInfo2.Name); } } } } if (swingNormalizedPowerBackingField != null) { swingNormalizedPowerBackingField.SetValue(playerGolfer, 0.999f); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Perfect Shot error: " + ex.Message); } } private void InitializeAirDragExtrasReflection() { if (airDragExtrasReflectionInitialized) { return; } airDragExtrasReflectionInitialized = true; try { object golfBallSettingsObject = GetGolfBallSettingsObject(); if (golfBallSettingsObject == null) { BirdieLog.Warning("[Birdie] GolfBallSettings is null"); return; } Type type = golfBallSettingsObject.GetType(); cachedLinearAirDragField = type.GetField("k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic); if (cachedLinearAirDragField != null && cachedLinearAirDragField.FieldType == typeof(float)) { savedLinearAirDrag = (float)cachedLinearAirDragField.GetValue(golfBallSettingsObject); } else { BirdieLog.Warning("[Birdie] k__BackingField not found on " + type.Name); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] AirDrag reflection error: " + ex.Message); } } private void ToggleNoAirDrag() { if (IsFeatureAllowed(5)) { noAirDragEnabled = !noAirDragEnabled; InitializeAirDragExtrasReflection(); if (noAirDragEnabled) { ApplyNoAirDragState(); BirdieLog.Msg($"[Birdie] No Air Drag ON (saved={savedLinearAirDrag:F5})"); } else { RestoreAirDragState(); BirdieLog.Msg("[Birdie] No Air Drag OFF"); } MarkHudDirty(); } } private void ApplyNoAirDragState() { if (cachedLinearAirDragField == null) { return; } try { object golfBallSettingsObject = GetGolfBallSettingsObject(); if (golfBallSettingsObject != null) { cachedLinearAirDragField.SetValue(golfBallSettingsObject, 1E-05f); } } catch { } } private void RestoreAirDragState() { if (cachedLinearAirDragField == null) { return; } try { object golfBallSettingsObject = GetGolfBallSettingsObject(); if (golfBallSettingsObject != null) { cachedLinearAirDragField.SetValue(golfBallSettingsObject, savedLinearAirDrag); } } catch { } } private void InitializeMoveSpeedExtrasReflection() { if (moveSpeedExtrasReflectionInitialized) { return; } moveSpeedExtrasReflectionInitialized = true; try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("GameManager"); if (type != null) { break; } } if (type == null) { BirdieLog.Warning("[Birdie] GameManager type not found"); return; } cachedPlayerMovSettingsProperty = type.GetProperty("PlayerMovementSettings", BindingFlags.Static | BindingFlags.Public); if (cachedPlayerMovSettingsProperty == null) { BirdieLog.Warning("[Birdie] GameManager.PlayerMovementSettings property not found"); return; } object value = cachedPlayerMovSettingsProperty.GetValue(null, null); if (value == null) { BirdieLog.Warning("[Birdie] PlayerMovementSettings value is null"); return; } Type type2 = value.GetType(); cachedDefaultMoveSpeedField = type2.GetField("k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic); if (cachedDefaultMoveSpeedField != null && cachedDefaultMoveSpeedField.FieldType == typeof(float)) { savedDefaultMoveSpeed = (float)cachedDefaultMoveSpeedField.GetValue(value); } else { BirdieLog.Warning("[Birdie] k__BackingField not found on " + type2.Name); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] MoveSpeed reflection error: " + ex.Message); } } private void ToggleSpeedMultiplier() { if (IsFeatureAllowed(6)) { speedMultiplierEnabled = !speedMultiplierEnabled; InitializeMoveSpeedExtrasReflection(); if (speedMultiplierEnabled) { ApplySpeedMultiplierState(); BirdieLog.Msg($"[Birdie] Speed Multiplier ON (x{speedMultiplierFactor:F1}, base={savedDefaultMoveSpeed:F2})"); } else { RestoreSpeedState(); BirdieLog.Msg("[Birdie] Speed Multiplier OFF"); } MarkHudDirty(); } } private void ApplySpeedMultiplierState() { if (cachedPlayerMovSettingsProperty == null || cachedDefaultMoveSpeedField == null) { return; } try { object value = cachedPlayerMovSettingsProperty.GetValue(null, null); if (value != null) { cachedDefaultMoveSpeedField.SetValue(value, savedDefaultMoveSpeed * speedMultiplierFactor); } } catch { } } private void RestoreSpeedState() { if (cachedPlayerMovSettingsProperty == null || cachedDefaultMoveSpeedField == null) { return; } try { object value = cachedPlayerMovSettingsProperty.GetValue(null, null); if (value != null) { cachedDefaultMoveSpeedField.SetValue(value, savedDefaultMoveSpeed); } } catch { } } private void InitializeAmmoInventoryReflection() { if (ammoInventoryReflectionReady) { return; } ammoInventoryReflectionReady = true; try { Type type = null; Type type2 = null; Type type3 = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { if (type == null) { type = assembly.GetType("GameManager"); } if (type2 == null) { type2 = assembly.GetType("PlayerInventory"); } if (type3 == null) { type3 = assembly.GetType("InventorySlot"); } if (type != null && type2 != null && type3 != null) { break; } } if (type == null || type2 == null || type3 == null) { BirdieLog.Warning("[Birdie] Ammo: required types not found (GM=" + ((type != null) ? "ok" : "NULL") + " PI=" + ((type2 != null) ? "ok" : "NULL") + " IS=" + ((type3 != null) ? "ok" : "NULL") + ")"); return; } cachedLocalPlayerInventoryProperty = type.GetProperty("LocalPlayerInventory", BindingFlags.Static | BindingFlags.Public); cachedInventorySlotsSyncListField = type2.GetField("slots", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); cachedInventoryOverridesDictField = type2.GetField("localPlayerSlotOverrides", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); cachedInvSlotItemTypeField = type3.GetField("itemType", BindingFlags.Instance | BindingFlags.Public); Type type4 = cachedInvSlotItemTypeField?.FieldType; if (type4 != null) { cachedInvSlotConstructor = type3.GetConstructor(new Type[2] { type4, typeof(int) }); } if (cachedLocalPlayerInventoryProperty != null && cachedInventorySlotsSyncListField != null && cachedInventoryOverridesDictField != null && cachedInvSlotItemTypeField != null && cachedInvSlotConstructor != null) { BirdieLog.Msg("[Birdie] Ammo inventory reflection ready"); return; } BirdieLog.Warning("[Birdie] Ammo: one or more fields missing — inv=" + ((cachedLocalPlayerInventoryProperty != null) ? "ok" : "NULL") + " slots=" + ((cachedInventorySlotsSyncListField != null) ? "ok" : "NULL") + " overrides=" + ((cachedInventoryOverridesDictField != null) ? "ok" : "NULL") + " itemType=" + ((cachedInvSlotItemTypeField != null) ? "ok" : "NULL") + " ctor=" + ((cachedInvSlotConstructor != null) ? "ok" : "NULL")); } catch (Exception ex) { BirdieLog.Warning("[Birdie] Ammo inventory reflection error: " + ex.Message); } } private void ToggleInfiniteAmmo() { if (IsFeatureAllowed(7)) { infiniteAmmoEnabled = !infiniteAmmoEnabled; if (!infiniteAmmoEnabled) { ammoItemTypeBackup.Clear(); BirdieInfiniteAmmoBridge.LocalPlayerInventory = null; } BirdieInfiniteAmmoBridge.EnsurePatchApplied(); BirdieInfiniteAmmoBridge.IsActive = infiniteAmmoEnabled; BirdieLog.Msg(infiniteAmmoEnabled ? "[Birdie] Infinite Item Usage ON" : "[Birdie] Infinite Item Usage OFF"); MarkHudDirty(); } } private void TickInfiniteAmmo() { if (!infiniteAmmoEnabled) { return; } if (!ammoInventoryReflectionReady) { InitializeAmmoInventoryReflection(); } if (cachedLocalPlayerInventoryProperty == null || cachedInventorySlotsSyncListField == null || cachedInventoryOverridesDictField == null || cachedInvSlotItemTypeField == null || cachedInvSlotConstructor == null) { return; } try { object value = cachedLocalPlayerInventoryProperty.GetValue(null, null); if (value == null) { return; } BirdieInfiniteAmmoBridge.LocalPlayerInventory = value; IList list = cachedInventorySlotsSyncListField.GetValue(value) as IList; IDictionary dictionary = cachedInventoryOverridesDictField.GetValue(value) as IDictionary; if (list == null || dictionary == null) { return; } for (int i = 0; i < list.Count; i++) { object obj = list[i]; object obj2 = ((obj != null) ? cachedInvSlotItemTypeField.GetValue(obj) : null); object obj3 = (dictionary.Contains(i) ? dictionary[i] : null); object obj4 = ((obj3 != null) ? cachedInvSlotItemTypeField.GetValue(obj3) : null); object value2 = null; if (obj4 != null && (int)obj4 != 0) { value2 = obj4; } else if (obj2 != null && (int)obj2 != 0) { value2 = obj2; } else { ammoItemTypeBackup.TryGetValue(i, out value2); } if (value2 != null && (int)value2 != 0) { ammoItemTypeBackup[i] = value2; dictionary[i] = cachedInvSlotConstructor.Invoke(new object[2] { value2, 99 }); } } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Infinite ammo tick error: " + ex.Message); } } private void InitializeScreenshakeExtrasReflection() { if (screenshakeExtrasReflectionInitialized) { return; } screenshakeExtrasReflectionInitialized = true; try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("GameSettings"); if (type != null) { break; } } if (type == null) { BirdieLog.Warning("[Birdie] GameSettings type not found"); return; } PropertyInfo property = type.GetProperty("All", BindingFlags.Static | BindingFlags.Public); if (property == null) { BirdieLog.Warning("[Birdie] GameSettings.All property not found"); return; } object value = property.GetValue(null, null); if (value == null) { BirdieLog.Warning("[Birdie] GameSettings.All is null"); return; } PropertyInfo property2 = value.GetType().GetProperty("General", BindingFlags.Instance | BindingFlags.Public); if (property2 == null) { BirdieLog.Warning("[Birdie] AllSettings.General property not found"); return; } object value2 = property2.GetValue(value, null); if (value2 == null) { BirdieLog.Warning("[Birdie] AllSettings.General is null"); return; } FieldInfo field = value2.GetType().GetField("screenshakeFactor", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && field.FieldType == typeof(float)) { cachedScreenshakeOwner = value2; cachedScreenshakeFactorField = field; savedScreenshakeFactor = (float)field.GetValue(value2); } else { BirdieLog.Warning("[Birdie] screenshakeFactor field not found on GeneralSettings"); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Screenshake reflection error: " + ex.Message); } } private void ToggleNoRecoil() { if (IsFeatureAllowed(8)) { noRecoilEnabled = !noRecoilEnabled; InitializeScreenshakeExtrasReflection(); if (noRecoilEnabled) { ApplyNoRecoilState(); BirdieLog.Msg($"[Birdie] No Recoil ON (saved shake={savedScreenshakeFactor:F3})"); } else { RestoreRecoilState(); BirdieLog.Msg("[Birdie] No Recoil OFF"); } MarkHudDirty(); } } private void ApplyNoRecoilState() { if (cachedScreenshakeOwner == null || cachedScreenshakeFactorField == null) { return; } try { cachedScreenshakeFactorField.SetValue(cachedScreenshakeOwner, 0f); } catch { } } private void RestoreRecoilState() { if (cachedScreenshakeOwner == null || cachedScreenshakeFactorField == null) { return; } try { cachedScreenshakeFactorField.SetValue(cachedScreenshakeOwner, savedScreenshakeFactor); } catch { } } private void InitializeKnockbackImmunityReflection() { if (knockbackImmunityReflectionReady) { return; } knockbackImmunityReflectionReady = true; try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("PlayerMovement"); if (type != null) { break; } } if (type == null) { BirdieLog.Warning("[Birdie] No Knockback: PlayerMovement type not found"); return; } cachedKnockoutImmunityStatusField = type.GetField("knockoutImmunityStatus", BindingFlags.Instance | BindingFlags.NonPublic); if (cachedKnockoutImmunityStatusField == null) { BirdieLog.Warning("[Birdie] No Knockback: knockoutImmunityStatus field not found"); return; } Type fieldType = cachedKnockoutImmunityStatusField.FieldType; cachedHasImmunityField = fieldType.GetField("hasImmunity", BindingFlags.Instance | BindingFlags.Public); if (cachedHasImmunityField == null) { BirdieLog.Warning("[Birdie] No Knockback: hasImmunity field not found on " + fieldType.Name); } else { BirdieLog.Msg("[Birdie] Knockback immunity reflection ready (struct=" + fieldType.Name + ")"); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Knockback immunity reflection error: " + ex.Message); knockbackImmunityReflectionReady = false; } } private void ToggleNoKnockback() { if (IsFeatureAllowed(9)) { noKnockbackEnabled = !noKnockbackEnabled; BirdieNoKnockbackBridge.EnsurePatchApplied(); BirdieNoKnockbackBridge.IsActive = noKnockbackEnabled; BirdieLog.Msg(noKnockbackEnabled ? "[Birdie] No Knockback ON" : "[Birdie] No Knockback OFF"); MarkHudDirty(); } } private void ToggleLandmineImmunity() { if (IsFeatureAllowed(10)) { landmineImmunityEnabled = !landmineImmunityEnabled; BirdieLandmineImmunityBridge.EnsurePatchApplied(); BirdieLandmineImmunityBridge.IsActive = landmineImmunityEnabled; BirdieLog.Msg(landmineImmunityEnabled ? "[Birdie] Landmine Immunity ON" : "[Birdie] Landmine Immunity OFF"); MarkHudDirty(); } } private void InitializeLockOnReflection() { if (lockOnReflectionInitialized) { return; } lockOnReflectionInitialized = true; try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("GameManager"); if (type != null) { break; } } if (type == null) { BirdieLog.Warning("[Birdie] Lock-On: GameManager not found"); return; } PropertyInfo property = type.GetProperty("GolfSettings", BindingFlags.Static | BindingFlags.Public); if (property == null) { BirdieLog.Warning("[Birdie] Lock-On: GolfSettings property not found"); return; } object value = property.GetValue(null, null); if (value == null) { BirdieLog.Warning("[Birdie] Lock-On: GolfSettings is null"); return; } Type type2 = value.GetType(); cachedLockOnMaxDistanceField = type2.GetField("k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic); if (cachedLockOnMaxDistanceField == null) { cachedLockOnMaxDistanceField = type2.GetField("LockOnMaxDistance", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (cachedLockOnMaxDistanceField != null && cachedLockOnMaxDistanceField.FieldType == typeof(float)) { savedLockOnMaxDistance = (float)cachedLockOnMaxDistanceField.GetValue(value); BirdieLog.Msg("[Birdie] Lock-On reflection ready, default dist=" + savedLockOnMaxDistance); } else { BirdieLog.Warning("[Birdie] Lock-On: LockOnMaxDistance field not found"); cachedLockOnMaxDistanceField = null; } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Lock-On reflection error: " + ex.Message); } } private void ToggleLockOnAnyDistance() { if (IsFeatureAllowed(11)) { lockOnAnyDistanceEnabled = !lockOnAnyDistanceEnabled; InitializeLockOnReflection(); if (lockOnAnyDistanceEnabled) { ApplyLockOnAnyDistance(); } else { RestoreLockOnDistance(); } BirdieLog.Msg(lockOnAnyDistanceEnabled ? "[Birdie] Lock-On Any Distance ON" : "[Birdie] Lock-On Any Distance OFF"); MarkHudDirty(); } } private void ApplyLockOnAnyDistance() { if (cachedLockOnMaxDistanceField == null) { return; } try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("GameManager"); if (type != null) { break; } } if (type == null) { return; } PropertyInfo property = type.GetProperty("GolfSettings", BindingFlags.Static | BindingFlags.Public); if (!(property == null)) { object value = property.GetValue(null, null); if (value != null) { cachedLockOnMaxDistanceField.SetValue(value, 9999f); } } } catch { } } private void RestoreLockOnDistance() { if (cachedLockOnMaxDistanceField == null) { return; } try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("GameManager"); if (type != null) { break; } } if (type == null) { return; } PropertyInfo property = type.GetProperty("GolfSettings", BindingFlags.Static | BindingFlags.Public); if (!(property == null)) { object value = property.GetValue(null, null); if (value != null) { cachedLockOnMaxDistanceField.SetValue(value, savedLockOnMaxDistance); } } } catch { } } private void TickNoKnockback() { if ((!noKnockbackEnabled && !landmineImmunityEnabled) || (Object)(object)playerMovement == (Object)null) { BirdieNoKnockbackBridge.LocalPlayerHittable = null; BirdieLandmineImmunityBridge.LocalPlayerHittable = null; return; } if ((Object)(object)localPlayerHittable == (Object)null) { Transform val = playerMovement.transform; while ((Object)(object)val != (Object)null && (Object)(object)localPlayerHittable == (Object)null) { Component[] components = ((Component)val).GetComponents(); for (int i = 0; i < components.Length; i++) { if ((Object)(object)components[i] != (Object)null && ((object)components[i]).GetType().Name == "Hittable") { localPlayerHittable = components[i]; break; } } val = val.parent; } if ((Object)(object)localPlayerHittable == (Object)null) { Component[] componentsInChildren = playerMovement.GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { if ((Object)(object)componentsInChildren[j] != (Object)null && ((object)componentsInChildren[j]).GetType().Name == "Hittable") { localPlayerHittable = componentsInChildren[j]; break; } } } } BirdieNoKnockbackBridge.LocalPlayerHittable = (noKnockbackEnabled ? localPlayerHittable : null); BirdieLandmineImmunityBridge.LocalPlayerHittable = (landmineImmunityEnabled ? localPlayerHittable : null); if (!noKnockbackEnabled) { return; } if (!knockbackImmunityReflectionReady) { InitializeKnockbackImmunityReflection(); } if (cachedKnockoutImmunityStatusField == null || cachedHasImmunityField == null) { return; } try { object value = cachedKnockoutImmunityStatusField.GetValue(playerMovement); if (value != null && !(bool)cachedHasImmunityField.GetValue(value)) { cachedHasImmunityField.SetValue(value, true); cachedKnockoutImmunityStatusField.SetValue(playerMovement, value); } } catch { } } private void InitializeExpandedSlotsReflection() { if (expandedSlotsReflectionInitialized) { return; } expandedSlotsReflectionInitialized = true; try { Type type = null; Type type2 = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { if (type == null) { type = assembly.GetType("Hotkeys"); } if (type2 == null) { type2 = assembly.GetType("GameManager"); } if (type != null && type2 != null) { break; } } if (type == null || type2 == null) { BirdieLog.Warning("[Birdie] ExpandedSlots: Hotkeys or GameManager type not found"); return; } Object val = Object.FindObjectOfType(type); if (val == (Object)null) { BirdieLog.Warning("[Birdie] ExpandedSlots: Hotkeys instance not in scene"); return; } cachedExpandedHotkeysInstance = val; cachedHotkeyUisField = type.GetField("hotkeyUis", BindingFlags.Instance | BindingFlags.NonPublic); if (cachedHotkeyUisField == null) { BirdieLog.Warning("[Birdie] ExpandedSlots: hotkeyUis field not found"); return; } PropertyInfo property = type2.GetProperty("PlayerInventorySettings", BindingFlags.Static | BindingFlags.Public); if (property == null) { BirdieLog.Warning("[Birdie] ExpandedSlots: PlayerInventorySettings property not found"); return; } cachedExpandedPlayerInvSettings = property.GetValue(null); if (cachedExpandedPlayerInvSettings == null) { BirdieLog.Warning("[Birdie] ExpandedSlots: PlayerInventorySettings is null"); return; } cachedMaxItemsBackingField = cachedExpandedPlayerInvSettings.GetType().GetField("k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic); if (cachedMaxItemsBackingField == null) { cachedMaxItemsBackingField = cachedExpandedPlayerInvSettings.GetType().GetField("MaxItems", BindingFlags.Instance | BindingFlags.NonPublic); } if (cachedMaxItemsBackingField == null) { BirdieLog.Warning("[Birdie] ExpandedSlots: MaxItems field not found"); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] ExpandedSlots init error: " + ex.Message); } } private void ToggleExpandedSlots() { if (IsFeatureAllowed(12)) { expandedSlotsEnabled = !expandedSlotsEnabled; if (expandedSlotsEnabled) { ApplyExpandedSlots(); } else { RestoreExpandedSlots(); } MarkHudDirty(); } } private void ApplyExpandedSlots() { //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) InitializeExpandedSlotsReflection(); if (cachedExpandedHotkeysInstance == null || cachedHotkeyUisField == null || cachedMaxItemsBackingField == null) { BirdieLog.Warning("[Birdie] ExpandedSlots: reflection not ready, cannot apply"); expandedSlotsEnabled = false; return; } try { int num = (int)cachedMaxItemsBackingField.GetValue(cachedExpandedPlayerInvSettings); if (num >= 7) { BirdieLog.Warning("[Birdie] ExpandedSlots: already at target or beyond (" + num + ")"); return; } savedOriginalMaxItems = num; Array array = (Array)cachedHotkeyUisField.GetValue(cachedExpandedHotkeysInstance); if (array == null || array.Length < 2) { BirdieLog.Warning("[Birdie] ExpandedSlots: hotkeyUis array is null or too small"); expandedSlotsEnabled = false; return; } savedOriginalHotkeyUisArray = array; int num2 = 8; Type elementType = array.GetType().GetElementType(); Array array2 = Array.CreateInstance(elementType, num2); for (int i = 0; i < Math.Min(array.Length, num2); i++) { array2.SetValue(array.GetValue(i), i); } Component val = (Component)array.GetValue(1); Transform parent = val.transform.parent; RectTransform component = val.GetComponent(); object obj; if (array.Length <= 2) { obj = null; } else { Component val2 = (Component)array.GetValue(2); obj = (((int)val2 != 0) ? val2.GetComponent() : null); } RectTransform val3 = (RectTransform)obj; Vector2 val4 = (Vector2)(((Object)(object)component != (Object)null && (Object)(object)val3 != (Object)null) ? (val3.anchoredPosition - component.anchoredPosition) : new Vector2(((Object)(object)component != (Object)null) ? (component.sizeDelta.x + 4f) : 80f, 0f)); for (int j = num + 1; j <= 7; j++) { if (j < array.Length) { object value = array.GetValue(j); if (value != null) { Component val5 = (Component)((value is Component) ? value : null); if (val5 != null && (Object)(object)val5 != (Object)null && (Object)(object)val5.gameObject != (Object)null) { array2.SetValue(value, j); continue; } } } GameObject val6 = Object.Instantiate(val.gameObject, parent); ((Object)val6).name = "HotkeyUi_Extra_" + j; RectTransform component2 = val6.GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component != (Object)null) { RectTransform val7 = null; if (j > 1) { object? value2 = array2.GetValue(j - 1); Component val8 = (Component)((value2 is Component) ? value2 : null); if (val8 != null && (Object)(object)val8 != (Object)null) { val7 = val8.GetComponent(); } } if ((Object)(object)val7 == (Object)null) { val7 = component; } component2.anchoredPosition = val7.anchoredPosition + val4; } val6.SetActive(true); Component value3 = val6.GetComponent(elementType) ?? val6.GetComponent(); array2.SetValue(value3, j); spawnedExtraHotkeyUiObjects.Add(val6); } savedSlotParentTransform = parent; RectTransform component3 = ((Component)parent).GetComponent(); if ((Object)(object)component3 != (Object)null) { savedSlotParentSizeDelta = component3.sizeDelta; float num3 = ((Mathf.Abs(val4.x) > 1f) ? Mathf.Abs(val4.x) : (((Object)(object)component != (Object)null) ? (component.sizeDelta.x + 4f) : 84f)); component3.sizeDelta = new Vector2(num3 * (float)num2 + 20f, component3.sizeDelta.y); } Mask component4 = ((Component)parent).GetComponent(); savedSlotParentMaskEnabled = (Object)(object)component4 != (Object)null && ((Behaviour)component4).enabled; if ((Object)(object)component4 != (Object)null) { ((Behaviour)component4).enabled = false; } RectMask2D component5 = ((Component)parent).GetComponent(); if ((Object)(object)component5 != (Object)null) { ((Behaviour)component5).enabled = false; } cachedHotkeyUisField.SetValue(cachedExpandedHotkeysInstance, array2); cachedMaxItemsBackingField.SetValue(cachedExpandedPlayerInvSettings, 7); try { cachedExpandedHotkeysInstance.GetType().GetMethod("ForceRefreshCurrentModeInternal", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.Invoke(cachedExpandedHotkeysInstance, null); } catch { } TryExpandServerInventorySlots(); BirdieLog.Msg("[Birdie] ExpandedSlots: expanded to " + 7 + " slots (orig array len=" + array.Length + ", currentMax=" + num + ")"); } catch (Exception ex) { BirdieLog.Warning("[Birdie] ExpandedSlots apply error: " + ex.Message + "\n" + ex.StackTrace); expandedSlotsEnabled = false; RestoreExpandedSlots(); } } private void TryExpandServerInventorySlotsPublic() { TryExpandServerInventorySlots(); } private Component GetLocalPlayerInventoryComponent(Type piType) { try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("GameManager"); if (type != null) { break; } } if (type == null) { return null; } object? obj = type.GetProperty("LocalPlayerInventory", BindingFlags.Static | BindingFlags.Public)?.GetValue(null); return (Component)((obj is Component) ? obj : null); } catch { return null; } } private void TryExpandServerInventorySlots() { try { bool flag = false; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { Type type = assemblies[i].GetType("Mirror.NetworkServer"); if (!(type == null)) { PropertyInfo property = type.GetProperty("active", BindingFlags.Static | BindingFlags.Public); if (property != null) { flag = (bool)property.GetValue(null); } break; } } if (!flag) { return; } Type type2 = null; Type type3 = null; assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { if (type2 == null) { type2 = assembly.GetType("PlayerInventory"); } if (type3 == null) { type3 = assembly.GetType("InventorySlot"); } if (type2 != null && type3 != null) { break; } } if (type2 == null || type3 == null) { return; } object obj = Activator.CreateInstance(type3); Array obj2 = (expandedSlotsAllPlayers ? ((Array)Object.FindObjectsOfType(type2)) : ((Array)new Object[1] { (Object)GetLocalPlayerInventoryComponent(type2) })); int num = 0; Object[] array = (Object[])obj2; foreach (Object obj3 in array) { Component val = (Component)(object)((obj3 is Component) ? obj3 : null); if ((Object)(object)val == (Object)null) { continue; } FieldInfo field = ((object)val).GetType().GetField("slots", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field == null) { continue; } object value = field.GetValue(val); if (value == null) { continue; } PropertyInfo property2 = value.GetType().GetProperty("Count"); if (property2 == null) { continue; } int num2 = (int)property2.GetValue(value); if (num2 >= 7) { continue; } MethodInfo method = value.GetType().GetMethod("Add"); if (!(method == null)) { int num3 = 7 - num2; for (int j = 0; j < num3; j++) { method.Invoke(value, new object[1] { obj }); } num++; } } BirdieLog.Msg("[Birdie] ExpandedSlots: expanded " + num + " player inventories to " + 7 + " slots"); } catch (Exception ex) { BirdieLog.Warning("[Birdie] ExpandedSlots server slots error: " + ex.Message); } } private void RestoreExpandedSlots() { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) try { if (cachedMaxItemsBackingField != null && cachedExpandedPlayerInvSettings != null) { cachedMaxItemsBackingField.SetValue(cachedExpandedPlayerInvSettings, savedOriginalMaxItems); } if (cachedHotkeyUisField != null && cachedExpandedHotkeysInstance != null && savedOriginalHotkeyUisArray != null) { cachedHotkeyUisField.SetValue(cachedExpandedHotkeysInstance, savedOriginalHotkeyUisArray); } savedOriginalHotkeyUisArray = null; foreach (GameObject spawnedExtraHotkeyUiObject in spawnedExtraHotkeyUiObjects) { if ((Object)(object)spawnedExtraHotkeyUiObject != (Object)null) { Object.Destroy((Object)(object)spawnedExtraHotkeyUiObject); } } spawnedExtraHotkeyUiObjects.Clear(); try { if ((Object)(object)savedSlotParentTransform != (Object)null) { RectTransform component = ((Component)savedSlotParentTransform).GetComponent(); if ((Object)(object)component != (Object)null) { component.sizeDelta = savedSlotParentSizeDelta; } Mask component2 = ((Component)savedSlotParentTransform).GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = savedSlotParentMaskEnabled; } RectMask2D component3 = ((Component)savedSlotParentTransform).GetComponent(); if ((Object)(object)component3 != (Object)null) { ((Behaviour)component3).enabled = true; } savedSlotParentTransform = null; } } catch { } BirdieLog.Msg("[Birdie] ExpandedSlots: restored to " + savedOriginalMaxItems + " slots"); } catch (Exception ex) { BirdieLog.Warning("[Birdie] ExpandedSlots restore error: " + ex.Message); } } private void CreateImpactPreviewHud(Transform parent) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)impactPreviewPanelObject != (Object)null)) { impactPreviewPanelObject = new GameObject("BirdieImpactPreviewPanel"); impactPreviewPanelObject.transform.SetParent(parent, false); RectTransform obj = impactPreviewPanelObject.AddComponent(); obj.anchorMin = new Vector2(1f, 1f); obj.anchorMax = new Vector2(1f, 1f); obj.pivot = new Vector2(1f, 1f); obj.offsetMin = new Vector2(-374f, -274f); obj.offsetMax = new Vector2(-14f, -54f); ((Graphic)impactPreviewPanelObject.AddComponent()).color = new Color(0.03f, 0.05f, 0.07f, 0.92f); GameObject val = new GameObject("BirdieImpactPreviewViewport"); val.transform.SetParent(impactPreviewPanelObject.transform, false); RectTransform obj2 = val.AddComponent(); obj2.anchorMin = Vector2.zero; obj2.anchorMax = Vector2.one; obj2.offsetMin = new Vector2(3f, 3f); obj2.offsetMax = new Vector2(-3f, -3f); impactPreviewRawImage = val.AddComponent(); ((Graphic)impactPreviewRawImage).color = Color.white; ((Graphic)impactPreviewRawImage).raycastTarget = false; impactPreviewPanelObject.SetActive(false); } } private void EnsureImpactPreviewResources() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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 //IL_018f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)impactPreviewTexture == (Object)null || ((Texture)impactPreviewTexture).width != impactPreviewTextureWidth || ((Texture)impactPreviewTexture).height != impactPreviewTextureHeight) { if ((Object)(object)impactPreviewTexture != (Object)null) { if ((Object)(object)impactPreviewCamera != (Object)null && (Object)(object)impactPreviewCamera.targetTexture == (Object)(object)impactPreviewTexture) { impactPreviewCamera.targetTexture = null; } impactPreviewTexture.Release(); Object.Destroy((Object)(object)impactPreviewTexture); } impactPreviewTexture = new RenderTexture(impactPreviewTextureWidth, impactPreviewTextureHeight, 16); ((Object)impactPreviewTexture).name = "BirdieImpactPreviewTexture"; impactPreviewTexture.antiAliasing = 1; impactPreviewTexture.Create(); } if ((Object)(object)impactPreviewCamera == (Object)null) { impactPreviewCameraObject = new GameObject("BirdieImpactPreviewCamera"); Object.DontDestroyOnLoad((Object)(object)impactPreviewCameraObject); impactPreviewCamera = impactPreviewCameraObject.AddComponent(); ((Behaviour)impactPreviewCamera).enabled = false; impactPreviewCamera.depth = -100f; impactPreviewCamera.targetTexture = impactPreviewTexture; impactPreviewCamera.fieldOfView = impactPreviewFieldOfView; impactPreviewCamera.nearClipPlane = 0.05f; impactPreviewCamera.farClipPlane = 500f; impactPreviewCamera.clearFlags = (CameraClearFlags)1; impactPreviewCamera.backgroundColor = new Color(0.09f, 0.11f, 0.14f, 1f); impactPreviewCamera.cullingMask = -1; } if ((Object)(object)impactPreviewRawImage != (Object)null && (Object)(object)impactPreviewRawImage.texture != (Object)(object)impactPreviewTexture) { impactPreviewRawImage.texture = (Texture)(object)impactPreviewTexture; } } private void UpdateImpactPreview() { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)impactPreviewPanelObject == (Object)null || (Object)(object)impactPreviewRawImage == (Object)null) { return; } if (!assistEnabled || !impactPreviewEnabled) { HideImpactPreview(); return; } if (!TryGetCachedImpactPreviewFocus(out var focusPoint, out var approachDirection)) { HideImpactPreview(); return; } EnsureImpactPreviewResources(); if ((Object)(object)impactPreviewCamera == (Object)null || (Object)(object)impactPreviewTexture == (Object)null) { HideImpactPreview(); return; } float unscaledTime = Time.unscaledTime; bool flag = !impactPreviewPanelObject.activeSelf; float impactPreviewRenderInterval = GetImpactPreviewRenderInterval(); if (!flag && impactPreviewRenderInterval > 0f && unscaledTime < nextImpactPreviewRenderTime) { return; } if ((Object)(object)cachedImpactPreviewReferenceCamera == (Object)null || !((Behaviour)cachedImpactPreviewReferenceCamera).isActiveAndEnabled || unscaledTime >= nextImpactPreviewReferenceCameraRefreshTime) { cachedImpactPreviewReferenceCamera = FindReferenceGameplayCamera(); nextImpactPreviewReferenceCameraRefreshTime = unscaledTime + impactPreviewReferenceCameraRefreshInterval; } SyncImpactPreviewCameraSettings(cachedImpactPreviewReferenceCamera); PositionImpactPreviewCamera(focusPoint, approachDirection); try { impactPreviewCamera.Render(); nextImpactPreviewRenderTime = ((impactPreviewRenderInterval > 0f) ? (unscaledTime + impactPreviewRenderInterval) : 0f); if (flag) { impactPreviewPanelObject.SetActive(true); } } catch { HideImpactPreview(); } } private void HideImpactPreview() { if ((Object)(object)impactPreviewPanelObject != (Object)null && impactPreviewPanelObject.activeSelf) { impactPreviewPanelObject.SetActive(false); } nextImpactPreviewRenderTime = 0f; } private float GetImpactPreviewRenderInterval() { float num = ((impactPreviewTargetFps > 0.01f) ? impactPreviewTargetFps : impactPreviewAutoTargetFps); if (!(num > 0.01f)) { return 0f; } return 1f / num; } private bool TryGetCachedImpactPreviewFocus(out Vector3 focusPoint, out Vector3 approachDirection) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (predictedImpactPreviewValid) { focusPoint = predictedImpactPreviewPoint; approachDirection = predictedImpactPreviewApproachDirection; return true; } if (frozenImpactPreviewValid) { focusPoint = frozenImpactPreviewPoint; approachDirection = frozenImpactPreviewApproachDirection; return true; } focusPoint = Vector3.zero; approachDirection = GetFallbackPreviewDirection(); return false; } private void ResetImpactPreviewCache(bool resetPredicted, bool resetFrozen) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) if (resetPredicted) { predictedImpactPreviewValid = false; predictedImpactPreviewPoint = Vector3.zero; predictedImpactPreviewApproachDirection = Vector3.forward; } if (resetFrozen) { frozenImpactPreviewValid = false; frozenImpactPreviewPoint = Vector3.zero; frozenImpactPreviewApproachDirection = Vector3.forward; } } private void StoreImpactPreviewData(List sourcePoints, bool hasImpactPoint, Vector3 impactPoint, Vector3 approachDirection) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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) bool flag = sourcePoints == predictedPathPoints; bool flag2 = sourcePoints == frozenPredictedPathPoints; if (!flag && !flag2) { return; } if (!hasImpactPoint) { if (sourcePoints == null || sourcePoints.Count == 0) { ResetImpactPreviewCache(flag, flag2); return; } impactPoint = sourcePoints[sourcePoints.Count - 1]; if (sourcePoints.Count >= 2) { Vector3 val = sourcePoints[sourcePoints.Count - 1] - sourcePoints[sourcePoints.Count - 2]; if (((Vector3)(ref val)).sqrMagnitude >= 0.0001f) { approachDirection = ((Vector3)(ref val)).normalized; } } ProjectImpactPreviewPointToSurface(ref impactPoint); } if (((Vector3)(ref approachDirection)).sqrMagnitude < 0.0001f) { approachDirection = GetFallbackPreviewDirection(); } else { ((Vector3)(ref approachDirection)).Normalize(); } if (flag) { predictedImpactPreviewValid = true; predictedImpactPreviewPoint = impactPoint; predictedImpactPreviewApproachDirection = approachDirection; } if (flag2) { frozenImpactPreviewValid = true; frozenImpactPreviewPoint = impactPoint; frozenImpactPreviewApproachDirection = approachDirection; } } private bool TryFindWorldImpactAlongSegment(Vector3 startPoint, Vector3 endPoint, out RaycastHit resolvedHit) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0054: 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_007c: Unknown result type (might be due to invalid IL or missing references) resolvedHit = default(RaycastHit); Vector3 val = endPoint - startPoint; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude <= 0.0001f) { return false; } Vector3 val2 = val / magnitude; int num = Physics.RaycastNonAlloc(startPoint, val2, impactPreviewRaycastHits, magnitude, -5, (QueryTriggerInteraction)1); float num2 = float.MaxValue; for (int i = 0; i < num; i++) { RaycastHit val3 = impactPreviewRaycastHits[i]; if (!ShouldIgnoreImpactPreviewCollider(((RaycastHit)(ref val3)).collider) && ((RaycastHit)(ref val3)).distance < num2) { num2 = ((RaycastHit)(ref val3)).distance; resolvedHit = val3; } } return num2 < float.MaxValue; } private void ProjectImpactPreviewPointToSurface(ref Vector3 point) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_0082: Unknown result type (might be due to invalid IL or missing references) int num = Physics.RaycastNonAlloc(point + Vector3.up * impactPreviewProbeHeight, Vector3.down, impactPreviewGroundProbeHits, impactPreviewProbeHeight * 2f, -5, (QueryTriggerInteraction)1); float num2 = float.MaxValue; bool flag = false; RaycastHit val = default(RaycastHit); for (int i = 0; i < num; i++) { RaycastHit val2 = impactPreviewGroundProbeHits[i]; if (!ShouldIgnoreImpactPreviewCollider(((RaycastHit)(ref val2)).collider) && ((RaycastHit)(ref val2)).distance < num2) { num2 = ((RaycastHit)(ref val2)).distance; val = val2; flag = true; } } if (flag) { point = ((RaycastHit)(ref val)).point; } } private bool ShouldIgnoreImpactPreviewCollider(Collider collider) { if ((Object)(object)collider == (Object)null || collider.isTrigger) { return true; } Transform transform = ((Component)collider).transform; if ((Object)(object)golfBall != (Object)null && transform.IsChildOf(golfBall.transform)) { return true; } if ((Object)(object)playerGolfer != (Object)null && transform.IsChildOf(playerGolfer.transform)) { return true; } if ((Object)(object)playerMovement != (Object)null && transform.IsChildOf(playerMovement.transform)) { return true; } if ((Object)(object)impactPreviewCameraObject != (Object)null) { return transform.IsChildOf(impactPreviewCameraObject.transform); } return false; } private Vector3 GetFallbackPreviewDirection() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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) if ((Object)(object)golfBall != (Object)null && currentAimTargetPosition != Vector3.zero) { Vector3 val = currentAimTargetPosition - golfBall.transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude >= 0.0001f) { return ((Vector3)(ref val)).normalized; } } if ((Object)(object)playerGolfer != (Object)null) { Vector3 forward = playerGolfer.transform.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude >= 0.0001f) { return ((Vector3)(ref forward)).normalized; } } return Vector3.forward; } private Camera FindReferenceGameplayCamera() { Camera main = Camera.main; if ((Object)(object)main != (Object)null && (Object)(object)main != (Object)(object)impactPreviewCamera && ((Behaviour)main).isActiveAndEnabled && (Object)(object)main.targetTexture == (Object)null) { return main; } return null; } private void SyncImpactPreviewCameraSettings(Camera referenceCamera) { //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)impactPreviewCamera == (Object)null)) { if ((Object)(object)referenceCamera != (Object)null) { impactPreviewCamera.clearFlags = referenceCamera.clearFlags; impactPreviewCamera.backgroundColor = referenceCamera.backgroundColor; impactPreviewCamera.cullingMask = referenceCamera.cullingMask; impactPreviewCamera.allowHDR = referenceCamera.allowHDR; impactPreviewCamera.allowMSAA = referenceCamera.allowMSAA; impactPreviewCamera.useOcclusionCulling = referenceCamera.useOcclusionCulling; impactPreviewCamera.depthTextureMode = referenceCamera.depthTextureMode; impactPreviewCamera.renderingPath = referenceCamera.renderingPath; impactPreviewCamera.nearClipPlane = Mathf.Max(0.03f, referenceCamera.nearClipPlane); impactPreviewCamera.farClipPlane = Mathf.Max(200f, referenceCamera.farClipPlane); } else { impactPreviewCamera.clearFlags = (CameraClearFlags)1; impactPreviewCamera.backgroundColor = new Color(0.09f, 0.11f, 0.14f, 1f); impactPreviewCamera.cullingMask = -1; impactPreviewCamera.allowHDR = true; impactPreviewCamera.allowMSAA = true; impactPreviewCamera.useOcclusionCulling = true; impactPreviewCamera.depthTextureMode = (DepthTextureMode)0; impactPreviewCamera.renderingPath = (RenderingPath)(-1); impactPreviewCamera.nearClipPlane = 0.05f; impactPreviewCamera.farClipPlane = 500f; } impactPreviewCamera.fieldOfView = impactPreviewFieldOfView; impactPreviewCamera.targetTexture = impactPreviewTexture; } } private void PositionImpactPreviewCamera(Vector3 focusPoint, Vector3 approachDirection) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //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: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(approachDirection.x, 0f, approachDirection.z); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = GetFallbackPreviewDirection(); } ((Vector3)(ref val)).Normalize(); float num = (((Object)(object)golfBall != (Object)null) ? Vector3.Distance(golfBall.transform.position, focusPoint) : 24f); val = Quaternion.AngleAxis(Time.unscaledTime * impactPreviewOrbitDegreesPerSecond, Vector3.up) * val; float num2 = Mathf.Clamp(num * 0.24f + 7.5f, impactPreviewCameraMinDistance, impactPreviewCameraMaxDistance); float num3 = Mathf.Lerp(impactPreviewCameraMinHeight, impactPreviewCameraMaxHeight, Mathf.InverseLerp(0f, 80f, num)); Vector3 val2 = focusPoint + Vector3.up * impactPreviewLookHeightOffset; Vector3 desiredPosition = val2 - val * num2 + Vector3.up * num3; ClampImpactPreviewPositionAboveGround(val2, ref desiredPosition); ((Component)impactPreviewCamera).transform.position = desiredPosition; Transform transform = ((Component)impactPreviewCamera).transform; Vector3 val3 = val2 - desiredPosition; transform.rotation = Quaternion.LookRotation(((Vector3)(ref val3)).normalized, Vector3.up); } private void ClampImpactPreviewPositionAboveGround(Vector3 lookPoint, ref Vector3 desiredPosition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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) float num = lookPoint.y + impactPreviewMinVerticalLookOffset; desiredPosition.y = Mathf.Max(desiredPosition.y, num); int num2 = Physics.RaycastNonAlloc(new Vector3(desiredPosition.x, desiredPosition.y + impactPreviewProbeHeight, desiredPosition.z), Vector3.down, impactPreviewGroundProbeHits, impactPreviewProbeHeight * 2f, -5, (QueryTriggerInteraction)1); float num3 = float.MaxValue; bool flag = false; RaycastHit val = default(RaycastHit); for (int i = 0; i < num2; i++) { RaycastHit val2 = impactPreviewGroundProbeHits[i]; if (!ShouldIgnoreImpactPreviewCollider(((RaycastHit)(ref val2)).collider) && ((RaycastHit)(ref val2)).distance < num3) { num3 = ((RaycastHit)(ref val2)).distance; val = val2; flag = true; } } if (flag) { desiredPosition.y = Mathf.Max(new float[3] { desiredPosition.y, ((RaycastHit)(ref val)).point.y + impactPreviewGroundClearance, num }); } } private void InitializeItemSpawnerReflection() { if (itemSpawnerReflectionInitialized) { return; } itemSpawnerReflectionInitialized = true; try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { if (cachedNetworkServerActiveProperty == null) { Type type = assembly.GetType("Mirror.NetworkServer"); if (type != null) { cachedNetworkServerActiveProperty = type.GetProperty("active", BindingFlags.Static | BindingFlags.Public); } } if (cachedLocalPlayerInventoryProperty == null || cachedAllItemsProperty == null) { Type type2 = assembly.GetType("GameManager"); if (type2 != null) { if (cachedLocalPlayerInventoryProperty == null) { cachedLocalPlayerInventoryProperty = type2.GetProperty("LocalPlayerInventory", BindingFlags.Static | BindingFlags.Public); } if (cachedAllItemsProperty == null) { cachedAllItemsProperty = type2.GetProperty("AllItems", BindingFlags.Static | BindingFlags.Public); } } } if (cachedItemTypeEnumType == null) { cachedItemTypeEnumType = assembly.GetType("ItemType"); } if (cachedTryGetItemDataMethod == null) { Type type3 = assembly.GetType("ItemCollection"); if (type3 != null) { cachedTryGetItemDataMethod = type3.GetMethod("TryGetItemData", BindingFlags.Instance | BindingFlags.Public); } } if (cachedItemDataMaxUsesProperty == null) { Type type4 = assembly.GetType("ItemData"); if (type4 != null) { cachedItemDataMaxUsesProperty = type4.GetProperty("MaxUses", BindingFlags.Instance | BindingFlags.Public); } } if (cachedServerTryAddItemMethod == null) { Type type5 = assembly.GetType("PlayerInventory"); if (type5 != null) { cachedServerTryAddItemMethod = type5.GetMethod("ServerTryAddItem", BindingFlags.Instance | BindingFlags.Public); } } } } catch { } } private void InitializeDispenserReflection() { if (dispenserReflectionInitialized) { return; } dispenserReflectionInitialized = true; try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { if (cachedItemDispenserType == null) { Type type = assembly.GetType("ItemDispenser"); if (type != null) { cachedItemDispenserType = type; cachedItemDispenserItemTypeField = type.GetField("itemType", BindingFlags.Instance | BindingFlags.NonPublic); cachedItemDispenserIsEnabledProperty = type.GetProperty("IsInteractionEnabled", BindingFlags.Instance | BindingFlags.Public); cachedItemDispenserCmdDispenseMethod = type.GetMethod("CmdDispenseItemFor", BindingFlags.Instance | BindingFlags.Public); } } if (cachedPhysicalItemType == null) { Type type2 = assembly.GetType("PhysicalItem"); if (type2 != null) { cachedPhysicalItemType = type2; cachedPhysicalItemItemTypeField = type2.GetField("itemType", BindingFlags.Instance | BindingFlags.NonPublic); cachedCmdGiveToPlayerMethod = type2.GetMethod("CmdGiveToPlayer", BindingFlags.Instance | BindingFlags.Public); } } if (cachedItemDispenserType != null && cachedPhysicalItemType != null) { break; } } } catch { } } private Component FindMatchingDispenser(int itemTypeInt) { if (cachedItemDispenserType == null || cachedItemDispenserItemTypeField == null) { return null; } try { Object[] array = Object.FindObjectsOfType(cachedItemDispenserType); foreach (Object obj in array) { Component val = (Component)(object)((obj is Component) ? obj : null); if ((Object)(object)val == (Object)null) { continue; } object value = cachedItemDispenserItemTypeField.GetValue(val); if (value == null || (int)value != itemTypeInt) { continue; } if (cachedItemDispenserIsEnabledProperty != null) { object value2 = cachedItemDispenserIsEnabledProperty.GetValue(val, null); if (value2 != null && !(bool)value2) { continue; } } return val; } } catch { } return null; } private Component FindPhysicalItemOfType(int itemTypeInt) { if (cachedPhysicalItemType == null || cachedPhysicalItemItemTypeField == null) { return null; } try { Object[] array = Object.FindObjectsOfType(cachedPhysicalItemType); foreach (Object obj in array) { Component val = (Component)(object)((obj is Component) ? obj : null); if (!((Object)(object)val == (Object)null)) { object value = cachedPhysicalItemItemTypeField.GetValue(val); if (value != null && (int)value == itemTypeInt) { return val; } } } } catch { } return null; } internal void PollDispenserPickup() { if (!dispenserPickupPending) { return; } if (Time.time > dispenserPickupDeadline) { BirdieLog.Warning("[Birdie] Item spawner (dispenser): timed out waiting for spawned item."); dispenserPickupPending = false; dispenserPickupLocalInventory = null; return; } Component val = FindPhysicalItemOfType(dispenserPickupItemTypeInt); if ((Object)(object)val == (Object)null) { return; } dispenserPickupPending = false; if (cachedCmdGiveToPlayerMethod == null || (Object)(object)dispenserPickupLocalInventory == (Object)null) { BirdieLog.Warning("[Birdie] Item spawner (dispenser): CmdGiveToPlayer reflection not ready."); dispenserPickupLocalInventory = null; return; } try { cachedCmdGiveToPlayerMethod.Invoke(val, new object[2] { dispenserPickupLocalInventory, null }); } catch (Exception ex) { BirdieLog.Warning("[Birdie] Item spawner (dispenser pickup): " + ex.Message); } dispenserPickupLocalInventory = null; } private void InitializeCrateReflection() { if (crateReflectionInitialized) { return; } crateReflectionInitialized = true; try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { if (cachedItemSpawnerType == null) { Type type = assembly.GetType("ItemSpawner"); if (type != null) { cachedItemSpawnerType = type; cachedItemSpawnerSettingsField = type.GetField("settings", BindingFlags.Instance | BindingFlags.NonPublic); cachedItemSpawnerNetHasItemBoxProp = type.GetProperty("NetworkhasItemBox", BindingFlags.Instance | BindingFlags.Public); } } if (cachedItemSpawnerSettingsType == null) { Type type2 = assembly.GetType("ItemSpawnerSettings"); if (type2 != null) { cachedItemSpawnerSettingsType = type2; cachedGetRandomItemForMethod = type2.GetMethod("GetRandomItemFor", BindingFlags.Instance | BindingFlags.Public); } } if (cachedInventoryPlayerInfoProp == null) { Type type3 = assembly.GetType("PlayerInventory"); if (type3 != null) { cachedInventoryPlayerInfoProp = type3.GetProperty("PlayerInfo", BindingFlags.Instance | BindingFlags.Public); } } if (cachedItemSpawnerType != null && cachedItemSpawnerSettingsType != null && cachedInventoryPlayerInfoProp != null) { break; } } } catch { } } internal void TryCollectFromCrate() { if (!itemSpawnerReflectionInitialized) { InitializeItemSpawnerReflection(); } if (!crateReflectionInitialized) { InitializeCrateReflection(); } if (!(cachedLocalPlayerInventoryProperty == null)) { object? value = cachedLocalPlayerInventoryProperty.GetValue(null, null); Component val = (Component)((value is Component) ? value : null); if ((Object)(object)val == (Object)null) { BirdieLog.Warning("[Birdie] Crate: local player inventory not found."); } else if (IsNetworkServerActive()) { CollectFromCrateAsHost(val); } else { CollectFromCrateAsClient(val); } } } private void CollectFromCrateAsHost(Component localInventory) { //IL_004d: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (cachedItemSpawnerType == null) { BirdieLog.Warning("[Birdie] Crate: ItemSpawner type not found."); return; } Object[] array = Object.FindObjectsOfType(cachedItemSpawnerType); Component val = null; float num = float.MaxValue; Vector3 val2 = (((Object)(object)playerMovement != (Object)null) ? playerMovement.transform.position : Vector3.zero); foreach (Object obj in array) { Component val3 = (Component)(object)((obj is Component) ? obj : null); if ((Object)(object)val3 == (Object)null) { continue; } if (cachedItemSpawnerNetHasItemBoxProp != null) { object value = cachedItemSpawnerNetHasItemBoxProp.GetValue(val3, null); if (value != null && !(bool)value) { continue; } } float num2 = Vector3.Distance(val3.transform.position, val2); if (num2 < num) { num = num2; val = val3; } } if ((Object)(object)val == (Object)null) { BirdieLog.Warning("[Birdie] Crate: no item crate with an available box found."); return; } int num3 = GetCrateRandomItemType(val, localInventory); if (num3 <= 0) { num3 = SpawnableItemTypeInts[Random.Range(0, SpawnableItemTypeInts.Length)]; } if (cachedServerTryAddItemMethod == null || cachedItemTypeEnumType == null) { BirdieLog.Warning("[Birdie] Crate: ServerTryAddItem reflection not ready."); return; } object obj2 = Enum.ToObject(cachedItemTypeEnumType, num3); int num4 = GetItemMaxUses(num3); if (num4 <= 0) { num4 = 1; } try { if (!(bool)cachedServerTryAddItemMethod.Invoke(localInventory, new object[2] { obj2, num4 })) { BirdieLog.Warning("[Birdie] Crate: inventory full."); return; } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Crate (host grant): " + ex.Message); return; } if (!(cachedItemSpawnerNetHasItemBoxProp != null)) { return; } try { cachedItemSpawnerNetHasItemBoxProp.SetValue(val, false); } catch { } } private int GetCrateRandomItemType(Component spawner, Component localInventory) { try { if (cachedItemSpawnerSettingsField == null || cachedGetRandomItemForMethod == null || cachedInventoryPlayerInfoProp == null) { return 0; } object value = cachedItemSpawnerSettingsField.GetValue(spawner); if (value == null) { return 0; } object value2 = cachedInventoryPlayerInfoProp.GetValue(localInventory, null); if (value2 == null) { return 0; } object obj = cachedGetRandomItemForMethod.Invoke(value, new object[1] { value2 }); if (obj == null) { return 0; } return Convert.ToInt32(obj); } catch { return 0; } } private void CollectFromCrateAsClient(Component localInventory) { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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_0101: Unknown result type (might be due to invalid IL or missing references) if (BirdieGrantBridge.IsReady()) { int itemTypeInt = SpawnableItemTypeInts[Random.Range(0, SpawnableItemTypeInts.Length)]; BirdieGrantBridge.RequestGrant(localInventory, itemTypeInt); return; } if (!pendingCrateTeleport) { pendingCrateTeleport = true; pendingCrateTeleportExpiry = Time.time + 3f; MarkHudDirty(); return; } pendingCrateTeleport = false; MarkHudDirty(); if (cachedItemSpawnerType == null || cachedItemSpawnerNetHasItemBoxProp == null) { BirdieLog.Warning("[Birdie] Crate teleport: ItemSpawner reflection not ready."); return; } if ((Object)(object)playerMovement == (Object)null) { BirdieLog.Warning("[Birdie] Crate teleport: player not found."); return; } Object[] array = Object.FindObjectsOfType(cachedItemSpawnerType); Component val = null; float num = float.MaxValue; Vector3 position = playerMovement.transform.position; foreach (Object obj in array) { Component val2 = (Component)(object)((obj is Component) ? obj : null); if ((Object)(object)val2 == (Object)null) { continue; } object value = cachedItemSpawnerNetHasItemBoxProp.GetValue(val2, null); if (value == null || (bool)value) { float num2 = Vector3.Distance(val2.transform.position, position); if (num2 < num) { num = num2; val = val2; } } } if ((Object)(object)val == (Object)null) { BirdieLog.Warning("[Birdie] Crate teleport: no active crates in scene."); return; } crateReturnPosition = playerMovement.transform.position; playerMovement.transform.position = val.transform.position; crateReturnPending = true; } internal void PollCrateReturn() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (pendingCrateTeleport && Time.time > pendingCrateTeleportExpiry) { pendingCrateTeleport = false; MarkHudDirty(); } if (crateReturnPending) { crateReturnPending = false; if ((Object)(object)playerMovement != (Object)null) { playerMovement.transform.position = crateReturnPosition; } } } private void SpawnItemClientSide(int itemTypeInt) { if (!itemSpawnerReflectionInitialized) { InitializeItemSpawnerReflection(); } if (IsNetworkServerActive()) { SpawnItemAsHost(itemTypeInt); } else { SpawnItemAsClient(itemTypeInt); } } private void SpawnItemAsHost(int itemTypeInt) { try { if (cachedLocalPlayerInventoryProperty == null || cachedServerTryAddItemMethod == null || cachedItemTypeEnumType == null) { BirdieLog.Warning("[Birdie] Item spawner: host reflection cache incomplete."); return; } object? value = cachedLocalPlayerInventoryProperty.GetValue(null, null); Component val = (Component)((value is Component) ? value : null); if ((Object)(object)val == (Object)null) { BirdieLog.Warning("[Birdie] Item spawner: local player inventory not found."); return; } object obj = Enum.ToObject(cachedItemTypeEnumType, itemTypeInt); int num = GetItemMaxUses(itemTypeInt); if (num <= 0) { num = 1; } if (!(bool)cachedServerTryAddItemMethod.Invoke(val, new object[2] { obj, num })) { BirdieLog.Warning("[Birdie] Item spawner: inventory full or item invalid."); } } catch (Exception ex) { BirdieLog.Warning("[Birdie] Item spawner (host): " + ex.Message); } } private void SpawnItemAsClient(int itemTypeInt) { try { if (cachedLocalPlayerInventoryProperty == null) { BirdieLog.Warning("[Birdie] Item spawner: LocalPlayerInventory reflection not ready."); return; } object? value = cachedLocalPlayerInventoryProperty.GetValue(null, null); Component val = (Component)((value is Component) ? value : null); if ((Object)(object)val == (Object)null) { BirdieLog.Warning("[Birdie] Item spawner: local player inventory not found."); return; } if (itemTypeInt == 1) { if (!dispenserReflectionInitialized) { InitializeDispenserReflection(); } if (cachedItemDispenserCmdDispenseMethod != null) { Component val2 = FindMatchingDispenser(1); if ((Object)(object)val2 != (Object)null) { try { cachedItemDispenserCmdDispenseMethod.Invoke(val2, null); dispenserPickupPending = true; dispenserPickupItemTypeInt = 1; dispenserPickupLocalInventory = val; dispenserPickupDeadline = Time.time + 2.5f; return; } catch (Exception ex) { BirdieLog.Warning("[Birdie] Item spawner (dispenser): " + ex.Message); } } } } if (BirdieGrantBridge.IsReady()) { BirdieGrantBridge.RequestGrant(val, itemTypeInt); } else { BirdieLog.Warning("[Birdie] Item spawner: no client grant path available — host only."); } } catch (Exception ex2) { BirdieLog.Warning("[Birdie] Item spawner (client): " + ex2.Message); } } private bool IsNetworkServerActive() { if (!cachedNetworkServerPropertyInit) { cachedNetworkServerPropertyInit = true; if (cachedNetworkServerActiveProperty == null) { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { Type type = assemblies[i].GetType("Mirror.NetworkServer"); if (type != null) { cachedNetworkServerActiveProperty = type.GetProperty("active", BindingFlags.Static | BindingFlags.Public); break; } } } } if (cachedNetworkServerActiveProperty == null) { return false; } try { return (bool)cachedNetworkServerActiveProperty.GetValue(null, null); } catch { return false; } } private int GetItemMaxUses(int itemTypeInt) { try { if (cachedAllItemsProperty == null || cachedTryGetItemDataMethod == null || cachedItemDataMaxUsesProperty == null || cachedItemTypeEnumType == null) { return 1; } object value = cachedAllItemsProperty.GetValue(null, null); if (value == null) { return 1; } object obj = Enum.ToObject(cachedItemTypeEnumType, itemTypeInt); object[] array = new object[2] { obj, null }; if (!(bool)cachedTryGetItemDataMethod.Invoke(value, array) || array[1] == null) { return 1; } return (int)cachedItemDataMaxUsesProperty.GetValue(array[1], null); } catch { return 1; } } private string ItemIndexToName(int itemTypeInt) { int num = itemTypeInt - 1; if (num >= 0 && num < SpawnableItemNames.Length) { return SpawnableItemNames[num]; } return "item #" + itemTypeInt; } private static Texture2D MakeTex(Color c) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1); val.SetPixel(0, 0, c); val.Apply(); return val; } private void InitImStyles() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Expected O, but got Unknown //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Expected O, but got Unknown //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Expected O, but got Unknown //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Expected O, but got Unknown //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Expected O, but got Unknown //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Expected O, but got Unknown //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Expected O, but got Unknown //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Expected O, but got Unknown //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Expected O, but got Unknown //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Expected O, but got Unknown //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Expected O, but got Unknown //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Expected O, but got Unknown //IL_0677: Unknown result type (might be due to invalid IL or missing references) if (!_imStylesReady) { _imStylesReady = true; _imTxDark = MakeTex(new Color(0.1f, 0.1f, 0.13f, 0.97f)); _imTxBlue = MakeTex(new Color(0.22f, 0.5f, 0.9f, 1f)); _imTxGrey = MakeTex(new Color(0.2f, 0.2f, 0.25f, 1f)); _imTxDarker = MakeTex(new Color(0.07f, 0.07f, 0.09f, 1f)); _imTxRed = MakeTex(new Color(0.6f, 0.12f, 0.12f, 1f)); _imTxGreen = MakeTex(new Color(0.16f, 0.45f, 0.2f, 1f)); _imTxSeparator = MakeTex(new Color(1f, 1f, 1f, 0.06f)); _imWindowStyle = new GUIStyle(GUI.skin.window); _imWindowStyle.normal.background = _imTxDark; _imWindowStyle.onNormal.background = _imTxDark; _imWindowStyle.border = new RectOffset(4, 4, 4, 4); _imWindowStyle.padding = new RectOffset(0, 0, 0, 0); _imWindowStyle.normal.textColor = Color.clear; _imTitleStyle = new GUIStyle(GUI.skin.label); _imTitleStyle.fontSize = 14; _imTitleStyle.fontStyle = (FontStyle)1; _imTitleStyle.normal.textColor = Color.white; _imTitleStyle.alignment = (TextAnchor)3; _imTabActive = new GUIStyle(GUI.skin.button); _imTabActive.normal.background = _imTxBlue; _imTabActive.hover.background = _imTxBlue; _imTabActive.active.background = _imTxBlue; _imTabActive.normal.textColor = Color.white; _imTabActive.fontStyle = (FontStyle)1; _imTabActive.fontSize = 11; _imTabIdle = new GUIStyle(GUI.skin.button); _imTabIdle.normal.background = _imTxDarker; _imTabIdle.hover.background = _imTxGrey; _imTabIdle.active.background = _imTxGrey; _imTabIdle.normal.textColor = new Color(0.7f, 0.7f, 0.75f); _imTabIdle.fontSize = 11; _imSectionLabel = new GUIStyle(GUI.skin.label); _imSectionLabel.fontSize = 10; _imSectionLabel.fontStyle = (FontStyle)1; _imSectionLabel.normal.textColor = new Color(0.55f, 0.55f, 0.62f); _imActionLabel = new GUIStyle(GUI.skin.label); _imActionLabel.fontSize = 13; _imActionLabel.normal.textColor = Color.white; _imActionLabel.alignment = (TextAnchor)3; _imToggleOn = new GUIStyle(GUI.skin.button); _imToggleOn.normal.background = _imTxBlue; _imToggleOn.hover.background = _imTxBlue; _imToggleOn.normal.textColor = Color.white; _imToggleOn.fontSize = 11; _imToggleOn.fontStyle = (FontStyle)1; _imToggleOff = new GUIStyle(GUI.skin.button); _imToggleOff.normal.background = _imTxGrey; _imToggleOff.hover.background = _imTxGrey; _imToggleOff.normal.textColor = new Color(0.55f, 0.55f, 0.6f); _imToggleOff.fontSize = 11; _imKeyBadge = new GUIStyle(GUI.skin.button); _imKeyBadge.normal.background = _imTxBlue; _imKeyBadge.hover.background = _imTxGrey; _imKeyBadge.normal.textColor = Color.white; _imKeyBadge.fontSize = 11; _imRebindActive = new GUIStyle(_imKeyBadge); _imRebindActive.normal.background = _imTxGreen; _imRebindActive.hover.background = _imTxGreen; _imButton = new GUIStyle(GUI.skin.button); _imButton.normal.background = _imTxGrey; _imButton.hover.background = _imTxBlue; _imButton.normal.textColor = Color.white; _imButton.fontSize = 13; _imCloseBtn = new GUIStyle(GUI.skin.button); _imCloseBtn.normal.background = _imTxRed; _imCloseBtn.hover.background = _imTxRed; _imCloseBtn.normal.textColor = new Color(1f, 0.5f, 0.5f); _imCloseBtn.fontStyle = (FontStyle)1; _imCloseBtn.fontSize = 14; _imInfoLabel = new GUIStyle(GUI.skin.label); _imInfoLabel.fontSize = 12; _imInfoLabel.wordWrap = true; _imInfoLabel.normal.textColor = new Color(0.65f, 0.65f, 0.72f); _imDescLabel = new GUIStyle(GUI.skin.label); _imDescLabel.fontSize = 10; _imDescLabel.wordWrap = false; _imDescLabel.normal.textColor = new Color(0.5f, 0.5f, 0.58f); } } internal void BirdieOnGUI() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_007a: 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_0046: 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 (settingsPanelOpen) { InitImStyles(); if (!_imRectInit) { _imRect = new Rect((float)Screen.width * 0.5f - 320f, (float)Screen.height * 0.5f - 220f, 640f, 440f); _imRectInit = true; } _imRect = GUI.Window(9901, _imRect, new WindowFunction(DrawImWindow), string.Empty, _imWindowStyle); } } private void DrawImWindow(int id) { //IL_0030: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) float width = ((Rect)(ref _imRect)).width; float height = ((Rect)(ref _imRect)).height; float num = 70f; float num2 = 36f; GUI.DrawTexture(new Rect(0f, 0f, width, num2), (Texture)(object)_imTxDarker); GUI.Label(new Rect(10f, 8f, width - 50f, num2 - 8f), "Birdie Settings", _imTitleStyle); if (GUI.Button(new Rect(width - 32f, 6f, 26f, 24f), "✕", _imCloseBtn)) { CloseRosettaSettings(); } GUI.DrawTexture(new Rect(0f, num2, width, 1f), (Texture)(object)_imTxSeparator); GUI.DrawTexture(new Rect(0f, num2 + 1f, num, height - num2 - 1f), (Texture)(object)_imTxDarker); GUI.DrawTexture(new Rect(num, num2 + 1f, 1f, height - num2 - 1f), (Texture)(object)_imTxSeparator); string[] array = new string[7] { "Features", "Keys", "HUD", "$", "Items", "Net", "Weather" }; float num3 = 44f; for (int i = 0; i < array.Length; i++) { GUIStyle val = ((settingsTabIndex == i) ? _imTabActive : _imTabIdle); if (GUI.Button(new Rect(2f, num2 + 4f + (float)i * (num3 + 2f), num - 4f, num3), array[i], val)) { settingsTabIndex = i; } } float num4 = num + 8f; float num5 = num2 + 6f; float num6 = width - num - 16f; float num7 = height - num5 - 6f; GUILayout.BeginArea(new Rect(num4, num5, num6, num7)); switch (settingsTabIndex) { case 0: DrawImFeatures(num6); break; case 1: DrawImKeys(num6); break; case 2: DrawImHud(num6); break; case 3: DrawImCredits(num6); break; case 4: DrawImItems(num6); break; case 5: DrawImNetwork(num6); break; case 6: DrawImWeather(num6); break; } GUILayout.EndArea(); GUI.DragWindow(new Rect(0f, 0f, width, num2)); } private void DrawImFeatures(float w) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) _imFeaturesScroll = GUILayout.BeginScrollView(_imFeaturesScroll, Array.Empty()); ImSectionHeader("CORE"); if (IsFeatureAllowed(0)) { ImToggleRowWithDesc("Ice Immunity [" + iceToggleKeyLabel + "]", iceImmunityEnabled, "Slide on ice without slipping", delegate { ToggleIceImmunity(); }); } if (IsFeatureAllowed(1)) { ImToggleRowWithDesc("Shot Tracer", tracersEnabled, "Shows the ball's actual flight path", delegate { tracersEnabled = !tracersEnabled; SaveCurrentConfig(); MarkTrailVisualSettingsDirty(); MarkHudDirty(); }); } if (IsFeatureAllowed(14)) { ImToggleRowWithDesc("Assist [" + assistToggleKeyLabel + "]", assistEnabled, "Auto-aims and releases at the perfect moment", delegate { ToggleAssist(); }); } if (IsFeatureAllowed(2)) { ImToggleRowWithDesc("Impact Preview", impactPreviewEnabled, "Preview exactly where your shot will land", delegate { impactPreviewEnabled = !impactPreviewEnabled; SaveCurrentConfig(); }); } GUILayout.Space(6f); ImSectionHeader("EXTRAS"); if (IsFeatureAllowed(3)) { ImToggleRowWithDesc("No Wind [" + noWindKeyLabel + "]", noWindEnabled, "Removes wind deflection from your ball", delegate { ToggleNoWind(); }); } if (IsFeatureAllowed(4)) { ImToggleRowWithDesc("Perfect Shot [" + perfectShotKeyLabel + "]", perfectShotEnabled, "Forces your swing into the perfect power zone", delegate { TogglePerfectShot(); }); } if (IsFeatureAllowed(5)) { ImToggleRowWithDesc("No Air Drag [" + noAirDragKeyLabel + "]", noAirDragEnabled, "Removes air resistance — ball flies further", delegate { ToggleNoAirDrag(); }); } if (IsFeatureAllowed(6)) { ImToggleRowWithDesc("Speed Boost [" + speedMultiplierKeyLabel + "]", speedMultiplierEnabled, "Multiplies your movement speed", delegate { ToggleSpeedMultiplier(); }); } if (IsFeatureAllowed(7)) { ImToggleRowWithDesc("Inf. Item Usage [" + infiniteAmmoKeyLabel + "]", infiniteAmmoEnabled, "Weapons and items never run out", delegate { ToggleInfiniteAmmo(); }); } if (IsFeatureAllowed(8)) { ImToggleRowWithDesc("No Recoil [" + noRecoilKeyLabel + "]", noRecoilEnabled, "Removes screen shake when firing weapons", delegate { ToggleNoRecoil(); }); } if (IsFeatureAllowed(9)) { ImToggleRowWithDesc("No Knockback [" + noKnockbackKeyLabel + "]", noKnockbackEnabled, "Prevents weapons from flinging you back", delegate { ToggleNoKnockback(); }); } if (IsFeatureAllowed(10)) { ImToggleRowWithDesc("Landmine Immunity [" + landmineImmunityKeyLabel + "]", landmineImmunityEnabled, "Walk over landmines without being hit", delegate { ToggleLandmineImmunity(); }); } if (IsFeatureAllowed(11)) { ImToggleRowWithDesc("Lock-On Any Dist. [" + lockOnAnyDistanceKeyLabel + "]", lockOnAnyDistanceEnabled, "Lock-on targets golf balls at any range", delegate { ToggleLockOnAnyDistance(); }); } if (IsFeatureAllowed(12)) { ImToggleRowWithDesc("Expanded Slots [" + expandedSlotsKeyLabel + "]", expandedSlotsEnabled, "Expand hotbar to 8 total slots / keys 1-8", delegate { ToggleExpandedSlots(); }); if (expandedSlotsEnabled && IsNetworkHost()) { ImToggleRow(" Apply to all players", expandedSlotsAllPlayers, delegate { expandedSlotsAllPlayers = !expandedSlotsAllPlayers; SaveCurrentConfig(); if (expandedSlotsEnabled) { TryExpandServerInventorySlotsPublic(); } }); } } if (IsFeatureAllowed(6)) { GUILayout.Space(6f); ImSectionHeader("SPEED FACTOR"); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("x" + speedMultiplierFactor.ToString("F1"), _imActionLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(36f) }); float num = GUILayout.HorizontalSlider(speedMultiplierFactor, 0.5f, 10f, Array.Empty()); if (Math.Abs(num - speedMultiplierFactor) > 0.01f) { speedMultiplierFactor = Mathf.Round(num * 10f) / 10f; if (speedMultiplierEnabled) { ApplySpeedMultiplierState(); } SaveCurrentConfig(); } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); } private void DrawImKeys(float w) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(_imInfoLabel); val.normal.textColor = (keybindRebindMode ? new Color(0.4f, 0.9f, 0.5f) : new Color(0.55f, 0.55f, 0.62f)); GUILayout.Label(keybindRebindMode ? ("Press any key to bind: " + SettingsKeybindDisplayNames[keybindRebindIndex]) : "Click a key badge to rebind", val, Array.Empty()); GUILayout.Space(4f); _imKeysScroll = GUILayout.BeginScrollView(_imKeysScroll, Array.Empty()); for (int num = 0; num < SettingsKeybindDisplayNames.Length; num++) { int index = num; GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(SettingsKeybindDisplayNames[num], _imActionLabel, Array.Empty()); int num2; GUIStyle obj; if (keybindRebindMode) { num2 = ((keybindRebindIndex == num) ? 1 : 0); if (num2 != 0) { obj = _imRebindActive; goto IL_00e8; } } else { num2 = 0; } obj = _imKeyBadge; goto IL_00e8; IL_00e8: GUIStyle val2 = obj; if (GUILayout.Button((num2 != 0) ? "..." : FormatKeyLabel(GetKeybindNameByIndex(num)), val2, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(80f), GUILayout.Height(24f) })) { StartKeybindRebindForIndex(index); } GUILayout.EndHorizontal(); GUILayout.Space(2f); } GUILayout.EndScrollView(); } private void DrawImHud(float w) { ImSectionHeader("HUD VISIBILITY"); ImToggleRow("Bottom keybind bar", hudShowBottomBar, delegate { hudShowBottomBar = !hudShowBottomBar; SaveCurrentConfig(); MarkHudDirty(); }); ImToggleRow("Ball distance to hole", hudShowBallDistance, delegate { hudShowBallDistance = !hudShowBallDistance; SaveCurrentConfig(); MarkHudDirty(); }); ImToggleRow("Ice immunity indicator", hudShowIceIndicator, delegate { hudShowIceIndicator = !hudShowIceIndicator; SaveCurrentConfig(); MarkHudDirty(); }); ImToggleRow("Center title", hudShowCenterTitle, delegate { hudShowCenterTitle = !hudShowCenterTitle; SaveCurrentConfig(); MarkHudDirty(); }); ImToggleRow("Player info (left)", hudShowPlayerInfo, delegate { hudShowPlayerInfo = !hudShowPlayerInfo; SaveCurrentConfig(); MarkHudDirty(); }); ImToggleRow("Shot tracers", tracersEnabled, delegate { tracersEnabled = !tracersEnabled; SaveCurrentConfig(); MarkTrailVisualSettingsDirty(); MarkHudDirty(); }); } private void DrawImCredits(float w) { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) GUILayout.Label("Grant credits to yourself\n(client-local, no server sync)", _imInfoLabel, Array.Empty()); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Amount:", _imActionLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) }); GUILayout.Label(creditsGrantAmount.ToString(), _imActionLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); GUILayout.EndHorizontal(); int num = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)creditsGrantAmount, 0f, 50000f, Array.Empty())); if (num != creditsGrantAmount) { creditsGrantAmount = num; SaveCurrentConfig(); } GUILayout.Space(8f); if (GUILayout.Button("Grant " + creditsGrantAmount + " Credits", _imButton, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) })) { GrantCredits(creditsGrantAmount); } GUILayout.Space(12f); GUIStyle val = new GUIStyle(_imButton); val.normal.textColor = new Color(0.56f, 0.62f, 0.9f, 1f); if (GUILayout.Button("Join Discord", val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { Application.OpenURL("https://discord.gg/wbhNEHFGMq"); } } private void DrawImItems(float w) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_007f: Unknown result type (might be due to invalid IL or missing references) bool flag = BirdieGrantBridge.IsReady(); GUIStyle val = new GUIStyle(_imInfoLabel); val.normal.textColor = (flag ? new Color(0.3f, 0.85f, 0.45f) : new Color(0.8f, 0.35f, 0.35f)); GUILayout.Label(flag ? "Host has BirdieMod — items will spawn" : "Host does not have BirdieMod — items require host", val, Array.Empty()); GUILayout.Space(6f); _imItemsScroll = GUILayout.BeginScrollView(_imItemsScroll, Array.Empty()); float num = (w - 12f) * 0.5f; for (int i = 0; i < SpawnableItemNames.Length; i++) { if (i % 2 == 0) { GUILayout.BeginHorizontal(Array.Empty()); } int itemTypeInt = SpawnableItemTypeInts[i]; if (GUILayout.Button(SpawnableItemKeyLabels[i] + " " + SpawnableItemNames[i], _imButton, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(num), GUILayout.Height(30f) })) { SpawnItemClientSide(itemTypeInt); } if (i % 2 == 1 || i == SpawnableItemNames.Length - 1) { GUILayout.EndHorizontal(); } if (i % 2 == 1) { GUILayout.Space(2f); } } GUILayout.EndScrollView(); } private void DrawImNetwork(float w) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) _imNetScroll = GUILayout.BeginScrollView(_imNetScroll, Array.Empty()); if (IsNetworkHost()) { ImSectionHeader("HOST CONTROLS"); ImToggleRow("Host Controls", hostControlsActive, delegate { SetHostControlsActive(!hostControlsActive); }); if (hostControlsActive) { GUILayout.Space(4f); ImSectionHeader("ALLOWED FEATURES"); ImHostFeatureToggle("Ice Immunity", 0); ImHostFeatureToggle("Shot Tracer", 1); ImHostFeatureToggle("Impact Preview", 2); ImHostFeatureToggle("No Wind", 3); ImHostFeatureToggle("Perfect Shot", 4); ImHostFeatureToggle("No Air Drag", 5); ImHostFeatureToggle("Speed Multiplier", 6); ImHostFeatureToggle("Infinite Item Usage", 7); ImHostFeatureToggle("No Recoil", 8); ImHostFeatureToggle("No Knockback", 9); ImHostFeatureToggle("Landmine Immunity", 10); ImHostFeatureToggle("Lock-On Any Dist.", 11); ImHostFeatureToggle("Expanded Slots", 12); ImHostFeatureToggle("Coffee Boost", 13); ImHostFeatureToggle("Assist", 14); ImHostFeatureToggle("Weather", 15); } } else if (BirdieHostBridge.IsUnderHostControl) { GUIStyle val = new GUIStyle(_imInfoLabel); val.normal.textColor = new Color(1f, 0.75f, 0.2f, 1f); GUILayout.Label("Host Controls Active", val, Array.Empty()); GUILayout.Space(4f); GUILayout.Label("Some features may be restricted by the lobby host.", _imInfoLabel, Array.Empty()); } else { GUILayout.Label("No host control active. All features available.", _imInfoLabel, Array.Empty()); } GUILayout.EndScrollView(); } private void DrawImWeather(float w) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) _imNetScroll = GUILayout.BeginScrollView(_imNetScroll, Array.Empty()); if (!IsNetworkHost()) { GUILayout.Label("Weather controls are available to the lobby host only.", _imInfoLabel, Array.Empty()); GUILayout.EndScrollView(); return; } ImSectionHeader("WEATHER EVENT"); string[] array = new string[9] { "None (Clear)", "Rain - Light", "Rain - Medium", "Rain - Heavy", "Wind Gusts - Light", "Wind Gusts - Medium", "Wind Gusts - Heavy", "Thunderstorm", "Tornado" }; for (int i = 0; i < array.Length; i++) { GUIStyle val = ((_hostSelectedWeather == (byte)i) ? _imToggleOn : _imToggleOff); if (GUILayout.Button(array[i], val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { _hostSelectedWeather = (byte)i; } } GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(_hostWeatherRunning ? "Stop Weather" : "Start Weather", _imButton, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) })) { if (_hostWeatherRunning) { _hostWeatherRunning = false; BirdieWeatherBridge.BroadcastWeather(0, weatherAllowed: true); ApplyWeather(0); } else { _hostWeatherRunning = true; bool weatherAllowed = (hostAllowedFeatureMask & 0x8000) != 0; BirdieWeatherBridge.BroadcastWeather(_hostSelectedWeather, weatherAllowed); ApplyWeather(_hostSelectedWeather); } } GUILayout.EndHorizontal(); if (_hostWeatherRunning) { GUIStyle val2 = new GUIStyle(_imInfoLabel); val2.normal.textColor = new Color(0.3f, 0.85f, 0.45f, 1f); GUILayout.Label("Weather active: " + ((_hostSelectedWeather < 9) ? (new string[9] { "None", "Rain (Light)", "Rain (Medium)", "Rain (Heavy)", "Wind Gusts (Light)", "Wind Gusts (Medium)", "Wind Gusts (Heavy)", "Thunderstorm", "Tornado" })[_hostSelectedWeather] : "Unknown"), val2, Array.Empty()); } GUILayout.Space(10f); ImSectionHeader("AUTO WEATHER"); GUILayout.BeginHorizontal(Array.Empty()); GUIStyle val3 = (autoWeatherEnabled ? _imToggleOn : _imToggleOff); if (GUILayout.Button(autoWeatherEnabled ? "Auto Weather ON" : "Auto Weather OFF", val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { autoWeatherEnabled = !autoWeatherEnabled; } GUILayout.EndHorizontal(); GUILayout.Space(4f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label("Spawn Chance", _imInfoLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(110f) }); autoWeatherChance = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)autoWeatherChance, 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(w - 180f) })); GUILayout.Label(autoWeatherChance + "%", _imInfoLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) }); GUILayout.EndHorizontal(); GUILayout.Space(4f); GUILayout.Label("Per-Type Spawn Weight (0 = disabled):", _imInfoLabel, Array.Empty()); string[] array2 = new string[8] { "Rain - Light", "Rain - Medium", "Rain - Heavy", "Wind - Light", "Wind - Medium", "Wind - Heavy", "Thunderstorm", "Tornado" }; for (int j = 0; j < array2.Length; j++) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(array2[j], _imInfoLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(115f) }); autoWeatherChances[j] = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)autoWeatherChances[j], 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(w - 195f) })); GUILayout.Label(autoWeatherChances[j] + "%", _imInfoLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) }); GUILayout.EndHorizontal(); } GUILayout.Space(10f); ImSectionHeader("NOTES"); GUILayout.Label("Wind changes affect all players. Rain drag and visual effects apply to Birdie clients only.", _imInfoLabel, Array.Empty()); GUILayout.EndScrollView(); } private void ImHostFeatureToggle(string label, int bit) { bool enabled = (hostAllowedFeatureMask & (ulong)(1L << bit)) != 0; ImToggleRow(label, enabled, delegate { SetHostFeatureBit(bit, !enabled); }); } private bool IsNetworkHost() { try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { Type type = assemblies[i].GetType("Mirror.NetworkServer"); if (!(type == null)) { PropertyInfo property = type.GetProperty("active", BindingFlags.Static | BindingFlags.Public); if (property != null) { return (bool)property.GetValue(null); } break; } } } catch { } return false; } private void ImSectionHeader(string text) { GUILayout.Label(text, _imSectionLabel, Array.Empty()); } private void ImToggleRow(string label, bool value, Action onToggle) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(label, _imActionLabel, Array.Empty()); GUIStyle val = (value ? _imToggleOn : _imToggleOff); if (GUILayout.Button(value ? "ON" : "OFF", val, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(48f), GUILayout.Height(24f) })) { onToggle(); } GUILayout.EndHorizontal(); GUILayout.Space(1f); } private void ImToggleRowWithDesc(string label, bool value, string desc, Action onToggle) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.BeginVertical(Array.Empty()); GUILayout.Label(label, _imActionLabel, Array.Empty()); GUILayout.Label(desc, _imDescLabel, Array.Empty()); GUILayout.EndVertical(); GUIStyle val = (value ? _imToggleOn : _imToggleOff); if (GUILayout.Button(value ? "ON" : "OFF", val, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(48f), GUILayout.Height(34f) })) { onToggle(); } GUILayout.EndHorizontal(); GUILayout.Space(2f); } private void OpenRosettaSettings() { settingsPanelOpen = true; keybindRebindMode = false; keybindRebindIndex = -1; ApplyCursorUnlockForSettings(unlock: true); ApplyGameInputSuppressionForSettings(suppress: true); MarkHudDirty(); } private void CloseRosettaSettings() { settingsPanelOpen = false; keybindRebindMode = false; keybindRebindIndex = -1; ApplyCursorUnlockForSettings(unlock: false); ApplyGameInputSuppressionForSettings(suppress: false); MarkHudDirty(); } private void ToggleRosettaSettings() { if (settingsPanelOpen) { CloseRosettaSettings(); } else { OpenRosettaSettings(); } } private void EnsureRosettaRoot() { } internal void BirdieInit() { LoadOrCreateConfig(); WeatherSystemInit(); } internal void BirdieUpdate() { float time = Time.time; BirdieGrantBridge.EnsureInitialized(); BirdieHostBridge.EnsureHandlersRegistered(); BirdieWeatherBridge.EnsureHandlersRegistered(); if (BirdieHostBridge.FlagExpandedSlotsForClient && !expandedSlotsEnabled) { BirdieHostBridge.FlagExpandedSlotsForClient = false; ToggleExpandedSlots(); } WeatherSystemUpdate(); PollDispenserPickup(); PollCrateReturn(); InvalidateResolvedContextIfLost(); HandleInput(); if (((Object)(object)playerMovement == (Object)null || (Object)(object)playerGolfer == (Object)null) && time >= nextPlayerSearchTime) { nextPlayerSearchTime = time + playerSearchInterval; ResolvePlayerContext(); } EnsureLocalGolfBallReference(force: false); if ((Object)(object)playerGolfer != (Object)null && time >= nextIdealSwingCalculationTime) { nextIdealSwingCalculationTime = time + idealSwingCalculationInterval; CalculateIdealSwingParameters(forceHoleRefresh: false); } EnsureVisualsInitialized(); if (visualsInitialized) { UpdateTrails(); UpdateHud(); UpdateImpactPreview(); } } internal void BirdieLateUpdate() { TickInfiniteAmmo(); TickNoKnockback(); AutoAimCamera(); ApplyPerfectShotForcing(); if (assistEnabled && isLeftMousePressed && !autoReleaseTriggeredThisCharge) { AutoSwingRelease(); } WeatherSystemLateUpdate(); } private void HandleInput() { UpdateMouseState(); HandleKeyboardShortcuts(); } private void UpdateMouseState() { bool flag = isLeftMousePressed; if (Mouse.current != null) { isLeftMousePressed = Mouse.current.leftButton.isPressed; isRightMousePressed = Mouse.current.rightButton.isPressed; } else { isLeftMousePressed = false; isRightMousePressed = false; } if (isLeftMousePressed && !flag) { ResetChargeState(); ResetTrailState(); if (assistEnabled) { CalculateIdealSwingParameters(forceHoleRefresh: true); } } else if (!isLeftMousePressed && flag) { ResetChargeState(); DisableAutoAimCamera(); } } private void HandleKeyboardShortcuts() { //IL_000a: 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) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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) if (Keyboard.current != null) { if (WasConfiguredKeyPressed(assistToggleKey)) { ToggleAssist(); } if (WasConfiguredKeyPressed(coffeeBoostKey)) { AddCoffeeBoost(); } if (WasConfiguredKeyPressed(nearestBallModeKey)) { ToggleNearestBallMode(); } if (WasConfiguredKeyPressed(unlockAllCosmeticsKey)) { UnlockAllCosmetics(); } if (WasConfiguredKeyPressed(hudToggleKey)) { ToggleHudVisibility(); } if (WasConfiguredKeyPressed(randomItemKey)) { TryCollectFromCrate(); } if (WasConfiguredKeyPressed(iceToggleKey)) { ToggleIceImmunity(); } if (WasConfiguredKeyPressed(noWindKey)) { ToggleNoWind(); } if (WasConfiguredKeyPressed(perfectShotKey)) { TogglePerfectShot(); } if (WasConfiguredKeyPressed(noAirDragKey)) { ToggleNoAirDrag(); } if (WasConfiguredKeyPressed(speedMultiplierKey)) { ToggleSpeedMultiplier(); } if (WasConfiguredKeyPressed(infiniteAmmoKey)) { ToggleInfiniteAmmo(); } if (WasConfiguredKeyPressed(noRecoilKey)) { ToggleNoRecoil(); } if (WasConfiguredKeyPressed(noKnockbackKey)) { ToggleNoKnockback(); } if (WasConfiguredKeyPressed(landmineImmunityKey)) { ToggleLandmineImmunity(); } if (WasConfiguredKeyPressed(lockOnAnyDistanceKey)) { ToggleLockOnAnyDistance(); } if (WasConfiguredKeyPressed(expandedSlotsKey)) { ToggleExpandedSlots(); } if (WasConfiguredKeyPressed(settingsKey)) { ToggleRosettaSettings(); } if (settingsPanelOpen) { HandleSettingsPanelInput(); } } } private void ToggleHudVisibility() { hudVisible = !hudVisible; ApplyHudVisibility(); } private void ToggleAssist() { if (IsFeatureAllowed(-1)) { assistEnabled = !assistEnabled; MarkHudDirty(); if (assistEnabled) { ResolvePlayerContext(); FindHoleOnly(force: true); CalculateIdealSwingParameters(forceHoleRefresh: true); } else { DisableAutoAimCamera(); ResetChargeState(); ClearPredictedTrails(hideFrozenSnapshot: true); } } } private void AddCoffeeBoost() { if (!IsFeatureAllowed(13)) { return; } if ((Object)(object)playerMovement == (Object)null || addSpeedBoostMethod == null) { ResolvePlayerContext(); } if ((Object)(object)playerMovement == (Object)null || addSpeedBoostMethod == null) { return; } try { cachedSpeedBoostArgs[0] = 500f; addSpeedBoostMethod.Invoke(playerMovement, cachedSpeedBoostArgs); } catch { } } private void ToggleNearestBallMode() { nearestAnyBallModeEnabled = !nearestAnyBallModeEnabled; nextNearestAnyBallResolveTime = 0f; MarkHudDirty(); ResolvePlayerContext(); EnsureLocalGolfBallReference(force: true); ResetTrailState(); if ((Object)(object)playerGolfer != (Object)null) { FindHoleOnly(force: true); CalculateIdealSwingParameters(forceHoleRefresh: true); } } private void InvalidateResolvedContextIfLost() { if (hadResolvedPlayerContext && ((Object)(object)playerMovement == (Object)null || (Object)(object)playerGolfer == (Object)null || (Object)(object)playerMovement.gameObject == (Object)null || (Object)(object)playerGolfer.gameObject == (Object)null)) { playerFound = false; playerMovement = null; playerGolfer = null; golfBall = null; addSpeedBoostMethod = null; localPlayerHittable = null; lastBallResolveSource = "missing"; hadResolvedPlayerContext = false; hadResolvedBallContext = false; ClearRuntimeState(); } else if (hadResolvedBallContext && ((Object)(object)golfBall == (Object)null || (Object)(object)golfBall.gameObject == (Object)null)) { golfBall = null; lastBallResolveSource = "missing"; hadResolvedBallContext = false; ClearRuntimeState(); } } private void ResetChargeState() { autoReleaseTriggeredThisCharge = false; autoChargeSequenceStarted = false; nextTryStartChargingTime = 0f; lastAutoSwingReleaseFrame = -1; lastObservedSwingPower = 0f; } private void ClearRuntimeState() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00a0: 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) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00bb: Unknown result type (might be due to invalid IL or missing references) dispenserPickupPending = false; dispenserPickupLocalInventory = null; pendingCrateTeleport = false; crateReturnPending = false; settingsPanelOpen = false; keybindRebindMode = false; keybindRebindIndex = -1; UpdateSettingsPanelVisibility(); DisableAutoAimCamera(); ResetChargeState(); ResetTrailState(); HideImpactPreview(); cachedImpactPreviewReferenceCamera = null; nextImpactPreviewReferenceCameraRefreshTime = 0f; nextGolfBallCacheRefreshTime = 0f; cachedGolfBalls.Clear(); localPlayerHittable = null; nextPredictedPathRefreshTime = 0f; currentAimTargetPosition = Vector3.zero; currentSwingOriginPosition = Vector3.zero; windAimOffset = Vector3.zero; holePosition = Vector3.zero; flagPosition = Vector3.zero; nextHoleSearchTime = 0f; nextIdealSwingCalculationTime = 0f; cachedLocalPlayerDisplayName = ""; nextDisplayNameRefreshTime = 0f; MarkHudDirty(); } private void EnsureVisualsInitialized() { if (!visualsInitialized && !(Time.realtimeSinceStartup < visualsInitializationDelay)) { CreateHud(); EnsureTrailRenderers(); ApplyTrailVisualSettings(); visualsInitialized = true; } } private static Sprite GetRoundedSprite(ref Sprite cache, int texSize, int radius) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_006f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cache != (Object)null) { return cache; } Texture2D val = new Texture2D(texSize, texSize, (TextureFormat)4, false); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; Color32[] array = (Color32[])(object)new Color32[texSize * texSize]; for (int i = 0; i < texSize; i++) { for (int j = 0; j < texSize; j++) { array[i * texSize + j] = (InsideRoundedRect(j, i, texSize, texSize, radius) ? new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue) : new Color32((byte)0, (byte)0, (byte)0, (byte)0)); } } val.SetPixels32(array); val.Apply(); cache = Sprite.Create(val, new Rect(0f, 0f, (float)texSize, (float)texSize), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, new Vector4((float)radius, (float)radius, (float)radius, (float)radius)); return cache; } private static bool InsideRoundedRect(int px, int py, int w, int h, int r) { int num = w - r - 1; int num2 = h - r - 1; int num3 = ((px < r) ? r : ((px > num) ? num : px)); int num4 = ((py < r) ? r : ((py > num2) ? num2 : py)); int num5 = px - num3; int num6 = py - num4; return num5 * num5 + num6 * num6 <= r * r; } private static void SetRounded(Image img, Sprite sprite, Color color) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) img.sprite = sprite; img.type = (Type)1; img.pixelsPerUnitMultiplier = 1f; ((Graphic)img).color = color; } private IEnumerator AnimatePanelOpen() { CanvasGroup cg = (((Object)(object)settingsPanelObject != (Object)null) ? settingsPanelObject.GetComponent() : null); if (!((Object)(object)cg == (Object)null)) { float dur = 0.18f; float t = 0f; while (t < dur) { t += Time.unscaledDeltaTime; float num2 = (cg.alpha = Mathf.SmoothStep(0f, 1f, t / dur)); float num3 = Mathf.Lerp(0.92f, 1f, num2); settingsPanelObject.transform.localScale = new Vector3(num3, num3, 1f); yield return null; } cg.alpha = 1f; settingsPanelObject.transform.localScale = Vector3.one; } } private IEnumerator AnimatePanelClose() { CanvasGroup cg = (((Object)(object)settingsPanelObject != (Object)null) ? settingsPanelObject.GetComponent() : null); if ((Object)(object)cg == (Object)null) { if ((Object)(object)settingsPanelObject != (Object)null) { settingsPanelObject.SetActive(false); } yield break; } float dur = 0.12f; float t = 0f; while (t < dur) { t += Time.unscaledDeltaTime; float num = Mathf.SmoothStep(0f, 1f, t / dur); cg.alpha = 1f - num; float num2 = Mathf.Lerp(1f, 0.95f, num); settingsPanelObject.transform.localScale = new Vector3(num2, num2, 1f); yield return null; } cg.alpha = 0f; settingsPanelObject.SetActive(false); settingsPanelObject.transform.localScale = Vector3.one; } private IEnumerator AnimatePillSlide(RectTransform knob, Image pillBg, float targetX, Color targetColor) { //IL_001c: 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) float dur = 0.14f; float t = 0f; float startX = knob.anchoredPosition.x; Color startColor = ((Graphic)pillBg).color; while (t < dur) { t += Time.unscaledDeltaTime; float num = Mathf.SmoothStep(0f, 1f, t / dur); if ((Object)(object)knob != (Object)null) { knob.anchoredPosition = new Vector2(Mathf.Lerp(startX, targetX, num), 0f); } if ((Object)(object)pillBg != (Object)null) { ((Graphic)pillBg).color = Color.Lerp(startColor, targetColor, num); } yield return null; } if ((Object)(object)knob != (Object)null) { knob.anchoredPosition = new Vector2(targetX, 0f); } if ((Object)(object)pillBg != (Object)null) { ((Graphic)pillBg).color = targetColor; } } private void OpenSettingsMenu() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) settingsPanelOpen = true; keybindRebindMode = false; keybindRebindIndex = -1; ApplyCursorUnlockForSettings(unlock: true); ApplyGameInputSuppressionForSettings(suppress: true); SetSettingsV2Tab(settingsTabIndex); UpdateSettingsPanelVisibility(); if ((Object)(object)settingsPanelObject != (Object)null) { CanvasGroup component = settingsPanelObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.alpha = 0f; settingsPanelObject.transform.localScale = new Vector3(0.92f, 0.92f, 1f); } BirdieCoroutine.Start(AnimatePanelOpen()); } MarkHudDirty(); } private void CloseSettingsMenu() { settingsPanelOpen = false; keybindRebindMode = false; keybindRebindIndex = -1; ApplyCursorUnlockForSettings(unlock: false); ApplyGameInputSuppressionForSettings(suppress: false); BirdieCoroutine.Start(AnimatePanelClose()); MarkHudDirty(); } private void InitializeSettingsInputReflection() { if (settingsInputReflectionInitialized) { return; } settingsInputReflectionInitialized = true; try { Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { if (cachedCursorSetForceUnlockedMethod == null) { Type type = assembly.GetType("CursorManager"); if (type != null) { cachedCursorSetForceUnlockedMethod = type.GetMethod("SetCursorForceUnlocked", BindingFlags.Static | BindingFlags.Public); } } if (cachedInputManagerEnableModeMethod == null || cachedInputManagerDisableModeMethod == null) { Type type2 = assembly.GetType("InputManager"); if (type2 != null) { if (cachedInputManagerEnableModeMethod == null) { cachedInputManagerEnableModeMethod = type2.GetMethod("EnableMode", BindingFlags.Static | BindingFlags.Public); } if (cachedInputManagerDisableModeMethod == null) { cachedInputManagerDisableModeMethod = type2.GetMethod("DisableMode", BindingFlags.Static | BindingFlags.Public); } } } if (cachedInputModePausedValue == null) { Type type3 = assembly.GetType("InputMode"); if (type3 != null && type3.IsEnum) { try { cachedInputModePausedValue = Enum.Parse(type3, "Paused"); } catch { } } } if (cachedCursorSetForceUnlockedMethod != null && cachedInputManagerEnableModeMethod != null && cachedInputManagerDisableModeMethod != null && cachedInputModePausedValue != null) { break; } } } catch { } } private void ApplyCursorUnlockForSettings(bool unlock) { if (!settingsInputReflectionInitialized) { InitializeSettingsInputReflection(); } if (cachedCursorSetForceUnlockedMethod == null) { return; } try { cachedCursorSetForceUnlockedMethod.Invoke(null, new object[1] { unlock }); } catch { } } private void ApplyGameInputSuppressionForSettings(bool suppress) { if (!settingsInputReflectionInitialized) { InitializeSettingsInputReflection(); } if (cachedInputModePausedValue == null) { return; } try { if (suppress) { if (cachedInputManagerEnableModeMethod != null) { cachedInputManagerEnableModeMethod.Invoke(null, new object[1] { cachedInputModePausedValue }); } } else if (cachedInputManagerDisableModeMethod != null) { cachedInputManagerDisableModeMethod.Invoke(null, new object[1] { cachedInputModePausedValue }); } } catch { } } private void CreateSettingsPanelUi(Transform parent) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Expected O, but got Unknown //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_071a: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_076c: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Expected O, but got Unknown //IL_078f: Unknown result type (might be due to invalid IL or missing references) //IL_079a: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)settingsPanelObject != (Object)null) { return; } settingsPanelObject = new GameObject("BirdieSettingsPanel"); settingsPanelObject.transform.SetParent(parent, false); RectTransform obj = settingsPanelObject.AddComponent(); obj.anchorMin = new Vector2(0.5f, 0.5f); obj.anchorMax = new Vector2(0.5f, 0.5f); obj.pivot = new Vector2(0.5f, 0.5f); obj.sizeDelta = new Vector2(640f, 440f); settingsPanelObject.AddComponent(); SetRounded(settingsPanelObject.AddComponent(), GetRoundedSprite(ref s_roundedLg, 64, 12), new Color(0.1f, 0.1f, 0.13f, 0.96f)); GameObject val = CreateUiObject("Sidebar", settingsPanelObject.transform); RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(0f, 1f); component.pivot = new Vector2(0f, 0.5f); component.offsetMin = Vector2.zero; component.offsetMax = new Vector2(60f, 0f); SetRounded(val.AddComponent(), GetRoundedSprite(ref s_roundedLg, 64, 12), new Color(0.07f, 0.07f, 0.09f, 1f)); GameObject obj2 = CreateUiObject("SidebarSep", settingsPanelObject.transform); RectTransform component2 = obj2.GetComponent(); component2.anchorMin = new Vector2(0f, 0f); component2.anchorMax = new Vector2(0f, 1f); component2.pivot = new Vector2(0f, 0.5f); component2.offsetMin = new Vector2(59f, 4f); component2.offsetMax = new Vector2(60f, -4f); ((Graphic)obj2.AddComponent()).color = new Color(1f, 1f, 1f, 0.06f); GameObject val2 = CreateUiObject("MainArea", settingsPanelObject.transform); RectTransform component3 = val2.GetComponent(); component3.anchorMin = new Vector2(0f, 0f); component3.anchorMax = new Vector2(1f, 1f); component3.offsetMin = new Vector2(60f, 0f); component3.offsetMax = Vector2.zero; GameObject val3 = CreateUiObject("TitleBar", val2.transform); RectTransform component4 = val3.GetComponent(); component4.anchorMin = new Vector2(0f, 1f); component4.anchorMax = new Vector2(1f, 1f); component4.pivot = new Vector2(0.5f, 1f); component4.offsetMin = new Vector2(0f, -36f); component4.offsetMax = Vector2.zero; ((Graphic)val3.AddComponent()).color = new Color(0.08f, 0.08f, 0.1f, 1f); GameObject obj3 = CreateUiObject("TitleSep", val3.transform); RectTransform component5 = obj3.GetComponent(); component5.anchorMin = new Vector2(0f, 0f); component5.anchorMax = new Vector2(1f, 0f); component5.pivot = new Vector2(0.5f, 0f); component5.offsetMin = new Vector2(0f, 0f); component5.offsetMax = new Vector2(0f, 1f); ((Graphic)obj3.AddComponent()).color = new Color(1f, 1f, 1f, 0.06f); GameObject obj4 = CreateUiObject("TitleLabel", val3.transform); RectTransform component6 = obj4.GetComponent(); component6.anchorMin = Vector2.zero; component6.anchorMax = Vector2.one; component6.offsetMin = new Vector2(10f, 0f); component6.offsetMax = Vector2.zero; TextMeshProUGUI obj5 = obj4.AddComponent(); ((TMP_Text)obj5).text = "Birdie Settings"; ((TMP_Text)obj5).fontSize = 15f; ((TMP_Text)obj5).fontStyle = (FontStyles)1; ((Graphic)obj5).color = Color.white; ((TMP_Text)obj5).alignment = (TextAlignmentOptions)4097; GameObject val4 = CreateUiObject("ContentArea", val2.transform); RectTransform component7 = val4.GetComponent(); component7.anchorMin = Vector2.zero; component7.anchorMax = Vector2.one; component7.offsetMin = Vector2.zero; component7.offsetMax = new Vector2(0f, -36f); settingsV2TabPanels = (GameObject[])(object)new GameObject[5]; settingsV2TabPanels[0] = BuildFeaturesTab(val4.transform); settingsV2TabPanels[1] = BuildKeybindsTab(val4.transform); settingsV2TabPanels[2] = BuildHudTab(val4.transform); settingsV2TabPanels[3] = BuildCreditsTab(val4.transform); settingsV2TabPanels[4] = BuildItemsTab(val4.transform); settingsV2NavButtons = (Button[])(object)new Button[5]; string[] array = new string[5] { "Features", "Keys", "HUD", "$", "Items" }; for (int i = 0; i < 5; i++) { int capturedIndex = i; RectTransform component8 = CreateSidebarNavButton(val.transform, array[i], i, out settingsV2NavButtons[i]).GetComponent(); component8.anchorMin = new Vector2(0f, 1f); component8.anchorMax = new Vector2(1f, 1f); component8.pivot = new Vector2(0.5f, 1f); float num = 0f - (4f + (float)i * 56f); component8.offsetMin = new Vector2(2f, num - 52f); component8.offsetMax = new Vector2(-2f, num); ((UnityEvent)settingsV2NavButtons[i].onClick).AddListener((UnityAction)delegate { SetSettingsV2Tab(capturedIndex); }); } GameObject val5 = CreateUiObject("CloseBtn", val.transform); RectTransform component9 = val5.GetComponent(); component9.anchorMin = new Vector2(0f, 0f); component9.anchorMax = new Vector2(1f, 0f); component9.pivot = new Vector2(0.5f, 0f); component9.offsetMin = new Vector2(2f, 4f); component9.offsetMax = new Vector2(-2f, 44f); Image val6 = val5.AddComponent(); SetRounded(val6, GetRoundedSprite(ref s_roundedMd, 48, 8), new Color(0.55f, 0.12f, 0.12f, 0.9f)); Button obj6 = val5.AddComponent