Decompiled source of BONESQUAD CodeMod v11.1.0
Mods/BONESQUAD.dll
Decompiled 7 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using AudioImportLib; using BONESQUAD; using BONESQUAD.Modules.BulletWhiz; using BONESQUAD.Modules.Compass; using BONESQUAD.Modules.FusionCompat; using BONESQUAD.Modules.HUD; using BONESQUAD.Modules.RadialMenu; using BONESQUAD.Modules.Regeneration; using BONESQUAD.Modules.SlowRegen; using BONESQUAD.Modules.SlowWalk; using BONESQUAD.Modules.SoundFalloff; using BONESQUAD.Modules.Spawning; using BONESQUAD.Modules.Visual; using BONESQUAD.Modules.Voice; using BoneLib; using BoneLib.BoneMenu; using BoneLib.Notifications; using HarmonyLib; using Il2CppInterop.Runtime.Attributes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSLZ.Marrow; using Il2CppSLZ.Marrow.Data; using Il2CppSLZ.Marrow.Pool; using Il2CppSLZ.Marrow.Warehouse; using Il2CppSLZ.VFX; using Il2CppSLZ.VRMK; using LabFusion.Data; using LabFusion.Entities; using LabFusion.Extensions; using LabFusion.Marrow.Extenders; using LabFusion.Math; using LabFusion.Network; using LabFusion.Network.Serialization; using LabFusion.Player; using LabFusion.RPC; using LabFusion.SDK.Modules; using LabFusion.Senders; using LabFusion.Utilities; using LabFusion.Voice; using MelonLoader; using MelonLoader.Preferences; using MelonLoader.Utils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(BonesquadMod), "BONESQUAD", "11.1.0", "lunobe", null)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: MelonOptionalDependencies(new string[] { "LabFusion" })] [assembly: HarmonyDontPatchAll] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")] [assembly: AssemblyVersion("0.0.0.0")] namespace BONESQUAD { internal static class BonesquadMenu { private static BoolElement _swEnabled; private static FloatElement _swMultiplier; private static BoolElement _bwEnabled; private static FloatElement _bwVolume; private static FloatElement _bwMinDistance; private static FloatElement _bwPassDistance; private static BoolElement _sfEnabled; private static FloatElement _sfLocalRadius; private static FloatElement _sfQuietMaxDist; private static FloatElement _sfMediumMaxDist; private static FloatElement _sfLoudMaxDist; private static BoolElement _rgEnabled; private static FloatElement _rgSlowFactor; private static BoolElement _rgBleedingEnabled; private static FloatElement _rgBleedingModifier; private static BoolElement _spKoRespawn; private static BoolElement _vlEnabled; private static BoolElement _vlAlwaysOnTop; private static BoolElement _vlShowHpText; private static FloatElement _vlHpTextSize; private static FloatElement _vlIconSize; private static FloatElement _vlPosX; private static FloatElement _vlPosY; private static FloatElement _vlDepth; private static BoolElement _vlSmoothFollow; private static FloatElement _vlFollowSpeedX; private static FloatElement _vlFollowSpeedY; private static BoolElement _cmEnabled; private static BoolElement _cmAlwaysOnTop; private static BoolElement _cmRussian; private static BoolElement _cmShowArrow; private static FloatElement _cmScale; private static FloatElement _cmPosY; private static FloatElement _cmDepth; private static FloatElement _cmSmooth; private static FloatElement _cmBgAlpha; private static FloatElement _cmBgHeight; private static FloatElement _cmFadeEdge; private static FloatElement _cmFadeEdgeH; private static FloatElement _cmFadeSpread; private static FloatElement _cmFontCard; private static FloatElement _cmFontLarge; private static FloatElement _cmFontSmall; private static FloatElement _cmArrowSize; private static FloatElement _cmArrowHeight; private static BoolElement _cmSmoothFollow; private static FloatElement _cmFollowSpeedX; private static FloatElement _cmFollowSpeedY; private static BoolElement _cpEnabled; private static BoolElement _cpShowNames; private static BoolElement _cpShowDist; private static BoolElement _cpShowBehind; private static FloatElement _cpIconSize; private static FloatElement _cpNameSize; private static FloatElement _cpDistSize; private static FloatElement _cpHeight; private static BoolElement _ptEnabled; private static BoolElement _ptShowDist; private static BoolElement _ptShowBehind; private static FloatElement _ptLetterSize; private static FloatElement _ptDistSize; private static FloatElement _ptHeight; private static BoolElement _pgShowPings; private static BoolElement _pgShowDistance; private static BoolElement _pgShowOwnerLabel; private static FloatElement _pgIconSize; private static FloatElement _pgDistSize; private static FloatElement _pgOwnerSize; private static BoolElement _pgUseRightHand; private static BoolElement _pgMarkersDie; private static FloatElement _pgLifetime; private static BoolElement _ntEnabled; private static FloatElement _ntSize; private static FloatElement _ntDepth; private static FloatElement _ntPosY; private static BoolElement _ntSmoothFollow; private static FloatElement _ntFollowSpeedX; private static FloatElement _ntFollowSpeedY; private static BoolElement _mpRequireBonesquad; internal static void Init(MelonPreferences_Category prefs) { //IL_0017: 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_0072: 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_010f: 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) Page val = Page.Root.CreatePage("BONESQUAD", Color.cyan, 0, true); BuildFaqPage(val); val.CreateFunction("─── GAMEPLAY ───", Color.gray, (Action)null); BuildMovementPage(val, prefs); BuildBulletWhizPage(val, prefs); BuildSoundFalloffPage(val, prefs); BuildRegenerationPage(val, prefs); val.CreateFunction("─── HUD ───", Color.gray, (Action)null); BuildHpPage(val, prefs); BuildCompassPage(val, prefs); Page val2 = BuildPingMarkersPage(val, prefs); ((Element)val.CreatePageLink(val2)).SetTooltip("Markers you place are visible to all other players who have BONESQUAD installed."); Page val3 = BuildCaptureNotifsPage(val, prefs); ((Element)val.CreatePageLink(val3)).SetTooltip("Requires a BONESQUAD server (see FAQ above). Outside of a server session these notifications will never appear. All capture points, the capture system and point ownership are implemented server-side."); if (FusionCompat.IsAvailable) { val.CreateFunction("─── MULTIPLAYER ───", Color.gray, (Action)null); BuildMultiplayerPage(val, prefs); } val.CreateFunction("──────────────────", Color.gray, (Action)null); val.CreateFunction("Reset All to Defaults", Color.red, (Action)delegate { SlowWalkModule.ResetToDefaults(prefs); BulletWhizModule.ResetToDefaults(prefs); SoundFalloffModule.ResetToDefaults(prefs); RegenerationModule.ResetToDefaults(prefs); VisualModule.ResetToDefaults(prefs); CompassModule.ResetToDefaults(prefs); CaptureEventHandler.ResetToDefaults(prefs); PingMarkerModule.ResetToDefaults(prefs); RefreshMovementElements(); RefreshBulletWhizElements(); RefreshSoundFalloffElements(); RefreshRegenerationElements(); RefreshHpElements(); RefreshCompassElements(); RefreshCompassPingsElements(); RefreshCompassPointsElements(); RefreshPingMarkersElements(); RefreshCaptureNotifsElements(); }); } private static void BuildFaqPage(Page parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_004e: 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) Page obj = parent.CreatePage("FAQ", Color.white, 0, true); ((Element)obj.CreateFunction("What is this mod?", Color.white, (Action)null)).SetTooltip("This mod was developed for our RP project BONESQUAD RP. The project specializes in military theme. The core idea is to bring SQUAD into virtual reality. I — Lunobe (Code) — and my friend Kikelap (SDK) develop incredible mods for maximum immersion. BONESQUAD mod is the best RP code mod in BONELAB."); ((Element)obj.CreateFunction("Server-side?", Color.white, (Action)null)).SetTooltip("Some features need a server-side component and only work on our 24/7 BONESQUAD server. This part is not public and won't be released soon. Server-dependent: Capture Points · Admin Voice · groups/factions · Rally Points/HABs · ping group filtering · Clear Debris/Decals."); ((Element)obj.CreateFunction("Server-locked?", Color.white, (Action)null)).SetTooltip("To keep things fair, the server forces certain settings on join, preventing anyone from tweaking them for an advantage. Locked while connected, restored to your own values on disconnect. Locked: Slow Walk (enabled, speed) · Sound Falloff (ranges) · Regeneration (enabled, slow factor, bleeding enabled, bleed rate)."); ((Element)obj.CreateFunction("Join us!!", Color.white, (Action)null)).SetTooltip("We are actively looking for new people to play with. We have exciting and realistic sessions. You are welcome to join us! Discord invite code: 6KHRhw5Vk3 | Short Discord Link: https://dc.gg/bq | Our website: bonesquad.club"); } private static void BuildMovementPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) Page obj = parent.CreatePage("Movement", Color.cyan, 0, true); _swEnabled = obj.CreateBool("Slow Walk", Color.cyan, SlowWalkModule.Enabled.Value, (Action<bool>)delegate(bool val) { if (SlowWalkModule.ServerLocked) { _swEnabled.Value = SlowWalkModule.Enabled.Value; } else { SlowWalkModule.OnToggle(val); prefs.SaveToFile(true); } }); ((Element)_swEnabled).SetTooltip("Server-controlled. The server forces Slow Walk on or off for all players to standardize movement pace. When you join, the server pushes its Enabled and Speed Multiplier values."); _swMultiplier = obj.CreateFloat("Speed Multiplier", Color.white, SlowWalkModule.SpeedMultiplier.Value, 0.05f, 0.1f, 2f, (Action<float>)delegate(float val) { if (SlowWalkModule.ServerLocked) { _swMultiplier.Value = SlowWalkModule.SpeedMultiplier.Value; } else { SlowWalkModule.OnSpeedMultiplierChanged(val); prefs.SaveToFile(true); } }); ((Element)_swMultiplier).SetTooltip("Server-controlled. The server sets a fixed multiplier for all players. Your local value is overwritten on join and cannot be changed while connected."); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { if (!SlowWalkModule.ServerLocked) { SlowWalkModule.ResetToDefaults(prefs); RefreshMovementElements(); } }); } private static void RefreshMovementElements() { _swEnabled.Value = SlowWalkModule.Enabled.Value; _swMultiplier.Value = SlowWalkModule.SpeedMultiplier.Value; } private static void BuildBulletWhizPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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) Page obj = parent.CreatePage("Bullet Whiz", Color.yellow, 0, true); _bwEnabled = obj.CreateBool("Enabled", Color.yellow, BulletWhizModule.Enabled.Value, (Action<bool>)delegate(bool val) { BulletWhizModule.OnToggle(val); prefs.SaveToFile(true); }); _bwVolume = obj.CreateFloat("Volume", Color.white, BulletWhizModule.Volume.Value, 5f, 0f, 200f, (Action<float>)delegate(float val) { BulletWhizModule.Volume.Value = val; prefs.SaveToFile(true); }); _bwMinDistance = obj.CreateFloat("Min Distance", Color.white, BulletWhizModule.MinDistance.Value, 5f, 0f, 500f, (Action<float>)delegate(float val) { BulletWhizModule.MinDistance.Value = val; prefs.SaveToFile(true); }); _bwPassDistance = obj.CreateFloat("Pass Distance", Color.white, BulletWhizModule.PassDistance.Value, 0.5f, 0.5f, 20f, (Action<float>)delegate(float val) { BulletWhizModule.PassDistance.Value = val; prefs.SaveToFile(true); }); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { BulletWhizModule.ResetToDefaults(prefs); RefreshBulletWhizElements(); }); } private static void RefreshBulletWhizElements() { _bwEnabled.Value = BulletWhizModule.Enabled.Value; _bwVolume.Value = BulletWhizModule.Volume.Value; _bwMinDistance.Value = BulletWhizModule.MinDistance.Value; _bwPassDistance.Value = BulletWhizModule.PassDistance.Value; } private static void BuildSoundFalloffPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_0194: Unknown result type (might be due to invalid IL or missing references) Page obj = parent.CreatePage("Sound Falloff", Color.green, 0, true); _sfEnabled = obj.CreateBool("Enabled", Color.green, SoundFalloffModule.Enabled.Value, (Action<bool>)delegate(bool val) { if (SoundFalloffModule.ServerLocked) { _sfEnabled.Value = SoundFalloffModule.Enabled.Value; } else { SoundFalloffModule.OnToggle(val); prefs.SaveToFile(true); } }); ((Element)_sfEnabled).SetTooltip("Server-controlled. The server enforces Sound Falloff on or off so all players hear gunfire at the same distances. On join, the server pushes all six falloff parameters: Enabled, Local Radius, Quiet/Medium/Loud Max."); _sfLocalRadius = obj.CreateFloat("Local Radius", Color.white, SoundFalloffModule.LocalRadius.Value, 0.5f, 0f, 20f, (Action<float>)delegate(float val) { if (SoundFalloffModule.ServerLocked) { _sfLocalRadius.Value = SoundFalloffModule.LocalRadius.Value; } else { SoundFalloffModule.LocalRadius.Value = val; prefs.SaveToFile(true); } }); ((Element)_sfLocalRadius).SetTooltip("Server-controlled. Sounds within this radius are always heard at full volume regardless of category. Set by the server to match its range limits."); obj.CreateFunction("─── Range Limits ───", Color.gray, (Action)null); _sfQuietMaxDist = obj.CreateFloat("Quiet Max", Color.white, SoundFalloffModule.QuietMaxDist.Value, 5f, 5f, 200f, (Action<float>)delegate(float val) { if (SoundFalloffModule.ServerLocked) { _sfQuietMaxDist.Value = SoundFalloffModule.QuietMaxDist.Value; } else { SoundFalloffModule.QuietMaxDist.Value = val; prefs.SaveToFile(true); } }); ((Element)_sfQuietMaxDist).SetTooltip("Server-controlled. Max range for quiet sounds (reloads, footsteps). Set by the server."); _sfMediumMaxDist = obj.CreateFloat("Medium Max", Color.white, SoundFalloffModule.MediumMaxDist.Value, 10f, 20f, 500f, (Action<float>)delegate(float val) { if (SoundFalloffModule.ServerLocked) { _sfMediumMaxDist.Value = SoundFalloffModule.MediumMaxDist.Value; } else { SoundFalloffModule.MediumMaxDist.Value = val; prefs.SaveToFile(true); } }); ((Element)_sfMediumMaxDist).SetTooltip("Server-controlled. Max range for medium sounds (gunshots, impacts). Set by the server."); _sfLoudMaxDist = obj.CreateFloat("Loud Max", Color.white, SoundFalloffModule.LoudMaxDist.Value, 50f, 100f, 2000f, (Action<float>)delegate(float val) { if (SoundFalloffModule.ServerLocked) { _sfLoudMaxDist.Value = SoundFalloffModule.LoudMaxDist.Value; } else { SoundFalloffModule.LoudMaxDist.Value = val; prefs.SaveToFile(true); } }); ((Element)_sfLoudMaxDist).SetTooltip("Server-controlled. Max range for loud sounds (explosions, cannons). Set by the server."); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { if (!SoundFalloffModule.ServerLocked) { SoundFalloffModule.ResetToDefaults(prefs); RefreshSoundFalloffElements(); } }); } private static void RefreshSoundFalloffElements() { _sfEnabled.Value = SoundFalloffModule.Enabled.Value; _sfLocalRadius.Value = SoundFalloffModule.LocalRadius.Value; _sfQuietMaxDist.Value = SoundFalloffModule.QuietMaxDist.Value; _sfMediumMaxDist.Value = SoundFalloffModule.MediumMaxDist.Value; _sfLoudMaxDist.Value = SoundFalloffModule.LoudMaxDist.Value; } private static void BuildRegenerationPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_00ba: 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_013d: 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_0179: Unknown result type (might be due to invalid IL or missing references) Page obj = parent.CreatePage("Regeneration", Color.red, 0, true); _rgEnabled = obj.CreateBool("Slow Regen", Color.red, RegenerationModule.Enabled.Value, (Action<bool>)delegate(bool val) { if (RegenerationModule.ServerLocked) { _rgEnabled.Value = RegenerationModule.Enabled.Value; } else { RegenerationModule.OnToggle(val); prefs.SaveToFile(true); } }); ((Element)_rgEnabled).SetTooltip("Server-controlled. The server forces Slow Regen on or off for all players. On join, the server pushes four regen parameters: Slow Regen Enabled, Slow Factor, Bleeding Enabled, Bleed Rate."); _rgSlowFactor = obj.CreateFloat("Slow Factor", Color.white, RegenerationModule.SlowFactor.Value, 0.5f, 1f, 20f, (Action<float>)delegate(float val) { if (RegenerationModule.ServerLocked) { _rgSlowFactor.Value = RegenerationModule.SlowFactor.Value; } else { RegenerationModule.OnSlowFactorChanged(val); prefs.SaveToFile(true); } }); ((Element)_rgSlowFactor).SetTooltip("Server-controlled. How many times slower than vanilla regen rate. Set by the server to balance the session's medical system."); obj.CreateFunction("─── Bleeding ───", Color.gray, (Action)null); _rgBleedingEnabled = obj.CreateBool("Bleeding", Color.yellow, RegenerationModule.BleedingEnabled.Value, (Action<bool>)delegate(bool val) { if (RegenerationModule.ServerLocked) { _rgBleedingEnabled.Value = RegenerationModule.BleedingEnabled.Value; } else { RegenerationModule.OnBleedingToggle(val); prefs.SaveToFile(true); } }); ((Element)_rgBleedingEnabled).SetTooltip("Server-controlled. The server forces the bleeding system on or off. Usually matches Slow Regen state."); _rgBleedingModifier = obj.CreateFloat("Bleed Rate", Color.white, RegenerationModule.BleedingModifier.Value, 0.1f, 0.5f, 3f, (Action<float>)delegate(float val) { if (RegenerationModule.ServerLocked) { _rgBleedingModifier.Value = RegenerationModule.BleedingModifier.Value; } else { RegenerationModule.OnBleedingModifierChanged(val); prefs.SaveToFile(true); } }); ((Element)_rgBleedingModifier).SetTooltip("Server-controlled. Multiplier for bleed drain speed. Set by the server — higher values make bleeding more lethal."); obj.CreateFunction("─── Knockout ───", Color.gray, (Action)null); _spKoRespawn = obj.CreateBool("Auto Respawn", Color.white, RespawnModule.KnockoutTimerEnabled.Value, (Action<bool>)delegate(bool val) { RespawnModule.OnKnockoutTimerToggle(val); prefs.SaveToFile(true); }); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { if (!RegenerationModule.ServerLocked) { RegenerationModule.ResetToDefaults(prefs); RefreshRegenerationElements(); } }); } private static void RefreshRegenerationElements() { _rgEnabled.Value = RegenerationModule.Enabled.Value; _rgSlowFactor.Value = RegenerationModule.SlowFactor.Value; _rgBleedingEnabled.Value = RegenerationModule.BleedingEnabled.Value; _rgBleedingModifier.Value = RegenerationModule.BleedingModifier.Value; _spKoRespawn.Value = RespawnModule.KnockoutTimerEnabled.Value; } private static void BuildHpPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0251: 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) Page obj = parent.CreatePage("HP Indicator", Color.red, 0, true); _vlEnabled = obj.CreateBool("Enabled", Color.red, VisualModule.Enabled.Value, (Action<bool>)delegate(bool val) { VisualModule.OnToggle(val); prefs.SaveToFile(true); }); _vlAlwaysOnTop = obj.CreateBool("Always on Top", Color.white, VisualModule.AlwaysOnTop.Value, (Action<bool>)delegate(bool val) { VisualModule.AlwaysOnTop.Value = val; VisualModule.Invalidate(); prefs.SaveToFile(true); }); _vlShowHpText = obj.CreateBool("HP Text", Color.white, VisualModule.ShowHpText.Value, (Action<bool>)delegate(bool val) { VisualModule.OnShowHpTextChanged(val); prefs.SaveToFile(true); }); _vlHpTextSize = obj.CreateFloat("HP Text Size", Color.white, VisualModule.HpTextSize.Value, 0.001f, 0.003f, 0.04f, (Action<float>)delegate(float val) { VisualModule.OnHpTextSizeChanged(val); prefs.SaveToFile(true); }); obj.CreateFunction("─── Position ───", Color.gray, (Action)null); _vlIconSize = obj.CreateFloat("Icon Size", Color.white, VisualModule.IconSize.Value, 0.005f, 0.005f, 0.15f, (Action<float>)delegate(float val) { VisualModule.OnSizeChanged(val); prefs.SaveToFile(true); }); _vlPosX = obj.CreateFloat("Position X", Color.white, VisualModule.PosX.Value, 0.01f, -0.5f, 0.5f, (Action<float>)delegate(float val) { VisualModule.OnPosXChanged(val); prefs.SaveToFile(true); }); _vlPosY = obj.CreateFloat("Position Y", Color.white, VisualModule.PosY.Value, 0.01f, -0.5f, 0.5f, (Action<float>)delegate(float val) { VisualModule.OnPosYChanged(val); prefs.SaveToFile(true); }); _vlDepth = obj.CreateFloat("Depth", Color.white, VisualModule.Depth.Value, 0.05f, 0.3f, 2f, (Action<float>)delegate(float val) { VisualModule.OnDepthChanged(val); prefs.SaveToFile(true); }); obj.CreateFunction("─── Follow ───", Color.gray, (Action)null); _vlSmoothFollow = obj.CreateBool("Smooth Follow", Color.white, VisualModule.SmoothFollow.Value, (Action<bool>)delegate(bool val) { VisualModule.SmoothFollow.Value = val; prefs.SaveToFile(true); }); _vlFollowSpeedX = obj.CreateFloat("Speed X", Color.white, VisualModule.FollowSpeedX.Value, 1f, 1f, 30f, (Action<float>)delegate(float val) { VisualModule.FollowSpeedX.Value = val; prefs.SaveToFile(true); }); _vlFollowSpeedY = obj.CreateFloat("Speed Y", Color.white, VisualModule.FollowSpeedY.Value, 1f, 1f, 30f, (Action<float>)delegate(float val) { VisualModule.FollowSpeedY.Value = val; prefs.SaveToFile(true); }); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { VisualModule.ResetToDefaults(prefs); RefreshHpElements(); }); } private static void RefreshHpElements() { _vlEnabled.Value = VisualModule.Enabled.Value; _vlAlwaysOnTop.Value = VisualModule.AlwaysOnTop.Value; _vlShowHpText.Value = VisualModule.ShowHpText.Value; _vlHpTextSize.Value = VisualModule.HpTextSize.Value; _vlIconSize.Value = VisualModule.IconSize.Value; _vlPosX.Value = VisualModule.PosX.Value; _vlPosY.Value = VisualModule.PosY.Value; _vlDepth.Value = VisualModule.Depth.Value; _vlSmoothFollow.Value = VisualModule.SmoothFollow.Value; _vlFollowSpeedX.Value = VisualModule.FollowSpeedX.Value; _vlFollowSpeedY.Value = VisualModule.FollowSpeedY.Value; } private static void BuildCompassPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) Page obj = parent.CreatePage("Compass", Color.yellow, 0, true); _cmEnabled = obj.CreateBool("Enabled", Color.yellow, CompassModule.Enabled.Value, (Action<bool>)delegate(bool enabled) { CompassModule.OnToggle(enabled); prefs.SaveToFile(true); }); _cmAlwaysOnTop = obj.CreateBool("Always on Top", Color.white, CompassModule.AlwaysOnTop.Value, (Action<bool>)delegate(bool value) { CompassModule.AlwaysOnTop.Value = value; CompassModule.Invalidate(); prefs.SaveToFile(true); }); _cmRussian = obj.CreateBool("Russian Labels", Color.white, CompassModule.UseRussian.Value, (Action<bool>)delegate(bool value) { CompassModule.UseRussian.Value = value; prefs.SaveToFile(true); }); _cmShowArrow = obj.CreateBool("Show Arrow", Color.white, CompassModule.ShowArrow.Value, (Action<bool>)delegate(bool value) { CompassModule.ShowArrow.Value = value; prefs.SaveToFile(true); }); obj.CreateFunction("─── Layout ───", Color.gray, (Action)null); _cmScale = obj.CreateFloat("Scale", Color.white, CompassModule.Scale.Value, 0.1f, 0.3f, 3f, (Action<float>)delegate(float value) { CompassModule.Scale.Value = value; prefs.SaveToFile(true); }); _cmPosY = obj.CreateFloat("Position Y", Color.white, CompassModule.PosY.Value, 0.01f, -0.5f, 0.5f, (Action<float>)delegate(float value) { CompassModule.PosY.Value = value; prefs.SaveToFile(true); }); _cmDepth = obj.CreateFloat("Depth", Color.white, CompassModule.Depth.Value, 0.05f, 0.3f, 2f, (Action<float>)delegate(float value) { CompassModule.Depth.Value = value; prefs.SaveToFile(true); }); _cmSmooth = obj.CreateFloat("Smoothing", Color.white, 31f - CompassModule.SmoothFactor.Value, 0.5f, 1f, 30f, (Action<float>)delegate(float num) { CompassModule.SmoothFactor.Value = 31f - num; prefs.SaveToFile(true); }); obj.CreateFunction("─── Background ───", Color.gray, (Action)null); _cmBgAlpha = obj.CreateFloat("BG Alpha", Color.white, CompassModule.BgAlpha.Value, 0.05f, 0f, 0.8f, (Action<float>)delegate(float value) { CompassModule.BgAlpha.Value = value; prefs.SaveToFile(true); }); _cmBgHeight = obj.CreateFloat("BG Height", Color.white, CompassModule.BgHeightMult.Value, 0.1f, 0.2f, 4f, (Action<float>)delegate(float value) { CompassModule.BgHeightMult.Value = value; prefs.SaveToFile(true); }); _cmFadeEdge = obj.CreateFloat("Fade V", Color.white, CompassModule.FadeEdge.Value, 0.05f, 0f, 1f, (Action<float>)delegate(float value) { CompassModule.FadeEdge.Value = value; prefs.SaveToFile(true); }); _cmFadeEdgeH = obj.CreateFloat("Fade H", Color.white, CompassModule.FadeEdgeH.Value, 0.05f, 0f, 1f, (Action<float>)delegate(float value) { CompassModule.FadeEdgeH.Value = value; prefs.SaveToFile(true); }); _cmFadeSpread = obj.CreateFloat("Fade Shape", Color.white, CompassModule.FadeSpread.Value, 0.1f, 0.2f, 4f, (Action<float>)delegate(float value) { CompassModule.FadeSpread.Value = value; prefs.SaveToFile(true); }); obj.CreateFunction("─── Fonts ───", Color.gray, (Action)null); _cmFontCard = obj.CreateFloat("Cardinals", Color.white, CompassModule.FontScaleCard.Value, 0.05f, 0.3f, 3f, (Action<float>)delegate(float value) { CompassModule.FontScaleCard.Value = value; prefs.SaveToFile(true); }); _cmFontLarge = obj.CreateFloat("Large Numbers", Color.white, CompassModule.FontScaleLarge.Value, 0.05f, 0.3f, 3f, (Action<float>)delegate(float value) { CompassModule.FontScaleLarge.Value = value; prefs.SaveToFile(true); }); _cmFontSmall = obj.CreateFloat("Small Numbers", Color.white, CompassModule.FontScaleSmall.Value, 0.05f, 0.3f, 3f, (Action<float>)delegate(float value) { CompassModule.FontScaleSmall.Value = value; prefs.SaveToFile(true); }); _cmArrowSize = obj.CreateFloat("Arrow Size", Color.white, CompassModule.ArrowSize.Value, 0.001f, 0.001f, 0.03f, (Action<float>)delegate(float value) { CompassModule.ArrowSize.Value = value; prefs.SaveToFile(true); }); _cmArrowHeight = obj.CreateFloat("Arrow Height", Color.white, CompassModule.ArrowHeight.Value, 0.001f, 0f, 0.03f, (Action<float>)delegate(float value) { CompassModule.ArrowHeight.Value = value; prefs.SaveToFile(true); }); obj.CreateFunction("─── Follow ───", Color.gray, (Action)null); _cmSmoothFollow = obj.CreateBool("Smooth Follow", Color.white, CompassModule.SmoothFollow.Value, (Action<bool>)delegate(bool value) { CompassModule.SmoothFollow.Value = value; prefs.SaveToFile(true); }); _cmFollowSpeedX = obj.CreateFloat("Speed X", Color.white, CompassModule.FollowSpeedX.Value, 1f, 1f, 30f, (Action<float>)delegate(float value) { CompassModule.FollowSpeedX.Value = value; prefs.SaveToFile(true); }); _cmFollowSpeedY = obj.CreateFloat("Speed Y", Color.white, CompassModule.FollowSpeedY.Value, 1f, 1f, 30f, (Action<float>)delegate(float value) { CompassModule.FollowSpeedY.Value = value; prefs.SaveToFile(true); }); BuildCompassPingsPage(obj, prefs); Page val = BuildCompassPointsPage(obj, prefs); ((Element)obj.CreatePageLink(val)).SetTooltip("Requires a BONESQUAD server (see FAQ above). Outside of a server session capture points do not exist. All capture points, the capture system and point ownership are implemented server-side."); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { CompassModule.ResetToDefaults(prefs); RefreshCompassElements(); RefreshCompassPingsElements(); RefreshCompassPointsElements(); }); } private static void RefreshCompassElements() { _cmEnabled.Value = CompassModule.Enabled.Value; _cmAlwaysOnTop.Value = CompassModule.AlwaysOnTop.Value; _cmRussian.Value = CompassModule.UseRussian.Value; _cmShowArrow.Value = CompassModule.ShowArrow.Value; _cmScale.Value = CompassModule.Scale.Value; _cmPosY.Value = CompassModule.PosY.Value; _cmDepth.Value = CompassModule.Depth.Value; _cmSmooth.Value = 31f - CompassModule.SmoothFactor.Value; _cmBgAlpha.Value = CompassModule.BgAlpha.Value; _cmBgHeight.Value = CompassModule.BgHeightMult.Value; _cmFadeEdge.Value = CompassModule.FadeEdge.Value; _cmFadeEdgeH.Value = CompassModule.FadeEdgeH.Value; _cmFadeSpread.Value = CompassModule.FadeSpread.Value; _cmFontCard.Value = CompassModule.FontScaleCard.Value; _cmFontLarge.Value = CompassModule.FontScaleLarge.Value; _cmFontSmall.Value = CompassModule.FontScaleSmall.Value; _cmArrowSize.Value = CompassModule.ArrowSize.Value; _cmArrowHeight.Value = CompassModule.ArrowHeight.Value; _cmSmoothFollow.Value = CompassModule.SmoothFollow.Value; _cmFollowSpeedX.Value = CompassModule.FollowSpeedX.Value; _cmFollowSpeedY.Value = CompassModule.FollowSpeedY.Value; } private static void BuildCompassPingsPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) Page obj = parent.CreatePage("Pings on Compass", Color.cyan, 0, true); _cpEnabled = obj.CreateBool("Enabled", Color.cyan, CompassModule.PingsEnabled.Value, (Action<bool>)delegate(bool val) { CompassModule.PingsEnabled.Value = val; prefs.SaveToFile(true); }); _cpShowNames = obj.CreateBool("Show Names", Color.white, CompassModule.PingsShowNames.Value, (Action<bool>)delegate(bool val) { CompassModule.PingsShowNames.Value = val; prefs.SaveToFile(true); }); _cpShowDist = obj.CreateBool("Show Distance", Color.white, CompassModule.PingsShowDistance.Value, (Action<bool>)delegate(bool val) { CompassModule.PingsShowDistance.Value = val; prefs.SaveToFile(true); }); _cpShowBehind = obj.CreateBool("Show Behind", Color.white, CompassModule.PingsShowBehind.Value, (Action<bool>)delegate(bool val) { CompassModule.PingsShowBehind.Value = val; prefs.SaveToFile(true); }); _cpIconSize = obj.CreateFloat("Icon Size", Color.white, CompassModule.PingsIconSize.Value, 0.002f, 0.002f, 0.04f, (Action<float>)delegate(float val) { CompassModule.PingsIconSize.Value = val; prefs.SaveToFile(true); }); _cpNameSize = obj.CreateFloat("Name Size", Color.white, CompassModule.PingsNameSize.Value, 0.0005f, 0.001f, 0.01f, (Action<float>)delegate(float val) { CompassModule.PingsNameSize.Value = val; prefs.SaveToFile(true); }); _cpDistSize = obj.CreateFloat("Distance Size", Color.white, CompassModule.PingsDistSize.Value, 0.0005f, 0.001f, 0.01f, (Action<float>)delegate(float val) { CompassModule.PingsDistSize.Value = val; prefs.SaveToFile(true); }); _cpHeight = obj.CreateFloat("Height", Color.white, CompassModule.PingsHeight.Value, 0.003f, 0.005f, 0.1f, (Action<float>)delegate(float val) { CompassModule.PingsHeight.Value = val; prefs.SaveToFile(true); }); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { CompassModule.PingsEnabled.Value = true; CompassModule.PingsShowNames.Value = true; CompassModule.PingsShowDistance.Value = true; CompassModule.PingsShowBehind.Value = true; CompassModule.PingsIconSize.Value = 0.012f; CompassModule.PingsNameSize.Value = 0.003f; CompassModule.PingsDistSize.Value = 0.003f; CompassModule.PingsHeight.Value = 0.028f; prefs.SaveToFile(true); RefreshCompassPingsElements(); }); } private static void RefreshCompassPingsElements() { _cpEnabled.Value = CompassModule.PingsEnabled.Value; _cpShowNames.Value = CompassModule.PingsShowNames.Value; _cpShowDist.Value = CompassModule.PingsShowDistance.Value; _cpShowBehind.Value = CompassModule.PingsShowBehind.Value; _cpIconSize.Value = CompassModule.PingsIconSize.Value; _cpNameSize.Value = CompassModule.PingsNameSize.Value; _cpDistSize.Value = CompassModule.PingsDistSize.Value; _cpHeight.Value = CompassModule.PingsHeight.Value; } private static Page BuildCompassPointsPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) Page obj = parent.CreatePage("Points on Compass", Color.yellow, 0, false); _ptEnabled = obj.CreateBool("Enabled", Color.cyan, CompassModule.PointsEnabled.Value, (Action<bool>)delegate(bool val) { CompassModule.PointsEnabled.Value = val; prefs.SaveToFile(true); }); _ptShowDist = obj.CreateBool("Show Distance", Color.white, CompassModule.PointsShowDist.Value, (Action<bool>)delegate(bool val) { CompassModule.PointsShowDist.Value = val; prefs.SaveToFile(true); }); _ptShowBehind = obj.CreateBool("Show Behind", Color.white, CompassModule.PointsShowBehind.Value, (Action<bool>)delegate(bool val) { CompassModule.PointsShowBehind.Value = val; prefs.SaveToFile(true); }); _ptLetterSize = obj.CreateFloat("Letter Size", Color.white, CompassModule.PointsLetterSize.Value, 0.001f, 0.001f, 0.02f, (Action<float>)delegate(float val) { CompassModule.PointsLetterSize.Value = val; prefs.SaveToFile(true); }); _ptDistSize = obj.CreateFloat("Distance Size", Color.white, CompassModule.PointsDistSize.Value, 0.0005f, 0.001f, 0.01f, (Action<float>)delegate(float val) { CompassModule.PointsDistSize.Value = val; prefs.SaveToFile(true); }); _ptHeight = obj.CreateFloat("Height", Color.white, CompassModule.PointsHeight.Value, 0.003f, 0.005f, 0.1f, (Action<float>)delegate(float val) { CompassModule.PointsHeight.Value = val; prefs.SaveToFile(true); }); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { CompassModule.PointsEnabled.Value = true; CompassModule.PointsShowDist.Value = true; CompassModule.PointsShowBehind.Value = true; CompassModule.PointsLetterSize.Value = 0.005f; CompassModule.PointsDistSize.Value = 0.003f; CompassModule.PointsHeight.Value = 0.028f; prefs.SaveToFile(true); RefreshCompassPointsElements(); }); return obj; } private static void RefreshCompassPointsElements() { _ptEnabled.Value = CompassModule.PointsEnabled.Value; _ptShowDist.Value = CompassModule.PointsShowDist.Value; _ptShowBehind.Value = CompassModule.PointsShowBehind.Value; _ptLetterSize.Value = CompassModule.PointsLetterSize.Value; _ptDistSize.Value = CompassModule.PointsDistSize.Value; _ptHeight.Value = CompassModule.PointsHeight.Value; } private static Page BuildPingMarkersPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) Page obj = parent.CreatePage("Ping Markers", Color.yellow, 0, false); _pgShowPings = obj.CreateBool("Show Markers", Color.yellow, PingMarkerModule.ShowPings.Value, (Action<bool>)delegate(bool val) { PingMarkerModule.ShowPings.Value = val; prefs.SaveToFile(true); }); _pgUseRightHand = obj.CreateBool("Right Hand Placement", Color.white, PingMarkerModule.UseRightHand.Value, (Action<bool>)delegate(bool val) { PingMarkerModule.UseRightHand.Value = val; prefs.SaveToFile(true); }); obj.CreateFunction("─── Display ───", Color.gray, (Action)null); _pgShowDistance = obj.CreateBool("Show Distance", Color.white, PingMarkerModule.ShowDistance.Value, (Action<bool>)delegate(bool val) { PingMarkerModule.ShowDistance.Value = val; prefs.SaveToFile(true); }); _pgShowOwnerLabel = obj.CreateBool("Show Owner", Color.white, PingMarkerModule.ShowOwnerLabel.Value, (Action<bool>)delegate(bool val) { PingMarkerModule.ShowOwnerLabel.Value = val; prefs.SaveToFile(true); }); _pgIconSize = obj.CreateFloat("Icon Size", Color.white, PingMarkerModule.IconSize.Value, 0.002f, 0.004f, 0.08f, (Action<float>)delegate(float val) { PingMarkerModule.IconSize.Value = val; prefs.SaveToFile(true); }); _pgDistSize = obj.CreateFloat("Distance Size", Color.white, PingMarkerModule.DistSize.Value, 0.001f, 0.001f, 0.03f, (Action<float>)delegate(float val) { PingMarkerModule.DistSize.Value = val; prefs.SaveToFile(true); }); _pgOwnerSize = obj.CreateFloat("Owner Size", Color.white, PingMarkerModule.OwnerSize.Value, 0.001f, 0.001f, 0.03f, (Action<float>)delegate(float val) { PingMarkerModule.OwnerSize.Value = val; prefs.SaveToFile(true); }); obj.CreateFunction("─── Lifetime ───", Color.gray, (Action)null); _pgMarkersDie = obj.CreateBool("Markers Die", Color.white, PingMarkerModule.MarkersDie.Value, (Action<bool>)delegate(bool val) { PingMarkerModule.MarkersDie.Value = val; prefs.SaveToFile(true); }); _pgLifetime = obj.CreateFloat("Lifetime (sec)", Color.white, PingMarkerModule.MarkerLifetime.Value, 5f, 5f, 300f, (Action<float>)delegate(float val) { if (PingMarkerModule.ServerLocked) { _pgLifetime.Value = PingMarkerModule.MarkerLifetime.Value; } else { PingMarkerModule.MarkerLifetime.Value = val; prefs.SaveToFile(true); } }); ((Element)_pgLifetime).SetTooltip("Server-controlled. The server sets a fixed marker lifetime so all players' marks expire at the same time. Your local value is overwritten on join."); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { if (!PingMarkerModule.ServerLocked) { PingMarkerModule.ResetToDefaults(prefs); RefreshPingMarkersElements(); } }); return obj; } private static void RefreshPingMarkersElements() { _pgShowPings.Value = PingMarkerModule.ShowPings.Value; _pgShowDistance.Value = PingMarkerModule.ShowDistance.Value; _pgShowOwnerLabel.Value = PingMarkerModule.ShowOwnerLabel.Value; _pgIconSize.Value = PingMarkerModule.IconSize.Value; _pgDistSize.Value = PingMarkerModule.DistSize.Value; _pgOwnerSize.Value = PingMarkerModule.OwnerSize.Value; _pgUseRightHand.Value = PingMarkerModule.UseRightHand.Value; _pgMarkersDie.Value = PingMarkerModule.MarkersDie.Value; _pgLifetime.Value = PingMarkerModule.MarkerLifetime.Value; } private static Page BuildCaptureNotifsPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_0110: 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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) Page obj = parent.CreatePage("Capture Notifs", Color.white, 0, false); _ntEnabled = obj.CreateBool("Enabled", Color.white, CaptureEventHandler.NotifEnabled.Value, (Action<bool>)delegate(bool val) { CaptureEventHandler.NotifEnabled.Value = val; prefs.SaveToFile(true); }); _ntSize = obj.CreateFloat("Text Size", Color.white, CaptureEventHandler.NotifSize.Value, 0.1f, 0.3f, 5f, (Action<float>)delegate(float val) { CaptureEventHandler.NotifSize.Value = val; prefs.SaveToFile(true); }); obj.CreateFunction("─── Position ───", Color.gray, (Action)null); _ntDepth = obj.CreateFloat("Depth", Color.white, CaptureEventHandler.NotifDepth.Value, 0.05f, 0.3f, 2f, (Action<float>)delegate(float val) { CaptureEventHandler.NotifDepth.Value = val; prefs.SaveToFile(true); }); _ntPosY = obj.CreateFloat("Position Y", Color.white, CaptureEventHandler.NotifPosY.Value, 0.01f, -0.5f, 0.5f, (Action<float>)delegate(float val) { CaptureEventHandler.NotifPosY.Value = val; prefs.SaveToFile(true); }); obj.CreateFunction("─── Follow ───", Color.gray, (Action)null); _ntSmoothFollow = obj.CreateBool("Smooth Follow", Color.white, CaptureEventHandler.NotifSmoothFollow.Value, (Action<bool>)delegate(bool val) { CaptureEventHandler.NotifSmoothFollow.Value = val; prefs.SaveToFile(true); }); _ntFollowSpeedX = obj.CreateFloat("Speed X", Color.white, CaptureEventHandler.NotifFollowSpeedX.Value, 1f, 1f, 30f, (Action<float>)delegate(float val) { CaptureEventHandler.NotifFollowSpeedX.Value = val; prefs.SaveToFile(true); }); _ntFollowSpeedY = obj.CreateFloat("Speed Y", Color.white, CaptureEventHandler.NotifFollowSpeedY.Value, 1f, 1f, 30f, (Action<float>)delegate(float val) { CaptureEventHandler.NotifFollowSpeedY.Value = val; prefs.SaveToFile(true); }); obj.CreateFunction("Reset to Defaults", Color.red, (Action)delegate { CaptureEventHandler.ResetToDefaults(prefs); RefreshCaptureNotifsElements(); }); return obj; } private static void RefreshCaptureNotifsElements() { _ntEnabled.Value = CaptureEventHandler.NotifEnabled.Value; _ntSize.Value = CaptureEventHandler.NotifSize.Value; _ntDepth.Value = CaptureEventHandler.NotifDepth.Value; _ntPosY.Value = CaptureEventHandler.NotifPosY.Value; _ntSmoothFollow.Value = CaptureEventHandler.NotifSmoothFollow.Value; _ntFollowSpeedX.Value = CaptureEventHandler.NotifFollowSpeedX.Value; _ntFollowSpeedY.Value = CaptureEventHandler.NotifFollowSpeedY.Value; } private static void BuildMultiplayerPage(Page parent, MelonPreferences_Category prefs) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) _mpRequireBonesquad = parent.CreatePage("Multiplayer", Color.magenta, 0, true).CreateBool("Require BONESQUAD (Host Only)", Color.white, FusionCompat.RequireBonesquad.Value, (Action<bool>)delegate(bool val) { FusionCompat.RequireBonesquad.Value = val; prefs.SaveToFile(true); }); } } public class BonesquadMod : MelonMod { public static BonesquadMod Instance; internal static MelonPreferences_Entry<bool> VerboseLogging; public override void OnInitializeMelon() { Instance = this; MelonPreferences_Category prefs = MelonPreferences.CreateCategory("BONESQUAD"); VerboseLogging = prefs.CreateEntry<bool>("Debug_VerboseLogging", false, (string)null, "--- Debug --- (hand-edit only, not in BoneMenu)", false, false, (ValueValidator)null, (string)null); Log("=== BONESQUAD Initializing ==="); PatchAllIsolated(); TryInit("SlowWalk", delegate { SlowWalkModule.Init(prefs); }); TryInit("SoundFalloff", delegate { SoundFalloffModule.Init(prefs); }); TryInit("BulletWhiz", delegate { BulletWhizModule.Init(prefs); }); TryInit("Regeneration", delegate { RegenerationModule.Init(prefs); }); TryInit("Visual", delegate { VisualModule.Init(prefs); }); TryInit("Compass", delegate { CompassModule.Init(prefs); }); TryInit("PingMarker", delegate { PingMarkerModule.Init(prefs); }); TryInit("RadialMenu", delegate { RadialMenuModule.Init(prefs); }); TryInit("Respawn", delegate { RespawnModule.Init(prefs); }); TryInit("Notifications", delegate { CaptureEventHandler.Init(prefs); }); FusionCompat.InitPrefs(prefs); RallyPointTracker.Init(); TryInit("BoneMenu", delegate { BonesquadMenu.Init(prefs); }); if (FusionCompat.IsAvailable) { FusionCompat.Init(); } Log("=== BONESQUAD Ready ==="); } private static void TryInit(string name, Action init) { try { init(); } catch (Exception ex) { BonesquadMod instance = Instance; if (instance != null) { ((MelonBase)instance).LoggerInstance.Warning("[Init] " + name + " failed: " + ex.Message); } } } private void PatchAllIsolated() { IEnumerable<Type> enumerable = from t in ((object)this).GetType().Assembly.GetTypes() where t.GetCustomAttributes(typeof(HarmonyPatch), inherit: true).Length != 0 select t; int num = 0; int num2 = 0; foreach (Type item in enumerable) { try { ((MelonBase)this).HarmonyInstance.CreateClassProcessor(item).Patch(); num++; } catch (Exception ex) { num2++; LogWarning("[Harmony] Failed to patch '" + item.FullName + "': " + ex.Message); } } Log($"[Harmony] Patched {num} class(es), {num2} failed"); } public override void OnUpdate() { HudLayer.Update(); RegenerationModule.Update(); RespawnModule.Update(); VisualModule.Update(); CompassModule.Update(); PingMarkerModule.Update(); RadialMenuModule.Update(); CaptureEventHandler.Update(); } public override void OnDeinitializeMelon() { Log("=== BONESQUAD Unloaded ==="); } public static void Log(string msg) { MelonPreferences_Entry<bool> verboseLogging = VerboseLogging; if (verboseLogging != null && verboseLogging.Value) { BonesquadMod instance = Instance; if (instance != null) { ((MelonBase)instance).LoggerInstance.Msg(msg); } } } public static void LogWarning(string msg) { BonesquadMod instance = Instance; if (instance != null) { ((MelonBase)instance).LoggerInstance.Warning(msg); } } public static void LogError(string msg) { BonesquadMod instance = Instance; if (instance != null) { ((MelonBase)instance).LoggerInstance.Error(msg); } } } } namespace BONESQUAD.Modules.Voice { [RegisterTypeInIl2Cpp] internal class AdminVoiceFilter : MonoBehaviour { private static readonly ConcurrentQueue<float> _queue = new ConcurrentQueue<float>(); private static bool _didLog; internal static int QueueCount => _queue.Count; public AdminVoiceFilter(IntPtr ptr) : base(ptr) { } [HideFromIl2Cpp] internal static void Enqueue(float[] samples) { while (_queue.Count > 24000) { _queue.TryDequeue(out var _); } foreach (float item in samples) { _queue.Enqueue(item); } } [HideFromIl2Cpp] internal static void Clear() { float result; while (_queue.TryDequeue(out result)) { } } private void OnAudioFilterRead(Il2CppStructArray<float> data, int channels) { if (!_didLog) { _didLog = true; BonesquadMod.Log($"[Voice] OnAudioFilterRead firing (len={((Il2CppArrayBase<float>)(object)data).Length}, ch={channels})."); } int num = ((Il2CppArrayBase<float>)(object)data).Length / channels; for (int i = 0; i < num; i++) { float result; float num2 = (_queue.TryDequeue(out result) ? result : 0f); for (int j = 0; j < channels; j++) { ((Il2CppArrayBase<float>)(object)data)[i * channels + j] = num2; } } } } public class BroadcastAudioData : INetSerializable { public byte[] Bytes = Array.Empty<byte>(); public void Serialize(INetSerializer serializer) { serializer.SerializeValue(ref Bytes); } } public class BroadcastAudioHandler : ModuleMessageHandler { protected override void OnHandleMessage(ReceivedMessage received) { if (NetworkInfo.IsHost) { return; } try { BroadcastAudioData broadcastAudioData = new BroadcastAudioData(); NetReader val = NetReader.Create(((ReceivedMessage)(ref received)).Bytes); try { broadcastAudioData.Serialize((INetSerializer)(object)val); DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(48, 1); defaultInterpolatedStringHandler.AppendLiteral("[Voice] BroadcastAudio received: "); byte[] bytes = broadcastAudioData.Bytes; defaultInterpolatedStringHandler.AppendFormatted((bytes != null) ? bytes.Length : 0); defaultInterpolatedStringHandler.AppendLiteral(" encoded bytes."); BonesquadMod.Log(defaultInterpolatedStringHandler.ToStringAndClear()); VoiceModule.PlayAdminVoice(broadcastAudioData.Bytes); } finally { ((IDisposable)val)?.Dispose(); } } catch (Exception ex) { BonesquadMod.LogWarning("BroadcastAudio: " + ex.Message); } } } internal static class VoiceModule { private static AudioSource _source; private static int _playLogCount; internal static void Init() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_source)) { GameObject val = new GameObject("BONESQUAD_AdminVoice"); Object.DontDestroyOnLoad((Object)val); _source = val.AddComponent<AudioSource>(); _source.spatialBlend = 0f; _source.priority = 128; _source.loop = true; int num = AudioSettings.outputSampleRate; if (num <= 0) { num = 48000; } _source.clip = AudioClip.Create("adm_dummy", num, 1, num, false); val.AddComponent<AdminVoiceFilter>(); _source.Play(); BonesquadMod.Log($"[Voice] AdminVoice source initialised (outputSampleRate={num}, isPlaying={_source.isPlaying})."); } } internal static void PlayAdminVoice(byte[] encodedPcm) { try { short[] array = VoiceConverter.Decode(encodedPcm); float[] array2 = new float[array.Length]; for (int i = 0; i < array.Length; i++) { array2[i] = (float)array[i] / 32768f; } AdminVoiceFilter.Enqueue(array2); if (++_playLogCount <= 3) { BonesquadMod.Log($"[Voice] PlayAdminVoice: {array.Length} samples decoded, queue≈{AdminVoiceFilter.QueueCount}."); } } catch (Exception ex) { BonesquadMod.LogWarning("AdminVoice: " + ex.Message); } } } internal static class VoicePatches { internal static void Register(Harmony harmony) { } } } namespace BONESQUAD.Modules.Visual { internal static class VisualModule { internal static MelonPreferences_Entry<bool> Enabled; internal static MelonPreferences_Entry<bool> AlwaysOnTop; internal static MelonPreferences_Entry<float> IconSize; internal static MelonPreferences_Entry<float> PosX; internal static MelonPreferences_Entry<float> PosY; internal static MelonPreferences_Entry<float> Depth; internal static MelonPreferences_Entry<bool> ShowHpText; internal static MelonPreferences_Entry<float> HpTextSize; internal static MelonPreferences_Entry<bool> SmoothFollow; internal static MelonPreferences_Entry<float> FollowSpeedX; internal static MelonPreferences_Entry<float> FollowSpeedY; private const float DefaultSize = 0.035f; private const float DefaultPosX = 0.2f; private const float DefaultPosY = -0.09f; private const float DefaultDepth = 0.5f; private const float DefaultHpTextSize = 0.01f; private const float DefaultFollowSpeedX = 6f; private const float DefaultFollowSpeedY = 16f; private static byte[] _iconBytes; private static Texture2D _iconTex; private static GameObject _rootGo; private static GameObject _overlayGo; private static SpriteRenderer _sr; private static GameObject _textGo; private static SpriteRenderer _textSr; private static Material _textMat; private static Texture2D _textTex; private static int _lastHpDisplayed = -1; private static Vector3 _smoothPos; private static float _smoothYaw; private static float _nextTick; internal static void Init(MelonPreferences_Category prefs) { Enabled = prefs.CreateEntry<bool>("Visual_Enabled", true, (string)null, "--- Visual ---", false, false, (ValueValidator)null, (string)null); AlwaysOnTop = prefs.CreateEntry<bool>("Visual_AlwaysOnTop", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); IconSize = prefs.CreateEntry<float>("Visual_IconSize", 0.035f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); PosX = prefs.CreateEntry<float>("Visual_PosX", 0.2f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); PosY = prefs.CreateEntry<float>("Visual_PosY", -0.09f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); Depth = prefs.CreateEntry<float>("Visual_Depth", 0.5f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); ShowHpText = prefs.CreateEntry<bool>("Visual_ShowHpText", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); HpTextSize = prefs.CreateEntry<float>("Visual_HpTextSize", 0.01f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); SmoothFollow = prefs.CreateEntry<bool>("Visual_SmoothFollow", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); FollowSpeedX = prefs.CreateEntry<float>("Visual_FollowSpeedX", 6f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); FollowSpeedY = prefs.CreateEntry<float>("Visual_FollowSpeedY", 16f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); string text = Path.Combine(MelonEnvironment.UserDataDirectory, "BONESQUAD", "UI", "Icons", "stanceindicator_stand.png"); if (File.Exists(text)) { _iconBytes = File.ReadAllBytes(text); BonesquadMod.Log("[Visual] HP icon loaded."); } else { BonesquadMod.LogWarning("[Visual] HP icon not found: " + text); } } internal static void Invalidate() { if (Object.op_Implicit((Object)(object)_rootGo)) { Object.Destroy((Object)(object)_rootGo); _rootGo = null; } _overlayGo = null; _sr = null; _iconTex = null; _textGo = null; _textSr = null; _textMat = null; if (Object.op_Implicit((Object)(object)_textTex)) { Object.Destroy((Object)(object)_textTex); _textTex = null; } _lastHpDisplayed = -1; } internal static void OnToggle(bool enabled) { Enabled.Value = enabled; if (Object.op_Implicit((Object)(object)_overlayGo)) { _overlayGo.SetActive(enabled); } if (Object.op_Implicit((Object)(object)_textGo)) { _textGo.SetActive(enabled && ShowHpText.Value); } } internal static void OnShowHpTextChanged(bool show) { ShowHpText.Value = show; if (Object.op_Implicit((Object)(object)_textGo)) { _textGo.SetActive(show && Enabled.Value); } } internal static void OnHpTextSizeChanged(float size) { HpTextSize.Value = size; ApplyTextTransform(); } internal static void OnSizeChanged(float size) { IconSize.Value = size; ApplyTransform(); } internal static void OnPosXChanged(float x) { PosX.Value = x; ApplyTransform(); } internal static void OnPosYChanged(float y) { PosY.Value = y; ApplyTransform(); } internal static void OnDepthChanged(float d) { Depth.Value = d; ApplyTransform(); } internal static void ResetToDefaults(MelonPreferences_Category prefs) { Enabled.Value = true; IconSize.Value = 0.035f; PosX.Value = 0.2f; PosY.Value = -0.09f; Depth.Value = 0.5f; ShowHpText.Value = true; HpTextSize.Value = 0.01f; SmoothFollow.Value = false; FollowSpeedX.Value = 6f; FollowSpeedY.Value = 16f; prefs.SaveToFile(true); if (Object.op_Implicit((Object)(object)_overlayGo)) { _overlayGo.SetActive(true); } if (Object.op_Implicit((Object)(object)_textGo)) { _textGo.SetActive(ShowHpText.Value); } ApplyTransform(); } internal static void Update() { //IL_0076: 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_0081: Unknown result type (might be due to invalid IL or missing references) UpdatePosition(); float realtimeSinceStartup = Time.realtimeSinceStartup; if (realtimeSinceStartup < _nextTick) { return; } _nextTick = realtimeSinceStartup + 0.1f; EnsureOverlay(); if ((Object)(object)_sr == (Object)null) { return; } Player_Health health = RegenerationModule.Health; float num = (((Object)(object)health != (Object)null && Object.op_Implicit((Object)(object)health) && ((Health)health).max_Health > 0f) ? Mathf.Clamp01(((Health)health).curr_Health / ((Health)health).max_Health) : 1f); _sr.color = Color.Lerp(Color.red, Color.white, num); if ((Object)(object)_textSr != (Object)null && ShowHpText.Value) { int num2 = Mathf.Clamp(Mathf.RoundToInt(num * 100f), 0, 100); if (num2 != _lastHpDisplayed) { _lastHpDisplayed = num2; UpdateHpText(num2); } } } private static void UpdatePosition() { //IL_0050: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00ce: 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_00e8: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_012f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_rootGo)) { return; } Transform head = Player.Head; if (Object.op_Implicit((Object)(object)head)) { float value = Depth.Value; float num = value / 0.5f; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(PosX.Value * num, PosY.Value * num, value); float y = head.eulerAngles.y; Vector3 val2 = head.TransformPoint(val); if (SmoothFollow.Value) { float num2 = 1f - Mathf.Exp((0f - FollowSpeedX.Value) * Time.deltaTime); float num3 = 1f - Mathf.Exp((0f - FollowSpeedY.Value) * Time.deltaTime); _smoothYaw = Mathf.LerpAngle(_smoothYaw, y, num2); Vector3 val3 = head.InverseTransformPoint(_smoothPos); float num4 = Mathf.Lerp(val3.x, val.x, num2); float num5 = Mathf.Lerp(val3.y, val.y, num3); _smoothPos = head.TransformPoint(new Vector3(num4, num5, val.z)); _rootGo.transform.SetPositionAndRotation(_smoothPos, Quaternion.Euler(0f, _smoothYaw, 0f)); } else { _smoothPos = val2; _smoothYaw = y; _rootGo.transform.SetPositionAndRotation(val2, head.rotation); } } } private static void ApplyTransform() { //IL_0028: 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) if (Object.op_Implicit((Object)(object)_overlayGo)) { float num = Depth.Value / 0.5f; _overlayGo.transform.localPosition = Vector3.zero; if (Object.op_Implicit((Object)(object)_iconTex)) { float num2 = IconSize.Value * num; float num3 = num2 * (float)((Texture)_iconTex).width / Mathf.Max(1f, (float)((Texture)_iconTex).height); _overlayGo.transform.localScale = new Vector3(num3, num2, 1f); } ApplyTextTransform(); } } private static void ApplyTextTransform() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_textGo)) { float num = Depth.Value / 0.5f; float num2 = IconSize.Value * num; float num3 = HpTextSize.Value * num; float num4 = 0.004f * num; _textGo.transform.localPosition = new Vector3(0f, 0f - (num2 * 0.5f + num4 + num3 * 0.5f), 0f); _textGo.transform.localScale = new Vector3(num3, num3, 1f); } } private static void UpdateHpText(int hp) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_textSr)) { return; } if (Object.op_Implicit((Object)(object)_textTex)) { Object.Destroy((Object)(object)_textTex); _textTex = null; } Texture2D val = BitmapFont.Render($"{hp}/100"); if (!((Object)(object)val == (Object)null)) { _textTex = val; Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 7f); ((Object)val2).hideFlags = (HideFlags)61; _textSr.sprite = val2; if (Object.op_Implicit((Object)(object)_textMat)) { _textMat.mainTexture = (Texture)(object)val; } } } private static void EnsureOverlay() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_00a8: 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) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00eb: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Expected O, but got Unknown //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Expected O, but got Unknown //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)_rootGo) && Object.op_Implicit((Object)(object)_overlayGo) && Object.op_Implicit((Object)(object)_textGo)) { return; } Invalidate(); Transform head = Player.Head; if (!Object.op_Implicit((Object)(object)head)) { return; } float value = Depth.Value; float num = value / 0.5f; _rootGo = new GameObject("BONESQUAD_HpRoot"); Object.DontDestroyOnLoad((Object)(object)_rootGo); _smoothPos = head.TransformPoint(new Vector3(PosX.Value * num, PosY.Value * num, value)); _smoothYaw = head.eulerAngles.y; _rootGo.transform.SetPositionAndRotation(_smoothPos, head.rotation); _overlayGo = new GameObject("BONESQUAD_HpOverlay"); _overlayGo.transform.SetParent(_rootGo.transform, false); _overlayGo.transform.localPosition = Vector3.zero; _overlayGo.transform.localRotation = Quaternion.identity; if (_iconBytes != null) { _iconTex = new Texture2D(2, 2); ((Object)_iconTex).hideFlags = (HideFlags)61; ImageConversion.LoadImage(_iconTex, Il2CppStructArray<byte>.op_Implicit(_iconBytes)); float num2 = Mathf.Max(1f, (float)((Texture)_iconTex).height); Sprite val = Sprite.Create(_iconTex, new Rect(0f, 0f, (float)((Texture)_iconTex).width, (float)((Texture)_iconTex).height), new Vector2(0.5f, 0.5f), num2); ((Object)val).hideFlags = (HideFlags)61; float num3 = IconSize.Value * num; float num4 = num3 * (float)((Texture)_iconTex).width / Mathf.Max(1f, (float)((Texture)_iconTex).height); _overlayGo.transform.localScale = new Vector3(num4, num3, 1f); _sr = _overlayGo.AddComponent<SpriteRenderer>(); _sr.sprite = val; _sr.color = Color.white; ((Renderer)_sr).sortingOrder = 5; Shader hudShader = HudLayer.GetHudShader(AlwaysOnTop.Value); if (Object.op_Implicit((Object)(object)hudShader)) { Material val2 = new Material(hudShader); val2.mainTexture = (Texture)(object)_iconTex; ((Object)val2).hideFlags = (HideFlags)61; ((Renderer)_sr).material = val2; } } HudLayer.ApplyHp(_overlayGo); if (!Enabled.Value) { _overlayGo.SetActive(false); } _textGo = new GameObject("BONESQUAD_HpText"); _textGo.transform.SetParent(_rootGo.transform, false); _textGo.transform.localRotation = Quaternion.identity; _textSr = _textGo.AddComponent<SpriteRenderer>(); ((Renderer)_textSr).sortingOrder = 5; _textSr.color = Color.white; Shader hudShader2 = HudLayer.GetHudShader(AlwaysOnTop.Value); if (Object.op_Implicit((Object)(object)hudShader2)) { _textMat = new Material(hudShader2) { hideFlags = (HideFlags)61 }; ((Renderer)_textSr).sharedMaterial = _textMat; } _lastHpDisplayed = -1; ApplyTextTransform(); if (!ShowHpText.Value || !Enabled.Value) { _textGo.SetActive(false); } BonesquadMod.Log("[Visual] HP overlay created."); } } } namespace BONESQUAD.Modules.VersionCheck { internal static class VersionCheckModule { internal const string CurrentVersion = "11.1.0"; } } namespace BONESQUAD.Modules.Spawning { internal class CaptureEventData : INetSerializable { internal byte EventType; internal string GroupName = ""; internal string PointLetter = ""; internal byte TimerSecond; internal byte[] GroupMemberSmallIds = Array.Empty<byte>(); internal byte SpawnFlagSmallId; internal string FlagBarcode = ""; internal float FlagX; internal float FlagY; internal float FlagZ; internal float PointX; internal float PointZ; internal string GroupColor = ""; public void Serialize(INetSerializer serializer) { serializer.SerializeValue(ref EventType); serializer.SerializeValue(ref GroupName); serializer.SerializeValue(ref PointLetter); serializer.SerializeValue(ref TimerSecond); serializer.SerializeValue(ref GroupMemberSmallIds); serializer.SerializeValue(ref SpawnFlagSmallId); serializer.SerializeValue(ref FlagBarcode); serializer.SerializeValue(ref FlagX); serializer.SerializeValue(ref FlagY); serializer.SerializeValue(ref FlagZ); serializer.SerializeValue(ref PointX); serializer.SerializeValue(ref PointZ); serializer.SerializeValue(ref GroupColor); } } [SkipHandleWhileLoading] internal class CaptureEventHandler : ModuleMessageHandler { private struct CaptureCompassPoint { internal string Letter; internal Vector3 WorldPos; internal Texture2D IconTex; internal string ColorHex; } internal struct CompassCaptureEntry { internal Vector3 WorldPos; internal string Letter; internal string ColorHex; } private static readonly HashSet<string> _allFlagBarcodes = new HashSet<string> { "Kikelap.SQUADPROPS.Spawnable.RUFlag", "Kikelap.SQUADPROPS.Spawnable.UAFlag01", "Kikelap.SQUADPROPS.Spawnable.USAFlag", "Kikelap.SQUADPROPS.Spawnable.WPMCFlag" }; private static readonly Dictionary<string, CaptureCompassPoint> _compassPoints = new Dictionary<string, CaptureCompassPoint>(); private static readonly Dictionary<string, Texture2D> _iconCache = new Dictionary<string, Texture2D>(); private static GameObject _hudGo; private static TextMesh _hudTm; private static object _hudCoroutine; private static float _quietUntil; internal static MelonPreferences_Entry<bool> NotifEnabled; internal static MelonPreferences_Entry<float> NotifSize; internal static MelonPreferences_Entry<float> NotifDepth; internal static MelonPreferences_Entry<float> NotifPosY; internal static MelonPreferences_Entry<bool> NotifSmoothFollow; internal static MelonPreferences_Entry<float> NotifFollowSpeedX; internal static MelonPreferences_Entry<float> NotifFollowSpeedY; private static Vector3 _smoothPos; private static float _smoothYaw; private const float DefaultNotifSize = 1f; private const float DefaultNotifDepth = 0.45f; private const float DefaultNotifPosY = -0.1f; private const float DefaultFollowSpeedX = 6f; private const float DefaultFollowSpeedY = 16f; private static readonly HashSet<string> _prewarmedBarcodes = new HashSet<string>(); private static MethodInfo _spawnAsyncMethod; private static readonly Dictionary<char, byte[]> _glyphs = new Dictionary<char, byte[]> { ['A'] = new byte[7] { 14, 17, 17, 31, 17, 17, 17 }, ['B'] = new byte[7] { 30, 17, 17, 30, 17, 17, 30 }, ['C'] = new byte[7] { 14, 17, 16, 16, 16, 17, 14 }, ['D'] = new byte[7] { 30, 17, 17, 17, 17, 17, 30 }, ['E'] = new byte[7] { 31, 16, 16, 30, 16, 16, 31 }, ['F'] = new byte[7] { 31, 16, 16, 30, 16, 16, 16 }, ['G'] = new byte[7] { 14, 17, 16, 23, 17, 17, 14 }, ['H'] = new byte[7] { 17, 17, 17, 31, 17, 17, 17 }, ['I'] = new byte[7] { 14, 4, 4, 4, 4, 4, 14 }, ['J'] = new byte[7] { 7, 1, 1, 1, 17, 17, 14 }, ['K'] = new byte[7] { 17, 18, 20, 24, 20, 18, 17 }, ['L'] = new byte[7] { 16, 16, 16, 16, 16, 16, 31 }, ['M'] = new byte[7] { 17, 27, 21, 17, 17, 17, 17 }, ['N'] = new byte[7] { 17, 25, 21, 19, 17, 17, 17 }, ['O'] = new byte[7] { 14, 17, 17, 17, 17, 17, 14 }, ['P'] = new byte[7] { 30, 17, 17, 30, 16, 16, 16 }, ['Q'] = new byte[7] { 14, 17, 17, 17, 21, 18, 13 }, ['R'] = new byte[7] { 30, 17, 17, 30, 20, 18, 17 }, ['S'] = new byte[7] { 15, 16, 16, 14, 1, 1, 30 }, ['T'] = new byte[7] { 31, 4, 4, 4, 4, 4, 4 }, ['U'] = new byte[7] { 17, 17, 17, 17, 17, 17, 14 }, ['V'] = new byte[7] { 17, 17, 17, 17, 17, 10, 4 }, ['W'] = new byte[7] { 17, 17, 17, 17, 21, 27, 17 }, ['X'] = new byte[7] { 17, 17, 10, 4, 10, 17, 17 }, ['Y'] = new byte[7] { 17, 17, 10, 4, 4, 4, 4 }, ['Z'] = new byte[7] { 31, 1, 2, 4, 8, 16, 31 } }; private const string PointColor = "#FFE04D"; internal static void ClearPoints() { _compassPoints.Clear(); _iconCache.Clear(); } internal static void Init(MelonPreferences_Category prefs) { NotifEnabled = prefs.CreateEntry<bool>("Notif_Enabled", true, (string)null, "--- Notifications ---", false, false, (ValueValidator)null, (string)null); NotifSize = prefs.CreateEntry<float>("Notif_Size", 1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); NotifDepth = prefs.CreateEntry<float>("Notif_Depth", 0.45f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); NotifPosY = prefs.CreateEntry<float>("Notif_PosY", -0.1f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); NotifSmoothFollow = prefs.CreateEntry<bool>("Notif_SmoothFollow", false, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); NotifFollowSpeedX = prefs.CreateEntry<float>("Notif_FollowSpeedX", 6f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); NotifFollowSpeedY = prefs.CreateEntry<float>("Notif_FollowSpeedY", 16f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); } internal static void ResetToDefaults(MelonPreferences_Category prefs) { NotifEnabled.Value = true; NotifSize.Value = 1f; NotifDepth.Value = 0.45f; NotifPosY.Value = -0.1f; NotifSmoothFollow.Value = false; NotifFollowSpeedX.Value = 6f; NotifFollowSpeedY.Value = 16f; prefs.SaveToFile(true); } internal static void Update() { //IL_006c: 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_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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017c: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_hudGo) || !Object.op_Implicit((Object)(object)_hudTm)) { return; } Transform head; try { head = Player.Head; } catch { return; } if (Object.op_Implicit((Object)(object)head)) { float num = NotifDepth?.Value ?? 0.45f; float num2 = NotifPosY?.Value ?? (-0.1f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, num2, num); float y = head.eulerAngles.y; Vector3 val2 = head.TransformPoint(val); MelonPreferences_Entry<bool> notifSmoothFollow = NotifSmoothFollow; if (notifSmoothFollow != null && notifSmoothFollow.Value) { float num3 = NotifFollowSpeedX?.Value ?? 6f; float num4 = NotifFollowSpeedY?.Value ?? 16f; float num5 = 1f - Mathf.Exp((0f - num3) * Time.deltaTime); float num6 = 1f - Mathf.Exp((0f - num4) * Time.deltaTime); _smoothYaw = Mathf.LerpAngle(_smoothYaw, y, num5); Vector3 val3 = head.InverseTransformPoint(_smoothPos); float num7 = Mathf.Lerp(val3.x, 0f, num5); float num8 = Mathf.Lerp(val3.y, val.y, num6); _smoothPos = head.TransformPoint(new Vector3(num7, num8, val.z)); _hudGo.transform.SetPositionAndRotation(_smoothPos, Quaternion.Euler(0f, _smoothYaw, 0f)); } else { _smoothPos = val2; _smoothYaw = y; _hudGo.transform.SetPositionAndRotation(val2, head.rotation); } } } internal static void OnLevelUnloaded() { ClearPoints(); _prewarmedBarcodes.Clear(); ClearHud(); } private static void EnsureHud() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_011d: 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_013c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_hudGo) || !Object.op_Implicit((Object)(object)_hudTm)) { if (Object.op_Implicit((Object)(object)_hudGo)) { Object.Destroy((Object)(object)_hudGo); } _hudGo = null; _hudTm = null; _hudGo = new GameObject("BONESQUAD_CaptureHUD"); Object.DontDestroyOnLoad((Object)(object)_hudGo); _hudTm = _hudGo.AddComponent<TextMesh>(); _hudTm.fontSize = 48; _hudTm.characterSize = 0.005f * (NotifSize?.Value ?? 1f); _hudTm.anchor = (TextAnchor)4; _hudTm.color = Color.white; _hudTm.richText = true; _hudTm.text = ""; Transform val = null; try { val = Player.Head; } catch { } if (Object.op_Implicit((Object)(object)val)) { _smoothPos = val.TransformPoint(new Vector3(0f, NotifPosY?.Value ?? (-0.1f), NotifDepth?.Value ?? 0.45f)); _smoothYaw = val.eulerAngles.y; _hudGo.transform.SetPositionAndRotation(_smoothPos, val.rotation); } } } private static void ShowHud(string text, float duration) { if (NotifEnabled != null && !NotifEnabled.Value) { return; } EnsureHud(); if (!Object.op_Implicit((Object)(object)_hudTm)) { return; } _hudTm.text = text; _hudTm.characterSize = 0.005f * (NotifSize?.Value ?? 1f); if (_hudCoroutine != null) { try { MelonCoroutines.Stop(_hudCoroutine); } catch { } _hudCoroutine = null; } _hudCoroutine = MelonCoroutines.Start(HudClearAfter(duration)); } private static void ClearHud() { if (_hudCoroutine != null) { try { MelonCoroutines.Stop(_hudCoroutine); } catch { } _hudCoroutine = null; } if (Object.op_Implicit((Object)(object)_hudTm)) { _hudTm.text = ""; } } private static IEnumerator HudClearAfter(float delay) { yield return (object)new WaitForSeconds(delay); if (Object.op_Implicit((Object)(object)_hudTm)) { _hudTm.text = ""; } _hudCoroutine = null; } private static MethodInfo FindSpawnAsync() { MethodInfo[] methods = typeof(AssetSpawner).GetMethods(BindingFlags.Static | BindingFlags.Public); foreach (MethodInfo methodInfo in methods) { if (methodInfo.Name == "SpawnAsync" && methodInfo.GetParameters().Length >= 6) { return methodInfo; } } return null; } private static void PrewarmBundle(string barcode) { if (_allFlagBarcodes.Contains(barcode) && _prewarmedBarcodes.Add(barcode)) { if (_spawnAsyncMethod == null) { _spawnAsyncMethod = FindSpawnAsync(); } if (!(_spawnAsyncMethod == null)) { MelonCoroutines.Start(LocalSpawnForBundleLoad(barcode)); } } } private static IEnumerator LocalSpawnForBundleLoad(string barcode) { yield return (object)new WaitForSeconds(1f); try { Spawnable val = new Spawnable(); val.crateRef = new SpawnableCrateReference(barcode); AssetSpawner.Register(val); BonesquadMod.Log("[Capture] Pre-warming bundle: " + barcode); _spawnAsyncMethod.Invoke(null, new object[7] { val, (object)new Vector3(0f, -5000f, 0f), Quaternion.identity, null, false, null, null }); } catch (Exception ex) { BonesquadMod.LogWarning("[Capture] PrewarmBundle " + barcode + ": " + ex.Message); } } internal static void FillCompassPoints(List<CompassCaptureEntry> dest) { //IL_0026: 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) foreach (CaptureCompassPoint value in _compassPoints.Values) { dest.Add(new CompassCaptureEntry { WorldPos = value.WorldPos, Letter = value.Letter, ColorHex = value.ColorHex }); } } private static Texture2D GetOrCreateIcon(string letter) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) if (_iconCache.TryGetValue(letter, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } Texture2D val = new Texture2D(24, 24, (TextureFormat)4, false); ((Object)val).hideFlags = (HideFlags)61; Color32 val2 = default(Color32); ((Color32)(ref val2))..ctor(byte.MaxValue, (byte)216, (byte)26, byte.MaxValue); Color32 val3 = default(Color32); ((Color32)(ref val3))..ctor((byte)180, (byte)120, (byte)0, byte.MaxValue); float num = 12f; float num2 = 12f; float num3 = 11.5f; for (int i = 0; i < 24; i++) { for (int j = 0; j < 24; j++) { float num4 = (float)j - num + 0.5f; float num5 = (float)i - num2 + 0.5f; float num6 = Mathf.Sqrt(num4 * num4 + num5 * num5); if (num6 > num3) { val.SetPixel(j, i, Color.clear); } else if (num6 > num3 - 1.5f) { val.SetPixel(j, i, Color32.op_Implicit(val3)); } else { val.SetPixel(j, i, Color32.op_Implicit(val2)); } } } DrawGlyph(val, letter, 24); val.Apply(); _iconCache[letter] = val; return val; } private static void DrawGlyph(Texture2D tex, string letter, int S) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(letter)) { return; } char key = char.ToUpper(letter[0]); if (!_glyphs.TryGetValue(key, out var value)) { return; } int num = (S - 5) / 2; int num2 = (S - 7) / 2; for (int i = 0; i < 7; i++) { byte b = value[i]; int num3 = S - 1 - (num2 + i); for (int j = 0; j < 5; j++) { if ((b & (1 << 4 - j)) != 0) { tex.SetPixel(num + j, num3, Color.black); } } } } private static void StorePoint(string letter, float px, float pz) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrEmpty(letter) && (px != 0f || pz != 0f)) { Texture2D orCreateIcon = GetOrCreateIcon(letter); CaptureCompassPoint value; string colorHex = (_compassPoints.TryGetValue(letter, out value) ? value.ColorHex : ""); _compassPoints[letter] = new CaptureCompassPoint { Letter = letter, WorldPos = new Vector3(px, 0f, pz), IconTex = orCreateIcon, ColorHex = colorHex }; } } private static void SetPointColor(string letter, string colorHex) { if (!string.IsNullOrEmpty(letter) && _compassPoints.TryGetValue(letter, out var value)) { value.ColorHex = colorHex; _compassPoints[letter] = value; } } protected override void OnHandleMessage(ReceivedMessage received) { //IL_01ce: Unknown result type (might be due to invalid IL or missing references) try { CaptureEventData captureEventData = ((ReceivedMessage)(ref received)).ReadData<CaptureEventData>(); byte localSmallID = PlayerIDManager.LocalSmallID; bool flag = IsInGroup(localSmallID, captureEventData.GroupMemberSmallIds); StorePoint(captureEventData.PointLetter, captureEventData.PointX, captureEventData.PointZ); switch (captureEventData.EventType) { case 0: ShowStarted(captureEventData.GroupName, captureEventData.PointLetter, flag, captureEventData.GroupColor); if (!string.IsNullOrEmpty(captureEventData.FlagBarcode)) { PrewarmBundle(captureEventData.FlagBarcode); } break; case 1: BonesquadMod.Log($"[Capture] Tick {captureEventData.TimerSecond}/{60} — Point {captureEventData.PointLetter} ({captureEventData.GroupName})"); if (flag) { ShowTimer(captureEventData.GroupName, captureEventData.PointLetter, captureEventData.TimerSecond); } break; case 2: ShowCaptured(captureEventData.GroupName, captureEventData.PointLetter, flag, captureEventData.GroupColor); SetPointColor(captureEventData.PointLetter, captureEventData.GroupColor); if (captureEventData.SpawnFlagSmallId == localSmallID && !string.IsNullOrEmpty(captureEventData.FlagBarcode)) { BonesquadMod.Log($"[Capture] I am the spawner (SmallID={localSmallID}), scheduling flag spawn in 0.5s."); string flagBarcode = captureEventData.FlagBarcode; Vector3 pos = default(Vector3); ((Vector3)(ref pos))..ctor(captureEventData.FlagX, captureEventData.FlagY + 0.5f, captureEventData.FlagZ); MelonCoroutines.Start(SpawnFlagDelayed(flagBarcode, pos)); } else { BonesquadMod.Log($"[Capture] Not the spawner (my={localSmallID} spawner={captureEventData.SpawnFlagSmallId}), waiting for Fusion replication."); } break; case 3: if (flag) { ShowEnemyInZone(captureEventData.PointLetter); } break; case 4: SetPointColor(captureEventData.PointLetter, captureEventData.GroupColor); break; } } catch (Exception ex) { BonesquadMod.LogWarning("[Capture] CaptureEventHandler: " + ex.Message); } } private static IEnumerator SpawnFlagDelayed(string barcode, Vector3 pos) { //IL_000e: 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) yield return (object)new WaitForSeconds(0.5f); SpawnFlag(barcode, pos); } private static void SpawnFlag(string barcode, Vector3 pos) { //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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_008d: 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_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) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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) if (!_allFlagBarcodes.Contains(barcode)) { BonesquadMod.LogWarning("[Capture] Unknown flag barcode: " + barcode); return; } Spawnable val = new Spawnable(); val.crateRef = new SpawnableCrateReference(barcode); AssetSpawner.Register(val); BonesquadMod.Log($"[Capture] NetworkAssetSpawner.Spawn called at {DateTime.Now:HH:mm:ss.fff} — {barcode} at {pos}"); try { NetworkAssetSpawner.Spawn(new SpawnRequestInfo { Spawnable = val, Position = pos, Rotation = Quaternion.identity, SpawnEffect = false, SpawnCallback = delegate(SpawnCallbackInfo info) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(36, 2); defaultInterpolatedStringHandler.AppendLiteral("[Capture] Flag spawned at "); defaultInterpolatedStringHandler.AppendFormatted(DateTime.Now, "HH:mm:ss.fff"); defaultInterpolatedStringHandler.AppendLiteral(" EntityID="); NetworkEntity entity = info.Entity; defaultInterpolatedStringHandler.AppendFormatted((entity != null) ? new ushort?(entity.ID) : ((ushort?)null)); BonesquadMod.Log(defaultInterpolatedStringHandler.ToStringAndClear()); PinFlagToWorld(info.Spawned, pos); }, SpawnSource = (EntitySource)2 }); } catch (Exception ex) { BonesquadMod.LogWarning("[Capture] SpawnFlag failed: " + ex.Message); } } private static void PinFlagToWorld(GameObject go, Vector3 targetPos) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)go)) { return; } try { go.transform.SetPositionAndRotation(targetPos, Quaternion.identity); foreach (Rigidbody componentsInChild in go.GetComponentsInChildren<Rigidbody>()) { if (Object.op_Implicit((Object)(object)componentsInChild)) { componentsInChild.velocity = Vector3.zero; componentsInChild.angularVelocity = Vector3.zero; componentsInChild.isKinematic = true; } } BonesquadMod.Log($"[Capture] Flag pinned to world at {targetPos}"); } catch (Exception ex) { BonesquadMod.LogWarning("[Capture] PinFlagToWorld failed: " + ex.Message); } } private static bool IsInGroup(byte localId, byte[] memberIds) { for (int i = 0; i < memberIds.Length; i++) { if (memberIds[i] == localId) { return true; } } return false; } private static string PT(string letter) { return $"<color={"#FFE04D"}>Point {letter}</color>"; } private static string GN(string name, string colorHex) { if (!string.IsNullOrEmpty(colorHex)) { return $"<color={colorHex}>{name}</color>"; } return name; } private static void ShowStarted(string groupName, string letter, bool isMyGroup, string groupColor) { string text = (isMyGroup ? GN("Your group", groupColor) : GN(groupName, groupColor)); _quietUntil = Time.time + 2f; ShowHud(PT(letter) + " | " + text + " started capturing", 2f); } private static void ShowEnemyInZone(string letter) { ShowHud(PT(letter) + " | Enemy in zone — capture blocked", 5f); } private static void ShowTimer(string groupName, string letter, byte second) { if (!(Time.time < _quietUntil)) { ShowHud($"{PT(letter)} | Capturing ({second}/{60} sec)", 1.3f); } } private static void ShowCaptured(string groupName, string letter, bool isMyGroup, string groupColor) { _quietUntil = 0f;