using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Net; using System.Net.Security; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography.X509Certificates; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using Steamworks; using UnityEngine; using Zorro.Core; using Zorro.Core.Serizalization; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace PeakMX { public static class ActionTracker { private const string EventUrl = "https://peak-mx.rkngov.com/api/event"; public static void Track(string name, double? value = null, Dictionary meta = null) { if (!ModConfig.AllowAnonymousStats.Value) { return; } string id = ModConfig.InstallId.Value; if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(name)) { return; } Task.Run(delegate { try { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; using WebClient webClient = new WebClient { Encoding = Encoding.UTF8 }; webClient.Headers[HttpRequestHeader.ContentType] = "application/json"; webClient.UploadString("https://peak-mx.rkngov.com/api/event", "POST", BuildJson(id, name, value, meta)); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogDebug((object)("[ActionTracker] " + name + ": " + ex.Message)); } } }); } private static string BuildJson(string id, string name, double? value, Dictionary meta) { StringBuilder stringBuilder = new StringBuilder(256); stringBuilder.Append('{'); WriteProp(stringBuilder, "id", id); stringBuilder.Append(','); WriteProp(stringBuilder, "type", "action"); stringBuilder.Append(','); WriteProp(stringBuilder, "name", name); stringBuilder.Append(','); WriteProp(stringBuilder, "t", "peak-mx-public-v1"); if (value.HasValue) { stringBuilder.Append(','); stringBuilder.Append("\"value\":").Append(value.Value.ToString(CultureInfo.InvariantCulture)); } if (meta != null && meta.Count > 0) { stringBuilder.Append(','); stringBuilder.Append("\"meta\":"); WriteObject(stringBuilder, meta); } stringBuilder.Append('}'); return stringBuilder.ToString(); } private static void WriteObject(StringBuilder sb, Dictionary values) { sb.Append('{'); bool flag = true; foreach (KeyValuePair value in values) { if (!string.IsNullOrEmpty(value.Key) && value.Value != null) { if (!flag) { sb.Append(','); } flag = false; WritePropName(sb, value.Key); WriteValue(sb, value.Value); } } sb.Append('}'); } private static void WriteValue(StringBuilder sb, object value) { if (value != null) { if (!(value is string value2)) { if (!(value is bool flag)) { if (!(value is int value3)) { if (!(value is long value4)) { if (!(value is float num)) { if (!(value is double num2)) { if (value is Dictionary values) { WriteObject(sb, values); } else { WriteString(sb, value.ToString()); } } else { sb.Append(num2.ToString(CultureInfo.InvariantCulture)); } } else { sb.Append(num.ToString(CultureInfo.InvariantCulture)); } } else { sb.Append(value4); } } else { sb.Append(value3); } } else { sb.Append(flag ? "true" : "false"); } } else { WriteString(sb, value2); } } else { sb.Append("null"); } } private static void WriteProp(StringBuilder sb, string key, string value) { WritePropName(sb, key); WriteString(sb, value); } private static void WritePropName(StringBuilder sb, string key) { WriteString(sb, key); sb.Append(':'); } private static void WriteString(StringBuilder sb, string value) { if (value == null) { sb.Append("null"); return; } sb.Append('"'); foreach (char c in value) { switch (c) { case '"': sb.Append("\\\""); continue; case '\\': sb.Append("\\\\"); continue; case '\n': sb.Append("\\n"); continue; case '\r': sb.Append("\\r"); continue; case '\t': sb.Append("\\t"); continue; } if (c < ' ') { StringBuilder stringBuilder = sb.Append("\\u"); int num = c; stringBuilder.Append(num.ToString("x4")); } else { sb.Append(c); } } sb.Append('"'); } } public static class CheatTracker { private const string EventUrl = "https://peak-mx.rkngov.com/api/event"; private static readonly Dictionary _prev = new Dictionary(); private static readonly Dictionary _since = new Dictionary(); private static (string name, Func get)[] _cheats; public static void Tick() { if (!ModConfig.AllowAnonymousStats.Value) { return; } if (_cheats == null) { Build(); } (string, Func)[] cheats = _cheats; for (int i = 0; i < cheats.Length; i++) { (string, Func) tuple = cheats[i]; string item = tuple.Item1; bool flag = tuple.Item2(); bool value; bool flag2 = _prev.TryGetValue(item, out value) && value; if (flag != flag2) { _prev[item] = flag; if (flag) { _since[item] = Time.realtimeSinceStartup; Send(item, null); } else { float value2; float num = (_since.TryGetValue(item, out value2) ? (Time.realtimeSinceStartup - value2) : 0f); Send(item, Math.Max(0, (int)num)); } } } } private static void Build() { _cheats = new(string, Func)[30] { ("speed", () => ModConfig.SpeedMod), ("jump", () => ModConfig.JumpMod), ("infinitejumps", () => ModConfig.InfiniteJumps), ("climb", () => ModConfig.ClimbMod), ("vineclimb", () => ModConfig.VineClimbMod), ("ropeclimb", () => ModConfig.RopeClimbMod), ("god", () => ModConfig.GodMode), ("infstamina", () => ModConfig.InfiniteStamina), ("nofall", () => ModConfig.NoFallDamage), ("nofallingragdoll", () => ModConfig.NoFallingRagdoll), ("noweight", () => ModConfig.NoWeight), ("lockstatus", () => ModConfig.LockStatus), ("nostatus", () => ModConfig.NoStatusEffects), ("noinjury", () => ModConfig.NoInjury), ("nohunger", () => ModConfig.NoHunger), ("nocold", () => ModConfig.NoCold), ("nopoison", () => ModConfig.NoPoison), ("nocurse", () => ModConfig.NoCurse), ("nodrowsy", () => ModConfig.NoDrowsy), ("nohot", () => ModConfig.NoHot), ("staminaregendelay", () => ModConfig.StaminaRegenDelayMod), ("longinteract", () => ModConfig.LongInteraction), ("cinematiccam", () => ModConfig.CinematicCamera), ("noslippery", () => ModConfig.NoSlipperySurfaces), ("gamespeed", () => ModConfig.GameSpeedMod), ("unlimitedlantern", () => ModConfig.UnlimitedLanternFuel), ("unlimiteditems", () => ModConfig.UnlimitedItemUses), ("infiniteitems", () => ModConfig.InfiniteItems), ("teleportping", () => ModConfig.TeleportToPing), ("fly", () => ModConfig.Fly) }; } private static void Send(string name, int? value) { string value2 = ModConfig.InstallId.Value; if (string.IsNullOrEmpty(value2)) { return; } string url = "https://peak-mx.rkngov.com/api/event?id=" + Uri.EscapeDataString(value2) + "&type=cheat&name=" + Uri.EscapeDataString(name) + "&t=" + Uri.EscapeDataString("peak-mx-public-v1"); if (value.HasValue) { url += $"&value={value.Value}"; } Task.Run(delegate { try { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; using WebClient webClient = new WebClient(); webClient.DownloadString(url); } catch { } }); } } public static class Diagnostics { [CompilerGenerated] private static class <>O { public static LogCallback <0>__OnLog; } private const string DiagUrl = "https://peak-mx.rkngov.com/api/diag"; private const string CrashUrl = "https://peak-mx.rkngov.com/api/crash"; private const string LobbyUrl = "https://peak-mx.rkngov.com/api/lobby"; private static bool _diagSent; private static readonly HashSet _seenCrashes = new HashSet(); private static int _crashCount; private static string _lastLobby; public static void SendDiagOnce() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (_diagSent || !ModConfig.AllowAnonymousStats.Value || string.IsNullOrEmpty(ModConfig.InstallId.Value)) { return; } _diagSent = true; string id = ModConfig.InstallId.Value; string os = SystemInfo.operatingSystem; string cpu = $"{SystemInfo.processorType} ({SystemInfo.processorCount} cores)"; string gpu = $"{SystemInfo.graphicsDeviceName} ({SystemInfo.graphicsMemorySize} MB)"; int ram = SystemInfo.systemMemorySize; Resolution currentResolution = Screen.currentResolution; object arg = ((Resolution)(ref currentResolution)).width; currentResolution = Screen.currentResolution; string screen = $"{arg}x{((Resolution)(ref currentResolution)).height}"; string gameVer = SafeStr(() => Application.version); string bepinex = SafeBepInEx(); string mods = string.Join(", ", SafePlugins()); string steamid = SafeSteamId(); string nick = SafeStr(() => PhotonNetwork.NickName); Task.Run(delegate { try { StringBuilder stringBuilder = new StringBuilder("{"); JS(stringBuilder, "id", id); C(stringBuilder); JS(stringBuilder, "t", "peak-mx-public-v1"); C(stringBuilder); JS(stringBuilder, "os", os); C(stringBuilder); JS(stringBuilder, "cpu", cpu); C(stringBuilder); JS(stringBuilder, "gpu", gpu); C(stringBuilder); JN(stringBuilder, "ram", ram); C(stringBuilder); JS(stringBuilder, "screen", screen); C(stringBuilder); JS(stringBuilder, "gameVer", gameVer); C(stringBuilder); JS(stringBuilder, "bepinex", bepinex); C(stringBuilder); JS(stringBuilder, "steamid", steamid); C(stringBuilder); JS(stringBuilder, "nick", nick); C(stringBuilder); JS(stringBuilder, "mods", mods); stringBuilder.Append('}'); Post("https://peak-mx.rkngov.com/api/diag", stringBuilder.ToString()); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogDebug((object)("[Diag] " + ex.Message)); } } }); } public static void HookCrashes() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown if (ModConfig.AllowAnonymousStats.Value) { object obj = <>O.<0>__OnLog; if (obj == null) { LogCallback val = OnLog; <>O.<0>__OnLog = val; obj = (object)val; } Application.logMessageReceived += (LogCallback)obj; } } private static void OnLog(string condition, string stack, LogType type) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (((int)type != 4 && (int)type != 0) || _crashCount >= 20 || !ModConfig.AllowAnonymousStats.Value) { return; } string text = condition ?? ""; if (text.Length > 160) { text = text.Substring(0, 160); } if (!_seenCrashes.Add(text)) { return; } _crashCount++; string id = ModConfig.InstallId.Value; string msg = condition ?? ""; string st = stack ?? ""; Task.Run(delegate { try { StringBuilder stringBuilder = new StringBuilder("{"); JS(stringBuilder, "id", id); C(stringBuilder); JS(stringBuilder, "t", "peak-mx-public-v1"); C(stringBuilder); JS(stringBuilder, "message", msg); C(stringBuilder); JS(stringBuilder, "stack", st); stringBuilder.Append('}'); Post("https://peak-mx.rkngov.com/api/crash", stringBuilder.ToString()); } catch { } }); } public static void SendLobby(List nicks) { if (!ModConfig.AllowAnonymousStats.Value || nicks == null || nicks.Count == 0 || string.IsNullOrEmpty(ModConfig.InstallId.Value)) { return; } string text = string.Join(", ", nicks); if (text == _lastLobby) { return; } _lastLobby = text; string id = ModConfig.InstallId.Value; List list = new List(nicks); Task.Run(delegate { try { StringBuilder stringBuilder = new StringBuilder("{"); JS(stringBuilder, "id", id); C(stringBuilder); JS(stringBuilder, "t", "peak-mx-public-v1"); C(stringBuilder); stringBuilder.Append("\"nicks\":["); for (int i = 0; i < list.Count; i++) { if (i > 0) { stringBuilder.Append(','); } Str(stringBuilder, list[i]); } stringBuilder.Append("]}"); Post("https://peak-mx.rkngov.com/api/lobby", stringBuilder.ToString()); } catch { } }); } private static void Post(string url, string json) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; using WebClient webClient = new WebClient { Encoding = Encoding.UTF8 }; webClient.Headers[HttpRequestHeader.ContentType] = "application/json"; webClient.UploadString(url, "POST", json); } private static void C(StringBuilder sb) { sb.Append(','); } private static void JS(StringBuilder sb, string k, string v) { sb.Append('"').Append(k).Append("\":"); Str(sb, v); } private static void JN(StringBuilder sb, string k, int v) { sb.Append('"').Append(k).Append("\":") .Append(v); } private static void Str(StringBuilder sb, string v) { if (v == null) { sb.Append("null"); return; } sb.Append('"'); foreach (char c in v) { switch (c) { case '"': sb.Append("\\\""); continue; case '\\': sb.Append("\\\\"); continue; case '\n': sb.Append("\\n"); continue; case '\r': sb.Append("\\r"); continue; case '\t': sb.Append("\\t"); continue; } if (c < ' ') { StringBuilder stringBuilder = sb.Append("\\u"); int num = c; stringBuilder.Append(num.ToString("x4")); } else { sb.Append(c); } } sb.Append('"'); } private static string SafeStr(Func f) { try { return f(); } catch { return null; } } private static string SafeBepInEx() { try { return typeof(BaseUnityPlugin).Assembly.GetName().Version.ToString(); } catch { return null; } } private static List SafePlugins() { try { return (from p in Chainloader.PluginInfos.Values select $"{p.Metadata.Name} {p.Metadata.Version}" into s orderby s select s).ToList(); } catch { return new List(); } } private static string SafeSteamId() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) try { if (SteamAPI.IsSteamRunning()) { return SteamUser.GetSteamID().m_SteamID.ToString(); } } catch { } return null; } } public static class Features { private static readonly FieldRef InvincibleRef = AccessTools.FieldRefAccess("isInvincible"); private static readonly FieldInfo ClimbSpeedF = AccessTools.Field(typeof(CharacterClimbing), "climbSpeedMod"); private static readonly FieldInfo VineSpeedF = AccessTools.Field(typeof(CharacterVineClimbing), "climbSpeedMod"); private static readonly FieldInfo RopeSpeedF = AccessTools.Field(typeof(CharacterRopeHandling), "climbSpeedMod"); private static float _baseJumpImpulse = float.NaN; private static float[] _lockedStatuses; private static bool _godApplied; private static bool _speedApplied; private static bool _jumpApplied; private static bool _climbApplied; private static bool _vineApplied; private static bool _ropeApplied; private static float _itemTimer; private static float _timeOverrideTimer; private static float _adminTimer; private static float _baseInteractionDistance = -1f; private static float _baseInteractionArea = -1f; private static bool _timeScaleApplied; private static readonly Dictionary PingBaseFrustumSizes = new Dictionary(); private static GameObject _cinematicObject; private static CameraOverride _cinematicOverride; private static Vector2 _cinematicLook; public static void Tick() { Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)localCharacter.data == (Object)null) { return; } try { ApplyMovement(localCharacter); } catch (Exception e) { Warn("movement", e); } try { ApplyCheats(localCharacter); } catch (Exception e2) { Warn("cheats", e2); } try { ApplyInfiniteItems(); } catch (Exception e3) { Warn("items", e3); } try { ApplyWorldOverrides(); } catch (Exception e4) { Warn("world", e4); } try { ApplyUtilityModifiers(localCharacter); } catch (Exception e5) { Warn("utility", e5); } try { ApplyAdminProtection(); } catch (Exception e6) { Warn("admin", e6); } try { GameApi.ApplyFrozenPlayers(Time.deltaTime); } catch (Exception e7) { Warn("freeze", e7); } try { GameApi.ApplyInventoryLocks(Time.deltaTime); } catch (Exception e8) { Warn("inventory-lock", e8); } } private static void ApplyInfiniteItems() { if (!ModConfig.InfiniteItems) { return; } _itemTimer += Time.deltaTime; if (!(_itemTimer < 0.5f)) { _itemTimer = 0f; float value = ((ModConfig.RechargeValue > 0f) ? ModConfig.RechargeValue : 999f); int num = GameApi.SlotCount(); for (int i = 0; i < num; i++) { GameApi.RechargeSlot(i, value); } } } private static void ApplyWorldOverrides() { if (!ModConfig.OverrideExpeditionTime) { _timeOverrideTimer = 0f; return; } _timeOverrideTimer += Time.deltaTime; if (_timeOverrideTimer < 0.5f) { return; } _timeOverrideTimer = 0f; if (ModConfig.ExpeditionTimeSeconds <= 0.01f) { float num = GameApi.ExpeditionTimeSeconds(); if (!(num > 0.01f)) { return; } ModConfig.ExpeditionTimeSeconds = num; } GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } private static void ApplyAdminProtection() { _adminTimer += Time.deltaTime; if (!(_adminTimer < 2f)) { _adminTimer = 0f; GameApi.EnforceAdminProtection(); } } private static void ApplyMovement(Character c) { CharacterMovement val = c.refs?.movement; if ((Object)(object)val == (Object)null) { return; } if (ModConfig.SpeedMod) { val.movementModifier = ModConfig.SpeedAmount; _speedApplied = true; } else if (_speedApplied) { val.movementModifier = 1f; _speedApplied = false; } if (ModConfig.JumpMod) { if (float.IsNaN(_baseJumpImpulse) || _baseJumpImpulse <= 0f) { _baseJumpImpulse = ((val.jumpImpulse > 0f) ? val.jumpImpulse : 4f); } val.jumpImpulse = _baseJumpImpulse * ModConfig.JumpAmount; _jumpApplied = true; } else if (_jumpApplied) { if (!float.IsNaN(_baseJumpImpulse) && _baseJumpImpulse > 0f) { val.jumpImpulse = _baseJumpImpulse; } _jumpApplied = false; } if (ModConfig.InfiniteJumps) { c.data.jumpsRemaining = Mathf.Max(c.data.jumpsRemaining, 1); if (c.data.sinceJump > 0.28f) { c.data.sinceGrounded = Mathf.Min(c.data.sinceGrounded, 0.18f); } } ApplyClimbField(c, ClimbSpeedF, ModConfig.ClimbMod, ModConfig.ClimbAmount, ref _climbApplied); ApplyClimbField(c, VineSpeedF, ModConfig.VineClimbMod, ModConfig.VineClimbAmount, ref _vineApplied); ApplyClimbField(c, RopeSpeedF, ModConfig.RopeClimbMod, ModConfig.RopeClimbAmount, ref _ropeApplied); } private static void ApplyClimbField(Character c, FieldInfo f, bool on, float amount, ref bool applied) where T : Component { if (f == null) { return; } T component = ((Component)c).GetComponent(); if (!((Object)(object)component == (Object)null)) { if (on) { f.SetValue(component, amount); applied = true; } else if (applied) { f.SetValue(component, 1f); applied = false; } } } private static void ApplyCheats(Character c) { CharacterData data = c.data; CharacterAfflictions val = ((c.refs != null) ? c.refs.afflictions : null); if (ModConfig.GodMode) { InvincibleRef.Invoke(data) = true; _godApplied = true; } else if (_godApplied) { InvincibleRef.Invoke(data) = false; data.RecalculateInvincibility(); _godApplied = false; } if (ModConfig.InfiniteStamina) { data.currentStamina = 1f; data.extraStamina = Mathf.Max(data.extraStamina, 0f); } if (ModConfig.NoFallDamage) { data.fallSeconds = 0f; } if (ModConfig.NoFallingRagdoll) { data.fallSeconds = 0f; } if (ModConfig.NoSlipperySurfaces) { data.slippy = 0f; data.sinceFallSlide = Mathf.Max(data.sinceFallSlide, 2f); } if (!((Object)(object)val != (Object)null)) { return; } if (ModConfig.NoStatusEffects) { for (int i = 0; i < CharacterAfflictions.NumStatusTypes; i++) { val.SetStatus((STATUSTYPE)i, 0f, false); } } else { ClearBlockedStatus(val, (STATUSTYPE)0, ModConfig.NoInjury); ClearBlockedStatus(val, (STATUSTYPE)1, ModConfig.NoHunger); ClearBlockedStatus(val, (STATUSTYPE)2, ModConfig.NoCold); ClearBlockedStatus(val, (STATUSTYPE)3, ModConfig.NoPoison); ClearBlockedStatus(val, (STATUSTYPE)5, ModConfig.NoCurse); ClearBlockedStatus(val, (STATUSTYPE)6, ModConfig.NoDrowsy); ClearBlockedStatus(val, (STATUSTYPE)8, ModConfig.NoHot); } if (ModConfig.NoWeight) { val.SetStatus((STATUSTYPE)7, 0f, true); } if (ModConfig.LockStatus) { if (_lockedStatuses == null && val.currentStatuses != null) { _lockedStatuses = (float[])val.currentStatuses.Clone(); } if (_lockedStatuses != null && val.currentStatuses != null) { Array.Copy(_lockedStatuses, val.currentStatuses, Mathf.Min(_lockedStatuses.Length, val.currentStatuses.Length)); } } else { _lockedStatuses = null; } } private static void ClearBlockedStatus(CharacterAfflictions affl, STATUSTYPE type, bool blocked) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) if (blocked) { affl.SetStatus(type, 0f, false); } } private static void ApplyUtilityModifiers(Character c) { ApplyInteractionRange(); ApplyGameSpeed(); ApplyCinematicCamera(c); ApplyPingHandScale(); } private static void ApplyInteractionRange() { Interaction instance = Interaction.instance; if (!((Object)(object)instance == (Object)null)) { if (_baseInteractionDistance < 0f) { _baseInteractionDistance = instance.distance; _baseInteractionArea = instance.area; } if (ModConfig.LongInteraction) { instance.distance = Mathf.Max(_baseInteractionDistance, ModConfig.InteractionDistance); instance.area = Mathf.Max(_baseInteractionArea, 1.25f); } else if (_baseInteractionDistance >= 0f) { instance.distance = _baseInteractionDistance; instance.area = _baseInteractionArea; } } } private static void ApplyGameSpeed() { if (ModConfig.GameSpeedMod) { Time.timeScale = Mathf.Clamp(ModConfig.GameSpeed, 0.05f, 5f); _timeScaleApplied = true; } else if (_timeScaleApplied) { Time.timeScale = 1f; _timeScaleApplied = false; } } private static void ApplyCinematicCamera(Character c) { //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028b: 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_0296: Unknown result type (might be due to invalid IL or missing references) if (!ModConfig.CinematicCamera) { DisableCinematicCamera(); return; } if ((Object)(object)_cinematicObject == (Object)null) { _cinematicObject = new GameObject("PEAK-MX Cinematic Camera"); Object.DontDestroyOnLoad((Object)(object)_cinematicObject); _cinematicOverride = _cinematicObject.AddComponent(); Transform val = (((Object)(object)MainCamera.instance != (Object)null) ? ((Component)MainCamera.instance).transform : ((Component)c).transform); _cinematicObject.transform.position = val.position; _cinematicObject.transform.rotation = val.rotation; Quaternion rotation = _cinematicObject.transform.rotation; Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles; _cinematicLook = new Vector2(eulerAngles.y, eulerAngles.x); ActionTracker.Track("cinematic_camera_on"); } _cinematicOverride.fov = Mathf.Clamp(ModConfig.CinematicCameraFov, 1f, 120f); float unscaledDeltaTime = Time.unscaledDeltaTime; _cinematicLook.x += Input.GetAxis("Mouse X") * 140f * unscaledDeltaTime; _cinematicLook.y -= Input.GetAxis("Mouse Y") * 140f * unscaledDeltaTime; _cinematicLook.y = Mathf.Clamp(_cinematicLook.y, -89f, 89f); _cinematicObject.transform.rotation = Quaternion.Euler(_cinematicLook.y, _cinematicLook.x, 0f); Vector3 zero = Vector3.zero; if (Input.GetKey((KeyCode)119)) { zero.z += 1f; } if (Input.GetKey((KeyCode)115)) { zero.z -= 1f; } if (Input.GetKey((KeyCode)100)) { zero.x += 1f; } if (Input.GetKey((KeyCode)97)) { zero.x -= 1f; } if (Input.GetKey((KeyCode)32) || Input.GetKey((KeyCode)101)) { zero.y += 1f; } if (Input.GetKey((KeyCode)306) || Input.GetKey((KeyCode)113)) { zero.y -= 1f; } float num = Mathf.Max(0.1f, ModConfig.CinematicCameraSpeed) * (Input.GetKey((KeyCode)304) ? 4f : 1f); Transform transform = _cinematicObject.transform; transform.position += _cinematicObject.transform.TransformDirection(((Vector3)(ref zero)).normalized) * num * unscaledDeltaTime; if ((Object)(object)MainCamera.instance != (Object)null) { MainCamera.instance.SetCameraOverride(_cinematicOverride); } } private static void DisableCinematicCamera() { if ((Object)(object)_cinematicObject == (Object)null) { return; } try { if ((Object)(object)MainCamera.instance != (Object)null) { MainCamera.instance.SetCameraOverride((CameraOverride)null); } } catch { } Object.Destroy((Object)(object)_cinematicObject); _cinematicObject = null; _cinematicOverride = null; ActionTracker.Track("cinematic_camera_off"); } private static void ApplyPingHandScale() { float num = Mathf.Clamp(ModConfig.PingHandSizeMultiplier, 0.1f, 10f); PointPing[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (PointPing val in array) { if (!((Object)(object)val == (Object)null)) { if (!PingBaseFrustumSizes.ContainsKey(val)) { PingBaseFrustumSizes[val] = Mathf.Max(0.001f, val.sizeOfFrustum); } val.sizeOfFrustum = PingBaseFrustumSizes[val] * num; } } if (!(Mathf.Abs(num - 1f) < 0.01f) || PingBaseFrustumSizes.Count <= 0) { return; } foreach (KeyValuePair pingBaseFrustumSize in PingBaseFrustumSizes) { if ((Object)(object)pingBaseFrustumSize.Key != (Object)null) { pingBaseFrustumSize.Key.sizeOfFrustum = pingBaseFrustumSize.Value; } } PingBaseFrustumSizes.Clear(); } private static void Warn(string where, Exception e) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[Features:" + where + "] " + e.Message)); } } } public static class GameApi { public enum CosmeticCategory { Skin, Accessory, Eyes, Mouth, Outfit, Hat, Sash } public struct AdminListEntry { public string Key; public string Label; public AdminListEntry(string key, string label) { Key = key; Label = label; } } private struct AdminMotionSample { public Vector3 Position; public float Time; } public static readonly List Items = new List(); public static readonly List ItemNames = new List(); public static readonly List PlayerChars = new List(); public static readonly List PlayerNames = new List(); private static readonly HashSet LocalCosmeticUnlocks = new HashSet(); private static readonly HashSet SessionBans = new HashSet(); private static readonly Dictionary SessionBanNames = new Dictionary(); private static readonly HashSet InventoryLocks = new HashSet(); private static readonly Dictionary InventoryLockNames = new Dictionary(); private static readonly Dictionary FrozenPlayers = new Dictionary(); private static readonly Dictionary AdminMotion = new Dictionary(); private static readonly Dictionary AdminStrikes = new Dictionary(); public static readonly List AdminProtectionLog = new List(); private static float _freezeRpcTimer; private static float _inventoryLockTimer; private static bool _itemsEverLoaded; private static Customization _customizationDb; private static readonly MethodInfo CustomGetData = typeof(CharacterCustomization).GetMethod("GetCustomizationData", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly MethodInfo CustomSetData = typeof(CharacterCustomization).GetMethod("SetCustomizationData", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly MethodInfo CustomSetSkin = typeof(CharacterCustomization).GetMethod("SetCharacterSkinColor", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly MethodInfo CustomSetAccessory = typeof(CharacterCustomization).GetMethod("SetCharacterAccessory", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly MethodInfo CustomSetEyes = typeof(CharacterCustomization).GetMethod("SetCharacterEyes", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly MethodInfo CustomSetMouth = typeof(CharacterCustomization).GetMethod("SetCharacterMouth", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly MethodInfo CustomSetOutfit = typeof(CharacterCustomization).GetMethod("SetCharacterOutfit", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly MethodInfo CustomSetHat = typeof(CharacterCustomization).GetMethod("SetCharacterHat", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly MethodInfo CustomSetSash = typeof(CharacterCustomization).GetMethod("SetCharacterSash", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); public static readonly List LuggageLabels = new List(); public static readonly List LuggageObjects = new List(); public static readonly string[] StatusEn = new string[12] { "Injury", "Hunger", "Cold", "Poison", "Crab", "Curse", "Drowsy", "Weight", "Hot", "Thorns", "Spores", "Web" }; public static readonly string[] StatusRu = new string[12] { "Травма", "Голод", "Холод", "Яд", "Краб", "Проклятие", "Сонливость", "Вес", "Жара", "Шипы", "Споры", "Паутина" }; public static void LoadItems() { try { Items.Clear(); ItemNames.Clear(); Object obj = Resources.Load("ItemDatabase", typeof(ItemDatabase)); ItemDatabase val = (ItemDatabase)(object)((obj is ItemDatabase) ? obj : null); if ((Object)(object)val != (Object)null) { foreach (Item @object in ((DatabaseAsset)(object)val).Objects) { Add(@object); } } Object[] array = Resources.LoadAll("0_Items", typeof(Item)); foreach (Object obj2 in array) { Add((Item)(object)((obj2 is Item) ? obj2 : null)); } array = Resources.FindObjectsOfTypeAll(typeof(Item)); foreach (Object obj3 in array) { Add((Item)(object)((obj3 is Item) ? obj3 : null)); } _itemsEverLoaded = ItemNames.Count > 0; ManualLogSource log = Plugin.Log; if (log != null) { log.LogInfo((object)$"[GameApi] items loaded: {ItemNames.Count}"); } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; if (log2 != null) { log2.LogWarning((object)("[GameApi] LoadItems: " + ex.Message)); } } } public static bool EnsureItemsLoaded() { if (_itemsEverLoaded && ItemNames.Count > 0) { return false; } LoadItems(); if (ItemNames.Count > 0) { ActionTracker.Track("items_load", ItemNames.Count); } return ItemNames.Count > 0; } private static void Add(Item it) { if ((Object)(object)it == (Object)null) { return; } try { if (IsInventorySpawnableItem(it)) { string name = it.GetName(); if (!string.IsNullOrEmpty(name) && !HasItemAlready(it, name)) { Items.Add(it); ItemNames.Add(name); } } } catch { } } private static bool HasItemAlready(Item item, string displayName) { for (int i = 0; i < Items.Count; i++) { Item val = Items[i]; if ((Object)(object)val == (Object)null) { continue; } try { if ((Object)(object)val == (Object)(object)item) { return true; } if (val.itemID == item.itemID && (Object)(object)((Component)val).gameObject != (Object)null && (Object)(object)((Component)item).gameObject != (Object)null && string.Equals(((Object)((Component)val).gameObject).name, ((Object)((Component)item).gameObject).name, StringComparison.Ordinal)) { return true; } } catch { } } return ItemNames.Contains(displayName); } private static bool IsInventorySpawnableItem(Item item) { try { if ((Object)(object)item == (Object)null || item.UIData == null || (Object)(object)((Component)item).gameObject == (Object)null) { return false; } if ((((Object)((Component)item).gameObject).name ?? "").IndexOf("BaseConstructable", StringComparison.OrdinalIgnoreCase) >= 0) { return false; } if (!HasResourcePrefab(item)) { return false; } if (!item.UIData.canPocket && !item.UIData.canBackpack) { return false; } return true; } catch { return false; } } private static bool CanPocketItem(int itemIndex) { try { return itemIndex >= 0 && itemIndex < Items.Count && (Object)(object)Items[itemIndex] != (Object)null && Items[itemIndex].UIData != null && Items[itemIndex].UIData.canPocket && HasResourcePrefab(Items[itemIndex]); } catch { return false; } } private static bool CanBackpackItem(int itemIndex) { try { return itemIndex >= 0 && itemIndex < Items.Count && (Object)(object)Items[itemIndex] != (Object)null && Items[itemIndex].UIData != null && Items[itemIndex].UIData.canBackpack && HasResourcePrefab(Items[itemIndex]); } catch { return false; } } private static bool HasResourcePrefab(Item item) { try { if ((Object)(object)item == (Object)null || (Object)(object)((Component)item).gameObject == (Object)null) { return false; } return HasResourcePrefabName(((Object)((Component)item).gameObject).name); } catch { return false; } } private static bool HasResourcePrefabName(string prefabName) { try { if (string.IsNullOrWhiteSpace(prefabName)) { return false; } return Resources.Load("0_Items/" + prefabName, typeof(GameObject)) != (Object)null; } catch { return false; } } private static int RandomItemIndexForSlot(bool backpack) { EnsureItemsLoaded(); List list = new List(); for (int i = 0; i < Items.Count; i++) { if (backpack ? CanBackpackItem(i) : CanPocketItem(i)) { list.Add(i); } } if (list.Count == 0) { return -1; } return list[Random.Range(0, list.Count)]; } public static Texture2D ItemIcon(int index) { try { Item val = ((index >= 0 && index < Items.Count) ? Items[index] : null); if ((Object)(object)val == (Object)null || val.UIData == null) { return null; } Texture2D icon = val.UIData.icon; if ((Object)(object)icon != (Object)null) { return icon; } return TryTextureMember(val.UIData, "altIcon", "colorBlindIcon", "sprite", "smallIcon", "inventoryIcon"); } catch { return null; } } private static Texture2D TryTextureMember(object source, params string[] names) { if (source == null || names == null) { return null; } Type type = source.GetType(); foreach (string name in names) { try { FieldInfo field = type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { object value = field.GetValue(source); Texture2D val = (Texture2D)((value is Texture2D) ? value : null); if (val != null) { return val; } Sprite val2 = (Sprite)((value is Sprite) ? value : null); if (val2 != null && (Object)(object)val2.texture != (Object)null) { return val2.texture; } } } catch { } try { PropertyInfo property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property != null) { object value2 = property.GetValue(source, null); Texture2D val3 = (Texture2D)((value2 is Texture2D) ? value2 : null); if (val3 != null) { return val3; } Sprite val4 = (Sprite)((value2 is Sprite) ? value2 : null); if (val4 != null && (Object)(object)val4.texture != (Object)null) { return val4.texture; } } } catch { } } return null; } public static bool SpawnToSlot(int itemIndex, int slot) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown try { Player localPlayer = Player.localPlayer; if ((Object)(object)localPlayer == (Object)null || localPlayer.itemSlots == null) { return false; } if (slot < 0 || slot >= localPlayer.itemSlots.Length) { return false; } if (itemIndex < 0 || itemIndex >= Items.Count) { return false; } if (!CanPocketItem(itemIndex)) { return false; } ItemSlot obj = localPlayer.itemSlots[slot]; obj.prefab = Items[itemIndex]; obj.data = new ItemInstanceData(Guid.NewGuid()); ItemInstanceDataHandler.AddInstanceData(obj.data); SyncInventory(localPlayer); ActionTracker.Track("inventory_spawn_local", null, new Dictionary { ["slot"] = slot, ["item"] = ItemNames[itemIndex] }); return true; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] SpawnToSlot: " + ex.Message)); } return false; } } public static bool ClearSlot(int slot) { try { Player localPlayer = Player.localPlayer; if ((Object)(object)localPlayer == (Object)null || localPlayer.itemSlots == null || slot < 0 || slot >= localPlayer.itemSlots.Length) { return false; } ItemSlot obj = localPlayer.itemSlots[slot]; obj.prefab = null; obj.data = null; SyncInventory(localPlayer); ActionTracker.Track("inventory_clear_local", null, new Dictionary { ["slot"] = slot }); return true; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ClearSlot: " + ex.Message)); } return false; } } private static void SyncInventory(Player p) { SyncInventory(p, (RpcTarget)1); } private static void SyncInventory(Player p, RpcTarget target) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) byte[] array = IBinarySerializable.ToManagedArray(new InventorySyncData(p.itemSlots, p.backpackSlot, p.tempFullSlot)); ((MonoBehaviourPun)p).photonView.RPC("SyncInventoryRPC", target, new object[2] { array, true }); } private static Player PlayerOf(Character c) { try { return ((Object)(object)c != (Object)null) ? c.player : null; } catch { return null; } } private static bool IsLocal(Character c) { try { return (Object)(object)c == (Object)null || c.IsLocal || (Object)(object)c == (Object)(object)Character.localCharacter; } catch { return (Object)(object)c == (Object)null || (Object)(object)c == (Object)(object)Character.localCharacter; } } public static bool IsHost() { try { return PhotonNetwork.IsMasterClient; } catch { return PhotonNetwork.IsMasterClient; } } private static CharacterCustomization LocalCustomization() { try { return (!((Object)(object)Character.localCharacter != (Object)null)) ? null : Character.localCharacter.refs?.customization; } catch { return null; } } private static Customization CustomizationDb() { try { if ((Object)(object)_customizationDb != (Object)null) { return _customizationDb; } _customizationDb = Resources.FindObjectsOfTypeAll().FirstOrDefault(); return _customizationDb; } catch { return null; } } public static bool SpawnToSlotFor(Character target, int itemIndex, int slot) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown try { if (IsLocal(target)) { return SpawnToSlot(itemIndex, slot); } Player val = PlayerOf(target); if ((Object)(object)val == (Object)null || val.itemSlots == null) { return false; } if (slot < 0 || slot >= val.itemSlots.Length) { return false; } if (itemIndex < 0 || itemIndex >= Items.Count) { return false; } if (!CanPocketItem(itemIndex)) { return false; } ItemSlot obj = val.itemSlots[slot]; obj.prefab = Items[itemIndex]; obj.data = new ItemInstanceData(Guid.NewGuid()); ItemInstanceDataHandler.AddInstanceData(obj.data); SyncInventory(val, (RpcTarget)0); ActionTracker.Track("inventory_spawn_remote", null, new Dictionary { ["slot"] = slot, ["item"] = ItemNames[itemIndex], ["target"] = SafeCharacterName(target) }); return true; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] SpawnToSlotFor: " + ex.Message)); } return false; } } public static bool ClearSlotFor(Character target, int slot) { try { if (IsLocal(target)) { return ClearSlot(slot); } Player val = PlayerOf(target); if ((Object)(object)val == (Object)null || val.itemSlots == null || slot < 0 || slot >= val.itemSlots.Length) { return false; } ItemSlot obj = val.itemSlots[slot]; obj.prefab = null; obj.data = null; SyncInventory(val, (RpcTarget)0); ActionTracker.Track("inventory_clear_remote", null, new Dictionary { ["slot"] = slot, ["target"] = SafeCharacterName(target) }); return true; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ClearSlotFor: " + ex.Message)); } return false; } } public static int SlotCount() { return SlotCountFor(Player.localPlayer); } public static int SlotCountFor(Character c) { return SlotCountFor(PlayerOf(c)); } private static int SlotCountFor(Player p) { try { return ((Object)(object)p != (Object)null && p.itemSlots != null) ? p.itemSlots.Length : 0; } catch { return 0; } } private static Player TargetPlayer(Character c) { return PlayerOf(c) ?? Player.localPlayer; } public static string DescribeSlot(Character c, int slot) { try { Player val = TargetPlayer(c); if ((Object)(object)val == (Object)null || val.itemSlots == null || slot < 0 || slot >= val.itemSlots.Length) { return ""; } Item val2 = val.itemSlots[slot]?.prefab; if ((Object)(object)val2 == (Object)null) { return "-"; } string name = val2.GetName(); return string.IsNullOrWhiteSpace(name) ? ((Object)val2).name : name; } catch { return ""; } } public static bool HasBackpack(Character c) { try { Player val = TargetPlayer(c); return (Object)(object)val != (Object)null && val.backpackSlot != null && !((ItemSlot)val.backpackSlot).IsEmpty() && ((ItemSlot)val.backpackSlot).data != null; } catch { return false; } } public static int BackpackSlotCount(Character c) { BackpackData val = BackpackDataFor(c, create: false); if (val == null || val.itemSlots == null) { return 0; } return val.itemSlots.Length; } public static string DescribeBackpackSlot(Character c, int slot) { try { BackpackData val = BackpackDataFor(c, create: false); if (val == null || val.itemSlots == null || slot < 0 || slot >= val.itemSlots.Length) { return ""; } Item val2 = val.itemSlots[slot]?.prefab; if ((Object)(object)val2 == (Object)null) { return "-"; } string name = val2.GetName(); return string.IsNullOrWhiteSpace(name) ? ((Object)val2).name : name; } catch { return ""; } } public static bool SpawnToBackpackSlotFor(Character target, int itemIndex, int slot) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown try { if (itemIndex < 0 || itemIndex >= Items.Count) { return false; } if (!CanBackpackItem(itemIndex)) { return false; } BackpackData val = BackpackDataFor(target, create: true); if (val == null || val.itemSlots == null || slot < 0 || slot >= val.itemSlots.Length) { return false; } val.itemSlots[slot].prefab = Items[itemIndex]; val.itemSlots[slot].data = new ItemInstanceData(Guid.NewGuid()); ItemInstanceDataHandler.AddInstanceData(val.itemSlots[slot].data); SyncTargetInventory(target); ActionTracker.Track("inventory_spawn_backpack", null, new Dictionary { ["slot"] = slot, ["item"] = SafeItemName(itemIndex), ["target"] = SafeCharacterName(target) }); return true; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] SpawnToBackpackSlotFor: " + ex.Message)); } return false; } } public static bool ClearBackpackSlotFor(Character target, int slot) { try { BackpackData val = BackpackDataFor(target, create: false); if (val == null || val.itemSlots == null || slot < 0 || slot >= val.itemSlots.Length) { return false; } val.itemSlots[slot].prefab = null; val.itemSlots[slot].data = null; SyncTargetInventory(target); ActionTracker.Track("inventory_clear_backpack", null, new Dictionary { ["slot"] = slot, ["target"] = SafeCharacterName(target) }); return true; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ClearBackpackSlotFor: " + ex.Message)); } return false; } } public static void RechargeBackpackSlotFor(Character target, int slot, float value) { try { BackpackData val = BackpackDataFor(target, create: false); if (val != null && val.itemSlots != null && slot >= 0 && slot < val.itemSlots.Length) { RechargeItemSlotData(val.itemSlots[slot], value); SyncTargetInventory(target); ActionTracker.Track("inventory_recharge_backpack", value, new Dictionary { ["slot"] = slot, ["target"] = SafeCharacterName(target) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] RechargeBackpackSlotFor: " + ex.Message)); } } } private static BackpackData BackpackDataFor(Character c, bool create) { try { Player val = TargetPlayer(c); if ((Object)(object)val == (Object)null || val.backpackSlot == null || ((ItemSlot)val.backpackSlot).IsEmpty() || ((ItemSlot)val.backpackSlot).data == null) { return null; } BackpackData result = default(BackpackData); if (((ItemSlot)val.backpackSlot).data.TryGetDataEntry((DataEntryKey)7, ref result)) { return result; } return create ? ((ItemSlot)val.backpackSlot).data.RegisterNewEntry((DataEntryKey)7) : null; } catch { return null; } } private static void SyncTargetInventory(Character c) { Player val = TargetPlayer(c); if (!((Object)(object)val == (Object)null)) { SyncInventory(val, (RpcTarget)(IsLocal(c) ? 1 : 0)); } } public static CustomizationOption[] GetCosmeticOptions(CosmeticCategory category) { try { Customization val = CustomizationDb(); if ((Object)(object)val == (Object)null) { return Array.Empty(); } return category switch { CosmeticCategory.Skin => val.skins ?? Array.Empty(), CosmeticCategory.Accessory => val.accessories ?? Array.Empty(), CosmeticCategory.Eyes => val.eyes ?? Array.Empty(), CosmeticCategory.Mouth => val.mouths ?? Array.Empty(), CosmeticCategory.Outfit => val.fits ?? Array.Empty(), CosmeticCategory.Hat => val.hats ?? Array.Empty(), CosmeticCategory.Sash => val.sashes ?? Array.Empty(), _ => Array.Empty(), }; } catch { return Array.Empty(); } } public static int GetCurrentCosmeticIndex(CosmeticCategory category) { try { CharacterCustomization val = LocalCustomization(); if ((Object)(object)val == (Object)null) { return -1; } CharacterCustomizationData customizationData = GetCustomizationData(val); return category switch { CosmeticCategory.Skin => customizationData.currentSkin, CosmeticCategory.Accessory => customizationData.currentAccessory, CosmeticCategory.Eyes => customizationData.currentEyes, CosmeticCategory.Mouth => customizationData.currentMouth, CosmeticCategory.Outfit => customizationData.currentOutfit, CosmeticCategory.Hat => customizationData.currentHat, CosmeticCategory.Sash => customizationData.currentSash, _ => -1, }; } catch { return -1; } } public static int FindBlankCosmeticIndex(CosmeticCategory category) { CustomizationOption[] cosmeticOptions = GetCosmeticOptions(category); for (int i = 0; i < cosmeticOptions.Length; i++) { try { if ((Object)(object)cosmeticOptions[i] != (Object)null && cosmeticOptions[i].isBlank) { return i; } } catch { } } return -1; } public static bool IsCosmeticOptionGrantable(CosmeticCategory category, int index) { CustomizationOption[] cosmeticOptions = GetCosmeticOptions(category); if (index >= 0 && index < cosmeticOptions.Length) { return IsCosmeticOptionGrantable(category, cosmeticOptions[index]); } return false; } public static bool IsCosmeticOptionGrantable(CosmeticCategory category, CustomizationOption option) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)option == (Object)null) { return false; } try { if (option.isBlank) { return true; } if (option.type != ExpectedCosmeticType(category)) { return false; } if (!HasKnownCosmeticRequirement(option)) { return false; } if (!HasCosmeticUnlockRequirement(option)) { return false; } return HasCosmeticVisual(category, option); } catch { return false; } } private static Type ExpectedCosmeticType(CosmeticCategory category) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) return (Type)(category switch { CosmeticCategory.Skin => 0, CosmeticCategory.Accessory => 10, CosmeticCategory.Eyes => 20, CosmeticCategory.Mouth => 30, CosmeticCategory.Outfit => 40, CosmeticCategory.Hat => 50, CosmeticCategory.Sash => 60, _ => 0, }); } private static bool HasCosmeticVisual(CosmeticCategory category, CustomizationOption option) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0096: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)option == (Object)null) { return false; } if ((Object)(object)option.texture != (Object)null) { return true; } if ((Object)(object)option.fitMesh != (Object)null || (Object)(object)option.fitMaterial != (Object)null || (Object)(object)option.fitMaterialShoes != (Object)null) { return true; } if ((Object)(object)option.fitMaterialOverridePants != (Object)null || (Object)(object)option.fitMaterialOverrideHat != (Object)null) { return true; } if (category == CosmeticCategory.Skin) { Color color = option.color; if (!(color.a > 0.01f) && !(color.r > 0.01f) && !(color.g > 0.01f)) { return color.b > 0.01f; } return true; } return false; } private static bool HasKnownCosmeticRequirement(CustomizationOption option) { string a = ((object)Unsafe.As(ref option.customRequirement)/*cast due to .constrained prefix*/).ToString(); if (!string.Equals(a, "None", StringComparison.OrdinalIgnoreCase) && !string.Equals(a, "Goat", StringComparison.OrdinalIgnoreCase)) { return string.Equals(a, "Crown", StringComparison.OrdinalIgnoreCase); } return true; } private static bool HasCosmeticUnlockRequirement(CustomizationOption option) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)option == (Object)null || option.isBlank) { return false; } if (option.requiresAscent) { return true; } if (option.requiresSteamStat) { return true; } if ((int)option.requiredAchievement != 0) { return true; } string a = ((object)Unsafe.As(ref option.customRequirement)/*cast due to .constrained prefix*/).ToString(); if (!string.Equals(a, "Goat", StringComparison.OrdinalIgnoreCase)) { return string.Equals(a, "Crown", StringComparison.OrdinalIgnoreCase); } return true; } public static bool SetCosmetic(CosmeticCategory category, int index) { try { CharacterCustomization val = LocalCustomization(); CustomizationOption[] cosmeticOptions = GetCosmeticOptions(category); if ((Object)(object)val == (Object)null || index < 0 || index >= cosmeticOptions.Length) { return false; } if (!IsCosmeticOptionGrantable(category, cosmeticOptions[index])) { return false; } CharacterCustomizationData customizationData = GetCustomizationData(val); switch (category) { case CosmeticCategory.Skin: customizationData.currentSkin = index; InvokeCustomizationSetter(val, CustomSetSkin, index); break; case CosmeticCategory.Accessory: customizationData.currentAccessory = index; InvokeCustomizationSetter(val, CustomSetAccessory, index); break; case CosmeticCategory.Eyes: customizationData.currentEyes = index; InvokeCustomizationSetter(val, CustomSetEyes, index); break; case CosmeticCategory.Mouth: customizationData.currentMouth = index; InvokeCustomizationSetter(val, CustomSetMouth, index); break; case CosmeticCategory.Outfit: customizationData.currentOutfit = index; InvokeCustomizationSetter(val, CustomSetOutfit, index); break; case CosmeticCategory.Hat: customizationData.currentHat = index; InvokeCustomizationSetter(val, CustomSetHat, index); break; case CosmeticCategory.Sash: customizationData.currentSash = index; InvokeCustomizationSetter(val, CustomSetSash, index); break; default: return false; } customizationData.CorrectValues(); SetCustomizationData(val, customizationData); return true; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] SetCosmetic: " + ex.Message)); } return false; } } public static bool UnlockCosmeticOption(CustomizationOption option) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)option == (Object)null) { return false; } LocalCosmeticUnlocks.Add(((Object)option).GetInstanceID()); bool flag = false; try { if (option.requiresAscent) { SteamAch.SetMaxAscent(Mathf.Max(0, option.requiredAscent)); flag = true; } } catch { } try { if (option.requiresSteamStat) { SteamAch.SetStatValue(option.requiredSteamStat, Mathf.Max(1, option.requiredSteamStatValue)); flag = true; } } catch { } try { if ((int)option.requiredAchievement != 0) { SteamAch.Unlock(option.requiredAchievement); flag = true; } } catch { } try { string a = ((object)Unsafe.As(ref option.customRequirement)/*cast due to .constrained prefix*/).ToString(); if (string.Equals(a, "Goat", StringComparison.OrdinalIgnoreCase)) { SteamAch.SetMaxAscent(8); flag = true; } else if (string.Equals(a, "Crown", StringComparison.OrdinalIgnoreCase)) { SteamAch.UnlockAll(); flag = true; } } catch { } try { option.testLocked = false; } catch { } ActionTracker.Track("cosmetic_unlock_one", null, new Dictionary { ["name"] = SafeCosmeticName(option), ["changedRequirement"] = flag }); return true; } public static bool LockCosmeticOption(CustomizationOption option) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)option == (Object)null) { return false; } bool flag = false; LocalCosmeticUnlocks.Remove(((Object)option).GetInstanceID()); try { if ((int)option.requiredAchievement != 0) { SteamAch.Revoke(option.requiredAchievement); flag = true; } } catch { } try { if (option.requiresSteamStat) { SteamAch.SetStatValue(option.requiredSteamStat, 0); flag = true; } } catch { } try { if (option.requiresAscent) { SteamAch.SetMaxAscent(Mathf.Max(0, option.requiredAscent - 1)); flag = true; } } catch { } try { if (string.Equals(((object)Unsafe.As(ref option.customRequirement)/*cast due to .constrained prefix*/).ToString(), "Goat", StringComparison.OrdinalIgnoreCase)) { SteamAch.SetMaxAscent(0); flag = true; } } catch { } try { option.testLocked = true; } catch { } ActionTracker.Track("cosmetic_lock_one", null, new Dictionary { ["name"] = SafeCosmeticName(option), ["changedRequirement"] = flag }); return true; } public static void UnlockAllCosmeticOptions() { int num = 0; try { foreach (CosmeticCategory value in Enum.GetValues(typeof(CosmeticCategory))) { CustomizationOption[] cosmeticOptions = GetCosmeticOptions(value); foreach (CustomizationOption val in cosmeticOptions) { if (IsCosmeticOptionGrantable(value, val)) { LocalCosmeticUnlocks.Add(((Object)val).GetInstanceID()); num++; } } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] UnlockAllCosmeticOptions local: " + ex.Message)); } } try { SteamAch.UnlockAllCosmetics(); } catch { } ActionTracker.Track("cosmetic_unlock_all_local", num); } public static bool IsCosmeticLocallyUnlocked(CustomizationOption option) { try { return (Object)(object)option != (Object)null && LocalCosmeticUnlocks.Contains(((Object)option).GetInstanceID()); } catch { return false; } } private static string SafeCosmeticName(CustomizationOption option) { try { return ((Object)(object)option != (Object)null && !string.IsNullOrWhiteSpace(((Object)option).name)) ? ((Object)option).name : "Unknown"; } catch { return "Unknown"; } } private static CharacterCustomizationData GetCustomizationData(CharacterCustomization cc) { if (CustomGetData == null) { return null; } object obj = (CustomGetData.IsStatic ? null : cc); object? obj2 = CustomGetData.Invoke(obj, new object[1] { PhotonNetwork.LocalPlayer }); CharacterCustomizationData val = (CharacterCustomizationData)((obj2 is CharacterCustomizationData) ? obj2 : null); if (val == null) { return null; } return val; } private static void SetCustomizationData(CharacterCustomization cc, CharacterCustomizationData data) { if (!(CustomSetData == null)) { object obj = (CustomSetData.IsStatic ? null : cc); CustomSetData.Invoke(obj, new object[2] { data, PhotonNetwork.LocalPlayer }); } } private static void InvokeCustomizationSetter(CharacterCustomization cc, MethodInfo method, int index) { if (!(method == null)) { object obj = (method.IsStatic ? null : cc); method.Invoke(obj, new object[1] { index }); } } public static void RefreshPlayers() { try { PlayerChars.Clear(); PlayerNames.Clear(); List allCharacters = Character.AllCharacters; if (allCharacters == null) { return; } foreach (Character item in allCharacters) { if ((Object)(object)item == (Object)null) { continue; } bool flag = false; try { flag = (Object)(object)((MonoBehaviourPun)item).photonView != (Object)null; } catch { } if (!flag) { continue; } bool flag2 = false; for (int i = 0; i < PlayerChars.Count; i++) { if ((Object)(object)PlayerChars[i] == (Object)(object)item) { flag2 = true; break; } } if (flag2) { continue; } PlayerChars.Add(item); string text = null; try { text = item.characterName; } catch { } if (string.IsNullOrWhiteSpace(text)) { try { PhotonView photonView = ((MonoBehaviourPun)item).photonView; object obj3; if (photonView == null) { obj3 = null; } else { Player owner = photonView.Owner; obj3 = ((owner != null) ? owner.NickName : null); } text = (string)obj3; } catch { } } PlayerNames.Add(string.IsNullOrWhiteSpace(text) ? "Unknown" : text); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] RefreshPlayers: " + ex.Message)); } } } public static void ReviveSelf() { if ((Object)(object)Character.localCharacter != (Object)null) { RevivePlayer(Character.localCharacter); } } public static void KillSelf() { if ((Object)(object)Character.localCharacter != (Object)null) { KillPlayer(Character.localCharacter); } } public static void WarpToSpawn() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) try { Character localCharacter = Character.localCharacter; Transform val = (((Object)(object)localCharacter != (Object)null) ? localCharacter.data.spawnPoint : null); if (!((Object)(object)val == (Object)null)) { ((MonoBehaviourPun)localCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val.position + new Vector3(0f, 2f, 0f), true }); ActionTracker.Track("warp_spawn"); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] WarpToSpawn: " + ex.Message)); } } } public static void WarpPlayerToSpawn(Character c) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)c == (Object)null)) { Transform val = (((Object)(object)c.data != (Object)null) ? c.data.spawnPoint : null); if (!((Object)(object)val == (Object)null)) { ((MonoBehaviourPun)c).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val.position + new Vector3(0f, 2f, 0f), true }); ActionTracker.Track("warp_player_spawn", null, new Dictionary { ["target"] = SafeCharacterName(c) }); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] WarpPlayerToSpawn: " + ex.Message)); } } } public static void TeleportToCoords(float x, float y, float z) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) try { Character localCharacter = Character.localCharacter; if (!((Object)(object)localCharacter == (Object)null) && !localCharacter.data.dead) { ((MonoBehaviourPun)localCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { (object)new Vector3(x, y, z), true }); ActionTracker.Track("warp_coords", null, new Dictionary { ["x"] = x, ["y"] = y, ["z"] = z }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] TeleportToCoords: " + ex.Message)); } } } public static void KillPlayer(Character c) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)c != (Object)null) { ((MonoBehaviourPun)c).photonView.RPC("RPCA_Die", (RpcTarget)0, new object[1] { ((Component)c).transform.position }); } if ((Object)(object)c != (Object)null) { ActionTracker.Track("player_kill", null, new Dictionary { ["target"] = SafeCharacterName(c) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] KillPlayer: " + ex.Message)); } } } public static void RevivePlayer(Character c) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)c == (Object)null)) { Vector3 val = (((Object)(object)c.Ghost != (Object)null) ? ((Component)c.Ghost).transform.position : c.Head) + new Vector3(0f, 4f, 0f); ((MonoBehaviourPun)c).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[3] { val, false, -1 }); ActionTracker.Track("player_revive", null, new Dictionary { ["target"] = SafeCharacterName(c) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] RevivePlayer: " + ex.Message)); } } } public static void KickPlayer(Character c) { try { if (IsHost() && !((Object)(object)c == (Object)null) && !IsLocal(c)) { Player val = PlayerOf(c); PhotonView val2 = (((Object)(object)val != (Object)null) ? ((MonoBehaviourPun)val).photonView : null); Player val3 = (((Object)(object)val2 != (Object)null) ? val2.Owner : null); if (!((Object)(object)val2 == (Object)null) && val3 != null) { val2.RPC("RPC_GetKicked", val3, new object[0]); ActionTracker.Track("admin_kick", null, new Dictionary { ["target"] = SafeCharacterName(c) }); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] KickPlayer: " + ex.Message)); } } } public static void BanPlayer(Character c) { try { if (IsHost() && !((Object)(object)c == (Object)null) && !IsLocal(c)) { string text = PlayerBanId(c); if (!string.IsNullOrWhiteSpace(text)) { SessionBans.Add(text); SessionBanNames[text] = SafeCharacterName(c); AddAdminLog(SafeCharacterName(c) + ": session ban"); } KickPlayer(c); ActionTracker.Track("admin_ban_session", null, new Dictionary { ["target"] = SafeCharacterName(c) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] BanPlayer: " + ex.Message)); } } } public static bool IsSessionBanned(Character c) { string text = PlayerBanId(c); if (!string.IsNullOrWhiteSpace(text)) { return SessionBans.Contains(text); } return false; } public static void ToggleSessionBan(Character c) { try { if ((Object)(object)c == (Object)null || IsLocal(c)) { return; } string text = PlayerBanId(c); if (string.IsNullOrWhiteSpace(text)) { return; } if (SessionBans.Contains(text)) { UnbanSession(text); return; } SessionBans.Add(text); SessionBanNames[text] = SafeCharacterName(c); AddAdminLog(SafeCharacterName(c) + ": session ban"); if (IsHost()) { KickPlayer(c); } ActionTracker.Track("admin_toggle_ban", 1.0, new Dictionary { ["target"] = SafeCharacterName(c) }); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ToggleSessionBan: " + ex.Message)); } } } public static void UnbanSession(string key) { if (!string.IsNullOrWhiteSpace(key)) { string value; string text = (SessionBanNames.TryGetValue(key, out value) ? value : key); SessionBans.Remove(key); SessionBanNames.Remove(key); AddAdminLog(text + ": session unban"); ActionTracker.Track("admin_unban_session", null, new Dictionary { ["target"] = text }); } } public static List SessionBanEntries() { List list = new List(); foreach (string sessionBan in SessionBans) { string value; string label = ((SessionBanNames.TryGetValue(sessionBan, out value) && !string.IsNullOrWhiteSpace(value)) ? value : sessionBan); list.Add(new AdminListEntry(sessionBan, label)); } return list; } public static void ToggleMute(Character c) { try { Player val = OwnerOf(c); if (val != null && val != PhotonNetwork.LocalPlayer) { SetMuted(val, !IsMuted(c)); ActionTracker.Track("admin_toggle_mute", null, new Dictionary { ["target"] = SafeCharacterName(c), ["muted"] = IsMuted(c) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ToggleMute: " + ex.Message)); } } } public static bool IsMuted(Character c) { try { Player val = OwnerOf(c); if (val == null) { return false; } if (((object)val).GetType().GetProperty("CustomProperties")?.GetValue(val, null) is IDictionary dictionary && dictionary.Contains("mu")) { object obj = dictionary["mu"]; bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } return false; } catch { return false; } } private static void SetMuted(Player player, bool muted) { if (player == null) { return; } Type type = Type.GetType("ExitGames.Client.Photon.Hashtable, Photon3Unity3D"); if (!(type == null)) { object obj = Activator.CreateInstance(type); if (obj is IDictionary dictionary) { dictionary["mu"] = muted; } ((object)player).GetType().GetMethod("SetCustomProperties", new Type[1] { type })?.Invoke(player, new object[1] { obj }); } } public static bool IsFrozen(Character c) { string text = FreezeKey(c); if (!string.IsNullOrWhiteSpace(text)) { return FrozenPlayers.ContainsKey(text); } return false; } public static void ToggleFreeze(Character c) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)c == (Object)null) { return; } string text = FreezeKey(c); if (!string.IsNullOrWhiteSpace(text)) { bool flag; if (FrozenPlayers.ContainsKey(text)) { FrozenPlayers.Remove(text); flag = false; } else { FrozenPlayers[text] = SafePosition(c); flag = true; } ActionTracker.Track("admin_toggle_freeze", flag ? 1 : 0, new Dictionary { ["target"] = SafeCharacterName(c) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ToggleFreeze: " + ex.Message)); } } } public static void ApplyFrozenPlayers(float deltaTime) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) try { if (FrozenPlayers.Count == 0) { return; } _freezeRpcTimer += Mathf.Max(0f, deltaTime); bool flag = _freezeRpcTimer >= 0.2f; if (flag) { _freezeRpcTimer = 0f; } KeyValuePair[] array = FrozenPlayers.ToArray(); for (int i = 0; i < array.Length; i++) { KeyValuePair keyValuePair = array[i]; Character val = FindFrozenCharacter(keyValuePair.Key); if (!((Object)(object)val == (Object)null)) { FreezeCharacter(val, keyValuePair.Value, flag); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ApplyFrozenPlayers: " + ex.Message)); } } } public static bool IsInventoryLocked(Character c) { string text = AdminCharacterKey(c); if (!string.IsNullOrWhiteSpace(text)) { return InventoryLocks.Contains(text); } return false; } public static void ToggleInventoryLock(Character c) { try { if ((Object)(object)c == (Object)null) { return; } string text = AdminCharacterKey(c); if (!string.IsNullOrWhiteSpace(text)) { string text2 = SafeCharacterName(c); bool flag; if (InventoryLocks.Contains(text)) { InventoryLocks.Remove(text); InventoryLockNames.Remove(text); flag = false; AddAdminLog(text2 + ": inventory unlock"); } else { InventoryLocks.Add(text); InventoryLockNames[text] = text2; flag = true; AddAdminLog(text2 + ": inventory lock"); DropAllInventory(c, track: false); } ActionTracker.Track("admin_toggle_inventory_lock", flag ? 1 : 0, new Dictionary { ["target"] = text2 }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ToggleInventoryLock: " + ex.Message)); } } } public static void UnlockInventoryLock(string key) { if (!string.IsNullOrWhiteSpace(key)) { string value; string text = (InventoryLockNames.TryGetValue(key, out value) ? value : key); InventoryLocks.Remove(key); InventoryLockNames.Remove(key); AddAdminLog(text + ": inventory unlock"); ActionTracker.Track("admin_inventory_unlock", null, new Dictionary { ["target"] = text }); } } public static List InventoryLockEntries() { List list = new List(); foreach (string inventoryLock in InventoryLocks) { string value; string label = ((InventoryLockNames.TryGetValue(inventoryLock, out value) && !string.IsNullOrWhiteSpace(value)) ? value : inventoryLock); list.Add(new AdminListEntry(inventoryLock, label)); } return list; } public static void ApplyInventoryLocks(float deltaTime) { try { if (InventoryLocks.Count == 0) { return; } _inventoryLockTimer += Mathf.Max(0f, deltaTime); if (_inventoryLockTimer < 0.45f) { return; } _inventoryLockTimer = 0f; string[] array = InventoryLocks.ToArray(); for (int i = 0; i < array.Length; i++) { Character val = FindFrozenCharacter(array[i]); if (!((Object)(object)val == (Object)null)) { DropAllInventory(val, track: false); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ApplyInventoryLocks: " + ex.Message)); } } } private static string FreezeKey(Character c) { return AdminCharacterKey(c); } private static string AdminCharacterKey(Character c) { if ((Object)(object)c == (Object)null) { return ""; } if (IsLocal(c)) { return "local"; } return PlayerBanId(c); } private static Character FindFrozenCharacter(string key) { if (string.Equals(key, "local", StringComparison.Ordinal)) { return Character.localCharacter; } List allCharacters = Character.AllCharacters; if (allCharacters == null) { return null; } for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if ((Object)(object)val != (Object)null && string.Equals(PlayerBanId(val), key, StringComparison.Ordinal)) { return val; } } return null; } private static Vector3 SafePosition(Character c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) try { return c.Center; } catch { try { return ((Component)c).transform.position; } catch { return Vector3.zero; } } } private static void FreezeCharacter(Character c, Vector3 position, bool sendRpc) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)c == (Object)null) { return; } HaltCharacter(c); try { if (Vector3.Distance(c.Center, position) > 0.08f && (Object)(object)c.refs?.ragdoll != (Object)null) { c.refs.ragdoll.MoveAllRigsInDirection(position - c.Center); } } catch { } if (!(!IsLocal(c) && IsHost() && sendRpc)) { return; } try { ((MonoBehaviourPun)c).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { position, false }); } catch { } } private static void HaltCharacter(Character c) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) try { CharacterRefs refs = c.refs; if (refs != null) { CharacterRagdoll ragdoll = refs.ragdoll; if (ragdoll != null) { ragdoll.HaltBodyVelocity(); } } } catch { } try { List list = c.refs?.ragdoll?.partList; if (list == null) { return; } for (int i = 0; i < list.Count; i++) { Rigidbody val = (((Object)(object)list[i] != (Object)null) ? list[i].Rig : null); if (!((Object)(object)val == (Object)null) && !val.isKinematic) { val.linearVelocity = Vector3.zero; val.angularVelocity = Vector3.zero; } } } catch { } } public static void EnforceSessionBans() { try { if (!IsHost() || SessionBans.Count == 0) { return; } RefreshPlayers(); for (int i = 0; i < PlayerChars.Count; i++) { Character val = PlayerChars[i]; if (!((Object)(object)val == (Object)null) && !IsLocal(val)) { string text = PlayerBanId(val); if (!string.IsNullOrWhiteSpace(text) && SessionBans.Contains(text)) { KickPlayer(val); } } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] EnforceSessionBans: " + ex.Message)); } } } public static void EnforceAdminProtection() { try { if (ModConfig.AdminProtectionEnabled && IsHost()) { if (ModConfig.AdminAutoKickSessionBans) { EnforceSessionBans(); } if (ModConfig.AdminDetectExtremeMovement) { CheckExtremeMovement(); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] EnforceAdminProtection: " + ex.Message)); } } } private static void CheckExtremeMovement() { //IL_00a1: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) RefreshPlayers(); float realtimeSinceStartup = Time.realtimeSinceStartup; float num = Mathf.Max(5f, ModConfig.AdminMaxSpeed); int num2 = Mathf.Clamp(ModConfig.AdminSpeedStrikes, 1, 10); for (int i = 0; i < PlayerChars.Count; i++) { Character val = PlayerChars[i]; if ((Object)(object)val == (Object)null || IsLocal(val) || IsFrozen(val)) { continue; } try { if ((Object)(object)val.data != (Object)null && val.data.dead) { continue; } } catch { } string text = PlayerBanId(val); if (string.IsNullOrWhiteSpace(text)) { continue; } Vector3 val2 = SafePosition(val); if (AdminMotion.TryGetValue(text, out var value)) { float num3 = Mathf.Max(0.001f, realtimeSinceStartup - value.Time); float num4 = Vector3.Distance(val2, value.Position) / num3; int value3; if (num4 > num) { int value2; int num5 = ((!AdminStrikes.TryGetValue(text, out value2)) ? 1 : (value2 + 1)); AdminStrikes[text] = num5; AddAdminLog($"{SafeCharacterName(val)}: speed {num4:0.0} m/s ({num5}/{num2})"); if (!ModConfig.AdminWarnOnly && num5 >= num2) { AddAdminLog(SafeCharacterName(val) + ": auto-kick by admin protection"); KickPlayer(val); AdminStrikes[text] = 0; } } else if (AdminStrikes.TryGetValue(text, out value3) && value3 > 0) { AdminStrikes[text] = value3 - 1; } } AdminMotion[text] = new AdminMotionSample { Position = val2, Time = realtimeSinceStartup }; } } public static void AddAdminLog(string message) { if (!string.IsNullOrWhiteSpace(message)) { string item = DateTime.Now.ToString("HH:mm:ss") + " " + message; AdminProtectionLog.Insert(0, item); while (AdminProtectionLog.Count > 18) { AdminProtectionLog.RemoveAt(AdminProtectionLog.Count - 1); } ManualLogSource log = Plugin.Log; if (log != null) { log.LogInfo((object)("[AdminProtection] " + message)); } } } private static Player OwnerOf(Character c) { try { object result; if (!((Object)(object)c != (Object)null)) { result = null; } else { PhotonView photonView = ((MonoBehaviourPun)c).photonView; result = ((photonView != null) ? photonView.Owner : null); } return (Player)result; } catch { return null; } } private static string PlayerBanId(Character c) { Player val = OwnerOf(c); if (val == null) { return ""; } if (!string.IsNullOrWhiteSpace(val.UserId)) { return "uid:" + val.UserId; } if (!string.IsNullOrWhiteSpace(val.NickName)) { return "nick:" + val.NickName; } return "actor:" + val.ActorNumber; } public static void WarpToPlayer(Character c) { //IL_001c: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)c == (Object)null) && !((Object)(object)Character.localCharacter == (Object)null)) { Vector3 val = c.Head + new Vector3(0f, 4f, 0f); ((MonoBehaviourPun)Character.localCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val, true }); ActionTracker.Track("warp_to_player", null, new Dictionary { ["target"] = SafeCharacterName(c) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] WarpToPlayer: " + ex.Message)); } } } public static void BringPlayer(Character c) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)c == (Object)null) && !((Object)(object)Character.localCharacter == (Object)null)) { Vector3 val = Character.localCharacter.Head + new Vector3(0f, 4f, 0f); ((MonoBehaviourPun)c).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val, true }); ActionTracker.Track("bring_player", null, new Dictionary { ["target"] = SafeCharacterName(c) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] BringPlayer: " + ex.Message)); } } } public static void ReviveAll() { RefreshPlayers(); foreach (Character playerChar in PlayerChars) { RevivePlayer(playerChar); } ActionTracker.Track("revive_all", PlayerChars.Count); } public static void WarpAllToMe() { RefreshPlayers(); foreach (Character playerChar in PlayerChars) { if ((Object)(object)playerChar != (Object)null && !playerChar.IsLocal) { BringPlayer(playerChar); } } ActionTracker.Track("bring_all", PlayerChars.Count); } public static void KillAll(bool excludeSelf) { RefreshPlayers(); int num = 0; foreach (Character playerChar in PlayerChars) { if ((Object)(object)playerChar == (Object)null) { continue; } if (excludeSelf) { try { if (playerChar.IsLocal) { continue; } } catch { } } KillPlayer(playerChar); num++; } ActionTracker.Track("kill_all", num, new Dictionary { ["excludeSelf"] = excludeSelf }); } public static void RechargeSlot(int slot, float value) { try { Player localPlayer = Player.localPlayer; if (!((Object)(object)localPlayer == (Object)null) && localPlayer.itemSlots != null && slot >= 0 && slot < localPlayer.itemSlots.Length) { RechargeItemSlotData(localPlayer.itemSlots[slot], value); SyncInventory(localPlayer); ActionTracker.Track("inventory_recharge", value, new Dictionary { ["slot"] = slot }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] RechargeSlot: " + ex.Message)); } } } public static void RechargeSlotFor(Character target, int slot, float value) { try { if (IsLocal(target)) { RechargeSlot(slot, value); return; } Player val = PlayerOf(target); if (!((Object)(object)val == (Object)null) && val.itemSlots != null && slot >= 0 && slot < val.itemSlots.Length) { RechargeItemSlotData(val.itemSlots[slot], value); SyncInventory(val, (RpcTarget)0); ActionTracker.Track("inventory_recharge_remote", value, new Dictionary { ["slot"] = slot, ["target"] = SafeCharacterName(target) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] RechargeSlotFor: " + ex.Message)); } } } private static void RechargeItemSlotData(ItemSlot slot, float value) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected I4, but got Unknown Dictionary dictionary = slot?.data?.data; if (dictionary == null) { return; } foreach (KeyValuePair item in dictionary) { int num = (int)item.Key; if (num == 12) { DataEntryValue value2 = item.Value; IntItemData val = (IntItemData)(object)((value2 is IntItemData) ? value2 : null); if (val != null) { val.Value = (int)value; continue; } } if (num == 10) { DataEntryValue value3 = item.Value; FloatItemData val2 = (FloatItemData)(object)((value3 is FloatItemData) ? value3 : null); if (val2 != null) { val2.Value = value; continue; } } if (num == 11) { DataEntryValue value4 = item.Value; FloatItemData val3 = (FloatItemData)(object)((value4 is FloatItemData) ? value4 : null); if (val3 != null) { val3.Value = value; continue; } } if (num == 2) { DataEntryValue value5 = item.Value; OptionableIntItemData val4 = (OptionableIntItemData)(object)((value5 is OptionableIntItemData) ? value5 : null); if (val4 != null) { val4.Value = (int)value; } } } } public static void RefreshLuggage() { //IL_003f: 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_0069: 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) try { LuggageLabels.Clear(); LuggageObjects.Clear(); Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null) { return; } List aLL_LUGGAGE = Luggage.ALL_LUGGAGE; if (aLL_LUGGAGE == null || aLL_LUGGAGE.Count == 0) { return; } Vector3 head = localCharacter.Head; List> list = new List>(); foreach (Luggage item in aLL_LUGGAGE) { if ((Object)(object)item == (Object)null) { continue; } try { float num = Vector3.Distance(head, item.Center()); if (num <= 300f) { list.Add(new KeyValuePair(item, num)); } } catch { } } list.Sort((KeyValuePair a, KeyValuePair b) => a.Value.CompareTo(b.Value)); foreach (KeyValuePair item2 in list) { LuggageObjects.Add(item2.Key); LuggageLabels.Add(string.Format("{0} [{1:F0}m]", item2.Key.displayName ?? "Container", item2.Value)); } ActionTracker.Track("luggage_refresh", LuggageObjects.Count); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] RefreshLuggage: " + ex.Message)); } } } public static void OpenLuggage(int index) { try { if (index < 0 || index >= LuggageObjects.Count) { return; } Luggage val = LuggageObjects[index]; if (!((Object)(object)val == (Object)null)) { PhotonView component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.RPC("OpenLuggageRPC", (RpcTarget)0, new object[1] { true }); } ActionTracker.Track("luggage_open", null, new Dictionary { ["label"] = SafeLuggageName(val) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] OpenLuggage: " + ex.Message)); } } } public static void OpenAllNearbyLuggage() { for (int i = 0; i < LuggageObjects.Count; i++) { OpenLuggage(i); } ActionTracker.Track("luggage_open_all", LuggageObjects.Count); } public static void WarpToLuggage(int index) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) try { if (index >= 0 && index < LuggageObjects.Count) { Luggage val = LuggageObjects[index]; Character localCharacter = Character.localCharacter; if (!((Object)(object)val == (Object)null) && !((Object)(object)localCharacter == (Object)null)) { ((MonoBehaviourPun)localCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val.Center() + new Vector3(0f, 2f, 0f), true }); ActionTracker.Track("luggage_warp", null, new Dictionary { ["label"] = SafeLuggageName(val) }); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] WarpToLuggage: " + ex.Message)); } } } public static float ExpeditionTimeSeconds() { try { return ((Object)(object)RunManager.Instance != (Object)null) ? RunManager.Instance.timeSinceRunStarted : 0f; } catch { return 0f; } } public static void SetExpeditionTime(float seconds) { try { RunManager instance = RunManager.Instance; if (!((Object)(object)instance == (Object)null)) { seconds = Mathf.Max(0f, seconds); instance.timeSinceRunStarted = seconds; if (PhotonNetwork.IsMasterClient) { ((MonoBehaviourPun)instance).photonView.RPC("RPC_SyncTime", (RpcTarget)0, new object[2] { seconds, true }); } ActionTracker.Track("world_set_run_time", seconds); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] SetExpeditionTime: " + ex.Message)); } } } public static float TimeOfDay() { try { return ((Object)(object)DayNightManager.instance != (Object)null) ? DayNightManager.instance.timeOfDay : 0f; } catch { return 0f; } } public static int DayCount() { try { return ((Object)(object)DayNightManager.instance != (Object)null) ? DayNightManager.instance.dayCount : 0; } catch { return 0; } } public static void SetTimeOfDay(float hour) { try { DayNightManager instance = DayNightManager.instance; if ((Object)(object)instance == (Object)null) { return; } float num = Mathf.Repeat(hour, 24f); DayNightManager.SetTimeOfDay(num); instance.setTimeOfDay(num); instance.UpdateCycle(); try { FieldInfo field = typeof(DayNightManager).GetField("photonView", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { object? value = field.GetValue(instance); PhotonView val = (PhotonView)((value is PhotonView) ? value : null); if (val != null) { val.RPC("RPCA_SyncTime", (RpcTarget)0, new object[1] { num }); } } } catch { } ActionTracker.Track("world_set_time_of_day", num); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] SetTimeOfDay: " + ex.Message)); } } } public static void ForceWin() { try { Character localCharacter = Character.localCharacter; if (!((Object)(object)localCharacter == (Object)null)) { ((MonoBehaviourPun)localCharacter).photonView.RPC("RPCEndGame_ForceWin", (RpcTarget)0, new object[0]); ActionTracker.Track("world_force_win"); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] ForceWin: " + ex.Message)); } } } public static void SpawnScoutmaster(Character target) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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) //IL_0086: 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) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) try { if (!PhotonNetwork.IsMasterClient) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)"[GameApi] Scoutmaster: host only"); } } else { RaycastHit val = default(RaycastHit); if ((Object)(object)target == (Object)null || !Physics.Raycast(((Component)target).transform.position + new Vector3(Random.Range(-10f, 10f), 25f, Random.Range(-10f, 10f)), Vector3.down, ref val, 100f)) { return; } Vector3 val2 = ((RaycastHit)(ref val)).point + Vector3.up; GameObject val3 = PhotonNetwork.InstantiateRoomObject("Character_Scoutmaster", val2, Quaternion.identity, (byte)0, (object[])null); if (!((Object)(object)val3 == (Object)null)) { Character component = val3.GetComponent(); if ((Object)(object)component != (Object)null) { component.data.spawnPoint = ((Component)component).transform; } Scoutmaster component2 = val3.GetComponent(); if ((Object)(object)component2 != (Object)null) { typeof(Scoutmaster).GetMethod("SetCurrentTarget", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(component2, new object[2] { target, 15f }); } ActionTracker.Track("spawn_scoutmaster", null, new Dictionary { ["target"] = SafeCharacterName(target) }); } } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; if (log2 != null) { log2.LogWarning((object)("[GameApi] SpawnScoutmaster: " + ex.Message)); } } } public static void FullStamina(Character c) { try { if ((Object)(object)c != (Object)null && (Object)(object)c.data != (Object)null) { c.data.currentStamina = 1f; c.data.extraStamina = Mathf.Max(c.data.extraStamina, 0f); } if ((Object)(object)c != (Object)null) { ActionTracker.Track("status_full_stamina", null, new Dictionary { ["target"] = SafeCharacterName(c) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] FullStamina: " + ex.Message)); } } } public static void FullExtraStamina(Character c) { SetExtraStamina(c, 1f); } public static void SetExtraStamina(Character c, float amount) { try { Character val = c ?? Character.localCharacter; if (!((Object)(object)val == (Object)null)) { float num = Mathf.Clamp01(amount); if (IsLocal(val)) { val.SetExtraStamina(num); } else if (IsHost() && (Object)(object)val.data != (Object)null) { val.data.extraStamina = num; } ActionTracker.Track("status_set_extra_stamina", num, new Dictionary { ["target"] = SafeCharacterName(val) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] SetExtraStamina: " + ex.Message)); } } } public static void SetStatus(Character c, int idx, float amount, bool track = true) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) try { CharacterAfflictions val = (((Object)(object)c != (Object)null && c.refs != null) ? c.refs.afflictions : null); if ((Object)(object)val == (Object)null || idx < 0 || idx > 11) { return; } float num = Mathf.Clamp01(amount); STATUSTYPE val2 = (STATUSTYPE)idx; PrepareLocalStatusWrite(c, val2, num); if (IsLocal(c)) { val.SetStatus(val2, num, true); } else { if (!IsHost()) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)"[GameApi] Remote status changes require host/master client."); } return; } float currentStatus = val.GetCurrentStatus(val2); float num2 = num - currentStatus; if (Mathf.Abs(num2) > 0.0001f) { float[] array = new float[CharacterAfflictions.NumStatusTypes]; array[idx] = num2; ((MonoBehaviourPun)val).photonView.RPC("RPC_ApplyStatusesFromFloatArray", (RpcTarget)0, new object[1] { array }); } } if (track) { ActionTracker.Track("status_set", amount, new Dictionary { ["target"] = SafeCharacterName(c), ["status"] = ((idx >= 0 && idx < StatusEn.Length) ? StatusEn[idx] : idx.ToString()) }); } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; if (log2 != null) { log2.LogWarning((object)("[GameApi] SetStatus: " + ex.Message)); } } } private static void PrepareLocalStatusWrite(Character target, STATUSTYPE type, float amount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected I4, but got Unknown if (IsLocal(target) && !(amount <= 0f)) { ModConfig.LockStatus = false; if (ModConfig.NoStatusEffects) { ModConfig.NoStatusEffects = false; } switch ((int)type) { case 0: ModConfig.NoInjury = false; break; case 1: ModConfig.NoHunger = false; break; case 2: ModConfig.NoCold = false; break; case 3: ModConfig.NoPoison = false; break; case 5: ModConfig.NoCurse = false; break; case 6: ModConfig.NoDrowsy = false; break; case 8: ModConfig.NoHot = false; break; case 4: case 7: break; } } } private static void PrepareLocalStatusBatch(Character target) { if (IsLocal(target)) { ModConfig.LockStatus = false; ModConfig.NoStatusEffects = false; ModConfig.NoInjury = false; ModConfig.NoHunger = false; ModConfig.NoCold = false; ModConfig.NoPoison = false; ModConfig.NoCurse = false; ModConfig.NoDrowsy = false; ModConfig.NoHot = false; } } public static void IncreaseStatus(Character c, int idx, float amount) { try { CharacterAfflictions val = (((Object)(object)c != (Object)null && c.refs != null) ? c.refs.afflictions : null); if (!((Object)(object)val == (Object)null) && idx >= 0 && idx <= 11) { float amount2 = Mathf.Clamp01(val.GetCurrentStatus((STATUSTYPE)idx) + Mathf.Max(0f, amount)); SetStatus(c, idx, amount2, track: false); ActionTracker.Track("status_increase", amount, new Dictionary { ["target"] = SafeCharacterName(c), ["status"] = ((idx >= 0 && idx < StatusEn.Length) ? StatusEn[idx] : idx.ToString()) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] IncreaseStatus: " + ex.Message)); } } } public static void IncreaseCommonStatuses(Character c, float amount) { int[] array = new int[7] { 0, 1, 2, 3, 5, 6, 8 }; for (int i = 0; i < array.Length; i++) { IncreaseStatus(c, array[i], amount); } ActionTracker.Track("status_increase_common", amount, new Dictionary { ["target"] = SafeCharacterName(c) }); } public static void ClearAllStatus(Character c) { for (int i = 0; i < 12; i++) { SetStatus(c, i, 0f, track: false); } ActionTracker.Track("status_clear_all", null, new Dictionary { ["target"] = SafeCharacterName(c) }); } public static void PrankAfflict(Character c) { Character val = c ?? Character.localCharacter; if (!((Object)(object)val == (Object)null)) { PrepareLocalStatusBatch(val); SetStatusAtLeast(val, 3, 0.1f); SetStatusAtLeast(val, 5, 0.1f); SetStatusAtLeast(val, 4, 0.1f); SetStatusAtLeast(val, 6, 0.1f); SetStatusAtLeast(val, 11, 0.1f); ActionTracker.Track("prank_afflict", 0.10000000149011612, new Dictionary { ["target"] = SafeCharacterName(val) }); } } private static void SetStatusAtLeast(Character c, int idx, float amount) { try { CharacterAfflictions val = (((Object)(object)c != (Object)null && c.refs != null) ? c.refs.afflictions : null); float num = (((Object)(object)val != (Object)null && idx >= 0 && idx <= 11) ? val.GetCurrentStatus((STATUSTYPE)idx) : 0f); SetStatus(c, idx, Mathf.Max(num, Mathf.Clamp01(amount)), track: false); } catch { SetStatus(c, idx, Mathf.Clamp01(amount), track: false); } } public static void PrankSpawnItems(Character c, int itemIndex, int count) { EnsureItemsLoaded(); Character val = c ?? Character.localCharacter; if ((Object)(object)val == (Object)null || itemIndex < 0 || itemIndex >= Items.Count) { return; } int num = SlotCountFor(val); if (num > 0) { int num2 = Mathf.Clamp(count, 1, num); for (int i = 0; i < num2; i++) { SpawnToSlotFor(val, itemIndex, i); } ActionTracker.Track("prank_spawn_items", num2, new Dictionary { ["target"] = SafeCharacterName(val), ["item"] = SafeItemName(itemIndex) }); } } public static int FindItemIndex(params string[] fragments) { EnsureItemsLoaded(); if (fragments == null || fragments.Length == 0) { return -1; } for (int i = 0; i < ItemNames.Count; i++) { string text = ItemSearchText(i); if (string.IsNullOrWhiteSpace(text)) { continue; } foreach (string text2 in fragments) { if (!string.IsNullOrWhiteSpace(text2) && text.Contains(text2.ToLowerInvariant())) { return i; } } } return -1; } public static int FindGoldenItemIndex() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) EnsureItemsLoaded(); for (int i = 0; i < Items.Count; i++) { try { if ((Object)(object)Items[i] != (Object)null && ((Enum)Items[i].itemTags).HasFlag((Enum)(object)(ItemTags)64)) { return i; } } catch { } } return FindItemIndex("gold", "golden", "idol", "coin", "treasure", "valuable"); } public static int FindWebItemIndex() { int num = FindItemIndex("web", "spider", "silk", "cocoon"); if (num >= 0) { return num; } return FindItemIndexByComponent("Spider", "Web", "Silk"); } public static void FillInventoryWithGold(Character c) { int num = FindGoldenItemIndex(); if (num >= 0) { FillInventoryWith(c, num); return; } ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)"[GameApi] Gold item not found."); } } public static void FillInventoryWithWebs(Character c) { int num = FindWebItemIndex(); if (num >= 0) { FillInventoryWith(c, num); return; } Character c2 = c ?? Character.localCharacter; SetStatusAtLeast(c2, 11, 0.18f); ActionTracker.Track("prank_web_fallback", null, new Dictionary { ["target"] = SafeCharacterName(c2) }); } public static void TieBalloons(Character c, int count) { try { Character val = c ?? Character.localCharacter; CharacterBalloons val2 = val?.refs?.balloons; if (!((Object)(object)val2 == (Object)null)) { int num = Mathf.Clamp(count, 1, 8); int num2 = ((val2.balloonColors == null || val2.balloonColors.Length == 0) ? 1 : val2.balloonColors.Length); for (int i = 0; i < num; i++) { val2.TieNewBalloon(Random.Range(0, num2)); } ActionTracker.Track("prank_tie_balloons", num, new Dictionary { ["target"] = SafeCharacterName(val) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] TieBalloons: " + ex.Message)); } } } public static void DropAllInventory(Character c, bool track = true) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) try { Character val = c ?? Character.localCharacter; if ((Object)(object)val == (Object)null || (Object)(object)val.refs?.items == (Object)null || (Object)(object)val.player == (Object)null) { return; } Vector3 val2 = SafePosition(val) + Vector3.up * 0.8f; int num = 0; int num2 = SlotCountFor(val); for (int i = 0; i < num2; i++) { ItemSlot val3 = ((val.player.itemSlots != null && i < val.player.itemSlots.Length) ? val.player.itemSlots[i] : null); if (val3 != null && !val3.IsEmpty()) { if (!CanDropSlot(val3)) { ClearSlotFor(val, i); continue; } DropSlotByRpc(val, (byte)i, val2 + Vector3.up * (0.35f * (float)num)); num++; } } if (val.player.backpackSlot != null && !((ItemSlot)val.player.backpackSlot).IsEmpty()) { if (CanDropSlot((ItemSlot)(object)val.player.backpackSlot)) { DropSlotByRpc(val, 3, val2 + Vector3.up * (0.35f * (float)num)); num++; } else { ((ItemSlot)val.player.backpackSlot).EmptyOut(); SyncTargetInventory(val); } } if (track) { ActionTracker.Track("prank_drop_inventory", num, new Dictionary { ["target"] = SafeCharacterName(val) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[GameApi] DropAllInventory: " + ex.Message)); } } } private static bool CanDropSlot(ItemSlot slot) { try { if (slot == null || slot.IsEmpty()) { return false; } if ((Object)(object)slot.prefab != (Object)null && slot.prefab.UIData != null && !slot.prefab.UIData.canDrop) { return false; } return HasResourcePrefabName(slot.GetPrefabName()); } catch { return false; } } private static void DropSlotByRpc(Character target, byte slot, Vector3 spawnPosition) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) try { ((MonoBehaviourPun)target.refs.items).photonView.RPC("DropItemFromSlotRPC", (RpcTarget)0, new object[2] { slot, spawnPosition }); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)$"[GameApi] DropSlotByRpc {slot}: {ex.Message}"); } } } private static string ItemSearchText(int index) { try { Item val = ((index >= 0 && index < Items.Count) ? Items[index] : null); string text = ((index >= 0 && index < ItemNames.Count) ? ItemNames[index] : ""); if ((Object)(object)val == (Object)null) { return (text ?? "").ToLowerInvariant(); } return string.Join(" ", text, ((Object)val).name, ((Object)(object)((Component)val).gameObject != (Object)null) ? ((Object)((Component)val).gameObject).name : "", (val.UIData != null) ? val.UIData.itemName : "", ((object)Unsafe.As(ref val.itemTags)/*cast due to .constrained prefix*/).ToString(), ((object)val).GetType().Name).ToLowerInvariant(); } catch { return ""; } } private static int FindItemIndexByComponent(params string[] fragments) { EnsureItemsLoaded(); for (int i = 0; i < Items.Count; i++) { Item val = Items[i]; if ((Object)(object)val == (Object)null) { continue; } try { Component[] componentsInChildren = ((Component)val).GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren.Length; j++) { string text = (((Object)(object)componentsInChildren[j] != (Object)null) ? ((object)componentsInChildren[j]).GetType().Name.ToLowerInvariant() : ""); for (int k = 0; k < fragments.Length; k++) { if (!string.IsNullOrWhiteSpace(fragments[k]) && text.Contains(fragments[k].ToLowerInvariant())) { return i; } } } } catch { } } return -1; } public static void FillInventoryWith(Character c, int itemIndex) { EnsureItemsLoaded(); if (itemIndex < 0 || itemIndex >= Items.Count) { return; } Character val = c ?? Character.localCharacter; int num = (((Object)(object)val != (Object)null) ? SlotCountFor(val) : SlotCount()); if (CanPocketItem(itemIndex)) { for (int i = 0; i < num; i++) { SpawnToSlotFor(val, itemIndex, i); } } int num2 = BackpackSlotCount(val); if (CanBackpackItem(itemIndex)) { for (int j = 0; j < num2; j++) { SpawnToBackpackSlotFor(val, itemIndex, j); } } ActionTracker.Track("prank_fill_inventory", num, new Dictionary { ["target"] = SafeCharacterName(val), ["item"] = SafeItemName(itemIndex), ["backpackSlots"] = num2 }); } public static void FillInventoryWithRandom(Character c) { EnsureItemsLoaded(); if (Items.Count == 0) { return; } Character val = c ?? Character.localCharacter; int num = (((Object)(object)val != (Object)null) ? SlotCountFor(val) : SlotCount()); if (num <= 0) { return; } for (int i = 0; i < num; i++) { int num2 = RandomItemIndexForSlot(backpack: false); if (num2 >= 0) { SpawnToSlotFor(val, num2, i); } } int num3 = BackpackSlotCount(val); for (int j = 0; j < num3; j++) { int num4 = RandomItemIndexForSlot(backpack: true); if (num4 >= 0) { SpawnToBackpackSlotFor(val, num4, j); } } ActionTracker.Track("prank_fill_random_inventory", num, new Dictionary { ["target"] = SafeCharacterName(val), ["backpackSlots"] = num3 }); } public static void ClearInventory(Character c) { Character val = c ?? Character.localCharacter; int num = (((Object)(object)val != (Object)null) ? SlotCountFor(val) : SlotCount()); if (num > 0) { for (int i = 0; i < num; i++) { ClearSlotFor(val, i); } int num2 = BackpackSlotCount(val); for (int j = 0; j < num2; j++) { ClearBackpackSlotFor(val, j); } ActionTracker.Track("prank_clear_inventory", num, new Dictionary { ["target"] = SafeCharacterName(val), ["backpackSlots"] = num2 }); } } public static string PlayerDisplayName(Character c) { return SafeCharacterName(c); } public static bool IsDead(Character c) { try { return (Object)(object)c != (Object)null && (Object)(object)c.data != (Object)null && c.data.dead; } catch { return false; } } public static string PlayerDetails(Character c, bool russian) { if ((Object)(object)c == (Object)null) { if (!russian) { return "No player selected."; } return "Игрок не выбран."; } List list = new List(); string text = SafeCharacterName(c); bool flag = IsDead(c); bool flag2 = IsLocal(c); list.Add(text + ((!flag2) ? "" : (russian ? " (ты)" : " (you)"))); list.Add((!flag) ? (russian ? "Состояние: жив" : "State: alive") : (russian ? "Состояние: мёртв" : "State: dead")); try { if ((Object)(object)c.data != (Object)null) { list.Add((russian ? "Стамина: " : "Stamina: ") + Mathf.RoundToInt(Mathf.Clamp01(c.data.currentStamina) * 100f) + "% + " + Mathf.RoundToInt(Mathf.Max(0f, c.data.extraStamina) * 100f) + "%"); } } catch { } string text2 = StatusSummary(c, russian); if (!string.IsNullOrWhiteSpace(text2)) { list.Add((russian ? "Недуги: " : "Afflictions: ") + text2); } int num = SlotCountFor(c); if (num > 0) { list.Add(russian ? "Инвентарь:" : "Inventory:"); for (int i = 0; i < num; i++) { list.Add(" " + (i + 1) + ". " + DescribeSlot(c, i)); } } int num2 = BackpackSlotCount(c); if (num2 > 0) { list.Add(russian ? "Рюкзак:" : "Backpack:"); for (int j = 0; j < num2; j++) { list.Add(" B" + (j + 1) + ". " + DescribeBackpackSlot(c, j)); } } else { list.Add(russian ? "Рюкзак: нет / не синхронизирован" : "Backpack: none / not synced"); } if (IsMuted(c)) { list.Add(russian ? "Мут: включён" : "Mute: on"); } if (IsFrozen(c)) { list.Add(russian ? "Фриз: включён" : "Freeze: on"); } if (IsInventoryLocked(c)) { list.Add(russian ? "Инвентарь: запрещён" : "Inventory lock: on"); } if (IsSessionBanned(c)) { list.Add(russian ? "Бан: сессионный" : "Ban: session"); } return string.Join("\n", list.ToArray()); } private static string StatusSummary(Character c, bool russian) { try { CharacterAfflictions val = (((Object)(object)c != (Object)null && c.refs != null) ? c.refs.afflictions : null); if ((Object)(object)val == (Object)null) { return ""; } List list = new List(); for (int i = 0; i < 12; i++) { float currentStatus = val.GetCurrentStatus((STATUSTYPE)i); if (!(currentStatus < 0.01f)) { string[] array = (russian ? StatusRu : StatusEn); string text = ((i >= 0 && i < array.Length) ? array[i] : i.ToString()); list.Add(text + " " + Mathf.RoundToInt(currentStatus * 100f) + "%"); } } return string.Join(", ", list.ToArray()); } catch { return ""; } } private static string SafeItemName(int itemIndex) { try { return (itemIndex >= 0 && itemIndex < ItemNames.Count) ? ItemNames[itemIndex] : itemIndex.ToString(); } catch { return itemIndex.ToString(); } } private static string SafeCharacterName(Character c) { try { if ((Object)(object)c == (Object)null) { return "Unknown"; } if (!string.IsNullOrWhiteSpace(c.characterName)) { return c.characterName; } PhotonView photonView = ((MonoBehaviourPun)c).photonView; object obj; if (photonView == null) { obj = null; } else { Player owner = photonView.Owner; obj = ((owner != null) ? owner.NickName : null); } string text = (string)obj; return string.IsNullOrWhiteSpace(text) ? "Unknown" : text; } catch { return "Unknown"; } } private static string SafeLuggageName(Luggage lug) { try { return ((Object)(object)lug != (Object)null && !string.IsNullOrWhiteSpace(lug.displayName)) ? lug.displayName : "Container"; } catch { return "Container"; } } } public enum Lang { English, Russian, Ukrainian, ChineseSimplified, ChineseTraditional, Japanese, Korean, Spanish, PortugueseBR, German, French, Italian, Polish, Turkish } public static class Localization { public static Lang Current = Lang.Russian; public static readonly (Lang lang, string name)[] Options = new(Lang, string)[14] { (Lang.English, "English"), (Lang.Russian, "Русский"), (Lang.Ukrainian, "Українська"), (Lang.ChineseSimplified, "Chinese (Simplified)"), (Lang.ChineseTraditional, "Chinese (Traditional)"), (Lang.Japanese, "Japanese"), (Lang.Korean, "Korean"), (Lang.Spanish, "Espanol"), (Lang.PortugueseBR, "Portugues (BR)"), (Lang.German, "Deutsch"), (Lang.French, "Francais"), (Lang.Italian, "Italiano"), (Lang.Polish, "Polski"), (Lang.Turkish, "Turkce") }; private static readonly string[] Keys = new string[23] { "tab.character", "tab.cheats", "tab.admin", "tab.inventory", "tab.world", "tab.badges", "tab.cosmetics", "tab.about", "tab.settings", "feat.speed", "feat.jump", "feat.climb", "feat.vineclimb", "feat.ropeclimb", "feat.god", "feat.infstam", "feat.nofall", "feat.noweight", "feat.lockstatus", "feat.tpping", "feat.fly", "wip", "ui.language" }; private static readonly Dictionary Values = new Dictionary { [Lang.English] = new string[23] { "Character", "Cheats", "Admin", "Inventory", "World", "Badges", "Cosmetics", "About", "Settings", "Speed", "Jump", "Climb speed", "Vine climb", "Rope climb", "God mode", "Infinite stamina", "No fall damage", "No weight", "Lock status (freeze afflictions)", "Teleport to ping", "Fly", "work-in-progress", "Language" }, [Lang.Russian] = new string[23] { "Персонаж", "Читы", "Админ", "Инвентарь", "Мир", "Ачивки", "Косметика", "О моде", "Настройки", "Скорость", "Прыжок", "Скорость лазания", "Лазание по лозам", "Лазание по верёвкам", "Бессмертие", "Бесконечная стамина", "Без урона от падения", "Без веса", "Заморозка статусов", "Телепорт к пингу", "Полёт", "в разработке", "Язык" }, [Lang.Ukrainian] = new string[23] { "Персонаж", "Чити", "Адмін", "Інвентар", "Світ", "Ачивки", "Косметика", "Про мод", "Налаштування", "Швидкість", "Стрибок", "Швидкість лазіння", "Лазіння по ліанах", "Лазіння по мотузках", "Безсмертя", "Нескінченна витривалість", "Без шкоди від падіння", "Без ваги", "Заморозка статусів", "Телепорт до пінгу", "Політ", "у розробці", "Мова" }, [Lang.ChineseSimplified] = new string[23] { "角色", "作弊", "管理", "物品栏", "世界", "成就", "外观", "关于", "设置", "速度", "跳跃", "攀爬速度", "藤蔓攀爬", "绳索攀爬", "无敌模式", "无限体力", "无坠落伤害", "无重量", "锁定状态", "传送到标记", "飞行", "开发中", "语言" }, [Lang.ChineseTraditional] = new string[23] { "角色", "作弊", "管理", "物品欄", "世界", "成就", "外觀", "關於", "設定", "速度", "跳躍", "攀爬速度", "藤蔓攀爬", "繩索攀爬", "無敵模式", "無限體力", "無墜落傷害", "無重量", "鎖定狀態", "傳送到標記", "飛行", "開發中", "語言" }, [Lang.Japanese] = new string[23] { "キャラクター", "チート", "管理", "インベントリ", "ワールド", "実績", "外見", "情報", "設定", "スピード", "ジャンプ", "登坂速度", "ツル登り", "ロープ登り", "無敵モード", "無限スタミナ", "落下ダメージ無効", "重量なし", "ステータス固定", "ピンへテレポート", "飛行", "開発中", "言語" }, [Lang.Korean] = new string[23] { "캐릭터", "치트", "관리", "인벤토리", "월드", "업적", "외형", "정보", "설정", "속도", "점프", "등반 속도", "덩굴 등반", "밧줄 등반", "무적 모드", "무한 스태미나", "낙하 데미지 없음", "무게 없음", "상태 고정", "핑으로 순간이동", "비행", "개발 중", "언어" }, [Lang.Spanish] = new string[23] { "Personaje", "Trucos", "Admin", "Inventario", "Mundo", "Logros", "Cosméticos", "Acerca de", "Ajustes", "Velocidad", "Salto", "Velocidad de escalada", "Escalada de lianas", "Escalada de cuerdas", "Modo dios", "Resistencia infinita", "Sin daño por caída", "Sin peso", "Bloquear estado", "Teletransporte al ping", "Volar", "en desarrollo", "Idioma" }, [Lang.PortugueseBR] = new string[23] { "Personagem", "Trapaças", "Admin", "Inventário", "Mundo", "Conquistas", "Cosméticos", "Sobre", "Configurações", "Velocidade", "Pulo", "Velocidade de escalada", "Escalada de cipó", "Escalada de corda", "Modo deus", "Estamina infinita", "Sem dano de queda", "Sem peso", "Travar status", "Teleportar para o ping", "Voar", "em desenvolvimento", "Idioma" }, [Lang.German] = new string[23] { "Charakter", "Cheats", "Admin", "Inventar", "Welt", "Erfolge", "Kosmetik", "Über", "Einstellungen", "Geschwindigkeit", "Sprung", "Klettergeschwindigkeit", "Rankenklettern", "Seilklettern", "Gottmodus", "Unendliche Ausdauer", "Kein Fallschaden", "Kein Gewicht", "Status einfrieren", "Zum Ping teleportieren", "Fliegen", "in Arbeit", "Sprache" }, [Lang.French] = new string[23] { "Personnage", "Triches", "Admin", "Inventaire", "Monde", "Succès", "Cosmétiques", "À propos", "Paramètres", "Vitesse", "Saut", "Vitesse d'escalade", "Escalade de lianes", "Escalade de corde", "Mode dieu", "Endurance infinie", "Aucun dégât de chute", "Sans poids", "Verrouiller le statut", "Téléportation au ping", "Voler", "en cours", "Langue" }, [Lang.Italian] = new string[23] { "Personaggio", "Trucchi", "Admin", "Inventario", "Mondo", "Obiettivi", "Cosmetici", "Info", "Impostazioni", "Velocità", "Salto", "Velocità di arrampicata", "Arrampicata su liane", "Arrampicata su corda", "Modalità dio", "Stamina infinita", "Nessun danno da caduta", "Senza peso", "Blocca stato", "Teletrasporto al ping", "Vola", "in lavorazione", "Lingua" }, [Lang.Polish] = new string[23] { "Postać", "Cheaty", "Admin", "Ekwipunek", "Świat", "Osiągnięcia", "Kosmetyki", "O modzie", "Ustawienia", "Prędkość", "Skok", "Prędkość wspinania", "Wspinaczka po pnączach", "Wspinaczka po linie", "Tryb boga", "Nieskończona wytrzymałość", "Brak obrażeń od upadku", "Bez wagi", "Zablokuj status", "Teleport do pingu", "Latanie", "w trakcie prac", "Język" }, [Lang.Turkish] = new string[23] { "Karakter", "Hileler", "Admin", "Envanter", "Dünya", "Başarımlar", "Kozmetikler", "Hakkında", "Ayarlar", "Hız", "Zıplama", "Tırmanma hızı", "Sarmaşık tırmanışı", "Halat tırmanışı", "Tanrı modu", "Sınırsız dayanıklılık", "Düşme hasarı yok", "Ağırlık yok", "Durumu kilitle", "Ping'e ışınlan", "Uçuş", "geliştiriliyor", "Dil" } }; private static readonly Dictionary Index = BuildIndex(); private static readonly Dictionary> Desc = new Dictionary> { [Lang.English] = new Dictionary { ["feat.speed"] = "Increases your movement speed by the chosen multiplier.", ["feat.jump"] = "Increases your jump force/height by the chosen multiplier.", ["feat.climb"] = "Increases climbing speed by the chosen multiplier.", ["feat.vineclimb"] = "Climb vines faster by the chosen multiplier.", ["feat.ropeclimb"] = "Climb ropes faster by the chosen multiplier.", ["feat.god"] = "Invincibility — you take no damage from anything.", ["feat.infstam"] = "Your stamina never runs out.", ["feat.nofall"] = "Removes all fall damage.", ["feat.noweight"] = "Carried items no longer slow you down.", ["feat.lockstatus"] = "Freezes all status effects (hunger, cold, poison, weight...) at their current values.", ["feat.tpping"] = "Teleports you to your ping marker.", ["feat.fly"] = "Free-fly noclip movement through the world." }, [Lang.Russian] = new Dictionary { ["feat.speed"] = "Увеличивает скорость передвижения на выбранный множитель.", ["feat.jump"] = "Увеличивает силу и высоту прыжка на выбранный множитель.", ["feat.climb"] = "Увеличивает скорость лазания на выбранный множитель.", ["feat.vineclimb"] = "Быстрее лазать по лозам на выбранный множитель.", ["feat.ropeclimb"] = "Быстрее лазать по верёвкам на выбранный множитель.", ["feat.god"] = "Неуязвимость — вы не получаете никакого урона.", ["feat.infstam"] = "Стамина никогда не заканчивается.", ["feat.nofall"] = "Полностью убирает урон от падения.", ["feat.noweight"] = "Переносимые предметы больше не замедляют вас.", ["feat.lockstatus"] = "Замораживает все статусы (голод, холод, яд, вес...) на текущих значениях.", ["feat.tpping"] = "Телепортирует к метке пинга.", ["feat.fly"] = "Свободный полёт сквозь геометрию." } }; private static Dictionary BuildIndex() { Dictionary dictionary = new Dictionary(); for (int i = 0; i < Keys.Length; i++) { dictionary[Keys[i]] = i; } return dictionary; } public static string T(string key) { if (!Index.TryGetValue(key, out var value)) { return key; } if (Values.TryGetValue(Current, out var value2) && value < value2.Length && !string.IsNullOrEmpty(value2[value])) { return value2[value]; } return Values[Lang.English][value]; } public static string D(string key) { Lang key2 = (Desc.ContainsKey(Current) ? Current : Lang.English); if (Desc[key2].TryGetValue(key, out var value)) { return value; } if (!Desc[Lang.English].TryGetValue(key, out var value2)) { return ""; } return value2; } public static string RequiredOsFont(Lang lang) { return lang switch { Lang.ChineseSimplified => "Microsoft YaHei", Lang.ChineseTraditional => "Microsoft JhengHei", Lang.Japanese => "Yu Gothic", Lang.Korean => "Malgun Gothic", _ => null, }; } } public static class Menu { [Flags] private enum ResizeEdge { None = 0, Left = 1, Right = 2, Top = 4, Bottom = 8 } [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawWindow; public static WindowFunction <1>__DrawNoticeWindowModern; } private const string UrlSteam = "https://steamcommunity.com/id/everyng/"; private const string UrlTelegram = "https://t.me/maxkir041"; private const string UrlPlayground = "https://users.playground.ru/7293247/"; private const string UrlDonate = "https://www.donationalerts.com/r/maxkir041"; private const string UrlGitHub = "https://github.com/maxkir041/PEAK-MX"; private const string UrlWebsite = "https://peak-mx.rkngov.com"; private const string UrlQr = "https://files.donationalerts.com/uploads/qr/8215314/qr_6de7aa0b93950f375ec25fdfd0bd0c53.png"; private static readonly string[] Tabs = new string[8] { "tab.character", "tab.cheats", "tab.admin", "tab.inventory", "tab.world", "tab.badges", "tab.cosmetics", "tab.about" }; private const float HeaderHeight = 62f; private const float WindowPadding = 12f; private const float ResizeGrip = 8f; private const float MinWindowWidth = 540f; private const float MinWindowHeight = 500f; private static Rect _rect = new Rect(80f, 80f, 680f, 580f); private static Rect _noticeRect = new Rect(40f, 40f, 360f, 0f); private static int _tab; private static Vector2 _scroll; private static bool _noticeDismissed; private static string _itemSearch = ""; private static int _selItem = -1; private static int _selSlot = 0; private static int _selBackpackSlot = 0; private static Vector2 _itemScroll; private static int _invTarget = -1; private static bool _excludeSelf = true; private static string _tpX = "0"; private static string _tpY = "0"; private static string _tpZ = "0"; private static Vector2 _luggageScroll; private static int _selLuggage = -1; private static int _selStatus; private static float _statusAmount = 0.5f; private static int _statusTarget = -1; private static int _prankTarget = -1; private static int _adminTarget = -1; private static Vector2 _adminScroll; private static bool _targetPickerOpen; private static bool _inventoryTargetPickerOpen; private static float _timeOfDay = 9f; private static bool _timeOfDayDirty; private static int _timePreset = -1; private static Vector2 _badgeScroll; private static bool[] _badgeUnlockedCache; private static ACHIEVEMENTTYPE[] _badgeTypeCache; private static float _badgeCacheTime = -999f; private static Vector2 _cosmeticScroll; private static int _cosmeticCategory; private static readonly Dictionary _sectionOpen = new Dictionary(); private static readonly Dictionary _numberText = new Dictionary(); private static ResizeEdge _resizeEdge; private static Rect _resizeStartRect; private static Vector2 _resizeStartMouse; private static Rect _contentRect; private static string _hoverTip; private static string _lastTip; private static float _lastTipUntil; private static Vector2 _tipScroll; private static bool _closeRequested; private static Font _langFont; private static Lang _langFontFor = (Lang)(-1); private static Font _origFont; private static bool _origFontSaved; private static readonly Color BadgeLocked = new Color(0.85f, 0.27f, 0.27f); private static Texture2D _frameOn; private static Texture2D _frameOff; private static Texture2D _tileBg; private static bool _langOpen; private static readonly Color BadgeLockedModern = new Color(0.85f, 0.27f, 0.27f); private static Texture2D _badgeTileOn; private static Texture2D _badgeTileOff; private static Texture2D _badgeTileBg; private static Texture2D _badgeStripeOn; private static Texture2D _badgeStripeOff; private static Texture2D _lineTex; private static Texture2D _sliderFillTex; private static Texture2D _headerTex; private static Texture2D _accentTex; private static Texture2D _brandIconTex; private static GUIStyle _brandIconText; private static GUIStyle _itemIconText; private static byte[] _qrBytes; private static bool _qrRequested; private static Texture2D _qrTex; private static MethodInfo _loadImage; private static bool _loadImageResolved; private static bool Ru => Localization.Current == Lang.Russian; private static bool UseModernUi => true; private static string L(string key) { return Localization.T(key); } private static void ApplyFont() { if (!_origFontSaved) { _origFont = GUI.skin.font; _origFontSaved = true; } if (_langFontFor != Localization.Current) { _langFontFor = Localization.Current; string text = Localization.RequiredOsFont(Localization.Current); try { _langFont = (string.IsNullOrEmpty(text) ? null : Font.CreateDynamicFontFromOSFont(text, 14)); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[Font] " + ex.Message)); } _langFont = null; } } GUI.skin.font = (((Object)(object)_langFont != (Object)null) ? _langFont : _origFont); } public static void Draw() { //IL_0024: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown Theme.EnsureBuilt(); ApplyFont(); ClampWindowToScreen(); _hoverTip = null; HandleWindowResize(Event.current); Rect rect = _rect; object obj = <>O.<0>__DrawWindow; if (obj == null) { WindowFunction val = DrawWindow; <>O.<0>__DrawWindow = val; obj = (object)val; } _rect = GUI.Window(44048, rect, (WindowFunction)obj, GUIContent.none, Theme.Window); ClampWindowToScreen(); DrawTooltipOverlay(); } public static bool ConsumeCloseRequest() { bool closeRequested = _closeRequested; _closeRequested = false; return closeRequested; } private static void DrawWindow(int id) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) if (UseModernUi) { DrawWindowModern(id); return; } if ((Object)(object)_headerTex == (Object)null) { _headerTex = Theme.GradientTex(new Color(0.118f, 0.302f, 0.22f), new Color(0.078f, 0.157f, 0.122f), Mathf.RoundToInt(62f)); } if ((Object)(object)_accentTex == (Object)null) { _accentTex = Theme.Tex(Theme.Accent); } GUI.DrawTexture(new Rect(0f, 0f, ((Rect)(ref _rect)).width, 62f), (Texture)(object)_headerTex); GUI.DrawTexture(new Rect(0f, 62f, ((Rect)(ref _rect)).width, 2f), (Texture)(object)_accentTex); if (Event.current != null) { float num = Mathf.Clamp(((Rect)(ref _rect)).width * 0.22f, 136f, 176f); float num2 = 74f; float num3 = ((Rect)(ref _rect)).height - num2 - 12f; float num4 = 12f + num + 12f; float num5 = ((Rect)(ref _rect)).width - num4 - 12f; GUILayout.BeginArea(new Rect(16f, 10f, ((Rect)(ref _rect)).width - 32f, 44f)); GUILayout.BeginHorizontal(Array.Empty()); DrawBrandMark(32f); GUILayout.Space(8f); GUILayout.BeginVertical(Array.Empty()); GUILayout.Label("PEAK-MX", Theme.Title, Array.Empty()); GUILayout.Label("v1.0.0 | " + L(Tabs[_tab]), Theme.Subtitle, Array.Empty()); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button("X", Theme.CloseBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(34f), GUILayout.Height(26f) })) { _closeRequested = true; } GUILayout.EndHorizontal(); GUILayout.EndArea(); Rect val = default(Rect); ((Rect)(ref val))..ctor(12f, num2, num, num3); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num4, num2, num5, num3); GUI.Box(val, GUIContent.none, Theme.Panel9); GUI.Box(val2, GUIContent.none, Theme.Card); GUILayout.BeginArea(new Rect(((Rect)(ref val)).x + 10f, ((Rect)(ref val)).y + 10f, ((Rect)(ref val)).width - 20f, ((Rect)(ref val)).height - 20f)); for (int i = 0; i < Tabs.Length; i++) { GUIStyle val3 = ((i == _tab) ? Theme.NavItemActive : Theme.NavItem); if (GUILayout.Button(L(Tabs[i]), val3, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { _tab = i; } } GUILayout.FlexibleSpace(); GUILayout.Label(Ru ? "Тяни за край, чтобы менять размер" : "Drag any edge to resize", Theme.LabelDim, Array.Empty()); GUILayout.EndArea(); GUILayout.BeginArea(new Rect(((Rect)(ref val2)).x + 12f, ((Rect)(ref val2)).y + 10f, ((Rect)(ref val2)).width - 24f, ((Rect)(ref val2)).height - 20f)); _scroll = GUILayout.BeginScrollView(_scroll, Array.Empty()); GUILayout.Space(2f); switch (_tab) { case 0: DrawCharacter(); break; case 1: DrawCheats(); break; case 2: DrawAdminModern(); break; case 3: DrawInventory(); break; case 4: DrawWorld(); break; case 5: DrawBadges(); break; case 6: DrawCosmetics(); break; case 7: DrawAbout(); break; } GUILayout.Space(4f); GUILayout.EndScrollView(); GUILayout.EndArea(); GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _rect)).width, 62f)); return; } GUILayout.Space(9f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Space(16f); GUILayout.BeginVertical(Array.Empty()); GUILayout.Label("PEAK-MX", Theme.Title, Array.Empty()); GUILayout.Label("v1.0.0 • by maxkir041", Theme.Subtitle, Array.Empty()); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(14f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); GUILayout.Space(6f); for (int j = 0; j < Tabs.Length; j++) { GUIStyle val4 = ((j == _tab) ? Theme.NavItemActive : Theme.NavItem); if (GUILayout.Button(L(Tabs[j]), val4, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) })) { _tab = j; } } GUILayout.EndVertical(); GUILayout.Space(8f); GUILayout.BeginVertical(Array.Empty()); _scroll = GUILayout.BeginScrollView(_scroll, Array.Empty()); GUILayout.Space(4f); switch (_tab) { case 0: DrawCharacter(); break; case 1: DrawCheats(); break; case 2: DrawAdminModern(); break; case 3: DrawInventory(); break; case 4: DrawWorld(); break; case 5: DrawBadges(); break; case 6: DrawCosmetics(); break; case 7: DrawAbout(); break; } GUILayout.EndScrollView(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); HLine(); string tooltip = GUI.tooltip; GUILayout.Label((!string.IsNullOrEmpty(tooltip)) ? tooltip : (Ru ? "ⓘ Наведи курсор на чит, чтобы увидеть описание" : "ⓘ Hover a cheat to see its description"), Theme.TipText, Array.Empty()); GUILayout.Label(Ru ? "❤\ufe0f Мод бесплатный — поддержать можно во вкладке «О моде»" : "❤\ufe0f This mod is free — you can support it in the About tab", Theme.DonateText, Array.Empty()); GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _rect)).width, 62f)); } private static void DrawCharacter() { if (UseModernUi && Event.current != null) { DrawCharacterModern(); } else if (Event.current != null) { if (BeginSection("character.move", L("tab.character"), defaultOpen: true)) { ModConfig.SpeedMod = Toggle("feat.speed", ModConfig.SpeedMod); if (ModConfig.SpeedMod) { ModConfig.SpeedAmount = Slider("x", ModConfig.SpeedAmount, 0.5f, 5f); } ModConfig.JumpMod = Toggle("feat.jump", ModConfig.JumpMod); if (ModConfig.JumpMod) { ModConfig.JumpAmount = Slider("x", ModConfig.JumpAmount, 1f, 5f); } EndSection(); } if (BeginSection("character.climb", Ru ? "Лазание" : "Climbing", defaultOpen: false)) { ModConfig.ClimbMod = Toggle("feat.climb", ModConfig.ClimbMod); if (ModConfig.ClimbMod) { ModConfig.ClimbAmount = Slider("x", ModConfig.ClimbAmount, 1f, 5f); } ModConfig.VineClimbMod = Toggle("feat.vineclimb", ModConfig.VineClimbMod); if (ModConfig.VineClimbMod) { ModConfig.VineClimbAmount = Slider("x", ModConfig.VineClimbAmount, 1f, 5f); } ModConfig.RopeClimbMod = Toggle("feat.ropeclimb", ModConfig.RopeClimbMod); if (ModConfig.RopeClimbMod) { ModConfig.RopeClimbAmount = Slider("x", ModConfig.RopeClimbAmount, 1f, 5f); } EndSection(); } if (BeginSection("character.status", Ru ? "Стамина и недуги" : "Stamina & afflictions", defaultOpen: false)) { Character c = TargetPicker(ref _statusTarget); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Полная стамина" : "Full stamina", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.FullStamina(c); } if (GUILayout.Button(Ru ? "Снять все недуги" : "Clear afflictions", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ClearAllStatus(c); } GUILayout.EndHorizontal(); string[] array = (Ru ? GameApi.StatusRu : GameApi.StatusEn); _selStatus = GUILayout.SelectionGrid(_selStatus, array, 3, Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(112f) }); _statusAmount = Slider(Ru ? "Сила" : "Amount", _statusAmount, 0f, 1f); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Наложить" : "Apply", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { GameApi.SetStatus(c, _selStatus, _statusAmount); } if (GUILayout.Button(Ru ? "Убрать этот" : "Remove this", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(140f), GUILayout.Height(32f) })) { GameApi.SetStatus(c, _selStatus, 0f); } GUILayout.EndHorizontal(); EndSection(); } } else { GUILayout.Label(L("tab.character"), Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); ModConfig.SpeedMod = Toggle("feat.speed", ModConfig.SpeedMod); if (ModConfig.SpeedMod) { ModConfig.SpeedAmount = Slider("x", ModConfig.SpeedAmount, 0.5f, 5f); } ModConfig.JumpMod = Toggle("feat.jump", ModConfig.JumpMod); if (ModConfig.JumpMod) { ModConfig.JumpAmount = Slider("x", ModConfig.JumpAmount, 1f, 5f); } GUILayout.EndVertical(); GUILayout.Label(Ru ? "Лазание" : "Climbing", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); ModConfig.ClimbMod = Toggle("feat.climb", ModConfig.ClimbMod); if (ModConfig.ClimbMod) { ModConfig.ClimbAmount = Slider("x", ModConfig.ClimbAmount, 1f, 5f); } ModConfig.VineClimbMod = Toggle("feat.vineclimb", ModConfig.VineClimbMod); if (ModConfig.VineClimbMod) { ModConfig.VineClimbAmount = Slider("x", ModConfig.VineClimbAmount, 1f, 5f); } ModConfig.RopeClimbMod = Toggle("feat.ropeclimb", ModConfig.RopeClimbMod); if (ModConfig.RopeClimbMod) { ModConfig.RopeClimbAmount = Slider("x", ModConfig.RopeClimbAmount, 1f, 5f); } GUILayout.EndVertical(); GUILayout.Label(Ru ? "Стамина и недуги" : "Stamina & afflictions", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); Character c2 = TargetPicker(ref _statusTarget); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Полная стамина" : "Full stamina", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.FullStamina(c2); } if (GUILayout.Button(Ru ? "Снять все недуги" : "Clear afflictions", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ClearAllStatus(c2); } GUILayout.EndHorizontal(); string[] array2 = (Ru ? GameApi.StatusRu : GameApi.StatusEn); _selStatus = GUILayout.SelectionGrid(_selStatus, array2, 3, Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(112f) }); _statusAmount = Slider(Ru ? "Сила" : "Amount", _statusAmount, 0f, 1f); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Наложить" : "Apply", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { GameApi.SetStatus(c2, _selStatus, _statusAmount); } if (GUILayout.Button(Ru ? "Убрать этот" : "Remove this", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(140f), GUILayout.Height(32f) })) { GameApi.SetStatus(c2, _selStatus, 0f); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); } } private static void DrawCheats() { if (UseModernUi && Event.current != null) { DrawCheatsModern(); return; } if (Event.current != null) { if (BeginSection("cheats.core", L("tab.cheats"), defaultOpen: true)) { ModConfig.GodMode = Toggle("feat.god", ModConfig.GodMode); ModConfig.InfiniteStamina = Toggle("feat.infstam", ModConfig.InfiniteStamina); ModConfig.NoFallDamage = Toggle("feat.nofall", ModConfig.NoFallDamage); ModConfig.NoWeight = Toggle("feat.noweight", ModConfig.NoWeight); ModConfig.LockStatus = Toggle("feat.lockstatus", ModConfig.LockStatus); EndSection(); } if (BeginSection("cheats.fly", Ru ? "Полет и телепорт" : "Fly & teleport", defaultOpen: false)) { ModConfig.TeleportToPing = Toggle("feat.tpping", ModConfig.TeleportToPing); ModConfig.Fly = Toggle("feat.fly", ModConfig.Fly); if (ModConfig.Fly) { ModConfig.Noclip = ToggleRaw(Ru ? "Ноклип" : "Noclip", Ru ? "Отключает локальные коллайдеры во время полёта, чтобы можно было проходить сквозь стены." : "Disables local colliders while flying so you can move through walls.", ModConfig.Noclip); ModConfig.FlySpeed = Slider(Ru ? "Скорость" : "Speed", ModConfig.FlySpeed, 1f, 50f); ModConfig.FlyAcceleration = Slider(Ru ? "Ускорение" : "Accel", ModConfig.FlyAcceleration, 1f, 100f); } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Коорд.:" : "Coords:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); GUILayout.Label("X", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpX = GUILayout.TextField(_tpX ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Y", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpY = GUILayout.TextField(_tpY ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Z", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpZ = GUILayout.TextField(_tpZ ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); if (GUILayout.Button(Ru ? "ТП" : "TP", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(54f), GUILayout.Height(26f) }) && (float.TryParse(_tpX, out var result) & float.TryParse(_tpY, out var result2) & float.TryParse(_tpZ, out var result3))) { GameApi.TeleportToCoords(result, result2, result3); } GUILayout.EndHorizontal(); EndSection(); } if (BeginSection("cheats.actions", Ru ? "Действия" : "Actions", defaultOpen: false)) { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Воскресить себя" : "Revive self", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.ReviveSelf(); } if (GUILayout.Button(Ru ? "Убить себя" : "Kill self", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.KillSelf(); } if (GUILayout.Button(Ru ? "К точке спавна" : "Warp to spawn", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.WarpToSpawn(); } GUILayout.EndHorizontal(); EndSection(); } if (BeginSection("cheats.players", Ru ? "Игроки" : "Players", defaultOpen: false)) { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Обновить список" : "Refresh", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.RefreshPlayers(); } if (GUILayout.Button(Ru ? "Воскресить всех" : "Revive all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.ReviveAll(); } if (GUILayout.Button(Ru ? "Притянуть всех" : "Warp all to me", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.WarpAllToMe(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Убить всех" : "Kill all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.KillAll(_excludeSelf); } _excludeSelf = GUILayout.Toggle(_excludeSelf, Ru ? " Не трогать себя" : " Exclude me", Theme.RowLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); GUILayout.EndHorizontal(); if (GameApi.PlayerChars.Count == 0) { GUILayout.Label(Ru ? "Список пуст - нажми «Обновить» в лобби" : "Empty - press Refresh in a lobby", Theme.LabelDim, Array.Empty()); } for (int i = 0; i < GameApi.PlayerChars.Count; i++) { Character val = GameApi.PlayerChars[i]; if ((Object)(object)val == (Object)null) { continue; } bool flag = false; try { flag = val.IsLocal; } catch { } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(((i < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[i] : "?") + ((!flag) ? "" : (Ru ? " (ты)" : " (you)")), Theme.RowLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) }); if (!flag) { if (GUILayout.Button("TP", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(44f) })) { GameApi.WarpToPlayer(val); } if (GUILayout.Button(Ru ? "Спавн" : "Spawn", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) })) { GameApi.WarpPlayerToSpawn(val); } if (GUILayout.Button(Ru ? "Притянуть" : "Bring", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(78f) })) { GameApi.BringPlayer(val); } if (GUILayout.Button(Ru ? "Убить" : "Kill", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(58f) })) { GameApi.KillPlayer(val); } if (GUILayout.Button(Ru ? "Ожив." : "Revive", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(66f) })) { GameApi.RevivePlayer(val); } } if (GUILayout.Button(Ru ? "Скаут" : "Scout", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(64f) })) { GameApi.SpawnScoutmaster(val); } GUILayout.EndHorizontal(); } EndSection(); } if (BeginSection("cheats.pranks", Ru ? "Приколы" : "Pranks", defaultOpen: false)) { Character c = TargetPicker(ref _prankTarget); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Наслать все недуги" : "Pile on afflictions", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.PrankAfflict(c); } if (GUILayout.Button(Ru ? "Вылечить" : "Cure", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ClearAllStatus(c); } GUILayout.EndHorizontal(); if (GUILayout.Button(Ru ? "Забить инвентарь выбранным предметом" : "Stuff inventory with selected item", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { GameApi.FillInventoryWith(c, _selItem); } GUILayout.Label(Ru ? "Предмет берётся из вкладки «Инвентарь». Физические шарики есть в новой версии вкладки." : "The item comes from the Inventory tab. Physical balloons are available in the newer tab.", Theme.LabelDim, Array.Empty()); EndSection(); } return; } GUILayout.Label(L("tab.cheats"), Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); ModConfig.GodMode = Toggle("feat.god", ModConfig.GodMode); ModConfig.InfiniteStamina = Toggle("feat.infstam", ModConfig.InfiniteStamina); ModConfig.NoFallDamage = Toggle("feat.nofall", ModConfig.NoFallDamage); ModConfig.NoWeight = Toggle("feat.noweight", ModConfig.NoWeight); ModConfig.LockStatus = Toggle("feat.lockstatus", ModConfig.LockStatus); GUILayout.EndVertical(); GUILayout.Label(Ru ? "Полёт и телепорт" : "Fly & teleport", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); ModConfig.TeleportToPing = Toggle("feat.tpping", ModConfig.TeleportToPing); ModConfig.Fly = Toggle("feat.fly", ModConfig.Fly); if (ModConfig.Fly) { ModConfig.FlySpeed = Slider(Ru ? "Скорость" : "Speed", ModConfig.FlySpeed, 1f, 50f); ModConfig.FlyAcceleration = Slider(Ru ? "Ускорение" : "Accel", ModConfig.FlyAcceleration, 1f, 100f); } GUILayout.EndVertical(); GUILayout.Label(Ru ? "Действия" : "Actions", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Воскресить себя" : "Revive self", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.ReviveSelf(); } if (GUILayout.Button(Ru ? "Убить себя" : "Kill self", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.KillSelf(); } if (GUILayout.Button(Ru ? "К точке спавна" : "Warp to spawn", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.WarpToSpawn(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Коорд.:" : "Coords:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); GUILayout.Label("X", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpX = GUILayout.TextField(_tpX ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Y", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpY = GUILayout.TextField(_tpY ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Z", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpZ = GUILayout.TextField(_tpZ ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); if (GUILayout.Button(Ru ? "ТП" : "TP", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(54f), GUILayout.Height(26f) }) && (float.TryParse(_tpX, out var result4) & float.TryParse(_tpY, out var result5) & float.TryParse(_tpZ, out var result6))) { GameApi.TeleportToCoords(result4, result5, result6); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Label(Ru ? "Игроки" : "Players", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Обновить список" : "Refresh", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.RefreshPlayers(); } if (GUILayout.Button(Ru ? "Воскресить всех" : "Revive all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.ReviveAll(); } if (GUILayout.Button(Ru ? "Притянуть всех" : "Warp all to me", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.WarpAllToMe(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Убить всех" : "Kill all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.KillAll(_excludeSelf); } _excludeSelf = GUILayout.Toggle(_excludeSelf, Ru ? " Не трогать себя" : " Exclude me", Theme.RowLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); GUILayout.EndHorizontal(); if (GameApi.PlayerChars.Count == 0) { GUILayout.Label(Ru ? "Список пуст — нажми «Обновить» в лобби" : "Empty — press Refresh in a lobby", Theme.LabelDim, Array.Empty()); } for (int j = 0; j < GameApi.PlayerChars.Count; j++) { Character val2 = GameApi.PlayerChars[j]; if ((Object)(object)val2 == (Object)null) { continue; } bool flag2 = false; try { flag2 = val2.IsLocal; } catch { } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(((j < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[j] : "?") + ((!flag2) ? "" : (Ru ? " (ты)" : " (you)")), Theme.RowLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) }); if (!flag2) { if (GUILayout.Button("TP", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(44f) })) { GameApi.WarpToPlayer(val2); } if (GUILayout.Button(Ru ? "Притянуть" : "Bring", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(78f) })) { GameApi.BringPlayer(val2); } if (GUILayout.Button(Ru ? "Убить" : "Kill", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(58f) })) { GameApi.KillPlayer(val2); } if (GUILayout.Button(Ru ? "Ожив." : "Revive", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(66f) })) { GameApi.RevivePlayer(val2); } } if (GUILayout.Button(Ru ? "Скаут" : "Scout", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(64f) })) { GameApi.SpawnScoutmaster(val2); } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); GUILayout.Label(Ru ? "Приколы \ud83d\ude08" : "Pranks \ud83d\ude08", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); Character c2 = TargetPicker(ref _prankTarget); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Наслать все недуги" : "Pile on afflictions", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.PrankAfflict(c2); } if (GUILayout.Button(Ru ? "Вылечить" : "Cure", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ClearAllStatus(c2); } GUILayout.EndHorizontal(); if (GUILayout.Button(Ru ? "\ud83c\udf92 Забить инвентарь выбранным предметом" : "\ud83c\udf92 Stuff inventory with selected item", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { GameApi.FillInventoryWith(c2, _selItem); } GUILayout.Label(Ru ? "Предмет берётся из вкладки «Инвентарь». Физические шарики на игроке — добавлю отдельно." : "Item comes from the Inventory tab. Physical balloons on a player will come separately.", Theme.LabelDim, Array.Empty()); GUILayout.EndVertical(); } private static void DrawInventory() { //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0a76: Unknown result type (might be due to invalid IL or missing references) //IL_0a8e: Unknown result type (might be due to invalid IL or missing references) //IL_0a93: Unknown result type (might be due to invalid IL or missing references) if (UseModernUi && Event.current != null) { DrawInventoryModern(); return; } if (Event.current != null) { if (BeginSection("inventory.spawn", Ru ? "Спавн предметов" : "Item spawner", defaultOpen: true)) { if (GameApi.ItemNames.Count <= 0) { if (GUILayout.Button(Ru ? "Загрузить список предметов" : "Load item list", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.EnsureItemsLoaded(); } } else { GUILayout.Label((Ru ? "Предметов: " : "Items: ") + GameApi.ItemNames.Count, Theme.LabelDim, Array.Empty()); if (_invTarget >= GameApi.PlayerChars.Count) { _invTarget = -1; } Character val = ((_invTarget >= 0 && _invTarget < GameApi.PlayerChars.Count) ? GameApi.PlayerChars[_invTarget] : null); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Кому:" : "Target:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); if (GUILayout.Button(Ru ? "Себе" : "Me", (_invTarget < 0) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _invTarget = -1; } for (int i = 0; i < GameApi.PlayerChars.Count; i++) { Character val2 = GameApi.PlayerChars[i]; bool flag = false; try { flag = (Object)(object)val2 != (Object)null && val2.IsLocal; } catch { } if (!flag && GUILayout.Button((i < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[i] : "?", (_invTarget == i) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _invTarget = i; } } if (GUILayout.Button(Ru ? "Обн." : "Sync", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(52f), GUILayout.Height(26f) })) { GameApi.RefreshPlayers(); } GUILayout.EndHorizontal(); int num = (((Object)(object)val != (Object)null) ? GameApi.SlotCountFor(val) : GameApi.SlotCount()); if (num <= 0) { num = 3; } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Слот:" : "Slot:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); for (int j = 0; j < num; j++) { if (GUILayout.Button((j + 1).ToString(), (_selSlot == j) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(36f), GUILayout.Height(30f) })) { _selSlot = j; } } GUILayout.EndHorizontal(); _itemSearch = GUILayout.TextField(_itemSearch ?? "", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); _itemScroll = GUILayout.BeginScrollView(_itemScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(170f) }); string text = (_itemSearch ?? "").Trim().ToLowerInvariant(); for (int k = 0; k < GameApi.ItemNames.Count; k++) { string text2 = GameApi.ItemNames[k]; if ((text.Length <= 0 || text2.ToLowerInvariant().IndexOf(text) >= 0) && DrawItemListRow(k, text2, _selItem == k)) { _selItem = k; } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Заспавнить в слот" : "Spawn to slot", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) }) && _selItem >= 0) { if ((Object)(object)val != (Object)null) { GameApi.SpawnToSlotFor(val, _selItem, _selSlot); } else { GameApi.SpawnToSlot(_selItem, _selSlot); } } if (GUILayout.Button(Ru ? "Очистить слот" : "Clear slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(28f) })) { if ((Object)(object)val != (Object)null) { GameApi.ClearSlotFor(val, _selSlot); } else { GameApi.ClearSlot(_selSlot); } } GUILayout.EndHorizontal(); if (_selItem >= 0 && _selItem < GameApi.ItemNames.Count) { GUILayout.Label((Ru ? "Выбрано: " : "Selected: ") + GameApi.ItemNames[_selItem], Theme.LabelDim, Array.Empty()); } if ((Object)(object)val != (Object)null) { GUILayout.Label((Ru ? "Редактируешь инвентарь игрока: " : "Editing player's inventory: ") + ((_invTarget < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[_invTarget] : "?"), Theme.LabelDim, Array.Empty()); } } EndSection(); } if (!BeginSection("inventory.recharge", Ru ? "Перезарядка предметов" : "Item recharge", defaultOpen: false)) { return; } ModConfig.RechargeValue = NumberField(Ru ? "Заряд" : "Charge", ModConfig.RechargeValue, 0f, 999f); GUILayout.BeginHorizontal(Array.Empty()); for (int l = 0; l < Mathf.Min(3, GameApi.SlotCount()); l++) { int num2 = l; if (GUILayout.Button((Ru ? "Слот " : "Slot ") + (num2 + 1), Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.RechargeSlot(num2, ModConfig.RechargeValue); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Зарядить выбранный слот" : "Recharge selected slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.RechargeSlot(_selSlot, ModConfig.RechargeValue); } if (GUILayout.Button(Ru ? "Зарядить все" : "Recharge all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(30f) })) { for (int m = 0; m < GameApi.SlotCount(); m++) { GameApi.RechargeSlot(m, ModConfig.RechargeValue); } } GUILayout.EndHorizontal(); EndSection(); return; } GUILayout.Label(Ru ? "Спавн предметов" : "Item spawner", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); if (GameApi.ItemNames.Count == 0) { if (GUILayout.Button(Ru ? "\ud83d\udce6 Загрузить список предметов" : "\ud83d\udce6 Load item list", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.EnsureItemsLoaded(); } } else { GUILayout.Label((Ru ? "Предметов: " : "Items: ") + GameApi.ItemNames.Count, Theme.LabelDim, Array.Empty()); if (_invTarget >= GameApi.PlayerChars.Count) { _invTarget = -1; } Character val3 = ((_invTarget >= 0 && _invTarget < GameApi.PlayerChars.Count) ? GameApi.PlayerChars[_invTarget] : null); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Кому:" : "Target:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); if (GUILayout.Button(Ru ? "Себе" : "Me", (_invTarget < 0) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _invTarget = -1; } for (int n = 0; n < GameApi.PlayerChars.Count; n++) { Character val4 = GameApi.PlayerChars[n]; bool flag2 = false; try { flag2 = (Object)(object)val4 != (Object)null && val4.IsLocal; } catch { } if (!flag2 && GUILayout.Button((n < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[n] : "?", (_invTarget == n) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _invTarget = n; } } if (GUILayout.Button(Ru ? "Обн." : "Sync", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(52f), GUILayout.Height(26f) })) { GameApi.RefreshPlayers(); } TipLast(Ru ? "Обновить список игроков для просмотра и редактирования их инвентаря." : "Refresh the player list for viewing and editing inventories."); GUILayout.EndHorizontal(); int num3 = (((Object)(object)val3 != (Object)null) ? GameApi.SlotCountFor(val3) : GameApi.SlotCount()); if (num3 <= 0) { num3 = 3; } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Слот:" : "Slot:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); for (int num4 = 0; num4 < num3; num4++) { if (GUILayout.Button((num4 + 1).ToString(), (_selSlot == num4) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(36f), GUILayout.Height(30f) })) { _selSlot = num4; } } GUILayout.EndHorizontal(); _itemSearch = GUILayout.TextField(_itemSearch ?? "", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); _itemScroll = GUILayout.BeginScrollView(_itemScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(170f) }); string text3 = (_itemSearch ?? "").Trim().ToLowerInvariant(); for (int num5 = 0; num5 < GameApi.ItemNames.Count; num5++) { string text4 = GameApi.ItemNames[num5]; if ((text3.Length <= 0 || text4.ToLowerInvariant().IndexOf(text3) >= 0) && DrawItemListRow(num5, text4, _selItem == num5)) { _selItem = num5; } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Заспавнить в слот" : "Spawn to slot", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) }) && _selItem >= 0) { if ((Object)(object)val3 != (Object)null) { GameApi.SpawnToSlotFor(val3, _selItem, _selSlot); } else { GameApi.SpawnToSlot(_selItem, _selSlot); } } if (GUILayout.Button(Ru ? "Очистить слот" : "Clear slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(28f) })) { if ((Object)(object)val3 != (Object)null) { GameApi.ClearSlotFor(val3, _selSlot); } else { GameApi.ClearSlot(_selSlot); } } GUILayout.EndHorizontal(); if (_selItem >= 0 && _selItem < GameApi.ItemNames.Count) { GUILayout.Label((Ru ? "Выбрано: " : "Selected: ") + GameApi.ItemNames[_selItem], Theme.LabelDim, Array.Empty()); } if ((Object)(object)val3 != (Object)null) { GUILayout.Label((Ru ? "⚠ Меняешь инвентарь игрока: " : "⚠ Editing player's inventory: ") + ((_invTarget < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[_invTarget] : "?"), Theme.LabelDim, Array.Empty()); } } GUILayout.EndVertical(); GUILayout.Label(Ru ? "Перезарядка предметов" : "Item recharge", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); ModConfig.RechargeValue = Slider(Ru ? "Заряд" : "Charge", ModConfig.RechargeValue, 0f, 999f); GUILayout.BeginHorizontal(Array.Empty()); for (int num6 = 0; num6 < Mathf.Min(3, GameApi.SlotCount()); num6++) { int num7 = num6; if (GUILayout.Button((Ru ? "Слот " : "Slot ") + (num7 + 1), Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.RechargeSlot(num7, ModConfig.RechargeValue); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Зарядить выбранный слот" : "Recharge selected slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.RechargeSlot(_selSlot, ModConfig.RechargeValue); } if (GUILayout.Button(Ru ? "Зарядить все" : "Recharge all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(30f) })) { for (int num8 = 0; num8 < GameApi.SlotCount(); num8++) { GameApi.RechargeSlot(num8, ModConfig.RechargeValue); } } GUILayout.EndHorizontal(); GUILayout.EndVertical(); } private static void DrawWorld() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Invalid comparison between Unknown and I4 //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0b3f: Unknown result type (might be due to invalid IL or missing references) //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0b5c: Unknown result type (might be due to invalid IL or missing references) if (UseModernUi && Event.current != null) { DrawWorldModern(); return; } if (Event.current != null) { float num = GameApi.ExpeditionTimeSeconds(); float timeOfDayNow = GameApi.TimeOfDay(); int num2 = GameApi.DayCount(); if ((int)Event.current.type == 7) { SyncTimeOfDayInput(timeOfDayNow); } if (BeginSection("world.time", Ru ? "Время и забег" : "Time & run", defaultOpen: true)) { GUILayout.Label((Ru ? "Время забега: " : "Run time: ") + FormatRunTime(num), Theme.LabelDim, Array.Empty()); GUILayout.Label((Ru ? "День: " : "Day: ") + num2 + " " + (Ru ? "Час: " : "Hour: ") + timeOfDayNow.ToString("0.0"), Theme.LabelDim, Array.Empty()); bool flag = Toggle(Ru ? "Держать время забега" : "Hold run timer", ModConfig.OverrideExpeditionTime); if (flag != ModConfig.OverrideExpeditionTime) { if (flag && ModConfig.ExpeditionTimeSeconds <= 0f) { ModConfig.ExpeditionTimeSeconds = num; } ModConfig.OverrideExpeditionTime = flag; } ModConfig.ExpeditionTimeSeconds = NumberField(Ru ? "Секунды забега" : "Run seconds", ModConfig.ExpeditionTimeSeconds, 0f, 7200f); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "-60 сек" : "-60 sec", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { ModConfig.ExpeditionTimeSeconds = Mathf.Max(0f, ModConfig.ExpeditionTimeSeconds - 60f); GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } if (GUILayout.Button(Ru ? "Применить" : "Apply", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } if (GUILayout.Button(Ru ? "+60 сек" : "+60 sec", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { ModConfig.ExpeditionTimeSeconds += 60f; GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } GUILayout.EndHorizontal(); float num3 = NumberField(TimeOfDayLabel(), _timeOfDay, 0f, 24f); if (Mathf.Abs(num3 - _timeOfDay) > 0.001f) { _timeOfDay = num3; _timePreset = PresetForHour(_timeOfDay); _timeOfDayDirty = true; } GUILayout.BeginHorizontal(Array.Empty()); TimePresetButton(Ru ? "Рассвет" : "Dawn", 6f, 0, Ru ? "Выбрать рассвет." : "Choose dawn."); TimePresetButton(Ru ? "День" : "Day", 12f, 1, Ru ? "Выбрать день." : "Choose daytime."); TimePresetButton(Ru ? "Закат" : "Dusk", 19f, 2, Ru ? "Выбрать закат." : "Choose dusk."); TimePresetButton(Ru ? "Ночь" : "Night", 23f, 3, Ru ? "Выбрать ночь." : "Choose night."); GUILayout.EndHorizontal(); if (GUILayout.Button(Ru ? "Применить время суток" : "Apply time of day", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { ApplySelectedTimeOfDay(); } EndSection(); } if (BeginSection("world.finish", Ru ? "Финиш" : "Finish", defaultOpen: false)) { GUILayout.Label(Ru ? "Мгновенно завершает текущий забег победой." : "Instantly ends the current run as a win.", Theme.LabelDim, Array.Empty()); if (GUILayout.Button(Ru ? "Мгновенно пройти" : "Force win", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ForceWin(); } EndSection(); } if (!BeginSection("world.luggage", Ru ? "Контейнеры рядом" : "Nearby containers", defaultOpen: false)) { return; } GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Обновить (300 м)" : "Refresh (300 m)", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.RefreshLuggage(); _selLuggage = -1; } if (GUILayout.Button(Ru ? "Открыть все рядом" : "Open all nearby", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.OpenAllNearbyLuggage(); } GUILayout.EndHorizontal(); if (GameApi.LuggageLabels.Count == 0) { GUILayout.Label(Ru ? "Список пуст — нажми «Обновить» в катке." : "Empty — press Refresh during a run.", Theme.LabelDim, Array.Empty()); } else { _luggageScroll = GUILayout.BeginScrollView(_luggageScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(150f) }); for (int i = 0; i < GameApi.LuggageLabels.Count; i++) { if (GUILayout.Button(GameApi.LuggageLabels[i], (_selLuggage == i) ? Theme.ListItemActive : Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Height(30f), GUILayout.ExpandWidth(true) })) { _selLuggage = i; } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Открыть выбранный" : "Open selected", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }) && _selLuggage >= 0) { GameApi.OpenLuggage(_selLuggage); } if (GUILayout.Button(Ru ? "Телепорт к нему" : "Warp to it", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }) && _selLuggage >= 0) { GameApi.WarpToLuggage(_selLuggage); } GUILayout.EndHorizontal(); } EndSection(); return; } GUILayout.Label(Ru ? "Время и забег" : "Time & run", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); float num4 = GameApi.ExpeditionTimeSeconds(); float timeOfDayNow2 = GameApi.TimeOfDay(); int num5 = GameApi.DayCount(); if ((int)Event.current.type == 7) { SyncTimeOfDayInput(timeOfDayNow2); } GUILayout.Label((Ru ? "Время забега: " : "Run time: ") + FormatRunTime(num4), Theme.LabelDim, Array.Empty()); GUILayout.Label((Ru ? "День: " : "Day: ") + num5 + " " + (Ru ? "Час: " : "Hour: ") + timeOfDayNow2.ToString("0.0"), Theme.LabelDim, Array.Empty()); bool flag2 = Toggle(Ru ? "Держать время забега" : "Hold run timer", ModConfig.OverrideExpeditionTime); if (flag2 != ModConfig.OverrideExpeditionTime) { ModConfig.OverrideExpeditionTime = flag2; if (flag2) { ModConfig.ExpeditionTimeSeconds = num4; } } ModConfig.ExpeditionTimeSeconds = Slider(Ru ? "Секунды забега" : "Run seconds", ModConfig.ExpeditionTimeSeconds, 0f, 7200f); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "-60 сек" : "-60 sec", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { ModConfig.ExpeditionTimeSeconds = Mathf.Max(0f, ModConfig.ExpeditionTimeSeconds - 60f); GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } if (GUILayout.Button(Ru ? "Применить" : "Apply", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } if (GUILayout.Button(Ru ? "+60 сек" : "+60 sec", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { ModConfig.ExpeditionTimeSeconds += 60f; GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } GUILayout.EndHorizontal(); float num6 = Slider(TimeOfDayLabel(), _timeOfDay, 0f, 24f); if (Mathf.Abs(num6 - _timeOfDay) > 0.001f) { _timeOfDay = num6; _timePreset = PresetForHour(_timeOfDay); _timeOfDayDirty = true; } GUILayout.BeginHorizontal(Array.Empty()); TimePresetButton(Ru ? "Рассвет" : "Dawn", 6f, 0, Ru ? "Выбрать рассвет." : "Choose dawn."); TimePresetButton(Ru ? "День" : "Day", 12f, 1, Ru ? "Выбрать день." : "Choose daytime."); TimePresetButton(Ru ? "Закат" : "Dusk", 19f, 2, Ru ? "Выбрать закат." : "Choose dusk."); TimePresetButton(Ru ? "Ночь" : "Night", 23f, 3, Ru ? "Выбрать ночь." : "Choose night."); GUILayout.EndHorizontal(); if (GUILayout.Button(Ru ? "Применить время суток" : "Apply time of day", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { ApplySelectedTimeOfDay(); } GUILayout.EndVertical(); GUILayout.Label(Ru ? "Финиш" : "Finish", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); GUILayout.Label(Ru ? "Мгновенно завершает текущий забег победой." : "Instantly ends the current run as a win.", Theme.LabelDim, Array.Empty()); if (GUILayout.Button(Ru ? "Мгновенно пройти" : "Force win", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ForceWin(); } GUILayout.EndVertical(); GUILayout.Label(Ru ? "Контейнеры рядом" : "Nearby containers", Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Обновить (300 м)" : "Refresh (300 m)", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.RefreshLuggage(); _selLuggage = -1; } if (GUILayout.Button(Ru ? "Открыть все рядом" : "Open all nearby", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.OpenAllNearbyLuggage(); } GUILayout.EndHorizontal(); if (GameApi.LuggageLabels.Count == 0) { GUILayout.Label(Ru ? "Список пуст — нажми «Обновить» в катке." : "Empty — press Refresh during a run.", Theme.LabelDim, Array.Empty()); } else { _luggageScroll = GUILayout.BeginScrollView(_luggageScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(150f) }); for (int j = 0; j < GameApi.LuggageLabels.Count; j++) { if (GUILayout.Button(GameApi.LuggageLabels[j], (_selLuggage == j) ? Theme.ListItemActive : Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Height(30f), GUILayout.ExpandWidth(true) })) { _selLuggage = j; } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Открыть выбранный" : "Open selected", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }) && _selLuggage >= 0) { GameApi.OpenLuggage(_selLuggage); } if (GUILayout.Button(Ru ? "Телепорт к нему" : "Warp to it", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }) && _selLuggage >= 0) { GameApi.WarpToLuggage(_selLuggage); } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); } private static string FormatRunTime(float seconds) { int num = Mathf.Max(0, Mathf.FloorToInt(seconds)); int num2 = num / 3600; int num3 = num % 3600 / 60; int num4 = num % 60; if (num2 <= 0) { return $"{num3:00}:{num4:00}"; } return $"{num2:00}:{num3:00}:{num4:00}"; } private static string TimeOfDayLabel() { if (!Ru) { return "Time of day"; } return "Время суток"; } private static void SyncTimeOfDayInput(float timeOfDayNow) { if (!_timeOfDayDirty) { _timeOfDay = Mathf.Repeat(timeOfDayNow, 24f); _timePreset = PresetForHour(_timeOfDay); SetNumberText(TimeOfDayLabel(), 0f, 24f, _timeOfDay); } } private static int PresetForHour(float hour) { hour = Mathf.Repeat(hour, 24f); if (Mathf.Abs(Mathf.DeltaAngle(hour * 15f, 90f)) <= 0.75f) { return 0; } if (Mathf.Abs(Mathf.DeltaAngle(hour * 15f, 180f)) <= 0.75f) { return 1; } if (Mathf.Abs(Mathf.DeltaAngle(hour * 15f, 285f)) <= 0.75f) { return 2; } if (Mathf.Abs(Mathf.DeltaAngle(hour * 15f, 345f)) <= 0.75f) { return 3; } return -1; } private static void TimePresetButton(string label, float hour, int preset, string tip) { bool flag = _timePreset == preset || PresetForHour(_timeOfDay) == preset; if (GUILayout.Button(label, flag ? Theme.ChipActive : Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { _timeOfDay = hour; _timePreset = preset; _timeOfDayDirty = true; SetNumberText(TimeOfDayLabel(), 0f, 24f, _timeOfDay); ActionTracker.Track("world_time_preset_select", hour, new Dictionary { ["preset"] = label }); } TipLast(tip); } private static void ApplySelectedTimeOfDay() { _timeOfDay = Mathf.Repeat(_timeOfDay, 24f); GameApi.SetTimeOfDay(_timeOfDay); _timeOfDayDirty = false; _timePreset = PresetForHour(_timeOfDay); SetNumberText(TimeOfDayLabel(), 0f, 24f, _timeOfDay); } private static void DrawBadges() { //IL_015c: 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) //IL_01fe: 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_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Invalid comparison between Unknown and I4 //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Expected O, but got Unknown //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) if (UseModernUi) { DrawBadgesModern(); return; } ACHIEVEMENTTYPE[] allTypes = SteamAch.AllTypes; int num = allTypes.Length; bool[] array = new bool[num]; int num2 = 0; for (int i = 0; i < num; i++) { if (array[i] = SteamAch.IsUnlocked(allTypes[i])) { num2++; } } GUILayout.Label(L("tab.badges"), Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label((Ru ? "Получено: " : "Unlocked: ") + num2 + " / " + num, Theme.LabelDim, Array.Empty()); GUILayout.FlexibleSpace(); if (GUILayout.Button(Ru ? "Выдать все" : "Unlock all", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { SteamAch.UnlockAll(); } if (GUILayout.Button(Ru ? "Отозвать все" : "Revoke all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { SteamAch.RevokeAll(); } GUILayout.EndHorizontal(); GUILayout.Label(Ru ? "Клик по иконке — выдать / отозвать. Зелёная = получена, красная = нет." : "Click an icon to unlock / revoke. Green = unlocked, red = locked.", Theme.LabelDim, Array.Empty()); if ((Object)(object)_tileBg == (Object)null) { _tileBg = Theme.RoundedTex(Theme.Panel, 8); } if ((Object)(object)_frameOn == (Object)null) { _frameOn = Theme.RoundedTex(Theme.Accent, 8); } if ((Object)(object)_frameOff == (Object)null) { _frameOff = Theme.RoundedTex(BadgeLocked, 8); } float num3 = Mathf.Max(1f, ((Rect)(ref _rect)).width - 270f); int num4 = Mathf.Max(3, Mathf.FloorToInt((num3 + 6f) / 86f)); float num5 = Mathf.Clamp(((Rect)(ref _rect)).height - 240f, 160f, 420f); _badgeScroll = GUILayout.BeginScrollView(_badgeScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(num5) }); for (int j = 0; j < num; j++) { if (j % num4 == 0) { GUILayout.BeginHorizontal(Array.Empty()); } ACHIEVEMENTTYPE t = allTypes[j]; bool flag = array[j]; Rect rect = GUILayoutUtility.GetRect(80f, 80f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(80f), GUILayout.Height(80f) }); if ((int)Event.current.type == 7) { GUI.DrawTexture(rect, (Texture)(object)(flag ? _frameOn : _frameOff)); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 3f, ((Rect)(ref rect)).width - 6f, ((Rect)(ref rect)).height - 6f), (Texture)(object)_tileBg); Texture2D val = SteamAch.Icon(t); float num6 = ((Rect)(ref rect)).x + 10f; float num7 = ((Rect)(ref rect)).y + 10f; if ((Object)(object)val != (Object)null) { GUI.DrawTexture(new Rect(num6, num7, 60f, 60f), (Texture)(object)val); } else { GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 80f, 80f), "…", Theme.LabelDim); } } string text = SteamAch.DisplayName(t); string text2 = SteamAch.Desc(t); if (!string.IsNullOrEmpty(text2)) { text = text + "\n" + text2; } if (GUI.Button(rect, new GUIContent("", text), GUIStyle.none)) { SteamAch.Toggle(t); } GUILayout.Space(6f); if (j % num4 == num4 - 1 || j == num - 1) { GUILayout.EndHorizontal(); } if (j % num4 == num4 - 1) { GUILayout.Space(6f); } } GUILayout.EndScrollView(); GUILayout.EndVertical(); } private static void DrawCosmetics() { GUILayout.Label(L("tab.cosmetics"), Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); if (GUILayout.Button(Ru ? "Разблокировать всю косметику" : "Unlock all cosmetics", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { SteamAch.UnlockAllCosmetics(); } GUILayout.Label(Ru ? "Косметика в PEAK открывается через достижения и стат максимальной высоты. Кнопка выдаёт все ачивки и поднимает этот стат — после этого наряды доступны в настройке персонажа." : "Cosmetics in PEAK unlock via achievements and the max height stat. This grants all achievements and raises that stat, so outfits become available in character customization.", Theme.LabelDim, Array.Empty()); GUILayout.EndVertical(); } private static void DrawAbout() { //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) if (Event.current != null) { GUILayout.Label("PEAK-MX v1.0.0", Theme.Section, Array.Empty()); GUILayout.Label(Ru ? "Автор: maxkir041" : "Author: maxkir041", Theme.Label, Array.Empty()); GUILayout.Space(6f); GUILayout.Label(L("ui.language"), Theme.Section, Array.Empty()); DrawLanguagePicker(); GUILayout.Space(6f); GUILayout.Label(Ru ? "Окно" : "Window", Theme.Section, Array.Empty()); GUILayout.Label(Ru ? "Перетаскивай меню за шапку и тяни за любую грань или угол, как обычное окно." : "Drag the menu by its header and resize it by any edge or corner, like a regular app window.", Theme.LabelDim, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Стандартный размер" : "Default size", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { _rect = DefaultWindowRect(); } if (GUILayout.Button(Ru ? "По центру" : "Center", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(100f), GUILayout.Height(28f) })) { CenterWindow(); } GUILayout.EndHorizontal(); GUILayout.Label((Ru ? "Текущий размер: " : "Current size: ") + Mathf.RoundToInt(((Rect)(ref _rect)).width) + " x " + Mathf.RoundToInt(((Rect)(ref _rect)).height), Theme.LabelDim, Array.Empty()); GUILayout.Space(6f); GUILayout.Label(Ru ? "Ссылки:" : "Links:", Theme.Section, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); LinkButton("GitHub", "https://github.com/maxkir041/PEAK-MX"); LinkButton("Steam", "https://steamcommunity.com/id/everyng/"); LinkButton("Telegram", "https://t.me/maxkir041"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); LinkButton("Playground", "https://users.playground.ru/7293247/"); LinkButton("Website", "https://peak-mx.rkngov.com"); GUILayout.EndHorizontal(); GUILayout.Space(8f); GUILayout.Label(SupportText(), Theme.DonateText, Array.Empty()); if (GUILayout.Button(DonateTextLabel(), Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) })) { OpenUrl("https://www.donationalerts.com/r/maxkir041"); } GUILayout.Space(6f); DrawQr(150f); GUILayout.Label(QrHintText(), Theme.LabelDim, Array.Empty()); GUILayout.Space(6f); bool value = ModConfig.ShowDonateNotice.Value; bool flag = GUILayout.Toggle(value, ReminderToggleText(), Theme.Label, Array.Empty()); if (flag != value) { ModConfig.ShowDonateNotice.Value = flag; } DrawAnalyticsStatus(); GUILayout.Space(6f); GUILayout.Label(Ru ? "Неофициальный фанатский мод. Не связан с разработчиками PEAK. Сторонние библиотеки остаются под своими лицензиями." : "Unofficial fan-made mod. Not affiliated with PEAK's developers. Third-party libraries keep their own licenses.", Theme.LabelDim, Array.Empty()); return; } GUILayout.Label("PEAK-MX v1.0.0", Theme.Section, Array.Empty()); GUILayout.Label(Ru ? "Автор: maxkir041" : "Author: maxkir041", Theme.Label, Array.Empty()); GUILayout.Space(6f); GUILayout.Label(L("ui.language"), Theme.Section, Array.Empty()); DrawLanguagePicker(); GUILayout.Space(6f); GUILayout.Label(Ru ? "Размер меню" : "Menu size", Theme.Section, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); float value2 = ModConfig.UiScale.Value; if (GUILayout.Button("−", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(40f), GUILayout.Height(28f) })) { ModConfig.UiScale.Value = Mathf.Clamp(value2 - 0.1f, 0.6f, 2f); } GUILayout.Label((value2 * 100f).ToString("0") + "%", Theme.Label, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(64f) }); if (GUILayout.Button("+", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(40f), GUILayout.Height(28f) })) { ModConfig.UiScale.Value = Mathf.Clamp(value2 + 0.1f, 0.6f, 2f); } if (GUILayout.Button(Ru ? "Сброс" : "Reset", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(80f), GUILayout.Height(28f) })) { ModConfig.UiScale.Value = 1f; } GUILayout.EndHorizontal(); GUILayout.Space(6f); GUILayout.Label(Ru ? "Ссылки:" : "Links:", Theme.Section, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); LinkButton("GitHub", "https://github.com/maxkir041/PEAK-MX"); LinkButton("Steam", "https://steamcommunity.com/id/everyng/"); LinkButton("Telegram", "https://t.me/maxkir041"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); LinkButton("Playground", "https://users.playground.ru/7293247/"); LinkButton("Website", "https://peak-mx.rkngov.com"); GUILayout.EndHorizontal(); GUILayout.Space(8f); GUILayout.Label(SupportText(), Theme.DonateText, Array.Empty()); if (GUILayout.Button(DonateTextLabel(), Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(160f) })) { OpenUrl("https://www.donationalerts.com/r/maxkir041"); } GUILayout.Space(6f); DrawQr(150f); GUILayout.Label(QrHintText(), Theme.LabelDim, Array.Empty()); GUILayout.Space(6f); bool value3 = ModConfig.ShowDonateNotice.Value; bool flag2 = GUILayout.Toggle(value3, ReminderToggleText(), Theme.Label, Array.Empty()); if (flag2 != value3) { ModConfig.ShowDonateNotice.Value = flag2; } DrawAnalyticsStatus(); GUILayout.Space(6f); GUILayout.Label(Ru ? "Неофициальный фанатский мод. Не связан с разработчиками PEAK. Сторонние библиотеки — под своими лицензиями." : "Unofficial fan-made mod. Not affiliated with PEAK's developers. Third-party libraries keep their own licenses.", Theme.LabelDim, Array.Empty()); } private static void DrawLanguagePicker() { string text = ""; (Lang, string)[] options = Localization.Options; for (int i = 0; i < options.Length; i++) { var (lang, text2) = options[i]; if (lang == Localization.Current) { text = text2; } } if (GUILayout.Button(text + (_langOpen ? " ▲" : " ▼"), Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(210f), GUILayout.Height(28f) })) { _langOpen = !_langOpen; } if (!_langOpen) { return; } GUILayout.BeginVertical(Theme.Card, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(210f) }); options = Localization.Options; for (int i = 0; i < options.Length; i++) { (Lang, string) tuple2 = options[i]; var (lang2, _) = tuple2; if (GUILayout.Button(tuple2.Item2, (lang2 == Localization.Current) ? Theme.NavItemActive : Theme.NavItem, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(190f) })) { Localization.Current = lang2; ModConfig.Language.Value = (int)lang2; _langOpen = false; } } GUILayout.EndVertical(); } private static void DrawAnalyticsStatus() { ModConfig.AllowAnonymousStats.Value = true; string text = InstallStatsToggleText().Trim(); GUILayout.Label(Localization.Current switch { Lang.Russian => text + ": включена", Lang.Ukrainian => text + ": увімкнена", Lang.Spanish => text + ": activada", Lang.PortugueseBR => text + ": ativa", Lang.German => text + ": aktiv", Lang.French => text + ": active", Lang.Italian => text + ": attiva", Lang.Polish => text + ": wlaczona", Lang.Turkish => text + ": acik", Lang.ChineseSimplified => text + ": 已启用", Lang.ChineseTraditional => text + ": 已啟用", Lang.Japanese => text + ": 有効", Lang.Korean => text + ": 켜짐", _ => text + ": enabled", }, Theme.LabelDim, Array.Empty()); if (Stats.InstallCount.HasValue) { GUILayout.Label(InstallsLabel() + Stats.InstallCount.Value, Theme.LabelDim, Array.Empty()); } } private static string SupportText() { return Localization.Current switch { Lang.Russian => "Я делаю PEAK-MX почти в одиночку, ночами чиню баги и всё равно держу мод бесплатным. Если он тебе помогает, поддержка правда спасает мотивацию и даёт силы выпускать новые обновления.", Lang.Ukrainian => "Я роблю PEAK-MX майже сам, ночами виправляю баги й усе одно залишаю мод безкоштовним. Якщо він тобі допомагає, підтримка справді рятує мотивацію та дає сили на нові оновлення.", Lang.Spanish => "Hago PEAK-MX casi solo, arreglo bugs de noche y aun asi lo mantengo gratis. Si el mod te ayuda, tu apoyo de verdad me salva la motivacion y me da fuerzas para seguir actualizando.", Lang.PortugueseBR => "Eu faco o PEAK-MX quase sozinho, corrijo bugs de madrugada e ainda mantenho o mod gratuito. Se ele te ajuda, o apoio realmente salva a motivacao e me da forca para continuar atualizando.", Lang.German => "Ich baue PEAK-MX fast allein, fixe nachts Bugs und halte den Mod trotzdem kostenlos. Wenn er dir hilft, rettet deine Unterstuetzung wirklich meine Motivation und macht weitere Updates moeglich.", Lang.French => "Je fais PEAK-MX presque seul, je corrige les bugs la nuit et je garde quand meme le mod gratuit. Si le mod t'aide, ton soutien sauve vraiment ma motivation et m'aide a continuer les mises a jour.", Lang.Italian => "Sviluppo PEAK-MX quasi da solo, sistemo bug di notte e lo tengo comunque gratuito. Se il mod ti aiuta, il supporto salva davvero la motivazione e mi da forza per continuare gli aggiornamenti.", Lang.Polish => "Tworze PEAK-MX prawie sam, naprawiam bugi nocami i nadal udostepniam mod za darmo. Jesli ci pomaga, wsparcie naprawde ratuje motywacje i daje sile na kolejne aktualizacje.", Lang.Turkish => "PEAK-MX'i neredeyse tek basima yapiyorum, geceleri hatalari duzeltiyorum ve modu yine de ucretsiz tutuyorum. Mod isine yariyorsa destek gercekten motivasyonumu kurtarir ve yeni guncellemeler icin guc verir.", Lang.ChineseSimplified => "PEAK-MX 基本都是我一个人维护,很多 bug 都是在深夜修的,但我还是让它免费。如果这个模组帮到了你,你的支持真的能救回我的动力,让我继续更新。", Lang.ChineseTraditional => "PEAK-MX 基本都是我一個人維護,很多 bug 都是在深夜修的,但我還是讓它免費。如果這個模組幫到了你,你的支持真的能救回我的動力,讓我繼續更新。", Lang.Japanese => "PEAK-MX はほぼ一人で作っていて、夜中にバグを直しながら、それでも無料で公開しています。この MOD が役に立ったなら、支援は本当に励みになり、次の更新を続ける力になります。", Lang.Korean => "PEAK-MX는 거의 혼자 만들고, 밤마다 버그를 고치면서도 무료로 유지하고 있습니다. 이 모드가 도움이 됐다면 후원은 정말 큰 힘이 되고 다음 업데이트를 계속할 동기가 됩니다.", _ => "I build PEAK-MX mostly alone, fix bugs late at night, and still keep the mod free. If it helps you, support genuinely rescues my motivation and gives me the strength to keep updates coming.", }; } private static string DonateTextLabel() { switch (Localization.Current) { case Lang.Russian: return "Поддержать"; case Lang.Ukrainian: return "Підтримати"; case Lang.Spanish: return "Apoyar"; case Lang.PortugueseBR: return "Apoiar"; case Lang.German: return "Unterstuetzen"; case Lang.French: return "Soutenir"; case Lang.Italian: return "Supporta"; case Lang.Polish: return "Wesprzyj"; case Lang.Turkish: return "Destekle"; case Lang.ChineseSimplified: case Lang.ChineseTraditional: return "支持"; case Lang.Japanese: return "支援する"; case Lang.Korean: return "후원"; default: return "Support"; } } private static string CloseTextLabel() { switch (Localization.Current) { case Lang.Russian: return "Закрыть"; case Lang.Ukrainian: return "Закрити"; case Lang.Spanish: return "Cerrar"; case Lang.PortugueseBR: return "Fechar"; case Lang.German: return "Schliessen"; case Lang.French: return "Fermer"; case Lang.Italian: return "Chiudi"; case Lang.Polish: return "Zamknij"; case Lang.Turkish: return "Kapat"; case Lang.ChineseSimplified: case Lang.ChineseTraditional: return "关闭"; case Lang.Japanese: return "閉じる"; case Lang.Korean: return "닫기"; default: return "Close"; } } private static string ReminderToggleText() { return Localization.Current switch { Lang.Russian => " Показывать напоминание при запуске", Lang.Ukrainian => " Показувати нагадування при запуску", Lang.Spanish => " Mostrar recordatorio al iniciar", Lang.PortugueseBR => " Mostrar lembrete ao iniciar", Lang.German => " Erinnerung beim Start zeigen", Lang.French => " Afficher le rappel au lancement", Lang.Italian => " Mostra promemoria all'avvio", Lang.Polish => " Pokazuj przypomnienie przy starcie", Lang.Turkish => " Baslangicta hatirlatma goster", Lang.ChineseSimplified => " 启动时显示提醒", Lang.ChineseTraditional => " 啟動時顯示提醒", Lang.Japanese => " 起動時にリマインダーを表示", Lang.Korean => " 시작 시 알림 표시", _ => " Show reminder on launch", }; } private static string InstallStatsToggleText() { return Localization.Current switch { Lang.Russian => " Анонимная аналитика", Lang.Ukrainian => " Анонімна аналітика", Lang.Spanish => " Analitica anonima", Lang.PortugueseBR => " Analise anonima", Lang.German => " Anonyme Analyse", Lang.French => " Analyse anonyme", Lang.Italian => " Analisi anonima", Lang.Polish => " Anonimowa analityka", Lang.Turkish => " Anonim analiz", Lang.ChineseSimplified => " 匿名分析", Lang.ChineseTraditional => " 匿名分析", Lang.Japanese => " 匿名分析", Lang.Korean => " 익명 분석", _ => " Anonymous analytics", }; } private static string InstallsLabel() { return Localization.Current switch { Lang.Russian => "Установок: ", Lang.Ukrainian => "Встановлень: ", Lang.Spanish => "Instalaciones: ", Lang.PortugueseBR => "Instalacoes: ", Lang.German => "Installationen: ", Lang.French => "Installations: ", Lang.Italian => "Installazioni: ", Lang.Polish => "Instalacje: ", Lang.Turkish => "Kurulumlar: ", Lang.ChineseSimplified => "安装数: ", Lang.ChineseTraditional => "安裝數: ", Lang.Japanese => "インストール数: ", Lang.Korean => "설치 수: ", _ => "Installs: ", }; } private static string QrHintText() { return Localization.Current switch { Lang.Russian => "Сканируй QR для поддержки", Lang.Ukrainian => "Скануй QR для підтримки", Lang.Spanish => "Escanea el QR para apoyar", Lang.PortugueseBR => "Escaneie o QR para apoiar", Lang.German => "QR scannen zum Unterstuetzen", Lang.French => "Scanne le QR pour soutenir", Lang.Italian => "Scansiona il QR per supportare", Lang.Polish => "Zeskanuj QR, aby wesprzec", Lang.Turkish => "Destek icin QR'yi tara", Lang.ChineseSimplified => "扫描二维码支持", Lang.ChineseTraditional => "掃描 QR 碼支持", Lang.Japanese => "QR を読み取って支援", Lang.Korean => "QR을 스캔해 후원", _ => "Scan the QR to support", }; } private static string CosmeticCategoryLabel(GameApi.CosmeticCategory category) { return category switch { GameApi.CosmeticCategory.Skin => Ru ? "Кожа" : "Skin", GameApi.CosmeticCategory.Accessory => Ru ? "Аксессуар" : "Accessory", GameApi.CosmeticCategory.Eyes => Ru ? "Глаза" : "Eyes", GameApi.CosmeticCategory.Mouth => Ru ? "Рот" : "Mouth", GameApi.CosmeticCategory.Outfit => Ru ? "Одежда" : "Outfit", GameApi.CosmeticCategory.Hat => Ru ? "Шляпа" : "Hat", GameApi.CosmeticCategory.Sash => Ru ? "Лента" : "Sash", _ => category.ToString(), }; } private static string CosmeticDisplayName(CustomizationOption option) { if ((Object)(object)option == (Object)null) { return "-"; } try { if (option.isBlank) { return Ru ? "Пусто" : "Empty"; } } catch { } string text = ""; try { text = ((Object)option).name ?? ""; } catch { } if (string.IsNullOrWhiteSpace(text)) { text = "Cosmetic"; } string text2 = HumanizeName(text); if (!Ru) { return text2; } return TranslateCosmeticRu(text2); } private static string HumanizeName(string raw) { string text = ""; char c = '\0'; for (int i = 0; i < raw.Length; i++) { char c2 = raw[i]; if (c2 == '_' || c2 == '-') { text += " "; } else { if (i > 0 && char.IsUpper(c2) && (char.IsLower(c) || char.IsDigit(c))) { text += " "; } text += c2; } c = c2; } text = WebUtility.HtmlDecode(text).Trim(); while (text.Contains(" ")) { text = text.Replace(" ", " "); } if (!string.IsNullOrWhiteSpace(text)) { return text; } return raw; } private static string TranslateCosmeticRu(string human) { string[] array = human.Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); Dictionary dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase) { ["eye"] = "глаз", ["eyes"] = "глаза", ["mouth"] = "рот", ["skin"] = "кожа", ["hat"] = "шляпа", ["cap"] = "кепка", ["crown"] = "корона", ["goat"] = "козёл", ["sash"] = "лента", ["fit"] = "наряд", ["outfit"] = "одежда", ["accessory"] = "аксессуар", ["red"] = "красный", ["blue"] = "синий", ["green"] = "зелёный", ["yellow"] = "жёлтый", ["black"] = "чёрный", ["white"] = "белый", ["gold"] = "золотой", ["silver"] = "серебряный", ["pink"] = "розовый", ["purple"] = "фиолетовый", ["orange"] = "оранжевый", ["brown"] = "коричневый", ["small"] = "маленький", ["big"] = "большой", ["large"] = "большой", ["round"] = "круглый", ["sad"] = "грустный", ["happy"] = "счастливый", ["angry"] = "злой", ["sleepy"] = "сонный", ["normal"] = "обычный", ["default"] = "обычный", ["empty"] = "пусто", ["glasses"] = "очки", ["mask"] = "маска", ["bandana"] = "бандана", ["flower"] = "цветок" }; for (int i = 0; i < array.Length; i++) { if (dictionary.TryGetValue(array[i], out var value)) { array[i] = value; } } if (array.Length == 0) { return human; } string text = string.Join(" ", array); return char.ToUpperInvariant(text[0]) + ((text.Length > 1) ? text.Substring(1) : ""); } private static void DrawCosmeticsModern2() { //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) GUILayout.Label(L("tab.cosmetics"), Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); GUILayout.Label(Ru ? "Здесь можно выбирать именно косметику по категориям, а не только выдавать связанные достижения." : "Here you can choose specific cosmetics by category, not just grant the linked achievements.", Theme.LabelDim, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Разблокировать всю косметику" : "Unlock all cosmetics", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { SteamAch.UnlockAllCosmetics(); } if (GUILayout.Button(Ru ? "Сбросить стат высоты" : "Reset height stat", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { SteamAch.SetMaxAscent(0); } GUILayout.EndHorizontal(); GameApi.CosmeticCategory[] array = (GameApi.CosmeticCategory[])Enum.GetValues(typeof(GameApi.CosmeticCategory)); GUILayout.BeginHorizontal(Array.Empty()); for (int i = 0; i < array.Length; i++) { if (GUILayout.Button(CosmeticCategoryLabel(array[i]), (_cosmeticCategory == i) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _cosmeticCategory = i; } } GUILayout.EndHorizontal(); GameApi.CosmeticCategory category = array[Mathf.Clamp(_cosmeticCategory, 0, array.Length - 1)]; CustomizationOption[] cosmeticOptions = GameApi.GetCosmeticOptions(category); int currentCosmeticIndex = GameApi.GetCurrentCosmeticIndex(category); int num = GameApi.FindBlankCosmeticIndex(category); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label((Ru ? "Активно: " : "Active: ") + ((currentCosmeticIndex >= 0 && currentCosmeticIndex < cosmeticOptions.Length && (Object)(object)cosmeticOptions[currentCosmeticIndex] != (Object)null) ? ((Object)cosmeticOptions[currentCosmeticIndex]).name : "-"), Theme.LabelDim, Array.Empty()); GUILayout.FlexibleSpace(); if (num >= 0 && GUILayout.Button(Ru ? "Выключить" : "Clear", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.SetCosmetic(category, num); } GUILayout.EndHorizontal(); _cosmeticScroll = GUILayout.BeginScrollView(_cosmeticScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(Mathf.Clamp(((Rect)(ref _rect)).height - 260f, 180f, 360f)) }); for (int j = 0; j < cosmeticOptions.Length; j++) { CustomizationOption val = cosmeticOptions[j]; if ((Object)(object)val == (Object)null) { continue; } bool flag = j == currentCosmeticIndex; string text = CosmeticDisplayName(val); try { if (!val.isBlank && val.IsLocked) { text += (Ru ? " [закрыто]" : " [locked]"); } } catch { } if (GUILayout.Button(text, flag ? Theme.ListItemActive : Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Height(30f), GUILayout.ExpandWidth(true) })) { GameApi.SetCosmetic(category, j); } } GUILayout.EndScrollView(); GUILayout.EndVertical(); } private static void DrawCosmeticsModern3() { //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) GUILayout.Label(L("tab.cosmetics"), Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); GUILayout.Label(Ru ? "Выбирай конкретную категорию и конкретный предмет косметики. Элементы можно открывать и сбрасывать отдельно." : "Choose a category and a specific cosmetic item. Options can be unlocked and reset one by one.", Theme.LabelDim, Array.Empty()); GUILayout.Label(Ru ? "Важно: закрытие некоторых предметов сбрасывает связанное достижение, стат или максимальную высоту, поэтому может повлиять на несколько косметик сразу." : "Important: locking some cosmetics resets a linked achievement, stat, or max height value, so it can affect multiple cosmetics at once.", Theme.LabelDim, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Разблокировать всё" : "Unlock all", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.UnlockAllCosmeticOptions(); } TipLast(Ru ? "Локально открывает все элементы косметики и дополнительно выставляет связанные Steam-условия." : "Locally unlocks every cosmetic option and also applies related Steam requirements."); if (GUILayout.Button(Ru ? "Сбросить стат высоты" : "Reset height stat", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { SteamAch.SetMaxAscent(0); } TipLast(Ru ? "Сбрасывает стат максимальной высоты до 0. Может закрыть косметику, завязанную на высоту." : "Resets the max height stat to 0. Can lock height-gated cosmetics."); GUILayout.EndHorizontal(); GameApi.CosmeticCategory[] array = (GameApi.CosmeticCategory[])Enum.GetValues(typeof(GameApi.CosmeticCategory)); GUILayout.BeginHorizontal(Array.Empty()); for (int i = 0; i < array.Length; i++) { if (GUILayout.Button(CosmeticCategoryLabel(array[i]), (_cosmeticCategory == i) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _cosmeticCategory = i; } } GUILayout.EndHorizontal(); GameApi.CosmeticCategory category = array[Mathf.Clamp(_cosmeticCategory, 0, array.Length - 1)]; CustomizationOption[] cosmeticOptions = GameApi.GetCosmeticOptions(category); int currentCosmeticIndex = GameApi.GetCurrentCosmeticIndex(category); int num = GameApi.FindBlankCosmeticIndex(category); int num2 = 0; int num3 = 0; foreach (CustomizationOption val in cosmeticOptions) { if (!((Object)(object)val == (Object)null)) { if (GameApi.IsCosmeticOptionGrantable(category, val)) { num2++; } else { num3++; } } } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label((Ru ? "Активно: " : "Active: ") + ((currentCosmeticIndex >= 0 && currentCosmeticIndex < cosmeticOptions.Length && (Object)(object)cosmeticOptions[currentCosmeticIndex] != (Object)null) ? CosmeticDisplayName(cosmeticOptions[currentCosmeticIndex]) : "-"), Theme.LabelDim, Array.Empty()); GUILayout.FlexibleSpace(); if (num >= 0 && GUILayout.Button(Ru ? "Выключить" : "Clear", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.SetCosmetic(category, num); } TipLast(Ru ? "Поставить пустой вариант в текущей категории косметики." : "Select the blank option for the current cosmetic category."); GUILayout.EndHorizontal(); if (num3 > 0) { GUILayout.Label((Ru ? "Базовые неудаляемые элементы скрыты: " : "Base non-removable items hidden: ") + num3, Theme.LabelDim, Array.Empty()); } if (num2 == 0) { GUILayout.Label(Ru ? "В этой категории нет выдаваемых элементов." : "This category has no grantable items.", Theme.LabelDim, Array.Empty()); } _cosmeticScroll = GUILayout.BeginScrollView(_cosmeticScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(Mathf.Clamp(((Rect)(ref _rect)).height - 260f, 180f, 360f)) }); for (int k = 0; k < cosmeticOptions.Length; k++) { CustomizationOption val2 = cosmeticOptions[k]; if ((Object)(object)val2 == (Object)null || !GameApi.IsCosmeticOptionGrantable(category, val2)) { continue; } bool flag = k == currentCosmeticIndex; bool flag2 = false; string text = CosmeticDisplayName(val2); try { flag2 = val2.IsLocked; } catch { } GUILayout.BeginHorizontal(Array.Empty()); if (DrawCosmeticListRow(category, val2, text + ((!flag2) ? "" : (Ru ? " [закрыто]" : " [locked]")), flag, flag2)) { GameApi.SetCosmetic(category, k); } TipLast((!flag2) ? (Ru ? "Выбрать этот элемент косметики." : "Select this cosmetic.") : (Ru ? "Элемент закрыт. Нажми «Открыть», чтобы разблокировать его отдельно." : "This option is locked. Press Unlock to unlock it separately.")); if (GUILayout.Button(Ru ? "Выбрать" : "Select", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(82f), GUILayout.Height(30f) })) { GameApi.SetCosmetic(category, k); } TipLast(Ru ? "Надеть этот элемент косметики." : "Equip this cosmetic option."); if (flag2 && GUILayout.Button(Ru ? "Открыть" : "Unlock", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(82f), GUILayout.Height(30f) })) { GameApi.UnlockCosmeticOption(val2); GameApi.SetCosmetic(category, k); } if (flag2) { TipLast(Ru ? "Открыть конкретный элемент без разблокировки всей категории." : "Unlock this specific cosmetic without unlocking the whole category."); } if (!flag2 && !val2.isBlank && GUILayout.Button(Ru ? "Закрыть" : "Lock", Theme.DangerBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(82f), GUILayout.Height(30f) })) { if (flag && num >= 0 && num != k) { GameApi.SetCosmetic(category, num); } GameApi.LockCosmeticOption(val2); } if (!flag2 && !val2.isBlank) { TipLast(Ru ? "Сбросить открытие этого элемента. Может сбросить достижение, стат или максимальную высоту." : "Reset this option's unlock. May reset a linked achievement, stat, or max height value."); } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); GUILayout.EndVertical(); } private static bool DrawCosmeticListRow(GameApi.CosmeticCategory category, CustomizationOption option, string name, bool active, bool locked) { //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) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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) Rect rect = GUILayoutUtility.GetRect(10f, 34f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(34f) }); bool result = GUI.Button(rect, GUIContent.none, active ? Theme.ListItemActive : Theme.ListItem); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x + 6f, ((Rect)(ref rect)).y + 5f, 24f, 24f); Texture val2 = null; Color val3 = Color.clear; bool flag = false; try { val2 = (((Object)(object)option != (Object)null) ? option.texture : null); if ((Object)(object)val2 == (Object)null && (Object)(object)option != (Object)null && (Object)(object)option.fitMaterial != (Object)null) { val2 = option.fitMaterial.mainTexture; } if ((Object)(object)val2 == (Object)null && (Object)(object)option != (Object)null && (Object)(object)option.fitHatMaterial != (Object)null) { val2 = option.fitHatMaterial.mainTexture; } if ((Object)(object)option != (Object)null && !option.isBlank) { val3 = option.color; flag = val3.a > 0.01f; } } catch { } if ((Object)(object)val2 != (Object)null) { Color color = GUI.color; GUI.color = (Color)(locked ? new Color(1f, 1f, 1f, 0.52f) : Color.white); if (category == GameApi.CosmeticCategory.Eyes) { GUI.DrawTextureWithTexCoords(val, val2, new Rect(0f, 1f, 1f, -1f), true); } else { GUI.DrawTexture(val, val2, (ScaleMode)2, true); } GUI.color = color; } else if (flag) { Texture2D val4 = Theme.Tex((Color)(locked ? new Color(val3.r, val3.g, val3.b, 0.5f) : val3)); GUI.DrawTexture(val, (Texture)(object)val4); } else { string text = (string.IsNullOrWhiteSpace(name) ? "?" : name.Trim()[0].ToString().ToUpperInvariant()); GUI.Label(val, text, ItemIconFallbackStyle()); } GUI.Label(new Rect(((Rect)(ref rect)).x + 38f, ((Rect)(ref rect)).y + 2f, ((Rect)(ref rect)).width - 44f, ((Rect)(ref rect)).height - 4f), name, Theme.RowLabel); return result; } private static void DrawCosmeticsModern() { GUILayout.Label(L("tab.cosmetics"), Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); GUILayout.Label(Ru ? "Косметика в PEAK в основном открывается через достижения и стат максимальной высоты. Здесь можно точечно управлять связанными достижениями." : "PEAK cosmetics mostly unlock through achievements and max height progression. You can manage the linked unlocks more precisely here.", Theme.LabelDim, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Разблокировать всю косметику" : "Unlock all cosmetics", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { SteamAch.UnlockAllCosmetics(); } if (GUILayout.Button(Ru ? "Сбросить стат высоты" : "Reset height stat", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { SteamAch.SetMaxAscent(0); } GUILayout.EndHorizontal(); GUILayout.Label(Ru ? "Стат максимальной высоты" : "Max height stat", Theme.LabelDim, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); for (int i = 0; i <= 8; i++) { int maxAscent = i; if (GUILayout.Button(maxAscent.ToString(), Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(34f), GUILayout.Height(26f) })) { SteamAch.SetMaxAscent(maxAscent); } } GUILayout.EndHorizontal(); GUILayout.EndVertical(); DrawBadgesModern(); } private static void DrawAboutModern() { GUILayout.Label("PEAK-MX v1.0.0", Theme.Section, Array.Empty()); GUILayout.Label(Ru ? "Автор: maxkir041" : "Author: maxkir041", Theme.Label, Array.Empty()); GUILayout.Label(Ru ? "Разработчик: maxkir041" : "Developer: maxkir041", Theme.LabelDim, Array.Empty()); GUILayout.Space(6f); GUILayout.Label(L("ui.language"), Theme.Section, Array.Empty()); DrawLanguagePicker(); GUILayout.Space(6f); GUILayout.Label(Ru ? "Ссылки" : "Links", Theme.Section, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); LinkButton("GitHub", "https://github.com/maxkir041/PEAK-MX"); LinkButton("Steam", "https://steamcommunity.com/id/everyng/"); LinkButton("Telegram", "https://t.me/maxkir041"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); LinkButton("Playground", "https://users.playground.ru/7293247/"); LinkButton("Website", "https://peak-mx.rkngov.com"); GUILayout.EndHorizontal(); GUILayout.Space(8f); GUILayout.Label(SupportText(), Theme.DonateText, Array.Empty()); if (GUILayout.Button(DonateTextLabel(), Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(180f), GUILayout.Height(30f) })) { OpenUrl("https://www.donationalerts.com/r/maxkir041"); } GUILayout.Space(6f); DrawQr(150f); GUILayout.Label(QrHintText(), Theme.LabelDim, Array.Empty()); GUILayout.Space(6f); bool value = ModConfig.ShowDonateNotice.Value; bool flag = ToggleRaw(ReminderToggleText().Trim(), Ru ? "Показывать окно поддержки при запуске игры." : "Show the support reminder when the game starts.", value); if (flag != value) { ModConfig.ShowDonateNotice.Value = flag; } DrawAnalyticsStatus(); } private static void DrawWindowModern(int id) { //IL_001c: 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_007e: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_headerTex == (Object)null) { _headerTex = Theme.GradientTex(new Color(0.118f, 0.302f, 0.22f), new Color(0.078f, 0.157f, 0.122f), Mathf.RoundToInt(62f)); } if ((Object)(object)_accentTex == (Object)null) { _accentTex = Theme.Tex(Theme.Accent); } GUI.DrawTexture(new Rect(0f, 0f, ((Rect)(ref _rect)).width, 62f), (Texture)(object)_headerTex); GUI.DrawTexture(new Rect(0f, 62f, ((Rect)(ref _rect)).width, 2f), (Texture)(object)_accentTex); float num = Mathf.Clamp(((Rect)(ref _rect)).width * 0.22f, 136f, 176f); float num2 = 74f; float num3 = ((Rect)(ref _rect)).height - num2 - 12f; float num4 = 12f + num + 12f; float num5 = ((Rect)(ref _rect)).width - num4 - 12f; float num6 = Mathf.Clamp(((Rect)(ref _rect)).height * 0.18f, 86f, 142f); GUILayout.BeginArea(new Rect(16f, 10f, ((Rect)(ref _rect)).width - 32f, 44f)); GUILayout.BeginHorizontal(Array.Empty()); DrawBrandMark(32f); GUILayout.Space(8f); GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(40f) }); GUILayout.Label("PEAK-MX", Theme.Title, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(22f) }); GUILayout.Label("v1.0.0 | by maxkir041 | " + L(Tabs[_tab]), Theme.Subtitle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(16f) }); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button("X", Theme.CloseBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(34f), GUILayout.Height(26f) })) { _closeRequested = true; } GUILayout.EndHorizontal(); GUILayout.EndArea(); Rect val = default(Rect); ((Rect)(ref val))..ctor(12f, num2, num, num3); _contentRect = new Rect(num4, num2, num5, num3); GUI.Box(val, GUIContent.none, Theme.Panel9); GUI.Box(_contentRect, GUIContent.none, Theme.Card); GUILayout.BeginArea(new Rect(((Rect)(ref val)).x + 10f, ((Rect)(ref val)).y + 10f, ((Rect)(ref val)).width - 20f, ((Rect)(ref val)).height - 20f)); for (int i = 0; i < Tabs.Length; i++) { GUIStyle val2 = ((i == _tab) ? Theme.NavItemActive : Theme.NavItem); if (GUILayout.Button(L(Tabs[i]), val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { _tab = i; } } GUILayout.FlexibleSpace(); GUILayout.Label("maxkir041", Theme.LabelDim, Array.Empty()); GUILayout.EndArea(); GUILayout.BeginArea(new Rect(((Rect)(ref _contentRect)).x + 12f, ((Rect)(ref _contentRect)).y + 10f, ((Rect)(ref _contentRect)).width - 24f, ((Rect)(ref _contentRect)).height - 24f - num6)); _scroll = GUILayout.BeginScrollView(_scroll, Array.Empty()); GUILayout.Space(2f); switch (_tab) { case 0: DrawCharacterModern(); break; case 1: DrawCheatsModern3(); break; case 2: DrawAdminModern(); break; case 3: DrawInventoryModern3(); break; case 4: DrawWorldModern(); break; case 5: DrawBadgesModern(); break; case 6: DrawCosmeticsModern3(); break; case 7: DrawAboutModern(); break; } GUILayout.Space(4f); GUILayout.EndScrollView(); GUILayout.EndArea(); DrawTooltipFooter(new Rect(((Rect)(ref _contentRect)).x + 12f, ((Rect)(ref _contentRect)).yMax - num6 - 10f, ((Rect)(ref _contentRect)).width - 24f, num6)); GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _rect)).width, 62f)); } private static void DrawCharacterModern() { if (BeginSection("character.move", L("tab.character"), defaultOpen: true)) { ModConfig.SpeedMod = Toggle("feat.speed", ModConfig.SpeedMod); if (ModConfig.SpeedMod) { ModConfig.SpeedAmount = Slider("x", ModConfig.SpeedAmount, 0.5f, 5f); } ModConfig.JumpMod = Toggle("feat.jump", ModConfig.JumpMod); if (ModConfig.JumpMod) { ModConfig.JumpAmount = Slider("x", ModConfig.JumpAmount, 1f, 5f); } ModConfig.InfiniteJumps = ToggleRaw(Ru ? "Бесконечные прыжки" : "Infinite jumps", Ru ? "Позволяет прыгать повторно в воздухе без ожидания земли." : "Allows repeated jumps in the air without touching the ground.", ModConfig.InfiniteJumps); ModConfig.NoSlipperySurfaces = ToggleRaw(Ru ? "Без скользких поверхностей" : "No slippery surfaces", Ru ? "Сильно снижает соскальзывание и считает крутые поверхности пригодными для стояния." : "Greatly reduces sliding and treats steep surfaces as standable.", ModConfig.NoSlipperySurfaces); EndSection(); } if (BeginSection("character.climb", Ru ? "Лазание" : "Climbing", defaultOpen: false)) { ModConfig.ClimbMod = Toggle("feat.climb", ModConfig.ClimbMod); if (ModConfig.ClimbMod) { ModConfig.ClimbAmount = Slider("x", ModConfig.ClimbAmount, 1f, 5f); } ModConfig.VineClimbMod = Toggle("feat.vineclimb", ModConfig.VineClimbMod); if (ModConfig.VineClimbMod) { ModConfig.VineClimbAmount = Slider("x", ModConfig.VineClimbAmount, 1f, 5f); } ModConfig.RopeClimbMod = Toggle("feat.ropeclimb", ModConfig.RopeClimbMod); if (ModConfig.RopeClimbMod) { ModConfig.RopeClimbAmount = Slider("x", ModConfig.RopeClimbAmount, 1f, 5f); } ModConfig.ClimbStaminaConsumptionPercent = Slider(Ru ? "Расход стамины при лазании %" : "Climbing stamina cost %", ModConfig.ClimbStaminaConsumptionPercent, 0f, 300f); EndSection(); } if (BeginSection("character.status", Ru ? "Стамина и недуги" : "Stamina & afflictions", defaultOpen: false)) { Character val = TargetPicker(ref _statusTarget); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Полная стамина" : "Full stamina", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.FullStamina(val); } if (GUILayout.Button(Ru ? "Полная экстра" : "Full extra", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { ModConfig.ExtraStaminaPercent = 100f; SetNumberText(Ru ? "Экстра стамина %" : "Extra stamina %", 0f, 100f, ModConfig.ExtraStaminaPercent); GameApi.FullExtraStamina(val); } if (GUILayout.Button(Ru ? "Снять все недуги" : "Clear afflictions", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ClearAllStatus(val); } GUILayout.EndHorizontal(); ModConfig.ExtraStaminaPercent = NumberField(Ru ? "Экстра стамина %" : "Extra stamina %", ModConfig.ExtraStaminaPercent, 0f, 100f); if (GUILayout.Button(Ru ? "Выдать экстрастамину" : "Set extra stamina", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.SetExtraStamina(val, ModConfig.ExtraStaminaPercent / 100f); } TipLast(Ru ? "Выставляет точное количество дополнительной стамины выбранной цели." : "Sets an exact amount of extra stamina for the selected target."); ModConfig.StaminaConsumptionPercent = Slider(Ru ? "Расход стамины %" : "Stamina cost %", ModConfig.StaminaConsumptionPercent, 0f, 300f); ModConfig.StaminaRegenPercent = Slider(Ru ? "Восстановление %" : "Stamina regen %", ModConfig.StaminaRegenPercent, 0f, 300f); ModConfig.StaminaRegenDelayMod = ToggleRaw(Ru ? "Своя задержка восстановления" : "Custom regen delay", Ru ? "Заменяет задержку перед восстановлением стамины на значение ниже." : "Overrides the delay before stamina starts regenerating.", ModConfig.StaminaRegenDelayMod); if (ModConfig.StaminaRegenDelayMod) { ModConfig.StaminaRegenDelay = Slider(Ru ? "Задержка" : "Delay", ModConfig.StaminaRegenDelay, 0f, 5f); } string[] array = (Ru ? GameApi.StatusRu : GameApi.StatusEn); _selStatus = GUILayout.SelectionGrid(_selStatus, array, 3, Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(112f) }); _statusAmount = Slider(Ru ? "Сила" : "Amount", _statusAmount, 0f, 1f); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Наложить" : "Apply", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { GameApi.SetStatus(val, _selStatus, _statusAmount); } if (GUILayout.Button(Ru ? "Убрать этот" : "Remove this", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(140f), GUILayout.Height(32f) })) { GameApi.SetStatus(val, _selStatus, 0f); } GUILayout.EndHorizontal(); ModConfig.StatusIncreasePercent = Slider(Ru ? "Увеличение статуса %" : "Status increase %", ModConfig.StatusIncreasePercent, 0f, 100f); if (GUILayout.Button(Ru ? "Увеличить выбранный" : "Increase selected", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.IncreaseStatus(val, _selStatus, ModConfig.StatusIncreasePercent / 100f); } TipLast(Ru ? "Прибавить выбранный статус на указанный процент." : "Increase the selected status by the chosen percentage."); DrawStatusIncreaseButtons(val); EndSection(); } } private static void DrawCheatsModern() { if (BeginSection("cheats.core", L("tab.cheats"), defaultOpen: true)) { ModConfig.GodMode = Toggle("feat.god", ModConfig.GodMode); ModConfig.InfiniteStamina = Toggle("feat.infstam", ModConfig.InfiniteStamina); ModConfig.NoFallDamage = Toggle("feat.nofall", ModConfig.NoFallDamage); ModConfig.NoWeight = Toggle("feat.noweight", ModConfig.NoWeight); ModConfig.LockStatus = Toggle("feat.lockstatus", ModConfig.LockStatus); EndSection(); } if (BeginSection("cheats.fly", Ru ? "Полёт и телепорт" : "Fly & teleport", defaultOpen: false)) { ModConfig.TeleportToPing = Toggle("feat.tpping", ModConfig.TeleportToPing); ModConfig.Fly = Toggle("feat.fly", ModConfig.Fly); if (ModConfig.Fly) { ModConfig.FlySpeed = Slider(Ru ? "Скорость" : "Speed", ModConfig.FlySpeed, 1f, 50f); ModConfig.FlyAcceleration = Slider(Ru ? "Ускорение" : "Accel", ModConfig.FlyAcceleration, 1f, 100f); } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Коорд.:" : "Coords:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); GUILayout.Label("X", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpX = GUILayout.TextField(_tpX ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Y", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpY = GUILayout.TextField(_tpY ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Z", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpZ = GUILayout.TextField(_tpZ ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); if (GUILayout.Button(Ru ? "ТП" : "TP", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(54f), GUILayout.Height(26f) }) && (float.TryParse(_tpX, out var result) & float.TryParse(_tpY, out var result2) & float.TryParse(_tpZ, out var result3))) { GameApi.TeleportToCoords(result, result2, result3); } GUILayout.EndHorizontal(); EndSection(); } if (BeginSection("cheats.actions", Ru ? "Действия" : "Actions", defaultOpen: false)) { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Воскресить себя" : "Revive self", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.ReviveSelf(); } if (GUILayout.Button(Ru ? "Убить себя" : "Kill self", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.KillSelf(); } if (GUILayout.Button(Ru ? "К точке спавна" : "Warp to spawn", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.WarpToSpawn(); } GUILayout.EndHorizontal(); EndSection(); } if (BeginSection("cheats.players", Ru ? "Игроки" : "Players", defaultOpen: false)) { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Обновить список" : "Refresh", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.RefreshPlayers(); } if (GUILayout.Button(Ru ? "Воскресить всех" : "Revive all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.ReviveAll(); } if (GUILayout.Button(Ru ? "Притянуть всех" : "Warp all to me", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.WarpAllToMe(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Убить всех" : "Kill all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.KillAll(_excludeSelf); } _excludeSelf = GUILayout.Toggle(_excludeSelf, Ru ? " Не трогать себя" : " Exclude me", Theme.RowLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); GUILayout.EndHorizontal(); if (GameApi.PlayerChars.Count == 0) { GUILayout.Label(Ru ? "Список пуст — нажми «Обновить» в лобби" : "Empty — press Refresh in a lobby", Theme.LabelDim, Array.Empty()); } for (int i = 0; i < GameApi.PlayerChars.Count; i++) { Character val = GameApi.PlayerChars[i]; if ((Object)(object)val == (Object)null) { continue; } bool flag = false; try { flag = val.IsLocal; } catch { } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(((i < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[i] : "?") + ((!flag) ? "" : (Ru ? " (ты)" : " (you)")), Theme.RowLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(140f) }); if (!flag) { if (GUILayout.Button("TP", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(44f) })) { GameApi.WarpToPlayer(val); } if (GUILayout.Button(Ru ? "Притянуть" : "Bring", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(78f) })) { GameApi.BringPlayer(val); } if (GUILayout.Button(Ru ? "Убить" : "Kill", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(58f) })) { GameApi.KillPlayer(val); } if (GUILayout.Button(Ru ? "Ожив." : "Revive", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(66f) })) { GameApi.RevivePlayer(val); } } if (GUILayout.Button(Ru ? "Скаут" : "Scout", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(64f) })) { GameApi.SpawnScoutmaster(val); } GUILayout.EndHorizontal(); } EndSection(); } if (!BeginSection("cheats.pranks", Ru ? "Приколы" : "Pranks", defaultOpen: false)) { return; } Character c = TargetPicker(ref _prankTarget); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Наслать все недуги" : "Pile on afflictions", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.PrankAfflict(c); } if (GUILayout.Button(Ru ? "Вылечить" : "Cure", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ClearAllStatus(c); } GUILayout.EndHorizontal(); if (GUILayout.Button(Ru ? "Забить инвентарь выбранным предметом" : "Stuff inventory with selected item", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { GameApi.FillInventoryWith(c, _selItem); } GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Забить золотом" : "Fill with gold", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { int num = GameApi.FindItemIndex("gold", "coin", "treasure"); if (num >= 0) { GameApi.FillInventoryWith(c, num); } } if (GUILayout.Button(Ru ? "Забить паутиной" : "Fill with webs", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { int num2 = GameApi.FindItemIndex("web", "spider"); if (num2 >= 0) { GameApi.FillInventoryWith(c, num2); } } GUILayout.EndHorizontal(); GUILayout.Label(Ru ? "Предмет берётся из вкладки «Инвентарь». Физические шарики на игроке добавлю отдельно." : "Item comes from the Inventory tab. Physical balloons on a player will come separately.", Theme.LabelDim, Array.Empty()); EndSection(); } private static void DrawCheatsModern2() { if (BeginSection("cheats.core", L("tab.cheats"), defaultOpen: true)) { ModConfig.GodMode = Toggle("feat.god", ModConfig.GodMode); ModConfig.InfiniteStamina = Toggle("feat.infstam", ModConfig.InfiniteStamina); ModConfig.NoFallDamage = Toggle("feat.nofall", ModConfig.NoFallDamage); ModConfig.NoWeight = Toggle("feat.noweight", ModConfig.NoWeight); ModConfig.LockStatus = Toggle("feat.lockstatus", ModConfig.LockStatus); EndSection(); } if (BeginSection("cheats.fly2", Ru ? "Полёт и телепорт" : "Fly & teleport", defaultOpen: false)) { ModConfig.TeleportToPing = Toggle("feat.tpping", ModConfig.TeleportToPing); ModConfig.Fly = Toggle("feat.fly", ModConfig.Fly); if (ModConfig.Fly) { ModConfig.Noclip = ToggleRaw(Ru ? "Ноклип" : "Noclip", Ru ? "Отключает локальные коллайдеры и столкновения во время полёта." : "Disables local colliders and collisions while flying.", ModConfig.Noclip); ModConfig.FlySpeed = Slider(Ru ? "Скорость" : "Speed", ModConfig.FlySpeed, 1f, 50f); ModConfig.FlyAcceleration = Slider(Ru ? "Ускорение" : "Accel", ModConfig.FlyAcceleration, 1f, 100f); } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Коорд.:" : "Coords:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); GUILayout.Label("X", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpX = GUILayout.TextField(_tpX ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Y", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpY = GUILayout.TextField(_tpY ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Z", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpZ = GUILayout.TextField(_tpZ ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); if (GUILayout.Button(Ru ? "ТП" : "TP", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(54f), GUILayout.Height(26f) }) && (float.TryParse(_tpX, out var result) & float.TryParse(_tpY, out var result2) & float.TryParse(_tpZ, out var result3))) { GameApi.TeleportToCoords(result, result2, result3); } GUILayout.EndHorizontal(); EndSection(); } if (BeginSection("cheats.actions2", Ru ? "Действия" : "Actions", defaultOpen: false)) { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Воскресить себя" : "Revive self", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.ReviveSelf(); } if (GUILayout.Button(Ru ? "Убить себя" : "Kill self", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.KillSelf(); } if (GUILayout.Button(Ru ? "К точке спавна" : "Warp to spawn", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.WarpToSpawn(); } GUILayout.EndHorizontal(); EndSection(); } if (BeginSection("cheats.players2", Ru ? "Игроки" : "Players", defaultOpen: false)) { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Обновить список" : "Refresh", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.RefreshPlayers(); } if (GUILayout.Button(Ru ? "Воскресить всех" : "Revive all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.ReviveAll(); } if (GUILayout.Button(Ru ? "Притянуть всех" : "Warp all to me", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.WarpAllToMe(); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Убить всех" : "Kill all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.KillAll(_excludeSelf); } _excludeSelf = GUILayout.Toggle(_excludeSelf, Ru ? " Не трогать себя" : " Exclude me", Theme.RowLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); GUILayout.EndHorizontal(); if (GameApi.PlayerChars.Count == 0) { GUILayout.Label(Ru ? "Список пуст — нажми «Обновить» в лобби." : "Empty - press Refresh in a lobby.", Theme.LabelDim, Array.Empty()); } for (int i = 0; i < GameApi.PlayerChars.Count; i++) { Character val = GameApi.PlayerChars[i]; if ((Object)(object)val == (Object)null) { continue; } bool flag = false; try { flag = val.IsLocal; } catch { } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(((i < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[i] : "?") + ((!flag) ? "" : (Ru ? " (ты)" : " (you)")), Theme.RowLabel, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(92f) }); if (!flag) { if (GUILayout.Button("TP", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(44f) })) { GameApi.WarpToPlayer(val); } if (GUILayout.Button(Ru ? "Спавн" : "Spawn", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) })) { GameApi.WarpPlayerToSpawn(val); } if (GUILayout.Button(Ru ? "Притянуть" : "Bring", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(78f) })) { GameApi.BringPlayer(val); } if (GUILayout.Button(Ru ? "Убить" : "Kill", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(58f) })) { GameApi.KillPlayer(val); } if (GUILayout.Button(Ru ? "Ожив." : "Revive", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(66f) })) { GameApi.RevivePlayer(val); } } if (GUILayout.Button(Ru ? "Скаут" : "Scout", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(64f) })) { GameApi.SpawnScoutmaster(val); } GUILayout.EndHorizontal(); } EndSection(); } if (!BeginSection("cheats.pranks2", Ru ? "Приколы" : "Pranks", defaultOpen: false)) { return; } Character c = TargetPicker(ref _prankTarget); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Наслать все недуги" : "Pile on afflictions", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.PrankAfflict(c); } if (GUILayout.Button(Ru ? "Вылечить" : "Cure", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ClearAllStatus(c); } GUILayout.EndHorizontal(); if (GUILayout.Button(Ru ? "Забить инвентарь выбранным предметом" : "Stuff inventory with selected item", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { GameApi.FillInventoryWith(c, _selItem); } GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Забить золотом" : "Fill with gold", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { int num = GameApi.FindItemIndex("gold", "coin", "treasure"); if (num >= 0) { GameApi.FillInventoryWith(c, num); } } if (GUILayout.Button(Ru ? "Забить паутиной" : "Fill with webs", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { int num2 = GameApi.FindItemIndex("web", "spider"); if (num2 >= 0) { GameApi.FillInventoryWith(c, num2); } } GUILayout.EndHorizontal(); GUILayout.Label(Ru ? "Предмет берётся из вкладки «Инвентарь». Физические шарики и другие приколы можно добавить позже отдельно." : "The item comes from the Inventory tab. Physical balloon-style pranks can be added separately later.", Theme.LabelDim, Array.Empty()); EndSection(); } private static void DrawInventoryModern() { //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) if (BeginSection("inventory.spawn", Ru ? "Спавн предметов" : "Item spawner", defaultOpen: true)) { if (GameApi.ItemNames.Count <= 0) { if (GUILayout.Button(Ru ? "Загрузить список предметов" : "Load item list", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.EnsureItemsLoaded(); } } else { GUILayout.Label((Ru ? "Предметов: " : "Items: ") + GameApi.ItemNames.Count, Theme.LabelDim, Array.Empty()); if (_invTarget >= GameApi.PlayerChars.Count) { _invTarget = -1; } Character val = ((_invTarget >= 0 && _invTarget < GameApi.PlayerChars.Count) ? GameApi.PlayerChars[_invTarget] : null); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Кому:" : "Target:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); if (GUILayout.Button(Ru ? "Себе" : "Me", (_invTarget < 0) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _invTarget = -1; } for (int i = 0; i < GameApi.PlayerChars.Count; i++) { Character val2 = GameApi.PlayerChars[i]; bool flag = false; try { flag = (Object)(object)val2 != (Object)null && val2.IsLocal; } catch { } if (!flag && GUILayout.Button((i < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[i] : "?", (_invTarget == i) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _invTarget = i; } } if (GUILayout.Button(Ru ? "Обн." : "Sync", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(52f), GUILayout.Height(26f) })) { GameApi.RefreshPlayers(); } GUILayout.EndHorizontal(); int num = (((Object)(object)val != (Object)null) ? GameApi.SlotCountFor(val) : GameApi.SlotCount()); if (num <= 0) { num = 3; } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Слот:" : "Slot:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); for (int j = 0; j < num; j++) { if (GUILayout.Button((j + 1).ToString(), (_selSlot == j) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(36f), GUILayout.Height(30f) })) { _selSlot = j; } } GUILayout.EndHorizontal(); GUILayout.Label(Ru ? "Содержимое слотов" : "Slot contents", Theme.LabelDim, Array.Empty()); for (int k = 0; k < num; k++) { string text = GameApi.DescribeSlot(val, k); GUILayout.Label(string.Format("{0}. {1}", k + 1, (!string.IsNullOrEmpty(text)) ? text : "-"), Theme.LabelDim, Array.Empty()); } _itemSearch = GUILayout.TextField(_itemSearch ?? "", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); _itemScroll = GUILayout.BeginScrollView(_itemScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(170f) }); string text2 = (_itemSearch ?? "").Trim().ToLowerInvariant(); for (int l = 0; l < GameApi.ItemNames.Count; l++) { string text3 = GameApi.ItemNames[l]; if ((text2.Length <= 0 || text3.ToLowerInvariant().IndexOf(text2) >= 0) && DrawItemListRow(l, text3, _selItem == l)) { _selItem = l; } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Заспавнить в слот" : "Spawn to slot", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) }) && _selItem >= 0) { if ((Object)(object)val != (Object)null) { GameApi.SpawnToSlotFor(val, _selItem, _selSlot); } else { GameApi.SpawnToSlot(_selItem, _selSlot); } } if (GUILayout.Button(Ru ? "Очистить слот" : "Clear slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(28f) })) { if ((Object)(object)val != (Object)null) { GameApi.ClearSlotFor(val, _selSlot); } else { GameApi.ClearSlot(_selSlot); } } GUILayout.EndHorizontal(); if (_selItem >= 0 && _selItem < GameApi.ItemNames.Count) { GUILayout.Label((Ru ? "Выбрано: " : "Selected: ") + GameApi.ItemNames[_selItem], Theme.LabelDim, Array.Empty()); } if ((Object)(object)val != (Object)null) { GUILayout.Label((Ru ? "Смотришь и редактируешь инвентарь игрока: " : "Viewing and editing player's inventory: ") + ((_invTarget < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[_invTarget] : "?"), Theme.LabelDim, Array.Empty()); } } EndSection(); } if (!BeginSection("inventory.recharge", Ru ? "Перезарядка предметов" : "Item recharge", defaultOpen: false)) { return; } ModConfig.RechargeValue = NumberField(Ru ? "Заряд" : "Charge", ModConfig.RechargeValue, 0f, 999f); GUILayout.BeginHorizontal(Array.Empty()); for (int m = 0; m < Mathf.Min(3, GameApi.SlotCount()); m++) { int num2 = m; if (GUILayout.Button((Ru ? "Слот " : "Slot ") + (num2 + 1), Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.RechargeSlot(num2, ModConfig.RechargeValue); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Зарядить выбранный слот" : "Recharge selected slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.RechargeSlot(_selSlot, ModConfig.RechargeValue); } if (GUILayout.Button(Ru ? "Зарядить все" : "Recharge all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(30f) })) { for (int n = 0; n < GameApi.SlotCount(); n++) { GameApi.RechargeSlot(n, ModConfig.RechargeValue); } } GUILayout.EndHorizontal(); EndSection(); } private static void DrawInventoryModern2() { //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) if (BeginSection("inventory.spawn2", Ru ? "Спавн предметов" : "Item spawner", defaultOpen: true)) { if (GameApi.ItemNames.Count <= 0) { if (GUILayout.Button(Ru ? "Загрузить список предметов" : "Load item list", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.EnsureItemsLoaded(); } } else { GUILayout.Label((Ru ? "Предметов: " : "Items: ") + GameApi.ItemNames.Count, Theme.LabelDim, Array.Empty()); if (_invTarget >= GameApi.PlayerChars.Count) { _invTarget = -1; } Character val = ((_invTarget >= 0 && _invTarget < GameApi.PlayerChars.Count) ? GameApi.PlayerChars[_invTarget] : null); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Кому:" : "Target:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); if (GUILayout.Button(Ru ? "Себе" : "Me", (_invTarget < 0) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _invTarget = -1; } for (int i = 0; i < GameApi.PlayerChars.Count; i++) { Character val2 = GameApi.PlayerChars[i]; bool flag = false; try { flag = (Object)(object)val2 != (Object)null && val2.IsLocal; } catch { } if (!flag && GUILayout.Button((i < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[i] : "?", (_invTarget == i) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { _invTarget = i; } } if (GUILayout.Button(Ru ? "Обн." : "Sync", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(52f), GUILayout.Height(26f) })) { GameApi.RefreshPlayers(); } GUILayout.EndHorizontal(); int num = (((Object)(object)val != (Object)null) ? GameApi.SlotCountFor(val) : GameApi.SlotCount()); if (num <= 0) { num = 3; } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Слот:" : "Slot:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); for (int j = 0; j < num; j++) { if (GUILayout.Button((j + 1).ToString(), (_selSlot == j) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(36f), GUILayout.Height(30f) })) { _selSlot = j; } } GUILayout.EndHorizontal(); GUILayout.Label(Ru ? "Содержимое слотов" : "Slot contents", Theme.LabelDim, Array.Empty()); for (int k = 0; k < num; k++) { string text = GameApi.DescribeSlot(val, k); GUILayout.Label(string.Format("{0}. {1}", k + 1, (!string.IsNullOrEmpty(text)) ? text : "-"), Theme.LabelDim, Array.Empty()); } _itemSearch = GUILayout.TextField(_itemSearch ?? "", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); _itemScroll = GUILayout.BeginScrollView(_itemScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(170f) }); string text2 = (_itemSearch ?? "").Trim().ToLowerInvariant(); for (int l = 0; l < GameApi.ItemNames.Count; l++) { string text3 = GameApi.ItemNames[l]; if ((text2.Length <= 0 || text3.ToLowerInvariant().IndexOf(text2) >= 0) && DrawItemListRow(l, text3, _selItem == l)) { _selItem = l; } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Заспавнить в слот" : "Spawn to slot", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) }) && _selItem >= 0) { if ((Object)(object)val != (Object)null) { GameApi.SpawnToSlotFor(val, _selItem, _selSlot); } else { GameApi.SpawnToSlot(_selItem, _selSlot); } } if (GUILayout.Button(Ru ? "Очистить слот" : "Clear slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(28f) })) { if ((Object)(object)val != (Object)null) { GameApi.ClearSlotFor(val, _selSlot); } else { GameApi.ClearSlot(_selSlot); } } GUILayout.EndHorizontal(); if (_selItem >= 0 && _selItem < GameApi.ItemNames.Count) { GUILayout.Label((Ru ? "Выбрано: " : "Selected: ") + GameApi.ItemNames[_selItem], Theme.LabelDim, Array.Empty()); } if ((Object)(object)val != (Object)null) { GUILayout.Label((Ru ? "Смотришь и редактируешь инвентарь игрока: " : "Viewing and editing player's inventory: ") + ((_invTarget < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[_invTarget] : "?"), Theme.LabelDim, Array.Empty()); } } EndSection(); } if (!BeginSection("inventory.recharge2", Ru ? "Перезарядка предметов" : "Item recharge", defaultOpen: false)) { return; } ModConfig.RechargeValue = NumberField(Ru ? "Заряд" : "Charge", ModConfig.RechargeValue, 0f, 999f); int num2 = Mathf.Max(1, GameApi.SlotCount()); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Слот:" : "Slot:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); for (int m = 0; m < num2; m++) { if (GUILayout.Button((m + 1).ToString(), (_selSlot == m) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(36f), GUILayout.Height(28f) })) { _selSlot = m; } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Зарядить выбранный слот" : "Recharge selected slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.RechargeSlot(_selSlot, ModConfig.RechargeValue); } if (GUILayout.Button(Ru ? "Зарядить все" : "Recharge all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(30f) })) { for (int n = 0; n < GameApi.SlotCount(); n++) { GameApi.RechargeSlot(n, ModConfig.RechargeValue); } } GUILayout.EndHorizontal(); EndSection(); } private static void DrawCheatsModern3() { if (BeginSection("cheats.core3", L("tab.cheats"), defaultOpen: true)) { ModConfig.GodMode = Toggle("feat.god", ModConfig.GodMode); ModConfig.InfiniteStamina = Toggle("feat.infstam", ModConfig.InfiniteStamina); ModConfig.NoFallDamage = Toggle("feat.nofall", ModConfig.NoFallDamage); ModConfig.NoFallingRagdoll = ToggleRaw(Ru ? "Без падения в ragdoll" : "No falling ragdoll", Ru ? "Блокирует принудительный ragdoll от падения и соскальзывания." : "Blocks forced ragdoll from falling and sliding.", ModConfig.NoFallingRagdoll); ModConfig.NoWeight = Toggle("feat.noweight", ModConfig.NoWeight); ModConfig.LockStatus = Toggle("feat.lockstatus", ModConfig.LockStatus); ModConfig.NoStatusEffects = ToggleRaw(Ru ? "Без эффектов статуса" : "No status effects", Ru ? "Постоянно очищает все недуги локального персонажа." : "Continuously clears every affliction from the local character.", ModConfig.NoStatusEffects); if (!ModConfig.NoStatusEffects) { ModConfig.NoInjury = ToggleRaw(Ru ? "Без травм" : "No injury", Ru ? "Постоянно очищает травмы." : "Continuously clears injury.", ModConfig.NoInjury); ModConfig.NoHunger = ToggleRaw(Ru ? "Без голода" : "No hunger", Ru ? "Постоянно очищает голод." : "Continuously clears hunger.", ModConfig.NoHunger); ModConfig.NoCold = ToggleRaw(Ru ? "Без холода" : "No cold", Ru ? "Постоянно очищает холод." : "Continuously clears cold.", ModConfig.NoCold); ModConfig.NoPoison = ToggleRaw(Ru ? "Без яда" : "No poison", Ru ? "Постоянно очищает яд." : "Continuously clears poison.", ModConfig.NoPoison); ModConfig.NoCurse = ToggleRaw(Ru ? "Без проклятия" : "No curse", Ru ? "Постоянно очищает проклятие." : "Continuously clears curse.", ModConfig.NoCurse); ModConfig.NoDrowsy = ToggleRaw(Ru ? "Без сонливости" : "No drowsy", Ru ? "Постоянно очищает сонливость." : "Continuously clears drowsiness.", ModConfig.NoDrowsy); ModConfig.NoHot = ToggleRaw(Ru ? "Без жары" : "No hot", Ru ? "Постоянно очищает жару." : "Continuously clears heat.", ModConfig.NoHot); } EndSection(); } if (BeginSection("cheats.fly3", Ru ? "Полёт и телепорт" : "Fly & teleport", defaultOpen: false)) { ModConfig.TeleportToPing = Toggle("feat.tpping", ModConfig.TeleportToPing); ModConfig.LongInteraction = ToggleRaw(Ru ? "Дальнее взаимодействие" : "Long interaction", Ru ? "Увеличивает дистанцию взаимодействия с предметами и объектами." : "Increases interaction distance for items and objects.", ModConfig.LongInteraction); if (ModConfig.LongInteraction) { ModConfig.InteractionDistance = Slider(Ru ? "Дистанция" : "Distance", ModConfig.InteractionDistance, 2f, 80f); } ModConfig.CinematicCamera = ToggleRaw(Ru ? "Кинематографичная камера" : "Cinematic camera", Ru ? "Свободная камера: WASD, Space/E вверх, Ctrl/Q вниз, Shift быстрее, мышь поворачивает." : "Free camera: WASD, Space/E up, Ctrl/Q down, Shift faster, mouse rotates.", ModConfig.CinematicCamera); if (ModConfig.CinematicCamera) { ModConfig.CinematicCameraSpeed = Slider(Ru ? "Скорость камеры" : "Camera speed", ModConfig.CinematicCameraSpeed, 0.5f, 40f); ModConfig.CinematicCameraFov = Slider("FOV", ModConfig.CinematicCameraFov, 1f, 120f); } ModConfig.Fly = Toggle("feat.fly", ModConfig.Fly); if (ModConfig.Fly) { ModConfig.Noclip = ToggleRaw(Ru ? "Проходить сквозь стены" : "Noclip through geometry", Ru ? "Во время полёта отключает столкновения локального персонажа с объектами и невидимыми стенами." : "Disables local character collisions while flying, including invisible blockers.", ModConfig.Noclip); ModConfig.FlySpeed = Slider(Ru ? "Скорость" : "Speed", ModConfig.FlySpeed, 1f, 50f); ModConfig.FlyAcceleration = Slider(Ru ? "Ускорение" : "Accel", ModConfig.FlyAcceleration, 1f, 100f); } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Коорд.:" : "Coords:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); GUILayout.Label("X", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpX = GUILayout.TextField(_tpX ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Y", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpY = GUILayout.TextField(_tpY ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); GUILayout.Label("Z", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(12f) }); _tpZ = GUILayout.TextField(_tpZ ?? "0", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(70f), GUILayout.Height(26f) }); if (GUILayout.Button(Ru ? "ТП" : "TP", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(54f), GUILayout.Height(26f) }) && (float.TryParse(_tpX, out var result) & float.TryParse(_tpY, out var result2) & float.TryParse(_tpZ, out var result3))) { GameApi.TeleportToCoords(result, result2, result3); } GUILayout.EndHorizontal(); EndSection(); } if (BeginSection("cheats.pranks3", Ru ? "Приколы" : "Pranks", defaultOpen: false)) { Character c = TargetPicker(ref _prankTarget); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Наслать недуги" : "Pile on afflictions", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.PrankAfflict(c); } TipLast(Ru ? "Накладывает яд, проклятие, краба, сонливость и паутину на выбранную цель. Для других игроков нужен хост." : "Adds poison, curse, crab, drowsy, and web to the target. Remote targets require host."); if (GUILayout.Button(Ru ? "Вылечить" : "Cure", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ClearAllStatus(c); } TipLast(Ru ? "Очищает все недуги выбранной цели." : "Clears every affliction on the selected target."); GUILayout.EndHorizontal(); if (GUILayout.Button(Ru ? "Забить выбранным предметом" : "Stuff with selected item", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { GameApi.FillInventoryWith(c, _selItem); } TipLast(Ru ? "Заполняет все обычные слоты и рюкзак предметом из вкладки «Инвентарь»." : "Fills every regular slot and backpack slot with the selected Inventory item."); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Забить золотом" : "Fill with gold", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.FillInventoryWithGold(c); } TipLast(Ru ? "Ищет золотой идол по игровому тегу и кладёт его во все слоты цели, включая рюкзак." : "Finds the golden idol by game tag and fills the target's slots, including backpack."); if (GUILayout.Button(Ru ? "Забить паутиной" : "Fill with webs", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.FillInventoryWithWebs(c); } TipLast(Ru ? "Пытается найти предмет паутины/паука; если такого предмета нет, накладывает эффект паутины." : "Tries to find a web/spider item; if none exists, applies the web status."); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Случайные предметы" : "Random items", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.FillInventoryWithRandom(c); } TipLast(Ru ? "Заполняет слоты цели случайными предметами из загруженного списка, включая рюкзак." : "Fills the target's slots with random loaded items, including backpack."); if (GUILayout.Button(Ru ? "Очистить инвентарь" : "Clear inventory", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.ClearInventory(c); } TipLast(Ru ? "Очищает обычные слоты и рюкзак выбранной цели." : "Clears the selected target's regular slots and backpack."); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "7 шариков" : "7 balloons", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.TieBalloons(c, 7); } TipLast(Ru ? "Привязывает к цели семь игровых шариков, чтобы подъём был заметнее." : "Ties seven in-game balloons to the target for a stronger lift."); if (GUILayout.Button(Ru ? "Высыпать вещи" : "Drop items", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.DropAllInventory(c); } TipLast(Ru ? "Выбрасывает содержимое основных слотов и надетый рюкзак рядом с целью." : "Drops main-slot items and the equipped backpack near the target."); GUILayout.EndHorizontal(); GUILayout.Label(Ru ? "Предмет для первого прикола выбирается во вкладке «Инвентарь». Список предметов загружается автоматически." : "The selected item comes from the Inventory tab. The item list loads automatically.", Theme.LabelDim, Array.Empty()); EndSection(); } } private static void DrawAdminModern() { //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) GUILayout.Label(Ru ? "Администрирование" : "Administration", Theme.Section, Array.Empty()); if (!GameApi.IsHost()) { GUILayout.Label(Ru ? "Кик, сессионный бан и автозащита работают у хоста комнаты. Локальные действия и просмотр игроков доступны всегда." : "Kick, session ban, and protection checks work for the room host. Local actions and player inspection are always available.", Theme.LabelDim, Array.Empty()); } if (BeginSection("admin.players", Ru ? "Игроки" : "Players", defaultOpen: true)) { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Обновить список" : "Refresh players", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.RefreshPlayers(); ActionTracker.Track("admin_players_refresh"); } TipLast(Ru ? "Обновить список игроков, не меняя размер панели." : "Refresh the player list without changing the panel size."); if (GUILayout.Button(Ru ? "Воскресить всех" : "Revive all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ReviveAll(); } TipLast(Ru ? "Воскресить всех игроков." : "Revive every player."); if (GUILayout.Button(Ru ? "Притянуть всех" : "Bring all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.WarpAllToMe(); } TipLast(Ru ? "Телепортировать остальных игроков к тебе." : "Teleport the other players to you."); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Убить всех" : "Kill all", Theme.DangerBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.KillAll(_excludeSelf); } TipLast(Ru ? "Убить всех игроков. Переключатель справа исключает тебя из действия." : "Kill all players. The switch on the right excludes you."); _excludeSelf = ToggleCompact(Ru ? "Не трогать себя" : "Exclude me", _excludeSelf); GUILayout.EndHorizontal(); if (GameApi.PlayerChars.Count == 0) { GUILayout.Label(Ru ? "Список пуст. Нажми «Обновить список» в лобби или забеге." : "Empty. Press Refresh in a lobby or run.", Theme.LabelDim, Array.Empty()); } _adminScroll = GUILayout.BeginScrollView(_adminScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(190f) }); for (int i = 0; i < GameApi.PlayerChars.Count; i++) { DrawAdminPlayerRow(i); } GUILayout.EndScrollView(); Character val = ((_adminTarget >= 0 && _adminTarget < GameApi.PlayerChars.Count) ? GameApi.PlayerChars[_adminTarget] : null); if ((Object)(object)val != (Object)null) { DrawAdminSelectedPlayer(val); } EndSection(); } if (BeginSection("admin.protection", Ru ? "Админ-защита" : "Admin protection", defaultOpen: false)) { GUILayout.Label(Ru ? "Хостовая защита от подозрительного поведения других игроков. На пользователя панели проверки не действуют." : "Host-side protection against suspicious behavior from other players. The panel user is exempt.", Theme.LabelDim, Array.Empty()); ModConfig.AdminProtectionEnabled = ToggleRaw(Ru ? "Включить админ-защиту" : "Enable admin protection", Ru ? "Включает проверки для других игроков. На пользователя панели проверки не действуют." : "Enables checks for other players. The panel user is exempt.", ModConfig.AdminProtectionEnabled); ModConfig.AdminWarnOnly = ToggleRaw(Ru ? "Только предупреждать" : "Warn only", Ru ? "Писать подозрительные события в лог, но не кикать автоматически." : "Write suspicious events to the log without automatic kicks.", ModConfig.AdminWarnOnly); ModConfig.AdminDetectExtremeMovement = ToggleRaw(Ru ? "Ловить резкие перемещения" : "Detect extreme movement", Ru ? "Проверяет скорость других игроков и отмечает слишком резкие скачки." : "Measures other players' speed and flags extreme jumps.", ModConfig.AdminDetectExtremeMovement); ModConfig.AdminAutoKickSessionBans = ToggleRaw(Ru ? "Держать сессионные баны" : "Enforce session bans", Ru ? "Если забаненный игрок вернётся в комнату, хост снова его кикнет." : "If a session-banned player rejoins, the host kicks them again.", ModConfig.AdminAutoKickSessionBans); ModConfig.AdminMaxSpeed = NumberField(Ru ? "Макс. скорость" : "Max speed", ModConfig.AdminMaxSpeed, 5f, 300f); ModConfig.AdminSpeedStrikes = Mathf.RoundToInt(NumberField(Ru ? "Срабатываний" : "Strikes", ModConfig.AdminSpeedStrikes, 1f, 10f)); EndSection(); } if (!BeginSection("admin.lists", Ru ? "Баны, запреты и лог" : "Bans, locks & log", defaultOpen: false)) { return; } GUILayout.Label(Ru ? "Сессионный бан-лист" : "Session ban list", Theme.LabelDim, Array.Empty()); List list = GameApi.SessionBanEntries(); if (list.Count == 0) { GUILayout.Label(Ru ? "Пока пусто." : "Empty.", Theme.LabelDim, Array.Empty()); } for (int j = 0; j < list.Count; j++) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(list[j].Label, Theme.RowLabel, Array.Empty()); if (GUILayout.Button(Ru ? "Разбанить" : "Unban", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(120f), GUILayout.Height(28f) })) { GameApi.UnbanSession(list[j].Key); } GUILayout.EndHorizontal(); } GUILayout.Space(6f); GUILayout.Label(Ru ? "Запрет инвентаря" : "Inventory locks", Theme.LabelDim, Array.Empty()); List list2 = GameApi.InventoryLockEntries(); if (list2.Count == 0) { GUILayout.Label(Ru ? "Пока пусто." : "Empty.", Theme.LabelDim, Array.Empty()); } for (int k = 0; k < list2.Count; k++) { GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(list2[k].Label, Theme.RowLabel, Array.Empty()); if (GUILayout.Button(Ru ? "Снять запрет" : "Unlock", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(120f), GUILayout.Height(28f) })) { GameApi.UnlockInventoryLock(list2[k].Key); } GUILayout.EndHorizontal(); } GUILayout.Space(6f); GUILayout.Label(Ru ? "Последние действия" : "Recent actions", Theme.LabelDim, Array.Empty()); if (GameApi.AdminProtectionLog.Count == 0) { GUILayout.Label(Ru ? "Лог пока пуст." : "No log events yet.", Theme.LabelDim, Array.Empty()); } for (int l = 0; l < GameApi.AdminProtectionLog.Count; l++) { GUILayout.Label(GameApi.AdminProtectionLog[l], Theme.LabelDim, Array.Empty()); } EndSection(); } private static void DrawAdminPlayerRow(int index) { Character val = ((index >= 0 && index < GameApi.PlayerChars.Count) ? GameApi.PlayerChars[index] : null); if (!((Object)(object)val == (Object)null)) { bool flag = GameApi.IsDead(val); bool flag2 = false; try { flag2 = val.IsLocal; } catch { } string text = ((index < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[index] : GameApi.PlayerDisplayName(val)); string text2 = ((!flag) ? (Ru ? "[жив] " : "[alive] ") : (Ru ? "[мёртв] " : "[dead] ")) + text + ((!flag2) ? "" : (Ru ? " (ты)" : " (you)")); GUIStyle val2 = ((_adminTarget == index) ? Theme.ListItemActive : (flag ? Theme.DangerBtn : Theme.ListItem)); if (GUILayout.Button(text2, val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { _adminTarget = index; ActionTracker.Track("admin_player_select", null, new Dictionary { ["target"] = text }); } TipLast(GameApi.PlayerDetails(val, Ru)); } } private static void DrawAdminSelectedPlayer(Character c) { GUILayout.Space(6f); GUILayout.Label((Ru ? "Выбран: " : "Selected: ") + GameApi.PlayerDisplayName(c), Theme.Section, Array.Empty()); GUILayout.Label(GameApi.PlayerDetails(c, Ru), Theme.LabelDim, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (AdminActionButton(Ru ? "Телепорт к нему" : "Teleport to", Ru ? "Переместиться к выбранному игроку." : "Move yourself to the selected player.")) { GameApi.WarpToPlayer(c); } if (AdminActionButton(Ru ? "К себе" : "Bring to me", Ru ? "Притянуть выбранного игрока к тебе." : "Bring the selected player to you.")) { GameApi.BringPlayer(c); } if (AdminActionButton(Ru ? "На спавн" : "To spawn", Ru ? "Отправить выбранного игрока на его точку спавна." : "Send the selected player to their spawn point.")) { GameApi.WarpPlayerToSpawn(c); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (AdminActionButton(Ru ? "Убить" : "Kill", Ru ? "Убить выбранного игрока." : "Kill the selected player.", Theme.DangerBtn)) { GameApi.KillPlayer(c); } if (AdminActionButton(Ru ? "Воскресить" : "Revive", Ru ? "Воскресить выбранного игрока." : "Revive the selected player.")) { GameApi.RevivePlayer(c); } if (AdminActionButton(Ru ? "Скаут" : "Scoutmaster", Ru ? "Призвать скаутмастера рядом с выбранным игроком. Работает у хоста." : "Spawn a Scoutmaster near the selected player. Host only.")) { GameApi.SpawnScoutmaster(c); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); bool flag = GameApi.IsFrozen(c); if (AdminActionButton((!flag) ? (Ru ? "Фриз: выкл" : "Freeze: off") : (Ru ? "Фриз: вкл" : "Freeze: on"), Ru ? "Первое нажатие замораживает, второе снимает фриз." : "First click freezes, second click unfreezes.", flag ? Theme.DangerBtn : Theme.LinkBtn)) { GameApi.ToggleFreeze(c); } bool flag2 = GameApi.IsMuted(c); bool flag3 = false; try { flag3 = c.IsLocal; } catch { } if (AdminActionButton((!flag2) ? (Ru ? "Мут: выкл" : "Mute: off") : (Ru ? "Мут: вкл" : "Mute: on"), (!flag3) ? (Ru ? "Переключить мут выбранного игрока через сетевое свойство Photon." : "Toggle this player's mute state through Photon properties.") : (Ru ? "Мут на себя может игнорироваться игрой/Photon. Эта кнопка в основном для других игроков." : "Self mute may be ignored by the game/Photon. This is mainly for other players."), flag2 ? Theme.DangerBtn : Theme.LinkBtn)) { if (flag3) { GameApi.AddAdminLog(Ru ? "Мут на себя: игра может игнорировать действие" : "Self mute: game may ignore it"); } GameApi.ToggleMute(c); } bool flag4 = GameApi.IsInventoryLocked(c); if (AdminActionButton((!flag4) ? (Ru ? "Инвентарь: можно" : "Inventory: allowed") : (Ru ? "Инвентарь: запрет" : "Inventory: locked"), Ru ? "Запрещает цель держать предметы: найденные предметы будут выкидываться." : "Prevents the target from keeping items by dropping them repeatedly.", flag4 ? Theme.DangerBtn : Theme.LinkBtn)) { GameApi.ToggleInventoryLock(c); } GUILayout.EndHorizontal(); if (flag3) { GUILayout.Label(Ru ? "Кик, мут и бан предназначены для других игроков. На себе они могут выглядеть как бездействие." : "Kick, mute, and ban are meant for other players. On yourself they can look like no-op actions.", Theme.LabelDim, Array.Empty()); } if (!GameApi.IsHost()) { return; } GUILayout.BeginHorizontal(Array.Empty()); if (AdminActionButton(Ru ? "Кикнуть" : "Kick", Ru ? "Кикнуть игрока из текущей комнаты. Только хост." : "Kick this player from the current room. Host only.", Theme.DangerBtn)) { GameApi.KickPlayer(c); } bool flag5 = GameApi.IsSessionBanned(c); if (AdminActionButton((!flag5) ? (Ru ? "Бан: выкл" : "Ban: off") : (Ru ? "Бан: вкл" : "Ban: on"), (!flag3) ? (Ru ? "Сессионный бан: игрок будет снова кикнут при входе в эту комнату." : "Session ban: the player is kicked again if they rejoin.") : (Ru ? "Сессионный бан нужен для других игроков. Самого себя игра обычно не кикает." : "Session ban is for other players. The game usually does not kick yourself."), flag5 ? Theme.DangerBtn : Theme.LinkBtn)) { if (flag3) { GameApi.AddAdminLog(Ru ? "Бан на себя: добавлен в список, самокик может игнорироваться" : "Self ban: listed, self-kick may be ignored"); } GameApi.ToggleSessionBan(c); } GUILayout.EndHorizontal(); } private static bool AdminActionButton(string label, string tip, GUIStyle style = null) { bool result = GUILayout.Button(label, style ?? Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }); TipLast(tip); return result; } private static bool ToggleCompact(string label, bool value) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) Rect rect = GUILayoutUtility.GetRect(160f, 30f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(178f), GUILayout.Height(30f) }); if (GUI.Button(rect, GUIContent.none, GUIStyle.none)) { value = !value; } GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - 54f, ((Rect)(ref rect)).height), label, Theme.LabelDim); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).xMax - 48f, ((Rect)(ref rect)).y + 3f, 46f, 24f); GUI.Box(val, GUIContent.none, value ? Theme.SwitchOn : Theme.SwitchOff); float num = 18f; float num2 = (value ? (((Rect)(ref val)).xMax - num - 3f) : (((Rect)(ref val)).x + 3f)); if ((Object)(object)Theme.KnobTex != (Object)null) { GUI.DrawTexture(new Rect(num2, ((Rect)(ref val)).y + 3f, num, num), (Texture)(object)Theme.KnobTex); } return value; } private static void DrawStatusIncreaseButtons(Character target) { GUILayout.Space(4f); GUILayout.Label(Ru ? "Быстрое увеличение недугов" : "Quick status increases", Theme.LabelDim, Array.Empty()); if (GUILayout.Button(Ru ? "Увеличить основные недуги" : "Increase common statuses", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.IncreaseCommonStatuses(target, ModConfig.StatusIncreasePercent / 100f); } DrawStatusIncreaseRow(target, 0, Ru ? "Травма %" : "Injury %", ref ModConfig.InjuryIncreasePercent); DrawStatusIncreaseRow(target, 1, Ru ? "Голод %" : "Hunger %", ref ModConfig.HungerIncreasePercent); DrawStatusIncreaseRow(target, 2, Ru ? "Холод %" : "Cold %", ref ModConfig.ColdIncreasePercent); DrawStatusIncreaseRow(target, 3, Ru ? "Яд %" : "Poison %", ref ModConfig.PoisonIncreasePercent); DrawStatusIncreaseRow(target, 5, Ru ? "Проклятие %" : "Curse %", ref ModConfig.CurseIncreasePercent); DrawStatusIncreaseRow(target, 6, Ru ? "Сонливость %" : "Drowsy %", ref ModConfig.DrowsyIncreasePercent); DrawStatusIncreaseRow(target, 8, Ru ? "Жара %" : "Hot %", ref ModConfig.HotIncreasePercent); } private static void DrawStatusIncreaseRow(Character target, int statusIndex, string label, ref float percent) { percent = NumberField(label, percent, 0f, 100f); string[] array = (Ru ? GameApi.StatusRu : GameApi.StatusEn); string text = ((statusIndex >= 0 && statusIndex < array.Length) ? array[statusIndex] : statusIndex.ToString()); if (GUILayout.Button("+ " + text, Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Height(28f), GUILayout.ExpandWidth(true) })) { GameApi.IncreaseStatus(target, statusIndex, percent / 100f); } TipLast(Ru ? "Прибавить этот недуг выбранной цели." : "Increase this status on the selected target."); } private static void DrawInventoryModern3() { //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) if (BeginSection("inventory.spawn3", Ru ? "Инвентарь и предметы" : "Inventory & items", defaultOpen: true)) { GameApi.EnsureItemsLoaded(); if (_invTarget >= GameApi.PlayerChars.Count) { _invTarget = -1; } Character val = InventoryTargetPicker(); int num = (((Object)(object)val != (Object)null) ? GameApi.SlotCountFor(val) : GameApi.SlotCount()); if (num <= 0) { num = 3; } if (_selSlot >= num) { _selSlot = Mathf.Max(0, num - 1); } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Слот:" : "Slot:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); for (int i = 0; i < num; i++) { if (GUILayout.Button((i + 1).ToString(), (_selSlot == i) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(36f), GUILayout.Height(30f) })) { _selSlot = i; } } GUILayout.EndHorizontal(); GUILayout.Label(Ru ? "Содержимое слотов" : "Slot contents", Theme.LabelDim, Array.Empty()); for (int j = 0; j < num; j++) { GUILayout.Label($"{j + 1}. {GameApi.DescribeSlot(val, j)}", Theme.LabelDim, Array.Empty()); } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label((Ru ? "Предметов: " : "Items: ") + GameApi.ItemNames.Count, Theme.LabelDim, Array.Empty()); GUILayout.FlexibleSpace(); if (GUILayout.Button(Ru ? "Перезагрузить список" : "Reload list", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.LoadItems(); } TipLast(Ru ? "Заново собрать список предметов из игровых ресурсов." : "Reload the item list from game resources."); GUILayout.EndHorizontal(); _itemSearch = GUILayout.TextField(_itemSearch ?? "", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }); _itemScroll = GUILayout.BeginScrollView(_itemScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(170f) }); string text = (_itemSearch ?? "").Trim().ToLowerInvariant(); for (int k = 0; k < GameApi.ItemNames.Count; k++) { string text2 = GameApi.ItemNames[k]; if ((text.Length <= 0 || text2.ToLowerInvariant().IndexOf(text) >= 0) && DrawItemListRow(k, text2, _selItem == k)) { _selItem = k; } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Заспавнить в слот" : "Spawn to slot", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) }) && _selItem >= 0) { GameApi.SpawnToSlotFor(val, _selItem, _selSlot); } TipLast(Ru ? "Положить выбранный предмет в выбранный основной слот цели." : "Put the selected item into the selected main slot."); if (GUILayout.Button(Ru ? "Очистить слот" : "Clear slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(34f) })) { GameApi.ClearSlotFor(val, _selSlot); } TipLast(Ru ? "Очистить выбранный основной слот цели." : "Clear the selected main slot."); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Во все слоты" : "Spawn to all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }) && _selItem >= 0) { GameApi.FillInventoryWith(val, _selItem); } TipLast(Ru ? "Положить выбранный предмет во все основные слоты и рюкзак цели." : "Put the selected item into every main slot and backpack slot."); if (GUILayout.Button(Ru ? "Очистить всё" : "Clear all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ClearInventory(val); } TipLast(Ru ? "Очистить все основные слоты и рюкзак выбранной цели." : "Clear all main slots and backpack slots for the selected target."); GUILayout.EndHorizontal(); if (_selItem >= 0 && _selItem < GameApi.ItemNames.Count) { GUILayout.Label((Ru ? "Выбрано: " : "Selected: ") + GameApi.ItemNames[_selItem], Theme.LabelDim, Array.Empty()); } if ((Object)(object)val != (Object)null) { GUILayout.Label((Ru ? "Смотришь и редактируешь инвентарь игрока: " : "Viewing and editing player's inventory: ") + ((_invTarget < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[_invTarget] : "?"), Theme.LabelDim, Array.Empty()); } EndSection(); } if (BeginSection("inventory.backpack3", Ru ? "Рюкзак" : "Backpack", defaultOpen: false)) { Character val2 = ((_invTarget >= 0 && _invTarget < GameApi.PlayerChars.Count) ? GameApi.PlayerChars[_invTarget] : null); GUILayout.Label(Ru ? "Ячейки рюкзака используют предмет, выбранный выше в списке." : "Backpack slots use the item selected above.", Theme.LabelDim, Array.Empty()); int num2 = GameApi.BackpackSlotCount(val2); if (num2 <= 0) { GUILayout.Label(Ru ? "Рюкзак не надет или ещё не синхронизирован." : "No backpack equipped or not synced yet.", Theme.LabelDim, Array.Empty()); } else { if (_selBackpackSlot >= num2) { _selBackpackSlot = Mathf.Max(0, num2 - 1); } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Слот:" : "Slot:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); for (int l = 0; l < num2; l++) { if (GUILayout.Button((l + 1).ToString(), (_selBackpackSlot == l) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(36f), GUILayout.Height(28f) })) { _selBackpackSlot = l; } } GUILayout.EndHorizontal(); for (int m = 0; m < num2; m++) { GUILayout.Label($"B{m + 1}. {GameApi.DescribeBackpackSlot(val2, m)}", Theme.LabelDim, Array.Empty()); } GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "В рюкзак" : "To backpack", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }) && _selItem >= 0) { GameApi.SpawnToBackpackSlotFor(val2, _selItem, _selBackpackSlot); } TipLast(Ru ? "Положить выбранный предмет в выбранную ячейку рюкзака." : "Put the selected item into the selected backpack slot."); if (GUILayout.Button(Ru ? "Очистить" : "Clear", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(110f), GUILayout.Height(30f) })) { GameApi.ClearBackpackSlotFor(val2, _selBackpackSlot); } TipLast(Ru ? "Очистить выбранную ячейку рюкзака." : "Clear the selected backpack slot."); GUILayout.EndHorizontal(); } EndSection(); } if (!BeginSection("inventory.recharge3", Ru ? "Перезарядка предметов" : "Item recharge", defaultOpen: false)) { return; } Character val3 = ((_invTarget >= 0 && _invTarget < GameApi.PlayerChars.Count) ? GameApi.PlayerChars[_invTarget] : null); int num3 = (((Object)(object)val3 != (Object)null) ? GameApi.SlotCountFor(val3) : GameApi.SlotCount()); if (num3 <= 0) { num3 = 3; } ModConfig.UnlimitedItemUses = ToggleRaw(Ru ? "Бесконечные использования предметов" : "Unlimited item uses", Ru ? "Не даёт предметам тратить количество использований." : "Prevents items from spending their use count.", ModConfig.UnlimitedItemUses); ModConfig.InfiniteItems = ToggleRaw(Ru ? "Автоперезарядка предметов" : "Auto recharge items", Ru ? "Периодически выставляет заряд/прочность предметов в слотах на значение ниже." : "Periodically sets charge/durability in slots to the value below.", ModConfig.InfiniteItems); ModConfig.UnlimitedLanternFuel = ToggleRaw(Ru ? "Бесконечное топливо фонаря" : "Unlimited lantern fuel", Ru ? "Фонари не расходуют топливо и держатся заполненными." : "Lanterns do not spend fuel and stay filled.", ModConfig.UnlimitedLanternFuel); if (!ModConfig.UnlimitedLanternFuel) { ModConfig.LanternFuelConsumptionPercent = Slider(Ru ? "Расход топлива фонаря %" : "Lantern fuel cost %", ModConfig.LanternFuelConsumptionPercent, 0f, 300f); } ModConfig.RechargeValue = NumberField(Ru ? "Заряд" : "Charge", ModConfig.RechargeValue, 0f, 999f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Слот:" : "Slot:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); for (int n = 0; n < num3; n++) { if (GUILayout.Button((n + 1).ToString(), (_selSlot == n) ? Theme.ChipActive : Theme.Chip, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(36f), GUILayout.Height(28f) })) { _selSlot = n; } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Зарядить выбранный" : "Recharge selected", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.RechargeSlotFor(val3, _selSlot, ModConfig.RechargeValue); } TipLast(Ru ? "Выставить заряд/прочность выбранного основного слота." : "Set charge/durability for the selected main slot."); if (GUILayout.Button(Ru ? "Зарядить все" : "Recharge all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(30f) })) { for (int num4 = 0; num4 < num3; num4++) { GameApi.RechargeSlotFor(val3, num4, ModConfig.RechargeValue); } } TipLast(Ru ? "Выставить заряд/прочность всех основных слотов." : "Set charge/durability for all main slots."); GUILayout.EndHorizontal(); int num5 = GameApi.BackpackSlotCount(val3); if (num5 > 0) { GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Зарядить слот рюкзака" : "Recharge backpack slot", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.RechargeBackpackSlotFor(val3, _selBackpackSlot, ModConfig.RechargeValue); } TipLast(Ru ? "Выставить заряд/прочность выбранной ячейки рюкзака." : "Set charge/durability for the selected backpack slot."); if (GUILayout.Button(Ru ? "Весь рюкзак" : "All backpack", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(130f), GUILayout.Height(30f) })) { for (int num6 = 0; num6 < num5; num6++) { GameApi.RechargeBackpackSlotFor(val3, num6, ModConfig.RechargeValue); } } TipLast(Ru ? "Выставить заряд/прочность всех предметов в рюкзаке." : "Set charge/durability for every backpack item."); GUILayout.EndHorizontal(); } EndSection(); } private static void DrawWorldModern() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_063f: Unknown result type (might be due to invalid IL or missing references) float num = GameApi.ExpeditionTimeSeconds(); float timeOfDayNow = GameApi.TimeOfDay(); int num2 = GameApi.DayCount(); if ((int)Event.current.type == 7) { SyncTimeOfDayInput(timeOfDayNow); } if (BeginSection("world.time", Ru ? "Время и забег" : "Time & run", defaultOpen: true)) { GUILayout.Label((Ru ? "Время забега: " : "Run time: ") + FormatRunTime(num), Theme.LabelDim, Array.Empty()); GUILayout.Label((Ru ? "День: " : "Day: ") + num2 + " " + (Ru ? "Час: " : "Hour: ") + timeOfDayNow.ToString("0.0"), Theme.LabelDim, Array.Empty()); bool flag = Toggle(Ru ? "Держать время забега" : "Hold run timer", ModConfig.OverrideExpeditionTime); if (flag != ModConfig.OverrideExpeditionTime) { if (flag && num > 0.01f) { ModConfig.ExpeditionTimeSeconds = num; SetNumberText(Ru ? "Секунды забега" : "Run seconds", 0f, 7200f, ModConfig.ExpeditionTimeSeconds); GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } ModConfig.OverrideExpeditionTime = flag; } ModConfig.ExpeditionTimeSeconds = NumberField(Ru ? "Секунды забега" : "Run seconds", ModConfig.ExpeditionTimeSeconds, 0f, 7200f); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "-60 сек" : "-60 sec", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { ModConfig.ExpeditionTimeSeconds = Mathf.Max(0f, ModConfig.ExpeditionTimeSeconds - 60f); GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } TipLast(Ru ? "Уменьшить удерживаемое время забега на минуту." : "Decrease the held run time by one minute."); if (GUILayout.Button(Ru ? "Применить" : "Apply", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } TipLast(Ru ? "Применить указанное время забега сейчас." : "Apply the entered run time now."); if (GUILayout.Button(Ru ? "+60 сек" : "+60 sec", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { ModConfig.ExpeditionTimeSeconds += 60f; GameApi.SetExpeditionTime(ModConfig.ExpeditionTimeSeconds); } TipLast(Ru ? "Увеличить удерживаемое время забега на минуту." : "Increase the held run time by one minute."); GUILayout.EndHorizontal(); float num3 = NumberField(TimeOfDayLabel(), _timeOfDay, 0f, 24f); if (Mathf.Abs(num3 - _timeOfDay) > 0.001f) { _timeOfDay = num3; _timePreset = PresetForHour(_timeOfDay); _timeOfDayDirty = true; } GUILayout.BeginHorizontal(Array.Empty()); TimePresetButton(Ru ? "Рассвет" : "Dawn", 6f, 0, Ru ? "Выбрать рассвет. Применится после кнопки ниже." : "Choose dawn. Applies after the button below."); TimePresetButton(Ru ? "День" : "Day", 12f, 1, Ru ? "Выбрать день. Применится после кнопки ниже." : "Choose daytime. Applies after the button below."); TimePresetButton(Ru ? "Закат" : "Dusk", 19f, 2, Ru ? "Выбрать закат. Применится после кнопки ниже." : "Choose dusk. Applies after the button below."); TimePresetButton(Ru ? "Ночь" : "Night", 23f, 3, Ru ? "Выбрать ночь. Применится после кнопки ниже." : "Choose night. Applies after the button below."); GUILayout.EndHorizontal(); if (GUILayout.Button(Ru ? "Применить время суток" : "Apply time of day", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { ApplySelectedTimeOfDay(); } TipLast(Ru ? "Применить указанное время суток." : "Apply the entered time of day."); EndSection(); } if (BeginSection("world.modifiers", Ru ? "Модификаторы мира" : "World modifiers", defaultOpen: false)) { ModConfig.GameSpeedMod = ToggleRaw(Ru ? "Скорость игры" : "Game speed", Ru ? "Меняет общий Time.timeScale игры. Используй аккуратно." : "Changes the game's global Time.timeScale. Use with care.", ModConfig.GameSpeedMod); if (ModConfig.GameSpeedMod) { ModConfig.GameSpeed = Slider("x", ModConfig.GameSpeed, 0.05f, 5f); } ModConfig.PingHandSizeMultiplier = Slider(Ru ? "Размер руки пинга" : "Ping hand size", ModConfig.PingHandSizeMultiplier, 0.1f, 10f); EndSection(); } if (BeginSection("world.finish", Ru ? "Финиш" : "Finish", defaultOpen: false)) { GUILayout.Label(Ru ? "Мгновенно завершает текущий забег победой." : "Instantly ends the current run as a win.", Theme.LabelDim, Array.Empty()); if (GUILayout.Button(Ru ? "Мгновенно пройти" : "Force win", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) })) { GameApi.ForceWin(); } EndSection(); } if (!BeginSection("world.luggage", Ru ? "Контейнеры рядом" : "Nearby containers", defaultOpen: false)) { return; } GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Обновить (300 м)" : "Refresh (300 m)", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.RefreshLuggage(); _selLuggage = -1; } if (GUILayout.Button(Ru ? "Открыть все рядом" : "Open all nearby", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) })) { GameApi.OpenAllNearbyLuggage(); } GUILayout.EndHorizontal(); if (GameApi.LuggageLabels.Count == 0) { GUILayout.Label(Ru ? "Список пуст — нажми «Обновить» во время забега." : "Empty — press Refresh during a run.", Theme.LabelDim, Array.Empty()); } else { _luggageScroll = GUILayout.BeginScrollView(_luggageScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(150f) }); for (int i = 0; i < GameApi.LuggageLabels.Count; i++) { if (GUILayout.Button(GameApi.LuggageLabels[i], (_selLuggage == i) ? Theme.ListItemActive : Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Height(30f), GUILayout.ExpandWidth(true) })) { _selLuggage = i; } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Ru ? "Открыть выбранный" : "Open selected", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }) && _selLuggage >= 0) { GameApi.OpenLuggage(_selLuggage); } if (GUILayout.Button(Ru ? "Телепорт к нему" : "Warp to it", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) }) && _selLuggage >= 0) { GameApi.WarpToLuggage(_selLuggage); } GUILayout.EndHorizontal(); } EndSection(); } private unsafe static void DrawBadgesModern() { //IL_0161: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Invalid comparison between Unknown and I4 //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: 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_0300: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) ACHIEVEMENTTYPE[] allTypes = SteamAch.AllTypes; int num = allTypes.Length; RefreshBadgeCache(force: false); int num2 = 0; for (int i = 0; i < num; i++) { if (_badgeUnlockedCache != null && i < _badgeUnlockedCache.Length && _badgeUnlockedCache[i]) { num2++; } } GUILayout.Label(L("tab.badges"), Theme.Section, Array.Empty()); GUILayout.BeginVertical(Theme.Card, Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label((Ru ? "Получено: " : "Unlocked: ") + num2 + " / " + num, Theme.LabelDim, Array.Empty()); GUILayout.FlexibleSpace(); if (GUILayout.Button(Ru ? "Выдать все" : "Unlock all", Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { SteamAch.UnlockAll(); RefreshBadgeCache(force: true); } if (GUILayout.Button(Ru ? "Отозвать все" : "Revoke all", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { SteamAch.RevokeAll(); RefreshBadgeCache(force: true); } GUILayout.EndHorizontal(); GUILayout.Label(Ru ? "Лёгкий список: маленькая иконка, название, статус и отдельная кнопка действия." : "Lightweight list: small icon, name, status, and a dedicated action button.", Theme.LabelDim, Array.Empty()); if ((Object)(object)_badgeTileBg == (Object)null) { _badgeTileBg = Theme.RoundedTex(Theme.Panel, 10); } if ((Object)(object)_badgeTileOn == (Object)null) { _badgeTileOn = Theme.RoundedTex(Theme.AccentDim, 10); } if ((Object)(object)_badgeTileOff == (Object)null) { _badgeTileOff = Theme.RoundedTex(Theme.PanelLight, 10); } if ((Object)(object)_badgeStripeOn == (Object)null) { _badgeStripeOn = Theme.RoundedTex(Theme.Accent, 6); } if ((Object)(object)_badgeStripeOff == (Object)null) { _badgeStripeOff = Theme.RoundedTex(BadgeLockedModern, 6); } float num3 = Mathf.Clamp(((Rect)(ref _rect)).height - 240f, 180f, 440f); _badgeScroll = GUILayout.BeginScrollView(_badgeScroll, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(num3) }); Rect val2 = default(Rect); for (int j = 0; j < num; j++) { ACHIEVEMENTTYPE t = allTypes[j]; bool flag = _badgeUnlockedCache != null && j < _badgeUnlockedCache.Length && _badgeUnlockedCache[j]; Rect rect = GUILayoutUtility.GetRect(10f, 42f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(42f) }); bool flag2 = Event.current != null && ((Rect)(ref rect)).Contains(Event.current.mousePosition); if ((int)Event.current.type == 7) { GUI.Box(rect, GUIContent.none, flag2 ? Theme.RowHover : (flag ? Theme.ListItemActive : Theme.ListItem)); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x + 6f, ((Rect)(ref rect)).y + 6f, 4f, ((Rect)(ref rect)).height - 12f), (Texture)(object)(flag ? _badgeStripeOn : _badgeStripeOff)); Texture2D val = SteamAch.Icon(t); ((Rect)(ref val2))..ctor(((Rect)(ref rect)).x + 16f, ((Rect)(ref rect)).y + 7f, 28f, 28f); if ((Object)(object)val != (Object)null) { Color color = GUI.color; GUI.color = (Color)(flag ? Color.white : new Color(1f, 1f, 1f, 0.58f)); GUI.DrawTexture(val2, (Texture)(object)val, (ScaleMode)2, true); GUI.color = color; } else { GUI.Label(val2, "?", ItemIconFallbackStyle()); } string text = SteamAch.DisplayName(t); GUI.Label(new Rect(((Rect)(ref rect)).x + 52f, ((Rect)(ref rect)).y + 2f, ((Rect)(ref rect)).width - 220f, 22f), text, Theme.RowLabel); GUI.Label(new Rect(((Rect)(ref rect)).x + 52f, ((Rect)(ref rect)).y + 21f, ((Rect)(ref rect)).width - 220f, 18f), (!flag) ? (Ru ? "Не получено" : "Locked") : (Ru ? "Получено" : "Unlocked"), Theme.LabelDim); } string text2 = SteamAch.DisplayName(t); string text3 = SteamAch.Desc(t); if (!string.IsNullOrEmpty(text3)) { text2 = text2 + "\n" + text3; } if (flag2) { _hoverTip = text2; } Rect val3 = new Rect(((Rect)(ref rect)).xMax - 112f, ((Rect)(ref rect)).y + 7f, 104f, 28f); string text4 = ((!flag) ? (Ru ? "Выдать" : "Unlock") : (Ru ? "Отозвать" : "Revoke")); if (GUI.Button(val3, text4, flag ? Theme.LinkBtn : Theme.DonateBtn)) { SteamAch.Toggle(t); RefreshBadgeCache(force: true); ActionTracker.Track(flag ? "badge_revoke_one" : "badge_unlock_one", null, new Dictionary { ["badge"] = ((object)(*(ACHIEVEMENTTYPE*)(&t))/*cast due to .constrained prefix*/).ToString() }); } } GUILayout.EndScrollView(); GUILayout.EndVertical(); } private static void RefreshBadgeCache(bool force) { ACHIEVEMENTTYPE[] allTypes = SteamAch.AllTypes; if (force || _badgeTypeCache != allTypes || _badgeUnlockedCache == null || _badgeUnlockedCache.Length != allTypes.Length || !(Time.realtimeSinceStartup - _badgeCacheTime < 0.75f)) { _badgeTypeCache = allTypes; if (_badgeUnlockedCache == null || _badgeUnlockedCache.Length != allTypes.Length) { _badgeUnlockedCache = new bool[allTypes.Length]; } for (int i = 0; i < allTypes.Length; i++) { _badgeUnlockedCache[i] = SteamAch.IsUnlocked(allTypes[i]); } _badgeCacheTime = Time.realtimeSinceStartup; } } private static void DrawTooltipOverlayModern() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) string text = HoverTooltipText(); if (!string.IsNullOrEmpty(text)) { Vector2 mouse = default(Vector2); ((Vector2)(ref mouse))..ctor(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y); DrawTooltipBox(text, mouse, avoidWindow: false); } } private static bool ToggleModern(string key, bool value) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) Rect rect = GUILayoutUtility.GetRect(10f, 40f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); int num; if (Event.current != null) { num = (((Rect)(ref rect)).Contains(Event.current.mousePosition) ? 1 : 0); if (num != 0 && (int)Event.current.type == 7) { GUI.Box(rect, GUIContent.none, Theme.RowHover); } } else { num = 0; } if (num != 0) { _hoverTip = Localization.D(key); } bool num2 = GUI.Button(rect, GUIContent.none, GUIStyle.none); GUI.Label(new Rect(((Rect)(ref rect)).x + 12f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - 72f, ((Rect)(ref rect)).height), L(key), Theme.RowLabel); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).xMax - 46f - 12f, ((Rect)(ref rect)).y + (((Rect)(ref rect)).height - 24f) * 0.5f, 46f, 24f); GUI.Box(val, GUIContent.none, value ? Theme.SwitchOn : Theme.SwitchOff); float num3 = 18f; float num4 = (value ? (((Rect)(ref val)).xMax - num3 - 3f) : (((Rect)(ref val)).x + 3f)); if ((Object)(object)Theme.KnobTex != (Object)null) { GUI.DrawTexture(new Rect(num4, ((Rect)(ref val)).y + 3f, num3, num3), (Texture)(object)Theme.KnobTex); } if (num2) { value = !value; } return value; } private static bool ToggleRaw(string label, string tip, bool value) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) Rect rect = GUILayoutUtility.GetRect(10f, 40f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); int num; if (Event.current != null) { num = (((Rect)(ref rect)).Contains(Event.current.mousePosition) ? 1 : 0); if (num != 0 && (int)Event.current.type == 7) { GUI.Box(rect, GUIContent.none, Theme.RowHover); } } else { num = 0; } if (num != 0) { _hoverTip = tip; } bool num2 = GUI.Button(rect, GUIContent.none, GUIStyle.none); GUI.Label(new Rect(((Rect)(ref rect)).x + 12f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - 72f, ((Rect)(ref rect)).height), label, Theme.RowLabel); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).xMax - 46f - 12f, ((Rect)(ref rect)).y + (((Rect)(ref rect)).height - 24f) * 0.5f, 46f, 24f); GUI.Box(val, GUIContent.none, value ? Theme.SwitchOn : Theme.SwitchOff); float num3 = 18f; float num4 = (value ? (((Rect)(ref val)).xMax - num3 - 3f) : (((Rect)(ref val)).x + 3f)); if ((Object)(object)Theme.KnobTex != (Object)null) { GUI.DrawTexture(new Rect(num4, ((Rect)(ref val)).y + 3f, num3, num3), (Texture)(object)Theme.KnobTex); } if (num2) { value = !value; } return value; } private static Rect DefaultWindowRect() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) return new Rect(80f, 80f, 680f, 580f); } private static void CenterWindow() { ((Rect)(ref _rect)).x = Mathf.Round(((float)Screen.width - ((Rect)(ref _rect)).width) * 0.5f); ((Rect)(ref _rect)).y = Mathf.Round(((float)Screen.height - ((Rect)(ref _rect)).height) * 0.5f); ClampWindowToScreen(); } private static void ClampWindowToScreen() { float num = 8f; float num2 = Mathf.Max(420f, (float)Screen.width - num * 2f); float num3 = Mathf.Max(340f, (float)Screen.height - num * 2f); float num4 = Mathf.Min(540f, num2); float num5 = Mathf.Min(500f, num3); ((Rect)(ref _rect)).width = Mathf.Clamp(((Rect)(ref _rect)).width, num4, num2); ((Rect)(ref _rect)).height = Mathf.Clamp(((Rect)(ref _rect)).height, num5, num3); ((Rect)(ref _rect)).x = Mathf.Clamp(((Rect)(ref _rect)).x, num, (float)Screen.width - ((Rect)(ref _rect)).width - num); ((Rect)(ref _rect)).y = Mathf.Clamp(((Rect)(ref _rect)).y, num, (float)Screen.height - ((Rect)(ref _rect)).height - num); } private static void HandleWindowResize(Event e) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_00d9: 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_00e3: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) if (e == null) { return; } if (_resizeEdge != ResizeEdge.None && !Input.GetMouseButton(0)) { _resizeEdge = ResizeEdge.None; } else if (_resizeEdge == ResizeEdge.None) { if ((int)e.type == 0 && e.button == 0) { ResizeEdge resizeEdge = HitResizeEdge(e.mousePosition); if (resizeEdge != ResizeEdge.None) { _resizeEdge = resizeEdge; _resizeStartRect = _rect; _resizeStartMouse = e.mousePosition; e.Use(); } } } else if ((int)e.type == 1) { _resizeEdge = ResizeEdge.None; e.Use(); } else if ((int)e.type == 3) { float num = 8f; float num2 = Mathf.Max(420f, (float)Screen.width - num * 2f); float num3 = Mathf.Max(340f, (float)Screen.height - num * 2f); float num4 = Mathf.Min(540f, num2); float num5 = Mathf.Min(500f, num3); Vector2 val = e.mousePosition - _resizeStartMouse; float num6 = ((Rect)(ref _resizeStartRect)).xMin; float num7 = ((Rect)(ref _resizeStartRect)).xMax; float num8 = ((Rect)(ref _resizeStartRect)).yMin; float num9 = ((Rect)(ref _resizeStartRect)).yMax; if ((_resizeEdge & ResizeEdge.Left) != ResizeEdge.None) { num6 = Mathf.Clamp(((Rect)(ref _resizeStartRect)).xMin + val.x, num, ((Rect)(ref _resizeStartRect)).xMax - num4); } if ((_resizeEdge & ResizeEdge.Right) != ResizeEdge.None) { num7 = Mathf.Clamp(((Rect)(ref _resizeStartRect)).xMax + val.x, ((Rect)(ref _resizeStartRect)).xMin + num4, (float)Screen.width - num); } if ((_resizeEdge & ResizeEdge.Top) != ResizeEdge.None) { num8 = Mathf.Clamp(((Rect)(ref _resizeStartRect)).yMin + val.y, num, ((Rect)(ref _resizeStartRect)).yMax - num5); } if ((_resizeEdge & ResizeEdge.Bottom) != ResizeEdge.None) { num9 = Mathf.Clamp(((Rect)(ref _resizeStartRect)).yMax + val.y, ((Rect)(ref _resizeStartRect)).yMin + num5, (float)Screen.height - num); } _rect = Rect.MinMaxRect(num6, num8, num7, num9); ((Rect)(ref _rect)).width = Mathf.Clamp(((Rect)(ref _rect)).width, num4, num2); ((Rect)(ref _rect)).height = Mathf.Clamp(((Rect)(ref _rect)).height, num5, num3); e.Use(); } } private static ResizeEdge HitResizeEdge(Vector2 mouse) { //IL_0000: 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_0036: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00d9: Unknown result type (might be due to invalid IL or missing references) bool num = mouse.x >= ((Rect)(ref _rect)).xMin - 8f && mouse.x <= ((Rect)(ref _rect)).xMax + 8f; bool flag = mouse.y >= ((Rect)(ref _rect)).yMin - 8f && mouse.y <= ((Rect)(ref _rect)).yMax + 8f; if (!num || !flag) { return ResizeEdge.None; } ResizeEdge resizeEdge = ResizeEdge.None; if (Mathf.Abs(mouse.x - ((Rect)(ref _rect)).xMin) <= 8f) { resizeEdge |= ResizeEdge.Left; } if (Mathf.Abs(mouse.x - ((Rect)(ref _rect)).xMax) <= 8f) { resizeEdge |= ResizeEdge.Right; } if (Mathf.Abs(mouse.y - ((Rect)(ref _rect)).yMin) <= 8f) { resizeEdge |= ResizeEdge.Top; } if (Mathf.Abs(mouse.y - ((Rect)(ref _rect)).yMax) <= 8f) { resizeEdge |= ResizeEdge.Bottom; } return resizeEdge; } private static void DrawTooltipOverlay() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (UseModernUi) { DrawTooltipOverlayModern(); return; } string tooltip = GUI.tooltip; if (!string.IsNullOrEmpty(tooltip)) { Vector2 mouse = (Vector2)((Event.current != null) ? Event.current.mousePosition : new Vector2(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y)); RememberTooltip(tooltip); DrawTooltipBox(tooltip, mouse, avoidWindow: true); } } public static void DrawDonateNotice() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown if (!_noticeDismissed && ModConfig.ShowDonateNotice.Value) { Theme.EnsureBuilt(); ApplyFont(); float num = 420f; float num2 = (_langOpen ? Mathf.Min(560f, (float)Screen.height - 80f) : 300f); Rect noticeRect = _noticeRect; object obj = <>O.<1>__DrawNoticeWindowModern; if (obj == null) { WindowFunction val = DrawNoticeWindowModern; <>O.<1>__DrawNoticeWindowModern = val; obj = (object)val; } _noticeRect = GUILayout.Window(1, noticeRect, (WindowFunction)obj, GUIContent.none, Theme.Window, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(num), GUILayout.Height(num2) }); } } private static void DrawNoticeWindow(int id) { GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Space(12f); GUILayout.BeginVertical(Array.Empty()); GUILayout.Label("PEAK-MX ♥", Theme.Title, Array.Empty()); GUILayout.Label(SupportText(), Theme.DonateText, Array.Empty()); GUILayout.Space(6f); GUILayout.Label(L("ui.language"), Theme.LabelDim, Array.Empty()); DrawLanguagePicker(); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(DonateTextLabel(), Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) })) { OpenUrl("https://www.donationalerts.com/r/maxkir041"); _noticeDismissed = true; } if (GUILayout.Button(CloseTextLabel(), Theme.CloseBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(90f) })) { _noticeDismissed = true; } GUILayout.EndHorizontal(); GUILayout.Space(6f); DrawQr(_langOpen ? 118 : 92); GUILayout.Space(8f); GUILayout.EndVertical(); GUILayout.Space(12f); GUILayout.EndHorizontal(); GUI.DragWindow(); } private static void DrawNoticeWindowModern(int id) { GUILayout.Space(10f); GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Space(12f); GUILayout.BeginVertical(Array.Empty()); GUILayout.Label("PEAK-MX ♥", Theme.Title, Array.Empty()); GUILayout.Label(SupportText(), Theme.DonateText, Array.Empty()); GUILayout.Space(6f); GUILayout.Label(L("ui.language"), Theme.LabelDim, Array.Empty()); DrawLanguagePicker(); GUILayout.Space(8f); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(DonateTextLabel(), Theme.DonateBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) })) { OpenUrl("https://www.donationalerts.com/r/maxkir041"); _noticeDismissed = true; } if (GUILayout.Button(Ru ? "Закрыть" : "Close", Theme.CloseBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(90f) })) { _noticeDismissed = true; } GUILayout.EndHorizontal(); GUILayout.Space(6f); DrawQr(_langOpen ? 118 : 92); GUILayout.Space(8f); GUILayout.EndVertical(); GUILayout.Space(12f); GUILayout.EndHorizontal(); GUI.DragWindow(); } private static bool BeginSection(string key, string title, bool defaultOpen) { if (!_sectionOpen.TryGetValue(key, out var value)) { value = defaultOpen; } GUILayout.BeginVertical(Theme.Card, Array.Empty()); string obj = (value ? "▼ " : "► "); GUIStyle val = (value ? Theme.FoldoutBtnOpen : Theme.FoldoutBtn); if (GUILayout.Button(obj + title, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(32f) })) { value = !value; } _sectionOpen[key] = value; if (!value) { GUILayout.EndVertical(); return false; } GUILayout.Space(8f); return true; } private static void EndSection() { GUILayout.EndVertical(); } private static bool Toggle(string key, bool value) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Invalid comparison between Unknown and I4 //IL_004e: 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) if (UseModernUi) { return ToggleModern(key, value); } Rect rect = GUILayoutUtility.GetRect(10f, 40f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (((Rect)(ref rect)).Contains(Event.current.mousePosition) && (int)Event.current.type == 7) { GUI.Box(rect, GUIContent.none, Theme.RowHover); } bool num = GUI.Button(rect, new GUIContent("", Localization.D(key)), GUIStyle.none); GUI.Label(new Rect(((Rect)(ref rect)).x + 12f, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - 72f, ((Rect)(ref rect)).height), L(key), Theme.RowLabel); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).xMax - 46f - 12f, ((Rect)(ref rect)).y + (((Rect)(ref rect)).height - 24f) * 0.5f, 46f, 24f); GUI.Box(val, GUIContent.none, value ? Theme.SwitchOn : Theme.SwitchOff); float num2 = 18f; float num3 = (value ? (((Rect)(ref val)).xMax - num2 - 3f) : (((Rect)(ref val)).x + 3f)); if ((Object)(object)Theme.KnobTex != (Object)null) { GUI.DrawTexture(new Rect(num3, ((Rect)(ref val)).y + 3f, num2, num2), (Texture)(object)Theme.KnobTex); } if (num) { value = !value; } return value; } private static float NumberField(string label, float value, float min, float max) { string key = NumberKey(label, min, max); if (!_numberText.TryGetValue(key, out var value2)) { value2 = value.ToString("0.##"); } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(label, Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) }); string text = GUILayout.TextField(value2, Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(96f), GUILayout.Height(28f) }); GUILayout.Label(min.ToString("0.##") + " - " + max.ToString("0.##"), Theme.LabelDim, Array.Empty()); GUILayout.EndHorizontal(); if (float.TryParse(text, out var result)) { value = Mathf.Clamp(result, min, max); } string text2 = value.ToString("0.##"); _numberText[key] = ((text == value2 && text != text2) ? text2 : text); return value; } private static string NumberKey(string label, float min, float max) { return label + "|" + min.ToString("0.###") + "|" + max.ToString("0.###"); } private static void SetNumberText(string label, float min, float max, float value) { _numberText[NumberKey(label, min, max)] = value.ToString("0.##"); } private static float Slider(string label, float value, float min, float max) { //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) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Invalid comparison between Unknown and I4 //IL_010a: Unknown result type (might be due to invalid IL or missing references) Rect rect = GUILayoutUtility.GetRect(10f, 34f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(34f) }); GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 120f, ((Rect)(ref rect)).height), $"{label}: {value:0.##}", Theme.LabelDim); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref rect)).x + 124f, ((Rect)(ref rect)).y + (((Rect)(ref rect)).height - 8f) * 0.5f, Mathf.Max(40f, ((Rect)(ref rect)).width - 140f), 8f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref val)).x, ((Rect)(ref rect)).y + 4f, ((Rect)(ref val)).width, ((Rect)(ref rect)).height - 8f); Event current = Event.current; if (current != null && ((int)current.type == 0 || (int)current.type == 3) && ((Rect)(ref val2)).Contains(current.mousePosition)) { float num = Mathf.Clamp01((current.mousePosition.x - ((Rect)(ref val)).x) / Mathf.Max(1f, ((Rect)(ref val)).width)); value = Mathf.Lerp(min, max, num); current.Use(); } GUI.Box(val, GUIContent.none, Theme.SliderBar); float num2 = Mathf.InverseLerp(min, max, value); Rect val3 = new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, Mathf.Clamp01(num2) * ((Rect)(ref val)).width, ((Rect)(ref val)).height); if ((Object)(object)_sliderFillTex == (Object)null) { _sliderFillTex = Theme.Tex(Theme.Accent); } GUI.DrawTexture(val3, (Texture)(object)_sliderFillTex); float num3 = 18f; GUI.Box(new Rect(((Rect)(ref val)).x + num2 * ((Rect)(ref val)).width - num3 * 0.5f, ((Rect)(ref val)).center.y - num3 * 0.5f, num3, num3), GUIContent.none, Theme.SliderThumb); return Mathf.Clamp(value, min, max); } private static void TipLast(string tip) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (Event.current != null && !string.IsNullOrWhiteSpace(tip)) { Rect lastRect = GUILayoutUtility.GetLastRect(); if (((Rect)(ref lastRect)).Contains(Event.current.mousePosition)) { _hoverTip = tip; } } } private static bool DrawItemListRow(int index, string name, bool active) { //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) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) Rect rect = GUILayoutUtility.GetRect(10f, 32f, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.ExpandWidth(true), GUILayout.Height(32f) }); bool result = GUI.Button(rect, GUIContent.none, active ? Theme.ListItemActive : Theme.ListItem); Texture2D val = GameApi.ItemIcon(index); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref rect)).x + 7f, ((Rect)(ref rect)).y + 4f, 24f, 24f); float num = ((Rect)(ref rect)).x + 38f; if ((Object)(object)val != (Object)null) { GUI.DrawTexture(val2, (Texture)(object)val, (ScaleMode)2, true); } else { GUI.Box(val2, GUIContent.none, active ? Theme.ChipActive : Theme.Chip); string text = (string.IsNullOrWhiteSpace(name) ? "?" : name.Substring(0, 1).ToUpperInvariant()); GUI.Label(val2, text, ItemIconFallbackStyle()); } GUI.Label(new Rect(num, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width - (num - ((Rect)(ref rect)).x) - 10f, ((Rect)(ref rect)).height), name, active ? Theme.RowLabel : Theme.Label); if (((Rect)(ref rect)).Contains(Event.current.mousePosition)) { _hoverTip = (Ru ? "Выбрать предмет для спавна или приколов." : "Select this item for spawning or pranks."); } return result; } private static GUIStyle ItemIconFallbackStyle() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown if (_itemIconText == null) { GUIStyle val = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 11, fontStyle = (FontStyle)1 }; val.normal.textColor = Color.white; _itemIconText = val; } return _itemIconText; } private static void DrawTooltipFooter(Rect rect) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) GUI.Box(rect, GUIContent.none, Theme.Panel9); string text = FooterTooltipText(); DrawScrollableTooltipText(new Rect(((Rect)(ref rect)).x + 12f, ((Rect)(ref rect)).y + 7f, ((Rect)(ref rect)).width - 24f, ((Rect)(ref rect)).height - 12f), text, Theme.TipText); } private static string DefaultTooltipText() { if (!Ru) { return "Hover a button, item, or player - the hint appears here."; } return "Наведи курсор на кнопку, предмет или игрока - подсказка появится здесь."; } private static string HoverTooltipText() { if (string.IsNullOrWhiteSpace(_hoverTip)) { return null; } RememberTooltip(_hoverTip); return _hoverTip; } private static string FooterTooltipText() { string text = HoverTooltipText(); if (!string.IsNullOrWhiteSpace(text)) { return text; } if (!string.IsNullOrWhiteSpace(_lastTip) && Time.realtimeSinceStartup <= _lastTipUntil) { return _lastTip; } return DefaultTooltipText(); } private static void RememberTooltip(string tip) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrWhiteSpace(tip)) { if (!string.Equals(_lastTip, tip, StringComparison.Ordinal)) { _tipScroll = Vector2.zero; } _lastTip = tip; _lastTipUntil = Time.realtimeSinceStartup + 0.3f; } } private static void DrawTooltipBox(string tip, Vector2 mouse, bool avoidWindow) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_006c: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrWhiteSpace(tip)) { return; } float num = Mathf.Min(560f, Mathf.Max(320f, (float)Screen.width * 0.44f)); float num2 = Mathf.Max(140f, (float)Screen.height * 0.72f); float num3 = num - 24f; float num4 = Mathf.Clamp(Theme.Tooltip.CalcHeight(new GUIContent(tip), num3) + 22f, 44f, num2); float num5 = mouse.x + 18f; float num6 = mouse.y + 20f; if (num5 + num > (float)Screen.width - 10f) { num5 = mouse.x - num - 18f; } if (num6 + num4 > (float)Screen.height - 10f) { num6 = mouse.y - num4 - 18f; } Rect val = default(Rect); ((Rect)(ref val))..ctor(num5, num6, num, num4); if (avoidWindow && ((Rect)(ref val)).Overlaps(_rect)) { float num7 = ((Rect)(ref _rect)).xMax + 14f; float num8 = ((Rect)(ref _rect)).xMin - num - 14f; float num9 = ((Rect)(ref _rect)).yMax + 12f; float num10 = ((Rect)(ref _rect)).yMin - num4 - 12f; if (num7 + num <= (float)Screen.width - 10f) { ((Rect)(ref val)).x = num7; } else if (num8 >= 10f) { ((Rect)(ref val)).x = num8; } else if (num9 + num4 <= (float)Screen.height - 10f) { ((Rect)(ref val)).y = num9; } else if (num10 >= 10f) { ((Rect)(ref val)).y = num10; } } ((Rect)(ref val)).x = Mathf.Clamp(((Rect)(ref val)).x, 10f, (float)Screen.width - num - 10f); ((Rect)(ref val)).y = Mathf.Clamp(((Rect)(ref val)).y, 10f, (float)Screen.height - num4 - 10f); int depth = GUI.depth; GUI.depth = -10000; GUI.Box(val, GUIContent.none, Theme.Tooltip); DrawScrollableTooltipText(new Rect(((Rect)(ref val)).x + 12f, ((Rect)(ref val)).y + 10f, ((Rect)(ref val)).width - 24f, ((Rect)(ref val)).height - 18f), tip, Theme.Tooltip); GUI.depth = depth; } private static void DrawScrollableTooltipText(Rect rect, string text, GUIStyle style) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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) if (!string.IsNullOrWhiteSpace(text)) { float num = 16f; float num2 = style.CalcHeight(new GUIContent(text), Mathf.Max(1f, ((Rect)(ref rect)).width - num)); if (num2 <= ((Rect)(ref rect)).height) { GUI.Label(rect, text, style); return; } Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, Mathf.Max(1f, ((Rect)(ref rect)).width - num), num2); _tipScroll = GUI.BeginScrollView(rect, _tipScroll, val, GUIStyle.none, GUI.skin.verticalScrollbar); GUI.Label(val, text, style); GUI.EndScrollView(); } } private static void LinkButton(string label, string url) { if (GUILayout.Button(label, Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { OpenUrl(url); } } private static Character TargetPicker(ref int sel) { if (sel >= GameApi.PlayerChars.Count) { sel = -1; } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Цель:" : "Target:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); if (GUILayout.Button(TargetName(sel), Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { _targetPickerOpen = !_targetPickerOpen; } TipLast(Ru ? "Открыть список игроков и выбрать цель действия." : "Open the player list and choose a target."); if (GUILayout.Button(Ru ? "Обновить" : "Refresh", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(86f), GUILayout.Height(28f) })) { GameApi.RefreshPlayers(); ActionTracker.Track("players_refresh_picker"); } GUILayout.EndHorizontal(); if (_targetPickerOpen) { if (GUILayout.Button(Ru ? "Себе" : "Me", (sel < 0) ? Theme.ListItemActive : Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { sel = -1; _targetPickerOpen = false; ActionTracker.Track("target_select", null, new Dictionary { ["target"] = "self" }); } for (int i = 0; i < GameApi.PlayerChars.Count; i++) { Character val = GameApi.PlayerChars[i]; bool flag = false; try { flag = (Object)(object)val != (Object)null && val.IsLocal; } catch { } if (!flag) { string text = ((i < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[i] : "?"); if (GUILayout.Button(text, (sel == i) ? Theme.ListItemActive : Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { sel = i; _targetPickerOpen = false; ActionTracker.Track("target_select", null, new Dictionary { ["target"] = text }); } TipLast(GameApi.PlayerDetails(val, Ru)); } } } if (sel < 0 || sel >= GameApi.PlayerChars.Count) { return Character.localCharacter; } return GameApi.PlayerChars[sel]; } private static string TargetName(int sel) { if (sel >= 0 && sel < GameApi.PlayerNames.Count) { return GameApi.PlayerNames[sel]; } if (!Ru) { return "Me"; } return "Себе"; } private static Character InventoryTargetPicker() { if (_invTarget >= GameApi.PlayerChars.Count) { _invTarget = -1; } GUILayout.BeginHorizontal(Array.Empty()); GUILayout.Label(Ru ? "Кому:" : "Target:", Theme.LabelDim, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(54f) }); if (GUILayout.Button(TargetName(_invTarget), Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { _inventoryTargetPickerOpen = !_inventoryTargetPickerOpen; } TipLast(Ru ? "Выбрать, чей инвентарь смотреть и редактировать." : "Choose whose inventory to inspect and edit."); if (GUILayout.Button(Ru ? "Обновить" : "Refresh", Theme.LinkBtn, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(86f), GUILayout.Height(28f) })) { GameApi.RefreshPlayers(); ActionTracker.Track("players_refresh_inventory"); } GUILayout.EndHorizontal(); if (_inventoryTargetPickerOpen) { if (GUILayout.Button(Ru ? "Себе" : "Me", (_invTarget < 0) ? Theme.ListItemActive : Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { _invTarget = -1; _inventoryTargetPickerOpen = false; ActionTracker.Track("inventory_target_select", null, new Dictionary { ["target"] = "self" }); } for (int i = 0; i < GameApi.PlayerChars.Count; i++) { Character val = GameApi.PlayerChars[i]; bool flag = false; try { flag = (Object)(object)val != (Object)null && val.IsLocal; } catch { } if (!flag) { string text = ((i < GameApi.PlayerNames.Count) ? GameApi.PlayerNames[i] : "?"); if (GUILayout.Button(text, (_invTarget == i) ? Theme.ListItemActive : Theme.ListItem, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(28f) })) { _invTarget = i; _inventoryTargetPickerOpen = false; ActionTracker.Track("inventory_target_select", null, new Dictionary { ["target"] = text }); } TipLast(GameApi.PlayerDetails(val, Ru)); } } } if (_invTarget < 0 || _invTarget >= GameApi.PlayerChars.Count) { return null; } return GameApi.PlayerChars[_invTarget]; } private static void HLine() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_lineTex == (Object)null) { _lineTex = Theme.Tex(Theme.PanelLight); } GUI.DrawTexture(GUILayoutUtility.GetRect(1f, 1f, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }), (Texture)(object)_lineTex); } private static void DrawBrandMark(float size) { //IL_0074: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown if ((Object)(object)_brandIconTex == (Object)null) { _brandIconTex = BuildBrandIcon(64); } if (_brandIconText == null) { GUIStyle val = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontSize = 13, fontStyle = (FontStyle)1 }; val.normal.textColor = Color.white; _brandIconText = val; } Rect rect = GUILayoutUtility.GetRect(size, size, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(size), GUILayout.Height(size) }); GUI.DrawTexture(rect, (Texture)(object)_brandIconTex, (ScaleMode)2, true); GUI.Label(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + size * 0.45f, ((Rect)(ref rect)).width, size * 0.34f), "MX", _brandIconText); } private static Texture2D BuildBrandIcon(int size) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_01dd: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(size, size, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; Color val2 = default(Color); ((Color)(ref val2))..ctor(0.05f, 0.064f, 0.078f, 1f); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.255f, 0.835f, 0.541f, 1f); Color val4 = default(Color); ((Color)(ref val4))..ctor(0.118f, 0.302f, 0.22f, 1f); Color val5 = default(Color); ((Color)(ref val5))..ctor(1f, 0.851f, 0.4f, 1f); float num = (float)size * 0.18f; Vector2 val6 = default(Vector2); ((Vector2)(ref val6))..ctor((float)size * 0.5f, (float)size * 0.5f); for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { float num2 = Mathf.Max(Mathf.Abs((float)j - val6.x) - ((float)size * 0.5f - num), 0f); float num3 = Mathf.Max(Mathf.Abs((float)i - val6.y) - ((float)size * 0.5f - num), 0f); float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = Mathf.Clamp01(num - num4 + 1f); Color val7 = val2; if (j < 3 || i < 3 || j >= size - 3 || i >= size - 3) { val7 = val3; } float num6 = (float)i / (float)(size - 1); float num7 = (float)j / (float)(size - 1); float num8 = Mathf.InverseLerp(0.12f, 0.5f, num7); float num9 = Mathf.InverseLerp(0.88f, 0.5f, num7); float num10 = Mathf.Min(num8, num9); if (num6 < num10 * 0.52f + 0.18f && num6 > 0.15f) { val7 = val4; } if (num6 < num10 * 0.18f + 0.18f && num7 > 0.4f && num7 < 0.6f) { val7 = val5; } val7.a *= num5; val.SetPixel(j, i, val7); } } val.Apply(); return val; } private static void OpenUrl(string url) { try { Application.OpenURL(url); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("OpenURL failed: " + ex.Message)); } } } private static Texture2D QrTexture() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown if ((Object)(object)_qrTex != (Object)null) { return _qrTex; } if (!_qrRequested) { _qrRequested = true; Task.Run(delegate { try { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; using WebClient webClient = new WebClient(); _qrBytes = webClient.DownloadData("https://files.donationalerts.com/uploads/qr/8215314/qr_6de7aa0b93950f375ec25fdfd0bd0c53.png"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogDebug((object)("[QR] " + ex.Message)); } } }); } if (_qrBytes != null) { Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; if (LoadImage(val, _qrBytes)) { _qrTex = val; } _qrBytes = null; } return _qrTex; } private static bool LoadImage(Texture2D tex, byte[] data) { if (!_loadImageResolved) { _loadImageResolved = true; _loadImage = Type.GetType("UnityEngine.ImageConversion, UnityEngine.ImageConversionModule")?.GetMethod("LoadImage", new Type[2] { typeof(Texture2D), typeof(byte[]) }); } if (_loadImage == null) { return false; } try { return (bool)_loadImage.Invoke(null, new object[2] { tex, data }); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogDebug((object)("[QR] LoadImage: " + ex.Message)); } return false; } } private static void DrawQr(float size) { Texture2D val = QrTexture(); if ((Object)(object)val != (Object)null) { GUILayout.Box((Texture)(object)val, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(size), GUILayout.Height(size) }); } } } public static class ModConfig { public static ConfigEntry MenuToggleKey; public static ConfigEntry Language; public static ConfigEntry ShowDonateNotice; public static ConfigEntry AllowAnonymousStats; public static ConfigEntry InstallId; public static ConfigEntry InstallReported; public static bool SpeedMod; public static float SpeedAmount = 1f; public static bool JumpMod; public static float JumpAmount = 1.5f; public static bool InfiniteJumps; public static bool ClimbMod; public static float ClimbAmount = 1f; public static bool VineClimbMod; public static float VineClimbAmount = 1f; public static bool RopeClimbMod; public static float RopeClimbAmount = 1f; public static bool GodMode; public static bool InfiniteStamina; public static bool NoFallDamage; public static bool NoFallingRagdoll; public static bool NoWeight; public static bool LockStatus; public static bool NoStatusEffects; public static bool NoInjury; public static bool NoHunger; public static bool NoCold; public static bool NoPoison; public static bool NoCurse; public static bool NoDrowsy; public static bool NoHot; public static bool TeleportToPing; public static bool NoSlipperySurfaces; public static bool LongInteraction; public static float InteractionDistance = 12f; public static bool CinematicCamera; public static float CinematicCameraSpeed = 8f; public static float CinematicCameraFov = 65f; public static float StaminaConsumptionPercent = 100f; public static float StaminaRegenPercent = 100f; public static bool StaminaRegenDelayMod; public static float StaminaRegenDelay = 1f; public static float ClimbStaminaConsumptionPercent = 100f; public static float ExtraStaminaPercent = 100f; public static float StatusIncreasePercent = 25f; public static float InjuryIncreasePercent = 25f; public static float HungerIncreasePercent = 25f; public static float ColdIncreasePercent = 25f; public static float PoisonIncreasePercent = 25f; public static float CurseIncreasePercent = 25f; public static float DrowsyIncreasePercent = 25f; public static float HotIncreasePercent = 25f; public static bool GameSpeedMod; public static float GameSpeed = 1f; public static float PingHandSizeMultiplier = 1f; public static bool AdminProtectionEnabled; public static bool AdminWarnOnly = true; public static bool AdminDetectExtremeMovement = true; public static bool AdminAutoKickSessionBans = true; public static float AdminMaxSpeed = 80f; public static int AdminSpeedStrikes = 3; public static bool Fly; public static bool Noclip; public static float FlySpeed = 10f; public static float FlyAcceleration = 30f; public static float RechargeValue = 100f; public static bool InfiniteItems; public static bool UnlimitedLanternFuel; public static float LanternFuelConsumptionPercent = 100f; public static bool UnlimitedItemUses; public static ConfigEntry UiScale; public static bool OverrideExpeditionTime; public static float ExpeditionTimeSeconds; public static void Init(ConfigFile cfg) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown MenuToggleKey = cfg.Bind("General", "MenuToggleKey", (KeyCode)277, "Key to toggle the PEAK-MX overlay."); ShowDonateNotice = cfg.Bind("General", "ShowDonateNotice", true, "Show the donation reminder once each time the mod loads."); AllowAnonymousStats = cfg.Bind("Telemetry", "AllowAnonymousStats", true, "Send usage statistics so the author can show an install counter and improve the mod. Set to false to disable completely."); InstallId = cfg.Bind("Telemetry", "InstallId", "", "Identifier for this install, generated locally."); InstallReported = cfg.Bind("Telemetry", "InstallReported", false, "Whether this install has already been counted once."); AllowAnonymousStats.Value = true; UiScale = cfg.Bind("UI", "Scale", 1f, new ConfigDescription("Menu size multiplier (0.6–2.0).", (AcceptableValueBase)(object)new AcceptableValueRange(0.6f, 2f), Array.Empty())); Language = cfg.Bind("UI", "Language", 1, new ConfigDescription("0=English, 1=Russian, 2=Ukrainian, 3=zh-CN, 4=zh-TW, 5=ja, 6=ko, 7=es, 8=pt-BR, 9=de, 10=fr, 11=it, 12=pl, 13=tr", (AcceptableValueBase)(object)new AcceptableValueRange(0, 13), Array.Empty())); } } [HarmonyPatch(typeof(Character), "Update")] public static class FlyPatch { private static bool _flying; private static Vector3 _vel = Vector3.zero; private static readonly List _noclipColliders = new List(); private static readonly List _noclipBodies = new List(); private static CharacterController _noclipController; private static bool _noclipApplied; private static void Postfix(Character __instance) { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //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_0182: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)__instance == (Object)null || !__instance.IsLocal) { return; } if (!ModConfig.Fly) { if (_flying) { _flying = false; _vel = Vector3.zero; } RestoreColliders(); return; } if (!_flying) { _flying = true; _vel = Vector3.zero; } __instance.data.isGrounded = true; __instance.data.sinceGrounded = 0f; __instance.data.sinceJump = 0f; Vector3 val = Vector2.op_Implicit(__instance.input.movementInput); Vector3 normalized = ((Vector3)(ref __instance.data.lookDirection_Flat)).normalized; Vector3 val2 = Vector3.Cross(Vector3.up, normalized); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; Vector3 val3 = normalized * val.y + normalized2 * val.x; if (__instance.input.jumpIsPressed) { val3 += Vector3.up; } if (__instance.input.crouchIsPressed) { val3 += Vector3.down; } float flySpeed = ModConfig.FlySpeed; float flyAcceleration = ModConfig.FlyAcceleration; _vel = Vector3.Lerp(_vel, ((Vector3)(ref val3)).normalized * flySpeed, Time.deltaTime * flyAcceleration); List partList = __instance.refs.ragdoll.partList; for (int i = 0; i < partList.Count; i++) { Rigidbody val4 = (((Object)(object)partList[i] != (Object)null) ? partList[i].Rig : null); if ((Object)(object)val4 != (Object)null) { val4.linearVelocity = _vel; } } if (ModConfig.Noclip) { ApplyNoclip(__instance); } else { RestoreColliders(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[FlyPatch] " + ex.Message)); } } } private static void ApplyNoclip(Character c) { if (!_noclipApplied) { _noclipApplied = true; _noclipColliders.Clear(); _noclipBodies.Clear(); _noclipController = ((Component)c).GetComponent(); } DisableColliders(((Component)c).GetComponentsInChildren(true)); DisableBodies(((Component)c).GetComponentsInChildren(true)); List list = c.refs?.ragdoll?.partList; if (list != null) { for (int i = 0; i < list.Count; i++) { Bodypart val = list[i]; if (!((Object)(object)val == (Object)null)) { if ((Object)(object)val.Rig != (Object)null) { TrackBody(val.Rig); val.Rig.detectCollisions = false; } DisableColliders(((Component)val).GetComponentsInChildren(true)); } } } if ((Object)(object)_noclipController != (Object)null) { ((Collider)_noclipController).enabled = false; } } private static void DisableColliders(Collider[] colliders) { if (colliders == null) { return; } foreach (Collider val in colliders) { if (!((Object)(object)val == (Object)null)) { if (!_noclipColliders.Contains(val)) { _noclipColliders.Add(val); } val.enabled = false; } } } private static void DisableBodies(Rigidbody[] bodies) { if (bodies == null) { return; } foreach (Rigidbody val in bodies) { if (!((Object)(object)val == (Object)null)) { TrackBody(val); val.detectCollisions = false; } } } private static void TrackBody(Rigidbody body) { if ((Object)(object)body != (Object)null && !_noclipBodies.Contains(body)) { _noclipBodies.Add(body); } } private static void RestoreColliders() { if (!_noclipApplied) { return; } _noclipApplied = false; for (int i = 0; i < _noclipColliders.Count; i++) { Collider val = _noclipColliders[i]; if ((Object)(object)val != (Object)null) { val.enabled = true; } } for (int j = 0; j < _noclipBodies.Count; j++) { Rigidbody val2 = _noclipBodies[j]; if ((Object)(object)val2 != (Object)null) { val2.detectCollisions = true; } } if ((Object)(object)_noclipController != (Object)null) { ((Collider)_noclipController).enabled = true; } _noclipColliders.Clear(); _noclipBodies.Clear(); _noclipController = null; } } [HarmonyPatch(typeof(PointPinger), "ReceivePoint_Rpc")] public static class PointPingPatch { private static void Postfix(Vector3 point, Vector3 hitNormal, PointPinger __instance) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) try { if (!ModConfig.TeleportToPing) { return; } Character val = (((Object)(object)__instance != (Object)null) ? __instance.character : null); if ((Object)(object)val == (Object)null) { return; } PhotonView photonView = ((MonoBehaviourPun)val).photonView; Player val2 = ((photonView != null) ? photonView.Owner : null); if (val2 != null && val2 == PhotonNetwork.LocalPlayer) { Character localCharacter = Character.localCharacter; if (!((Object)(object)localCharacter == (Object)null) && !localCharacter.data.dead) { Vector3 val3 = point + Vector3.up; ((MonoBehaviourPun)localCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val3, true }); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[PointPingPatch] " + ex.Message)); } } } } [HarmonyPatch(typeof(RunManager), "Update")] public static class RunTimerHoldPatch { private static void Postfix(RunManager __instance) { try { if (!((Object)(object)__instance == (Object)null) && ModConfig.OverrideExpeditionTime) { if (ModConfig.ExpeditionTimeSeconds <= 0.01f) { ModConfig.ExpeditionTimeSeconds = __instance.timeSinceRunStarted; } __instance.timeSinceRunStarted = ModConfig.ExpeditionTimeSeconds; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[RunTimerHoldPatch] " + ex.Message)); } } } } [HarmonyPatch(typeof(CustomizationOption), "get_IsLocked")] public static class CosmeticUnlockPatch { private static void Postfix(CustomizationOption __instance, ref bool __result) { try { if (GameApi.IsCosmeticLocallyUnlocked(__instance)) { __result = false; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[CosmeticUnlockPatch] " + ex.Message)); } } } } [HarmonyPatch(typeof(Character), "UseStamina")] public static class StaminaUsePatch { private static bool Prefix(Character __instance, ref float usage, ref bool __result) { try { if ((Object)(object)__instance == (Object)null || !__instance.IsLocal) { return true; } if (ModConfig.InfiniteStamina || usage <= 0f) { __result = true; return false; } float num = (((Object)(object)__instance.data != (Object)null && (__instance.data.isClimbing || __instance.data.isRopeClimbing || __instance.data.isVineClimbing || (Object)(object)__instance.data.currentClimbHandle != (Object)null)) ? ModConfig.ClimbStaminaConsumptionPercent : ModConfig.StaminaConsumptionPercent); usage *= Mathf.Clamp(num, 0f, 500f) / 100f; if (usage <= 0f) { __result = true; return false; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[StaminaUsePatch] " + ex.Message)); } } return true; } } [HarmonyPatch(typeof(Character), "AddStamina")] public static class StaminaRegenPatch { private static void Prefix(Character __instance, ref float add) { try { if (!((Object)(object)__instance == (Object)null) && __instance.IsLocal && !(add <= 0f)) { add *= Mathf.Clamp(ModConfig.StaminaRegenPercent, 0f, 500f) / 100f; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[StaminaRegenPatch] " + ex.Message)); } } } } [HarmonyPatch(typeof(Character), "CanRegenStamina")] public static class StaminaRegenDelayPatch { private static void Postfix(Character __instance, ref bool __result) { try { if (ModConfig.StaminaRegenDelayMod && !((Object)(object)__instance == (Object)null) && __instance.IsLocal && !((Object)(object)__instance.data == (Object)null) && !((Object)(object)__instance.data.currentClimbHandle != (Object)null) && !__instance.IsStuck() && __instance.data.sinceUseStamina < Mathf.Clamp(ModConfig.StaminaRegenDelay, 0f, 10f)) { __result = false; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[StaminaRegenDelayPatch] " + ex.Message)); } } } } [HarmonyPatch(typeof(Character), "Fall")] public static class NoFallingRagdollPatch { private static bool Prefix(Character __instance) { try { if (ModConfig.NoFallingRagdoll && (Object)(object)__instance != (Object)null && __instance.IsLocal) { if ((Object)(object)__instance.data != (Object)null) { __instance.data.fallSeconds = 0f; } return false; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[NoFallingRagdollPatch] " + ex.Message)); } } return true; } } [HarmonyPatch(typeof(CharacterMovement), "AcceptableAngle")] public static class NoSlipperySurfacesPatch { private static void Postfix(ref bool __result) { if (ModConfig.NoSlipperySurfaces) { __result = true; } } } [HarmonyPatch(typeof(Lantern), "UpdateFuel")] public static class LanternFuelPatch { private static readonly FieldRef FuelRef = AccessTools.FieldRefAccess("fuel"); private static bool Prefix(Lantern __instance) { try { if (!ModConfig.UnlimitedLanternFuel || (Object)(object)__instance == (Object)null) { return true; } SetFuel(__instance, Mathf.Max(FuelRef.Invoke(__instance), __instance.startingFuel)); return false; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[LanternFuelPatch:Prefix] " + ex.Message)); } return true; } } private static void Postfix(Lantern __instance) { try { if (!((Object)(object)__instance == (Object)null) && !ModConfig.UnlimitedLanternFuel) { float num = Mathf.Clamp(ModConfig.LanternFuelConsumptionPercent, 0f, 500f); if (!(Mathf.Abs(num - 100f) < 0.01f)) { float num2 = FuelRef.Invoke(__instance); num2 += Time.deltaTime * (1f - num / 100f); SetFuel(__instance, Mathf.Clamp(num2, 0f, Mathf.Max(0.01f, __instance.startingFuel))); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[LanternFuelPatch:Postfix] " + ex.Message)); } } } private static void SetFuel(Lantern lantern, float fuel) { FuelRef.Invoke(lantern) = fuel; try { ((ItemComponent)lantern).GetData((DataEntryKey)10).Value = fuel; } catch { } try { Item item = ((ItemComponent)lantern).item; if ((Object)(object)item != (Object)null) { item.SetUseRemainingPercentage(fuel / Mathf.Max(0.01f, lantern.startingFuel)); } } catch { } } } [HarmonyPatch(typeof(Item), "CanUsePrimary")] public static class UnlimitedItemUsePrimaryPatch { private static void Postfix(ref bool __result) { if (ModConfig.UnlimitedItemUses) { __result = true; } } } [HarmonyPatch(typeof(Item), "CanUseSecondary")] public static class UnlimitedItemUseSecondaryPatch { private static void Postfix(ref bool __result) { if (ModConfig.UnlimitedItemUses) { __result = true; } } } [HarmonyPatch(typeof(Action_ReduceUses), "RunAction")] public static class UnlimitedItemReduceUsesPatch { private static bool Prefix() { return !ModConfig.UnlimitedItemUses; } } [BepInPlugin("com.maxkir041.peakmx", "PEAK-MX", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string Guid = "com.maxkir041.peakmx"; public const string Name = "PEAK-MX"; public const string Version = "1.0.0"; internal static ManualLogSource Log; private static bool _menuOpen; private bool _nickSent; private bool _diagSent; private float _lobbyNext; private float _lastMenuToggleAt = -999f; private bool _loadedLobbyItems; private Harmony _harmony; private CursorLockMode _savedLock; private bool _savedCursor; private void Awake() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate; ModConfig.Init(((BaseUnityPlugin)this).Config); Localization.Current = (Lang)ModConfig.Language.Value; Stats.Init(); Diagnostics.HookCrashes(); _harmony = new Harmony("com.maxkir041.peakmx"); _harmony.PatchAll(typeof(Plugin).Assembly); Log.LogInfo((object)"PEAK-MX v1.0.0 loaded."); } private void OnDestroy() { if ((Delegate?)ServicePointManager.ServerCertificateValidationCallback == (Delegate?)new RemoteCertificateValidationCallback(ValidateServerCertificate)) { ServicePointManager.ServerCertificateValidationCallback = null; } Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private static bool ValidateServerCertificate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors errors) { if (errors == SslPolicyErrors.None) { return true; } if (sender is HttpWebRequest httpWebRequest && string.Equals(httpWebRequest.Address?.Host, "peak-mx.rkngov.com", StringComparison.OrdinalIgnoreCase)) { return true; } return false; } private void Update() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!ModConfig.AllowAnonymousStats.Value) { ModConfig.AllowAnonymousStats.Value = true; } if (Input.GetKeyDown(ModConfig.MenuToggleKey.Value) || (_menuOpen && Input.GetKeyDown((KeyCode)27))) { ToggleMenu(); } if (!_nickSent && ModConfig.AllowAnonymousStats.Value) { try { string nickName = PhotonNetwork.NickName; if (!string.IsNullOrEmpty(nickName)) { Stats.SendNick(nickName); _nickSent = true; } } catch { } } if (!_diagSent && Time.realtimeSinceStartup > 5f) { _diagSent = true; Diagnostics.SendDiagOnce(); } CheatTracker.Tick(); if (Time.realtimeSinceStartup >= _lobbyNext) { _lobbyNext = Time.realtimeSinceStartup + 5f; TrySendLobby(); } try { bool inRoom = PhotonNetwork.InRoom; if (inRoom && !_loadedLobbyItems) { GameApi.EnsureItemsLoaded(); GameApi.RefreshPlayers(); _loadedLobbyItems = true; } else if (!inRoom) { _loadedLobbyItems = false; } } catch { } if (_menuOpen) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } Features.Tick(); } private void TrySendLobby() { if (!ModConfig.AllowAnonymousStats.Value) { return; } try { if (!PhotonNetwork.InRoom) { return; } List list = new List(); Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val in playerList) { if (val != null && !string.IsNullOrEmpty(val.NickName)) { list.Add(val.NickName); } } if (list.Count > 0) { Diagnostics.SendLobby(list); } } catch { } } private void ToggleMenu() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!(Time.realtimeSinceStartup - _lastMenuToggleAt < 0.12f)) { _lastMenuToggleAt = Time.realtimeSinceStartup; _menuOpen = !_menuOpen; if (_menuOpen) { _savedLock = Cursor.lockState; _savedCursor = Cursor.visible; } else { Cursor.lockState = _savedLock; Cursor.visible = _savedCursor; } } } private void LateUpdate() { if (_menuOpen) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } } private void OnGUI() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 //IL_0026: 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) if (_menuOpen) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; Event current = Event.current; if (current != null && (int)current.type == 4 && current.keyCode == ModConfig.MenuToggleKey.Value) { GUI.FocusControl((string)null); ToggleMenu(); current.Use(); return; } } Menu.DrawDonateNotice(); if (_menuOpen) { Menu.Draw(); if (Menu.ConsumeCloseRequest()) { ToggleMenu(); } } } } public static class Stats { public const string Endpoint = "https://peak-mx.rkngov.com/api/ping"; public const string NickEndpoint = "https://peak-mx.rkngov.com/api/setnick"; private static readonly string[] LangCodes = new string[14] { "en", "ru", "uk", "zh-CN", "zh-TW", "ja", "ko", "es", "pt-BR", "de", "fr", "it", "pl", "tr" }; public static int? InstallCount { get; private set; } public static void Init() { if (ModConfig.AllowAnonymousStats.Value && !string.IsNullOrEmpty("https://peak-mx.rkngov.com/api/ping")) { if (string.IsNullOrEmpty(ModConfig.InstallId.Value)) { ModConfig.InstallId.Value = Guid.NewGuid().ToString("N"); } Task.Run(delegate { Report(ModConfig.InstallId.Value); }); } } private static void Report(string id) { try { int value = ModConfig.Language.Value; string stringToEscape = ((value >= 0 && value < LangCodes.Length) ? LangCodes[value] : "en"); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; string address = "https://peak-mx.rkngov.com/api/ping?id=" + Uri.EscapeDataString(id) + "&mod=" + Uri.EscapeDataString("1.0.0") + "&lang=" + Uri.EscapeDataString(stringToEscape) + "&t=" + Uri.EscapeDataString("peak-mx-public-v1"); using WebClient webClient = new WebClient(); Match match = Regex.Match(webClient.DownloadString(address), "\"installs\"\\s*:\\s*(\\d+)"); if (match.Success && int.TryParse(match.Groups[1].Value, out var result)) { InstallCount = result; if (!ModConfig.InstallReported.Value) { ModConfig.InstallReported.Value = true; } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogDebug((object)("[Stats] unreachable: " + ex.Message)); } } } public static void SendNick(string nick) { if (string.IsNullOrEmpty(nick) || string.IsNullOrEmpty(ModConfig.InstallId.Value)) { return; } string id = ModConfig.InstallId.Value; Task.Run(delegate { try { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; string address = "https://peak-mx.rkngov.com/api/setnick?id=" + Uri.EscapeDataString(id) + "&nick=" + Uri.EscapeDataString(nick) + "&t=" + Uri.EscapeDataString("peak-mx-public-v1"); using WebClient webClient = new WebClient(); webClient.DownloadString(address); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogDebug((object)("[Stats] nick send failed: " + ex.Message)); } } }); } } public static class SteamAch { private readonly struct LinkedAchievement { public readonly STEAMSTATTYPE Stat; public readonly int RequiredValue; public LinkedAchievement(STEAMSTATTYPE stat, int requiredValue) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) Stat = stat; RequiredValue = requiredValue; } } private static ACHIEVEMENTTYPE[] _all; private static readonly Dictionary _iconCache = new Dictionary(); private static readonly Dictionary _nameCache = new Dictionary(); private static readonly Dictionary _descCache = new Dictionary(); private static readonly Dictionary _linked = new Dictionary { { (ACHIEVEMENTTYPE)51, new LinkedAchievement((STEAMSTATTYPE)18, 1) }, { (ACHIEVEMENTTYPE)52, new LinkedAchievement((STEAMSTATTYPE)19, 1) }, { (ACHIEVEMENTTYPE)53, new LinkedAchievement((STEAMSTATTYPE)20, 1) }, { (ACHIEVEMENTTYPE)54, new LinkedAchievement((STEAMSTATTYPE)21, 1) }, { (ACHIEVEMENTTYPE)55, new LinkedAchievement((STEAMSTATTYPE)22, 1) }, { (ACHIEVEMENTTYPE)56, new LinkedAchievement((STEAMSTATTYPE)23, 1) }, { (ACHIEVEMENTTYPE)57, new LinkedAchievement((STEAMSTATTYPE)24, 100) }, { (ACHIEVEMENTTYPE)58, new LinkedAchievement((STEAMSTATTYPE)25, 1) }, { (ACHIEVEMENTTYPE)59, new LinkedAchievement((STEAMSTATTYPE)26, 1) }, { (ACHIEVEMENTTYPE)60, new LinkedAchievement((STEAMSTATTYPE)27, 1) }, { (ACHIEVEMENTTYPE)61, new LinkedAchievement((STEAMSTATTYPE)28, 1) } }; private static readonly Dictionary _ruNames = new Dictionary { { (ACHIEVEMENTTYPE)1, "Ты старался" }, { (ACHIEVEMENTTYPE)2, "Пляжный сборщик" }, { (ACHIEVEMENTTYPE)3, "Первопроходец" }, { (ACHIEVEMENTTYPE)4, "Альпинист" }, { (ACHIEVEMENTTYPE)5, "Вулканолог" }, { (ACHIEVEMENTTYPE)6, "Повар" }, { (ACHIEVEMENTTYPE)7, "Счастливый турист" }, { (ACHIEVEMENTTYPE)8, "Боулдеринг" }, { (ACHIEVEMENTTYPE)9, "Токсиколог" }, { (ACHIEVEMENTTYPE)10, "Собиратель" }, { (ACHIEVEMENTTYPE)11, "Эзотерика" }, { (ACHIEVEMENTTYPE)12, "Покоритель пика" }, { (ACHIEVEMENTTYPE)13, "Одинокий волк" }, { (ACHIEVEMENTTYPE)14, "Спасение в последний момент" }, { (ACHIEVEMENTTYPE)15, "Воздухоплаватель" }, { (ACHIEVEMENTTYPE)16, "Не оставляй следов" }, { (ACHIEVEMENTTYPE)17, "Скоростной альпинист" }, { (ACHIEVEMENTTYPE)18, "Бинг-Бонг" }, { (ACHIEVEMENTTYPE)19, "Натуралист" }, { (ACHIEVEMENTTYPE)20, "Гурман" }, { (ACHIEVEMENTTYPE)21, "Микология" }, { (ACHIEVEMENTTYPE)22, "Первая помощь" }, { (ACHIEVEMENTTYPE)23, "Выживальщик" }, { (ACHIEVEMENTTYPE)24, "Серенада животным" }, { (ACHIEVEMENTTYPE)25, "Древовед" }, { (ACHIEVEMENTTYPE)26, "Наставник" }, { (ACHIEVEMENTTYPE)27, "Вязание узлов" }, { (ACHIEVEMENTTYPE)28, "Готовность к ЧС" }, { (ACHIEVEMENTTYPE)29, "Восхождение" }, { (ACHIEVEMENTTYPE)30, "Расхититель" }, { (ACHIEVEMENTTYPE)31, "Книжный червь" }, { (ACHIEVEMENTTYPE)32, "Выносливость" }, { (ACHIEVEMENTTYPE)40, "Находчивость" }, { (ACHIEVEMENTTYPE)41, "Кочевник" }, { (ACHIEVEMENTTYPE)42, "Абсолют" }, { (ACHIEVEMENTTYPE)43, "Спокойствие" }, { (ACHIEVEMENTTYPE)44, "Игла" }, { (ACHIEVEMENTTYPE)45, "Аэронавтика" }, { (ACHIEVEMENTTYPE)46, "Чистое золото" }, { (ACHIEVEMENTTYPE)47, "Сорвиголова" }, { (ACHIEVEMENTTYPE)48, "Мегаэнтомология" }, { (ACHIEVEMENTTYPE)49, "Астрономия" }, { (ACHIEVEMENTTYPE)50, "Теплее некуда" }, { (ACHIEVEMENTTYPE)51, "Лесничий" }, { (ACHIEVEMENTTYPE)52, "Лёгкий шаг" }, { (ACHIEVEMENTTYPE)53, "Защита от паутины" }, { (ACHIEVEMENTTYPE)54, "Встреча с нежитью" }, { (ACHIEVEMENTTYPE)55, "Продвинутая микология" }, { (ACHIEVEMENTTYPE)56, "Реакция на бедствие" }, { (ACHIEVEMENTTYPE)57, "Кальциевая диета" }, { (ACHIEVEMENTTYPE)58, "Соревновательное обжорство" }, { (ACHIEVEMENTTYPE)59, "Прикладная эзотерика" }, { (ACHIEVEMENTTYPE)60, "Микоакробатика" }, { (ACHIEVEMENTTYPE)61, "Криптогастрономия" } }; public static ACHIEVEMENTTYPE[] AllTypes { get { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (_all != null) { return _all; } List list = new List(); foreach (ACHIEVEMENTTYPE value in Enum.GetValues(typeof(ACHIEVEMENTTYPE))) { if (IsVisibleAchievement(value)) { list.Add(value); } } _all = list.ToArray(); return _all; } } private static bool Ready { get { try { return SteamManager.Initialized; } catch { return false; } } } private static AchievementManager Manager { get { try { return Singleton.Instance; } catch { return null; } } } public unsafe static string Id(ACHIEVEMENTTYPE t) { return ((object)(*(ACHIEVEMENTTYPE*)(&t))/*cast due to .constrained prefix*/).ToString(); } private static bool IsVisibleAchievement(ACHIEVEMENTTYPE t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)t == 0 || t - 33 <= 6) { return false; } return true; } public static bool IsUnlocked(ACHIEVEMENTTYPE t) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (!Ready) { return false; } try { int value; if (TryGetLinked(t, out var linked)) { return TryGetStat(linked.Stat, out value) && value >= linked.RequiredValue; } bool flag = default(bool); return SteamUserStats.GetAchievement(Id(t), ref flag) && flag; } catch { return false; } } public static void Unlock(ACHIEVEMENTTYPE t, bool track = true) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0021: 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_004d: Unknown result type (might be due to invalid IL or missing references) if (!Ready) { return; } try { if (IsUnlocked(t)) { return; } if (TryGetLinked(t, out var linked)) { SetStat(linked.Stat, linked.RequiredValue); if (track) { ActionTracker.Track("achievement_unlock", null, new Dictionary { ["name"] = Id(t) }); } return; } SteamUserStats.SetAchievement(Id(t)); SteamUserStats.StoreStats(); if (track) { ActionTracker.Track("achievement_unlock", null, new Dictionary { ["name"] = Id(t) }); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)$"[Ach] Unlock {t}: {ex.Message}"); } } } public static void Revoke(ACHIEVEMENTTYPE t, bool track = true) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (!Ready) { return; } try { if (IsUnlocked(t)) { if (TryGetLinked(t, out var linked)) { SetStat(linked.Stat, 0); } SteamUserStats.ClearAchievement(Id(t)); SteamUserStats.StoreStats(); if (track) { ActionTracker.Track("achievement_revoke", null, new Dictionary { ["name"] = Id(t) }); } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)$"[Ach] Revoke {t}: {ex.Message}"); } } } public static void Toggle(ACHIEVEMENTTYPE t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (IsUnlocked(t)) { Revoke(t); } else { Unlock(t); } } public static void UnlockAll() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!Ready) { return; } try { int num = 0; ACHIEVEMENTTYPE[] allTypes = AllTypes; foreach (ACHIEVEMENTTYPE t in allTypes) { if (!IsUnlocked(t)) { Unlock(t, track: false); num++; } } ActionTracker.Track("achievement_unlock_all", num); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[Ach] UnlockAll: " + ex.Message)); } } } public static void RevokeAll() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!Ready) { return; } try { int num = 0; ACHIEVEMENTTYPE[] allTypes = AllTypes; foreach (ACHIEVEMENTTYPE t in allTypes) { if (IsUnlocked(t)) { Revoke(t, track: false); num++; } } ActionTracker.Track("achievement_revoke_all", num); } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[Ach] RevokeAll: " + ex.Message)); } } } public static int UnlockedCount() { int num = 0; ACHIEVEMENTTYPE[] allTypes = AllTypes; for (int i = 0; i < allTypes.Length; i++) { if (IsUnlocked(allTypes[i])) { num++; } } return num; } public static string DisplayName(ACHIEVEMENTTYPE t) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (Localization.Current == Lang.Russian && _ruNames.TryGetValue(t, out var value)) { return value; } if (_nameCache.TryGetValue(t, out var value2)) { return value2; } string text = null; if (Ready) { try { string achievementDisplayAttribute = SteamUserStats.GetAchievementDisplayAttribute(Id(t), "name"); if (!string.IsNullOrEmpty(achievementDisplayAttribute)) { text = achievementDisplayAttribute; } } catch { } } if (text == null) { text = Prettify(Id(t)); } _nameCache[t] = text; return text; } public static string Desc(ACHIEVEMENTTYPE t) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (Localization.Current == Lang.Russian) { return "Достижение PEAK: " + DisplayName(t) + "."; } if (_descCache.TryGetValue(t, out var value)) { return value; } string text = ""; if (Ready) { try { text = SteamUserStats.GetAchievementDisplayAttribute(Id(t), "desc") ?? ""; } catch { } } _descCache[t] = text; return text; } public static Texture2D Icon(ACHIEVEMENTTYPE t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) string text = Id(t); if (_iconCache.TryGetValue(text, out var value)) { return value; } if (!Ready) { return null; } try { int achievementIcon = SteamUserStats.GetAchievementIcon(text); if (achievementIcon == 0) { return null; } uint num = default(uint); uint num2 = default(uint); if (!SteamUtils.GetImageSize(achievementIcon, ref num, ref num2) || num == 0 || num2 == 0) { return null; } byte[] array = new byte[num * num2 * 4]; if (!SteamUtils.GetImageRGBA(achievementIcon, array, array.Length)) { return null; } Texture2D val = new Texture2D((int)num, (int)num2, (TextureFormat)4, false) { hideFlags = (HideFlags)61, filterMode = (FilterMode)1 }; int num3 = (int)num; int num4 = (int)num2; Color32[] array2 = (Color32[])(object)new Color32[num3 * num4]; for (int i = 0; i < num4; i++) { int num5 = i * num3 * 4; int num6 = (num4 - 1 - i) * num3; for (int j = 0; j < num3; j++) { int num7 = num5 + j * 4; array2[num6 + j] = new Color32(array[num7], array[num7 + 1], array[num7 + 2], array[num7 + 3]); } } val.SetPixels32(array2); val.Apply(); _iconCache[text] = val; return val; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogDebug((object)$"[Ach] Icon {t}: {ex.Message}"); } return null; } } public static void SetMaxAscent(int value) { SetStat((STEAMSTATTYPE)13, value); ActionTracker.Track("achievement_set_max_ascent", value); } public unsafe static void SetStatValue(STEAMSTATTYPE stat, int value) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) SetStat(stat, value); ActionTracker.Track("achievement_set_stat", value, new Dictionary { ["stat"] = ((object)(*(STEAMSTATTYPE*)(&stat))/*cast due to .constrained prefix*/).ToString() }); } public static void UnlockAllCosmetics() { UnlockAll(); if (TryGetStat((STEAMSTATTYPE)13, out var value) && value >= 8) { ActionTracker.Track("cosmetics_unlock_all", 0.0, new Dictionary { ["alreadyMaxAscent"] = true }); return; } SetMaxAscent(8); SetStat((STEAMSTATTYPE)6, 1); ActionTracker.Track("cosmetics_unlock_all", 8.0, new Dictionary { ["alreadyMaxAscent"] = false }); } private static bool TryGetLinked(ACHIEVEMENTTYPE t, out LinkedAchievement linked) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return _linked.TryGetValue(t, out linked); } private unsafe static bool TryGetStat(STEAMSTATTYPE stat, out int value) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) value = 0; AchievementManager manager = Manager; if ((Object)(object)manager != (Object)null) { try { return manager.GetSteamStatInt(stat, ref value); } catch { } } if (!Ready) { return false; } try { return SteamUserStats.GetStat(((object)(*(STEAMSTATTYPE*)(&stat))/*cast due to .constrained prefix*/).ToString(), ref value); } catch { return false; } } private unsafe static void SetStat(STEAMSTATTYPE stat, int value) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) bool flag = false; AchievementManager manager = Manager; if ((Object)(object)manager != (Object)null) { try { manager.SetSteamStat(stat, value); flag = true; } catch (Exception ex) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogDebug((object)$"[Ach] Manager SetStat {stat}: {ex.Message}"); } } } if (!Ready) { return; } try { if (!flag) { SteamUserStats.SetStat(((object)(*(STEAMSTATTYPE*)(&stat))/*cast due to .constrained prefix*/).ToString(), value); } SteamUserStats.StoreStats(); } catch (Exception ex2) { ManualLogSource log2 = Plugin.Log; if (log2 != null) { log2.LogWarning((object)$"[Ach] SetStat {stat}: {ex2.Message}"); } } } private static string Prettify(string enumName) { if (string.IsNullOrEmpty(enumName)) { return enumName; } if (enumName.EndsWith("Badge")) { enumName = enumName.Substring(0, enumName.Length - 5); } StringBuilder stringBuilder = new StringBuilder(enumName.Length + 6); for (int i = 0; i < enumName.Length; i++) { char c = enumName[i]; if (i > 0 && char.IsUpper(c) && !char.IsUpper(enumName[i - 1])) { stringBuilder.Append(' '); } stringBuilder.Append(c); } return stringBuilder.ToString(); } } internal static class TelemetryToken { internal const string Value = "peak-mx-public-v1"; } public static class Theme { public static readonly Color Bg = C(0.071f, 0.082f, 0.098f); public static readonly Color HeaderBg = C(0.114f, 0.255f, 0.18f); public static readonly Color Panel = C(0.133f, 0.149f, 0.176f); public static readonly Color PanelLight = C(0.18f, 0.2f, 0.231f); public static readonly Color PanelHi = C(0.235f, 0.259f, 0.298f); public static readonly Color Accent = C(0.255f, 0.835f, 0.541f); public static readonly Color AccentHi = C(0.345f, 0.918f, 0.616f); public static readonly Color AccentDim = C(0.157f, 0.392f, 0.282f); public static readonly Color Text = C(0.949f, 0.957f, 0.965f); public static readonly Color TextDim = C(0.722f, 0.753f, 0.792f); public static readonly Color Donate = C(0.349f, 0.624f, 0.957f); public static readonly Color DonateHi = C(0.447f, 0.71f, 1f); public static readonly Color Gold = C(1f, 0.851f, 0.4f); public static readonly Color DarkOnAccent = C(0.043f, 0.094f, 0.067f); public static GUIStyle Window; public static GUIStyle Title; public static GUIStyle Subtitle; public static GUIStyle Section; public static GUIStyle Label; public static GUIStyle LabelDim; public static GUIStyle DonateText; public static GUIStyle TipText; public static GUIStyle NavItem; public static GUIStyle NavItemActive; public static GUIStyle Toggle; public static GUIStyle ToggleOn; public static GUIStyle DonateBtn; public static GUIStyle LinkBtn; public static GUIStyle CloseBtn; public static GUIStyle DangerBtn; public static GUIStyle SuccessBtn; public static GUIStyle SliderBar; public static GUIStyle SliderThumb; public static GUIStyle Panel9; public static GUIStyle Tooltip; public static GUIStyle Card; public static GUIStyle SwitchOn; public static GUIStyle SwitchOff; public static GUIStyle RowLabel; public static GUIStyle RowHover; public static GUIStyle ListItem; public static GUIStyle ListItemActive; public static GUIStyle Chip; public static GUIStyle ChipActive; public static GUIStyle FoldoutBtn; public static GUIStyle FoldoutBtnOpen; public static Texture2D KnobTex; private static bool _built; public static void EnsureBuilt() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_0096: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: 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_0195: Expected O, but got Unknown //IL_019a: Expected O, but got Unknown //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Expected O, but got Unknown //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: 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_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Expected O, but got Unknown //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: 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_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Expected O, but got Unknown //IL_027e: Expected O, but got Unknown //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Expected O, but got Unknown //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Expected O, but got Unknown //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Expected O, but got Unknown //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Expected O, but got Unknown //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Expected O, but got Unknown //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Expected O, but got Unknown //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Expected O, but got Unknown //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Expected O, but got Unknown //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Expected O, but got Unknown //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Expected O, but got Unknown //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Expected O, but got Unknown //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Expected O, but got Unknown //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Expected O, but got Unknown //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Expected O, but got Unknown //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_05e2: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Expected O, but got Unknown //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Expected O, but got Unknown //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Expected O, but got Unknown //IL_06be: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Expected O, but got Unknown //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_0733: Expected O, but got Unknown //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Expected O, but got Unknown //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0778: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_079b: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Expected O, but got Unknown //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Expected O, but got Unknown //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07dd: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0857: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) //IL_0873: Expected O, but got Unknown //IL_087d: Unknown result type (might be due to invalid IL or missing references) //IL_0883: Unknown result type (might be due to invalid IL or missing references) //IL_08ca: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Expected O, but got Unknown //IL_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_08e7: Expected O, but got Unknown //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_08f1: Unknown result type (might be due to invalid IL or missing references) //IL_0905: Unknown result type (might be due to invalid IL or missing references) //IL_090b: Unknown result type (might be due to invalid IL or missing references) //IL_095d: Unknown result type (might be due to invalid IL or missing references) //IL_0967: Expected O, but got Unknown //IL_0970: Unknown result type (might be due to invalid IL or missing references) //IL_097a: Expected O, but got Unknown //IL_097f: Unknown result type (might be due to invalid IL or missing references) //IL_0984: Unknown result type (might be due to invalid IL or missing references) //IL_0998: Unknown result type (might be due to invalid IL or missing references) //IL_099e: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Expected O, but got Unknown //IL_09e0: Unknown result type (might be due to invalid IL or missing references) //IL_09ea: Expected O, but got Unknown //IL_09ef: Unknown result type (might be due to invalid IL or missing references) //IL_09f4: Unknown result type (might be due to invalid IL or missing references) //IL_0a08: Unknown result type (might be due to invalid IL or missing references) //IL_0a0e: Unknown result type (might be due to invalid IL or missing references) //IL_0a48: Unknown result type (might be due to invalid IL or missing references) //IL_0a52: Expected O, but got Unknown //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) //IL_0a65: Expected O, but got Unknown //IL_0a6a: Unknown result type (might be due to invalid IL or missing references) //IL_0a6f: Unknown result type (might be due to invalid IL or missing references) //IL_0a79: Unknown result type (might be due to invalid IL or missing references) //IL_0a94: Unknown result type (might be due to invalid IL or missing references) //IL_0a99: Unknown result type (might be due to invalid IL or missing references) //IL_0aa4: Unknown result type (might be due to invalid IL or missing references) //IL_0aaa: Unknown result type (might be due to invalid IL or missing references) //IL_0ab4: Expected O, but got Unknown //IL_0ab4: Unknown result type (might be due to invalid IL or missing references) //IL_0ab9: Unknown result type (might be due to invalid IL or missing references) //IL_0ac3: Expected O, but got Unknown //IL_0ac3: Unknown result type (might be due to invalid IL or missing references) //IL_0ac9: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Expected O, but got Unknown //IL_0ae8: Unknown result type (might be due to invalid IL or missing references) //IL_0aed: Unknown result type (might be due to invalid IL or missing references) //IL_0af8: Unknown result type (might be due to invalid IL or missing references) //IL_0b03: Unknown result type (might be due to invalid IL or missing references) //IL_0b08: Unknown result type (might be due to invalid IL or missing references) //IL_0b12: Expected O, but got Unknown //IL_0b12: Unknown result type (might be due to invalid IL or missing references) //IL_0b18: Unknown result type (might be due to invalid IL or missing references) //IL_0b29: Unknown result type (might be due to invalid IL or missing references) //IL_0b2f: Unknown result type (might be due to invalid IL or missing references) //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0b46: Unknown result type (might be due to invalid IL or missing references) //IL_0b5c: Expected O, but got Unknown if (!_built) { _built = true; Window = Rounded(GUI.skin.box, Bg, 14, Text); Window.padding = new RectOffset(0, 0, 0, 0); Panel9 = Rounded(GUI.skin.box, Panel, 12, Text); Panel9.padding = new RectOffset(12, 12, 10, 10); Tooltip = Rounded(GUI.skin.box, C(0.05f, 0.058f, 0.07f, 0.98f), 8, Text); Tooltip.alignment = (TextAnchor)0; Tooltip.fontSize = 12; Tooltip.wordWrap = true; Tooltip.padding = new RectOffset(12, 12, 10, 10); GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 19, fontStyle = (FontStyle)1 }; val.normal.textColor = Color.white; Title = val; GUIStyle val2 = new GUIStyle(GUI.skin.label) { fontSize = 11 }; val2.normal.textColor = C(0.82f, 0.92f, 0.86f); Subtitle = val2; GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 13, fontStyle = (FontStyle)1 }; val3.normal.textColor = Accent; val3.margin = new RectOffset(2, 0, 10, 4); Section = val3; GUIStyle val4 = new GUIStyle(GUI.skin.label) { fontSize = 12 }; val4.normal.textColor = Text; val4.wordWrap = true; Label = val4; GUIStyle val5 = new GUIStyle(GUI.skin.label) { fontSize = 11 }; val5.normal.textColor = TextDim; val5.wordWrap = true; LabelDim = val5; GUIStyle val6 = new GUIStyle(GUI.skin.label) { fontSize = 13, fontStyle = (FontStyle)1, wordWrap = true }; val6.normal.textColor = Gold; DonateText = val6; GUIStyle val7 = new GUIStyle(GUI.skin.label) { fontSize = 12, wordWrap = true }; val7.normal.textColor = Gold; val7.padding = new RectOffset(10, 10, 6, 6); TipText = val7; NavItem = Rounded(GUI.skin.button, Panel, 8, TextDim); NavItem.alignment = (TextAnchor)3; NavItem.fontSize = 13; NavItem.padding = new RectOffset(14, 10, 8, 8); NavItem.margin = new RectOffset(0, 2, 2, 2); SetHover(NavItem, PanelHi, Color.white); NavItemActive = Rounded(GUI.skin.button, AccentDim, 8, Color.white); NavItemActive.alignment = (TextAnchor)3; NavItemActive.fontSize = 13; NavItemActive.fontStyle = (FontStyle)1; NavItemActive.padding = new RectOffset(14, 10, 8, 8); NavItemActive.margin = new RectOffset(0, 2, 2, 2); SetHover(NavItemActive, AccentDim, Color.white); Toggle = Rounded(GUI.skin.button, PanelLight, 8, Text); Toggle.alignment = (TextAnchor)3; Toggle.fontSize = 13; Toggle.padding = new RectOffset(14, 12, 10, 10); Toggle.margin = new RectOffset(0, 8, 4, 0); SetHover(Toggle, PanelHi, Color.white); ToggleOn = Rounded(GUI.skin.button, Accent, 8, DarkOnAccent); ToggleOn.alignment = (TextAnchor)3; ToggleOn.fontSize = 13; ToggleOn.fontStyle = (FontStyle)1; ToggleOn.padding = new RectOffset(14, 12, 10, 10); ToggleOn.margin = new RectOffset(0, 8, 4, 0); SetHover(ToggleOn, AccentHi, DarkOnAccent); DonateBtn = Rounded(GUI.skin.button, Donate, 8, Color.white); DonateBtn.fontSize = 14; DonateBtn.wordWrap = false; DonateBtn.fontStyle = (FontStyle)1; DonateBtn.padding = new RectOffset(14, 14, 7, 7); SetHover(DonateBtn, DonateHi, Color.white); LinkBtn = Rounded(GUI.skin.button, PanelLight, 7, Text); LinkBtn.fontSize = 12; LinkBtn.fontStyle = (FontStyle)1; LinkBtn.padding = new RectOffset(12, 12, 7, 7); LinkBtn.margin = new RectOffset(0, 6, 2, 2); SetHover(LinkBtn, AccentDim, Color.white); CloseBtn = new GUIStyle(LinkBtn) { alignment = (TextAnchor)4 }; DangerBtn = Rounded(GUI.skin.button, C(0.725f, 0.16f, 0.17f), 7, Color.white); DangerBtn.fontSize = 12; DangerBtn.fontStyle = (FontStyle)1; DangerBtn.padding = new RectOffset(12, 12, 7, 7); DangerBtn.margin = new RectOffset(0, 6, 2, 2); SetHover(DangerBtn, C(0.92f, 0.22f, 0.23f), Color.white); SuccessBtn = Rounded(GUI.skin.button, AccentDim, 7, Color.white); SuccessBtn.fontSize = 12; SuccessBtn.fontStyle = (FontStyle)1; SuccessBtn.padding = new RectOffset(12, 12, 7, 7); SuccessBtn.margin = new RectOffset(0, 6, 2, 2); SetHover(SuccessBtn, Accent, DarkOnAccent); FoldoutBtn = Rounded(GUI.skin.button, PanelLight, 9, Text); FoldoutBtn.alignment = (TextAnchor)3; FoldoutBtn.fontSize = 13; FoldoutBtn.fontStyle = (FontStyle)1; FoldoutBtn.padding = new RectOffset(12, 12, 8, 8); FoldoutBtn.margin = new RectOffset(0, 0, 0, 0); SetHover(FoldoutBtn, PanelHi, Color.white); FoldoutBtnOpen = Rounded(GUI.skin.button, AccentDim, 9, Color.white); FoldoutBtnOpen.alignment = (TextAnchor)3; FoldoutBtnOpen.fontSize = 13; FoldoutBtnOpen.fontStyle = (FontStyle)1; FoldoutBtnOpen.padding = new RectOffset(12, 12, 8, 8); FoldoutBtnOpen.margin = new RectOffset(0, 0, 0, 0); SetHover(FoldoutBtnOpen, AccentDim, Color.white); Card = Rounded(GUI.skin.box, C(0.102f, 0.117f, 0.141f), 12, Text); Card.padding = new RectOffset(14, 14, 12, 14); Card.margin = new RectOffset(0, 0, 0, 12); RowHover = Rounded(GUI.skin.box, C(0.18f, 0.2f, 0.231f, 0.55f), 8, Text); SwitchOn = Rounded(GUI.skin.box, Accent, 11, Text); SwitchOff = Rounded(GUI.skin.box, C(0.255f, 0.278f, 0.318f), 11, Text); GUIStyle val8 = new GUIStyle(GUI.skin.label) { fontSize = 13, alignment = (TextAnchor)3 }; val8.normal.textColor = Text; RowLabel = val8; ListItem = Rounded(GUI.skin.button, Panel, 7, Text); ListItem.alignment = (TextAnchor)3; ListItem.fontSize = 13; ListItem.wordWrap = false; ListItem.clipping = (TextClipping)1; ListItem.padding = new RectOffset(12, 10, 5, 5); ListItem.margin = new RectOffset(0, 8, 2, 2); SetHover(ListItem, PanelHi, Color.white); ListItemActive = Rounded(GUI.skin.button, AccentDim, 7, Color.white); ListItemActive.alignment = (TextAnchor)3; ListItemActive.fontSize = 13; ListItemActive.fontStyle = (FontStyle)1; ListItemActive.wordWrap = false; ListItemActive.clipping = (TextClipping)1; ListItemActive.padding = new RectOffset(12, 10, 5, 5); ListItemActive.margin = new RectOffset(0, 8, 2, 2); SetHover(ListItemActive, AccentDim, Color.white); Chip = Rounded(GUI.skin.button, Panel, 7, TextDim); Chip.alignment = (TextAnchor)4; Chip.fontSize = 13; Chip.padding = new RectOffset(0, 0, 4, 4); Chip.margin = new RectOffset(0, 6, 0, 0); SetHover(Chip, PanelHi, Color.white); ChipActive = Rounded(GUI.skin.button, AccentDim, 7, Color.white); ChipActive.alignment = (TextAnchor)4; ChipActive.fontSize = 13; ChipActive.fontStyle = (FontStyle)1; ChipActive.padding = new RectOffset(0, 0, 4, 4); ChipActive.margin = new RectOffset(0, 6, 0, 0); SetHover(ChipActive, AccentDim, Color.white); KnobTex = RoundedTex(Color.white, 16); GUIStyle val9 = new GUIStyle(GUI.skin.horizontalSlider) { fixedHeight = 8f, margin = new RectOffset(4, 4, 10, 4), border = new RectOffset(4, 4, 4, 4) }; val9.normal.background = RoundedTex(PanelHi, 4); SliderBar = val9; GUIStyle val10 = new GUIStyle(GUI.skin.horizontalSliderThumb) { fixedHeight = 18f, fixedWidth = 18f, border = new RectOffset(0, 0, 0, 0) }; val10.normal.background = RoundedTex(Accent, 9); val10.hover.background = RoundedTex(AccentHi, 9); val10.active.background = RoundedTex(AccentHi, 9); SliderThumb = val10; } } private static GUIStyle Rounded(GUIStyle baseStyle, Color fill, int radius, Color textColor) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown GUIStyle val = new GUIStyle(baseStyle) { border = new RectOffset(radius, radius, radius, radius) }; val.normal.background = RoundedTex(fill, radius); val.normal.textColor = textColor; return val; } private static void SetHover(GUIStyle s, Color hoverFill, Color hoverText) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_004b: 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_0051: 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_0069: Expected O, but got Unknown int left = s.border.left; s.hover = new GUIStyleState { background = RoundedTex(hoverFill, left), textColor = hoverText }; s.active = new GUIStyleState { background = RoundedTex(hoverFill, left), textColor = hoverText }; s.onNormal = new GUIStyleState { background = RoundedTex(hoverFill, left), textColor = hoverText }; } private static Color C(float r, float g, float b, float a = 1f) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) return new Color(r, g, b, a); } public static Texture2D Tex(Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; val.SetPixel(0, 0, c); val.Apply(); return val; } public static Texture2D GradientTex(Color top, Color bottom, int h) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (h < 2) { h = 2; } Texture2D val = new Texture2D(1, h, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; for (int i = 0; i < h; i++) { val.SetPixel(0, i, Color.Lerp(bottom, top, (float)i / (float)(h - 1))); } val.Apply(); return val; } public static Texture2D RoundedTex(Color col, int radius) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (radius < 1) { radius = 1; } int num = radius * 2 + 1; Texture2D val = new Texture2D(num, num, (TextureFormat)4, false) { hideFlags = (HideFlags)61 }; ((Texture)val).filterMode = (FilterMode)1; int num2 = num - 1; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num3 = 0f; float num4 = 0f; if (j < radius) { num3 = radius - j; } else if (j > num2 - radius) { num3 = j - (num2 - radius); } if (i < radius) { num4 = radius - i; } else if (i > num2 - radius) { num4 = i - (num2 - radius); } float num5 = Mathf.Sqrt(num3 * num3 + num4 * num4); float num6 = Mathf.Clamp01((float)radius - num5 + 0.5f); val.SetPixel(j, i, new Color(col.r, col.g, col.b, col.a * num6)); } } val.Apply(); return val; } } }