Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Controller Support Plus v1.0.0
plugins/ControllerPro.dll
Decompiled 8 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.TextCore; using UnityEngine.UI; using Valheim.SettingsGui; using Valheim.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace ControllerPro; [BepInPlugin("rivolus.controllersupportplus", "Controller Support Plus", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string Guid = "rivolus.controllersupportplus"; public const string Version = "1.0.0"; private const string SecHotbar = "Controller Hotbar"; private const string SecStyle = "HUD Style"; private const string SecLayout = "HUD Style - Settings"; private const string SecHold = "Button Hold"; private const string SecCursor = "Controller Cursor"; private const string SecInvGuide = "Inventory Button Guide"; private const string SecPlayGuide = "Gameplay Button Guide"; public static ConfigEntry<bool> Enabled; public static ConfigEntry<bool> ReplaceVanillaTriggers; public static ConfigEntry<bool> ShowHints; public static ConfigEntry<bool> HideVanillaHints; public static ConfigEntry<float> HoldShort; public static ConfigEntry<float> HoldLong; public static ConfigEntry<float> RingDelay; public static ConfigEntry<float> SliderStartSpeed; public static ConfigEntry<float> SliderMaxSpeed; public static ConfigEntry<float> HintOffsetY; public static ConfigEntry<float> HintScale; public static ConfigEntry<int> DpadStep; public static ManualLogSource Log; private static Plugin self; public static ConfigEntry<bool> FavEnabled; public static ConfigEntry<bool> GamePanelStyle; public static ConfigEntry<bool> HideHotbar; public static ConfigEntry<bool> StripBackground; public static ConfigEntry<bool> FavSecondary; public static ConfigEntry<bool> StackHudHints; public static ConfigEntry<bool> FavMarkers; public static ConfigEntry<float> HudHintsGap; public static ConfigEntry<float> HudHintsSpacing; public static ConfigEntry<float> CursorSlotSpeed; public static ConfigEntry<float> CursorPanelSpeed; public static ConfigEntry<float> CursorTravelSpeed; public static ConfigEntry<bool> CursorEnabled; public static ConfigEntry<bool> FavDimSprint; public static ConfigEntry<bool> DimPanels; public static ConfigEntry<bool> DotCrosshair; public static ConfigEntry<bool> EquipRingLabel; public static ConfigEntry<string> EquipProgress; public static ConfigEntry<string> EquipRingFor; public static ConfigEntry<bool> HudOnKbm; public static ConfigEntry<bool> LtSelectSettings; public static ConfigEntry<bool> SwapDpadActions; public static ConfigEntry<bool> HudPickSeen; private static ConfigFile Internal; public static ConfigEntry<float> WheelHintsExtra; public static ConfigEntry<float> WheelReachSeen; public static ConfigEntry<float> HeaderSeen; public static ConfigEntry<float> BodySeen; public static ConfigEntry<string> HudPreset; public static ConfigEntry<string> ResourceStyle; public static ConfigEntry<string> HotbarStyle; public static ConfigEntry<string> BottomBarSide; public static ConfigEntry<string> RpgMap; public static ConfigEntry<string> FeedPos; public static ConfigEntry<string> BuffStyle; public static ConfigEntry<string> BuffPos; public static ConfigEntry<bool> ShowMinimap; public static ConfigEntry<bool> ShowMapHints; public static ConfigEntry<bool> LtInSetMiddle; public static ConfigEntry<float> DimStrength; public static ConfigEntry<float> FavFlash; public static ConfigEntry<float> SneakHold; public static ConfigEntry<float> ChordWindow; public static ConfigEntry<float> ChordGrace; public static ConfigEntry<float> ScrollSpeed; public static ConfigEntry<bool> RemapDodge; public static ConfigEntry<bool> PowerChord; public static ConfigEntry<bool> ProLayout; public static ConfigEntry<bool> HideHud; public static ConfigEntry<bool> FavAssignSound; public static ConfigEntry<bool> SheatheOnRs; public static ConfigEntry<bool> ObjectSlots; public static ConfigEntry<float> FavScale; public static ConfigEntry<float> FavDownHold; public static ConfigEntry<float> HintPadding; public static ConfigEntry<float> GlyphSize; public static ConfigEntry<float> StripExtraWidth; public static ConfigEntry<float> RingFullBeat; private static string PresetNote => Path.Combine(Paths.ConfigPath, "rivolus.controllersupportplus.lastpreset"); public static bool EquipRing { get { if (EquipProgress != null && EquipProgress.Value == "Ring" && Enabled.Value) { return ZInput.IsGamepadActive(); } return false; } } public static bool KbmPreset { get { if (!ZInput.IsGamepadActive() && HudOnKbm != null && HudOnKbm.Value) { return HudPreset.Value != "Vanilla"; } return false; } } public static bool LayoutOn { get { if (Enabled.Value) { if (!ZInput.IsGamepadActive()) { if (HudOnKbm != null) { return HudOnKbm.Value; } return false; } return true; } return false; } } public static bool SlimBuffs { get { if (HudPreset != null && HudPreset.Value != "Vanilla" && BuffStyle != null) { return BuffStyle.Value != "Vanilla"; } return false; } } public static bool BagCovers { get { if (InventoryGui.IsVisible()) { return !ModSettings.Open; } return false; } } public static bool PresetBottom { get { if (HudPreset != null) { return HudPreset.Value == "BottomHUD"; } return false; } } public static bool PresetActionRpg { get { if (HudPreset != null) { return HudPreset.Value == "ActionRPG"; } return false; } } public static bool RowHotbar { get { if (HotbarStyle != null) { return HotbarStyle.Value == "Row"; } return false; } } public static bool CompactHotbar { get { if (HotbarStyle != null) { return HotbarStyle.Value == "CompactCross"; } return false; } } public static string HotbarAt { get { if (!PresetBottom) { if (!PresetActionRpg) { return "Right"; } return "Left"; } if (BottomBarSide == null || !(BottomBarSide.Value == "Right")) { return "Center"; } return "Right"; } } public static bool HotbarCentred => HotbarAt == "Center"; public static bool HotbarLeft => HotbarAt == "Left"; public static bool MinimapBottom { get { if (!PresetBottom) { if (PresetActionRpg && RpgMap != null) { return RpgMap.Value == "Bottom"; } return false; } return true; } } public static bool VitalsGrouped { get { if (!PresetActionRpg) { if (PresetBottom) { return ResourceStyle.Value != "Vanilla"; } return false; } return true; } } public static bool VitalsMixed { get { if (!PresetBottom || !(ResourceStyle.Value == "Mixed")) { if (PresetActionRpg) { return ResourceStyle.Value != "Horizontal"; } return false; } return true; } } public static bool VitalsBottomLeft { get { if (VitalsGrouped) { return PresetBottom; } return false; } } private void Carry<T>(string sec, string key, ConfigEntry<T> to, Func<string, string> map = null) { ConfigEntry<string> val = ((BaseUnityPlugin)this).Config.Bind<string>(sec, key, "", "old"); string text = ((val.Value != null) ? val.Value.Trim() : ""); ((BaseUnityPlugin)this).Config.Remove(((ConfigEntryBase)val).Definition); if (text.Length == 0) { return; } if (map != null) { text = map(text); } try { to.Value = (T)TomlTypeConverter.ConvertToValue(text, typeof(T)); } catch (Exception) { } } private void Awake() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Expected O, but got Unknown //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Expected O, but got Unknown //IL_0f5f: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Expected O, but got Unknown //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Expected O, but got Unknown //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Expected O, but got Unknown //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Expected O, but got Unknown //IL_0863: Unknown result type (might be due to invalid IL or missing references) //IL_086d: Expected O, but got Unknown //IL_0a13: Unknown result type (might be due to invalid IL or missing references) //IL_0a1d: Expected O, but got Unknown self = this; Log = ((BaseUnityPlugin)this).Logger; HudPreset = ((BaseUnityPlugin)this).Config.Bind<string>("1. HUD layout", "HUDPreset", "Vanilla", new ConfigDescription("Vanilla (the game's HUD as it is), BottomHUD (resource bars bottom left, hotbar bottom centre, minimap bottom right) or ActionRPG (resource bars top left, hotbar bottom left, minimap top right). Each preset sets its own good starting choices for the styles below.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Vanilla", "BottomHUD", "ActionRPG" }), new object[0])); HotbarStyle = ((BaseUnityPlugin)this).Config.Bind<string>("2. Hotbar", "HotbarLayout", "Cross", new ConfigDescription("How the Controller Hotbar looks: Cross, CompactCross or Row.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Cross", "CompactCross", "Row" }), new object[0])); SwapDpadActions = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Hotbar", "SwapDpadItemsAndLTActions", false, "Off: the D-pad uses hotbar items 1-4 and LT + D-pad does the actions (consumables, emotes, hammer, sit). On: the other way round."); ShowMapHints = ((BaseUnityPlugin)this).Config.Bind<bool>("3. HUD elements", "ShowButtonHints", true, "Show the game's button hints (Attack, Block, Dodge, the build hints, the radial wheel's hints) on the controller."); bool flag = false; try { flag = File.Exists(((BaseUnityPlugin)this).Config.ConfigFilePath) && Regex.IsMatch(File.ReadAllText(((BaseUnityPlugin)this).Config.ConfigFilePath), "BuffsAndDebuffsStyle\\s*=\\s*Compact"); } catch (Exception) { } BuffStyle = ((BaseUnityPlugin)this).Config.Bind<string>("3. HUD elements", "BuffsAndDebuffsStyle", "Slim", new ConfigDescription("Bottom HUD and Action RPG: Vanilla (the game's own), Detailed (small boxes with a green frame for buffs, red for debuffs, grey for neutral ones) or Slim (floating icons, a red arrow on debuffs).", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Vanilla", "Detailed", "Slim" }), new object[0])); if (flag) { BuffStyle.Value = "Detailed"; } FeedPos = ((BaseUnityPlugin)this).Config.Bind<string>("3. HUD elements", "PickUpNotificationStyle", "Vanilla", new ConfigDescription("New (Modern: the mod's pickup list at the right edge) or Vanilla (the game's own message in the top left).", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "New", "Vanilla" }), new object[0])); EquipProgress = ((BaseUnityPlugin)this).Config.Bind<string>("3. HUD elements", "EquipProgressBarStyle", "Vanilla", new ConfigDescription("Ring (Radial progress: a ring around the crosshair) or Vanilla (the game's own bar).", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "Ring", "Vanilla" }), new object[0])); LtSelectSettings = ((BaseUnityPlugin)this).Config.Bind<bool>("4. Input and compatibility", "LTSelectOpensSettings", false, "LT + Select opens the Controller Support Plus Settings straight from play, instead of the chat."); HudOnKbm = ((BaseUnityPlugin)this).Config.Bind<bool>("4. Input and compatibility", "KeepHUDLayoutOnKeyboardAndMouse", false, "Keep the HUD preset's layout while using keyboard and mouse."); Carry<string>("HUD Style", "Preset", HudPreset); Carry<string>("Controller Hotbar", "HotbarStyle", HotbarStyle); Carry<bool>("HUD Style - Settings", "ShowButtonGuide", ShowMapHints); Carry<string>("HUD Style - Settings", "BuffsAndDebuffs", BuffStyle); Carry<string>("HUD Style - Settings", "PickUpNotificationStyle", FeedPos); Carry<string>("Crosshair", "EquipProgressBar", EquipProgress); Carry<bool>("HUD Style - Settings", "LTSelectOpensSettings", LtSelectSettings); Carry<bool>("Controller Hotbar", "SwapDpadActions", SwapDpadActions); Carry<bool>("HUD Style - Settings", "ApplyHudPresetToKeyboardAndMouse", HudOnKbm); Carry<string>("2. HUD elements", "HotbarLayout", HotbarStyle); Carry<bool>("3. Input and compatibility", "SwapDpadItemsAndLTActions", SwapDpadActions); Carry<bool>("2. HUD elements", "ButtonHints", ShowMapHints); ShowMapHints.SettingChanged += delegate { HintsLink.FromMod(); }; Carry<string>("2. HUD elements", "BuffsAndDebuffsStyle", BuffStyle); Carry<string>("2. HUD elements", "PickUpNotificationStyle", FeedPos); Carry<string>("2. HUD elements", "EquipProgressBarStyle", EquipProgress); Carry<bool>("3. Input and compatibility", "LTSelectOpensSettings", LtSelectSettings); Carry<bool>("3. Input and compatibility", "KeepHUDLayoutOnKeyboardAndMouse", HudOnKbm); if (HudPreset.Value != "Vanilla" && HudPreset.Value != "BottomHUD" && HudPreset.Value != "ActionRPG") { HudPreset.Value = "Vanilla"; } Internal = new ConfigFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "internal-settings.cfg"), true, ((BaseUnityPlugin)this).Info.Metadata); FavEnabled = Internal.Bind<bool>("Controller Hotbar", "Enabled", true, "D-pad favorites. While on, the D-pad no longer cycles the hotbar."); FavSecondary = Internal.Bind<bool>("Controller Hotbar", "SecondarySet", true, "A second set of four favorites on the face buttons while LT is held. While it is on, LT no longer opens the radial menu or stows the weapon. Only works in the Alternative 1 controller layout, where LT is not block."); HideHotbar = Internal.Bind<bool>("Controller Hotbar", "HideVanillaHotbar", true, "Hide Valheim's own hotbar (the row of 8 at the top left) while the Controller Hotbar is in use. Not the Controller Hotbar itself. The same items are still the first row of the inventory."); FavMarkers = Internal.Bind<bool>("Controller Hotbar", "MarkItemsInBag", true, "On the controller, show the Controller Hotbar button an item is on in its bag slot's top left corner, in place of the game's number keys (which are hidden on the controller)."); FavScale = Internal.Bind<float>("Controller Hotbar", "ClusterScale", 1f, "Size of the favorites cluster."); FavDownHold = Internal.Bind<float>("Controller Hotbar", "DownHoldSeconds", 0.4f, "With a favorite on D-pad down: tap uses the favorite, holding this long does the vanilla D-pad down action instead."); FavFlash = Internal.Bind<float>("Controller Hotbar", "EquippedFlashSeconds", 0.3f, "Length of the white flash on a favorite the moment its item finishes equipping. 0 turns it off."); LtInSetMiddle = Internal.Bind<bool>("Controller Hotbar", "LTInFaceSetMiddle", false, "Cross and compact cross only. Off (since 0.90.0): LT sits at the bottom between the two sets, as in the row, with the face glyphs at 30% until it is held. On (the archived look): LT in the middle of the face-button set, fading out while held, the face glyphs only while it is held."); FavAssignSound = Internal.Bind<bool>("Controller Hotbar", "AssignSound", true, "Play the game's equip sound when an item is put on a favorite in the assign overlay."); FavDimSprint = Internal.Bind<bool>("Controller Hotbar", "DimWhileSprinting", true, "Favorites do not respond while sprinting; pressing one flashes it red. (The name is from when the cluster also dimmed. It no longer does.)"); ResourceStyle = Internal.Bind<string>("HUD Style - Settings", "ResourceBarStyle", "Vanilla", new ConfigDescription("Your preferred resource bars: Vanilla (the game's own), Horizontal (the mod's horizontal bars for health, stamina and eitr, grouped with the food and the Forsaken power) or Mixed (the same group, but stamina and eitr stay the game's own bars, in their place). Used where the preset supports it: Bottom HUD supports all three; Action RPG supports Horizontal and Mixed, and uses Mixed when this is Vanilla (the game's own health and food cannot go to the top left); the Vanilla preset always uses the game's own.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[3] { "Vanilla", "Horizontal", "Mixed" }), new object[0])); BottomBarSide = Internal.Bind<string>("HUD Style - Settings", "BottomHUDPosition", "Center", new ConfigDescription("Bottom HUD only: where the Controller Hotbar (the action bar) sits, Center (bottom centre, with the game's stamina bar lifted above it) or Right (bottom right, just left of the minimap). The other presets ignore it.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "Center", "Right" }), new object[0])); RpgMap = Internal.Bind<string>("HUD Style - Settings", "ActionRPGMinimapPosition", "Bottom", new ConfigDescription("Action RPG only: the minimap at the Top right (its gameplay hints under it) or the Bottom right (the hints above it, reading upward). The other presets ignore it.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "Top", "Bottom" }), new object[0])); WheelHintsExtra = Internal.Bind<float>("Gameplay Button Guide", "WheelHintsExtraDistance", 0f, "How much further out from the radial wheel's centre its button guide sits, on top of the wheel's own size. The same for every wheel."); HeaderSeen = Internal.Bind<float>("Text styles", "HeaderSize", 0f, "Set by the mod: how tall the game's own Settings screen labels are, in HUD units (so it follows the resolution), measured when that screen is open. The Header text style is drawn at this size. 0 to measure again."); BodySeen = Internal.Bind<float>("Text styles", "BodySize", 0f, "Set by the mod: how tall the labels on the pause menu's controller picture are, in HUD units (so it follows the resolution), measured while that picture shows. The Body text style is drawn at this size. 0 to measure again."); string[] array = new string[2] { "HeaderScreenSize", "BodyScreenSize" }; foreach (string text in array) { ConfigEntry<float> val = Internal.Bind<float>("Text styles", text, 0f, "old"); Internal.Remove(((ConfigEntryBase)val).Definition); } WheelReachSeen = Internal.Bind<float>("Gameplay Button Guide", "WheelReachSeen", 0f, "Set by the mod: the widest a radial wheel has been drawn, from its centre. The wheel's button guide sits beyond it. 0 to measure again."); HudPickSeen = Internal.Bind<bool>("HUD Style - Settings", "HudLayoutPickDone", false, "Set by the mod: true once a HUD layout has been confirmed in the first-launch pick, so its plaque does not show again. false shows the plaque again. The pick can always be opened from Controller Support Plus Settings."); ShowMinimap = Internal.Bind<bool>("HUD Style - Settings", "ShowMinimap", true, "Show the small minimap on the controller, in every preset. Off hides it; its gameplay hints move up into its place and the status effects into the corner."); BuffPos = Internal.Bind<string>("HUD Style - Settings", "BuffsAndDebuffsPosition", "TopRight (Vanilla)", new ConfigDescription("Where the slim buffs and debuffs sit: TopRight (Vanilla) (where the game has them), TopLeft (in the resource bars group, between the bars and the Forsaken power; needs Horizontal or Mixed bars, and in Bottom HUD that group is in the bottom left), BottomRight (just left of the minimap, lined up with its bottom; beside it at the top when the minimap is at the top), BottomLeft (a column in the bottom left corner reading upward, above the hotbar or the resource bars when they are there) or BottomCenter (a centred row at the bottom, above the hotbar and the game's stamina bar when they are there). A place the layout cannot give falls back to TopRight.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[5] { "TopRight (Vanilla)", "TopLeft", "BottomRight", "BottomLeft", "BottomCenter" }), new object[0])); ProLayout = Internal.Bind<bool>("Controls", "UseProLayout", true, "Use the PRO controller layout: the game's Alternative 1 layout with the mod's remaps on top. It is also a fourth choice in the game's own controller layout setting, which is the easier place to change it. Picking Classic, Alternative 1 or Alternative 2 there turns this off."); RemapDodge = Internal.Bind<bool>("Controls", "DodgeAndSneakOnB", true, "PRO layout only: tapping B dodges on its own (no need to hold block), and holding B toggles sneak."); SheatheOnRs = Internal.Bind<bool>("Controls", "SheatheOnRightStick", true, "PRO layout only: clicking the right stick puts away the weapon or tool in hand, or takes it back out (the game's own sheathe), instead of sneaking. Only while DodgeAndSneakOnB is on, so sneak stays on holding B. With the hammer out the click stays the game's own."); ObjectSlots = Internal.Bind<bool>("Controls", "ObjectSlots", true, "On the controller, using a mannequin, an item stand, an item frame or a boss altar opens the bag with the object's slots under it, like a chest. RT puts the focused item on it at once, RT on its slots takes it back. Items that cannot go on it are greyed. Every rule is the object's own."); SneakHold = Internal.Bind<float>("Controls", "SneakHoldSeconds", 0.35f, "How long B is held before it toggles sneak instead of dodging."); PowerChord = Internal.Bind<bool>("Controls", "ForsakenPowerOnLBAndRB", true, "PRO layout only: pressing LB and RB together uses the Forsaken power."); ChordWindow = Internal.Bind<float>("Controls", "TogetherWindowSeconds", 0.12f, "How close together LB and RB must be pressed to count as pressed together. Holding one and pressing the other later is not the combination."); ChordGrace = Internal.Bind<float>("Controls", "RBWaitSeconds", 0.05f, "While a Forsaken power is ready, RB waits this long before doing its own job, to see whether LB joins it. Without it, pressing RB a hair before LB starts an attack. 0 turns the wait off."); Enabled = Internal.Bind<bool>("General", "Enabled", true, "Master switch. The mod only acts while a controller is the active input; it steps aside as soon as keyboard or mouse is used."); ReplaceVanillaTriggers = Internal.Bind<bool>("General", "ReplaceVanillaTriggerCombos", true, "Turns off vanilla LT+A (split), RT+A (drop) and LT+X (move) inside the inventory, so LT can be the modifier layer."); DotCrosshair = Internal.Bind<bool>("Crosshair", "DotCrosshair", true, "On the controller, show a small dot in the middle of the screen instead of the game's cross. With keyboard or mouse the cross comes back."); EquipRingFor = Internal.Bind<string>("Crosshair", "EquipRingShowsFor", "Everything", new ConfigDescription("With the Ring: Everything (every equip, unequip or reload that takes any time) or VanillaBarsOnly (only the longer ones the game shows its own bar for, over half a second).", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "Everything", "VanillaBarsOnly" }), new object[0])); EquipRingLabel = Internal.Bind<bool>("Crosshair", "EquipRingLabel", true, "With the Ring: show the action's name (Equipping ...) to the right of the ring, for the actions the game shows its own bar for. It fades out while the game shows a prompt by the crosshair."); CursorEnabled = Internal.Bind<bool>("Controller Cursor", "Enabled", true, "Using the left stick inside the inventory brings up a controller cursor. Using the D-pad puts it away again."); CursorSlotSpeed = Internal.Bind<float>("Controller Cursor", "SpeedOverSlotsAndButtons", 720f, "Cursor speed while it is over something that can be pressed. Pixels per second on a 1080-high screen, at full stick."); CursorPanelSpeed = Internal.Bind<float>("Controller Cursor", "SpeedInsidePanels", 1250f, "Cursor speed while it is over a panel but not over a slot or button."); ScrollSpeed = Internal.Bind<float>("Controller Cursor", "ListScrollSpeed", 1200f, "How fast the right stick scrolls a list in the inventory (the recipe list, a large chest), at full stick. 0 turns it off."); CursorTravelSpeed = Internal.Bind<float>("Controller Cursor", "SpeedBetweenPanels", 3000f, "Top cursor speed in the open space between panels. It builds up to this in a fraction of a second."); ShowHints = Internal.Bind<bool>("Inventory Button Guide", "ShowHintStrip", true, "Show the controller hint strip under the inventory."); HideVanillaHints = Internal.Bind<bool>("Inventory Button Guide", "HideVanillaInventoryHints", true, "Hide the vanilla inventory hints at the bottom of the screen while the strip is showing."); HintOffsetY = Internal.Bind<float>("Inventory Button Guide", "GapToButtons", 16f, "Space between the bottom of the inventory panel's art and the top of the buttons in the guide."); HintPadding = Internal.Bind<float>("Inventory Button Guide", "PaddingTopBottom", 16f, "Space above and below the buttons inside the strip."); HintScale = Internal.Bind<float>("Inventory Button Guide", "StripScale", 1f, "Size of the strip."); StripExtraWidth = Internal.Bind<float>("Inventory Button Guide", "ExtraWidth", 80f, "How much wider than the inventory panel the button guide may run, to the right, so longer labels fit."); StripBackground = Internal.Bind<bool>("Inventory Button Guide", "StripBackground", false, "Draw the wood panel behind the button guide. Off leaves the guide floating below the inventory. Takes effect the next time the game starts."); GlyphSize = Internal.Bind<float>("Inventory Button Guide", "ButtonGlyphSize", 16f, "Size of the button glyphs in the strip. They are the game's own glyphs. Kept small so the hold ring around them stays clearly visible."); GamePanelStyle = Internal.Bind<bool>("Inventory Button Guide", "UseGamePanelStyle", true, "Give the hint strip the same background art as the inventory panel. Off uses a flat dark bar. Takes effect the next time the game starts."); HideHud = Internal.Bind<bool>("Inventory Button Guide", "HideHudBehindInventory", true, "On the controller, fade out the rest of the HUD (minimap, health, food, Forsaken power, status effects) while the inventory is open."); StackHudHints = Internal.Bind<bool>("Gameplay Button Guide", "StackUnderMinimap", true, "On the controller, stack the game's own gameplay hints (Attack, Block, Dodge...) vertically under the minimap, clear of the favorites."); HudHintsGap = Internal.Bind<float>("Gameplay Button Guide", "GapBelowMinimap", 20f, "Space between the minimap and the first hint."); HudHintsSpacing = Internal.Bind<float>("Gameplay Button Guide", "SpaceBetweenStackedHints", 12f, "Clear space between rows in every stacked button guide: the gameplay hints under the minimap and the hints beside the crafting panel. Both use this one value, so they always match."); DimPanels = Internal.Bind<bool>("Panels", "DimInactivePanels", true, "On the controller, darken the inventory panels that are not the one in use, so the active panel stands out."); DimStrength = Internal.Bind<float>("Panels", "DimStrength", 0.5f, "How dark an inactive panel gets. 0 is no change, 1 is black."); HoldShort = Internal.Bind<float>("Button Hold", "ShortHoldSeconds", 0.4f, "Hold length for convenience actions (hold Y to split)."); HoldLong = Internal.Bind<float>("Button Hold", "LongHoldSeconds", 0.6f, "Hold length for actions that lose items (hold B to drop)."); RingDelay = Internal.Bind<float>("Button Hold", "RingDelaySeconds", 0.18f, "Quiet period before the hold ring shows, so a plain tap never flashes it."); RingFullBeat = Internal.Bind<float>("Button Hold", "FullRingBeatSeconds", 0.08f, "How long the completed ring stays on screen before the hold action fires, so the fill is seen to finish."); SliderStartSpeed = Internal.Bind<float>("Split slider", "StartSpeed", 6f, "Items per second when the stick has just started being held."); SliderMaxSpeed = Internal.Bind<float>("Split slider", "MaxSpeed", 60f, "Items per second once the stick has been held for about a second."); DpadStep = Internal.Bind<int>("Split slider", "DpadStep", 5, "Amount D-pad up / down changes the split by."); Carry<bool>("Controls", "UseProLayout", ProLayout); Carry<float>("Gameplay Button Guide", "WheelReachSeen", WheelReachSeen); Internal.Save(); try { PropertyInfo property = typeof(ConfigFile).GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); IDictionary dictionary = ((property != null) ? (property.GetValue(((BaseUnityPlugin)this).Config, null) as IDictionary) : null); if (dictionary != null && dictionary.Count > 0) { Log.LogInfo((object)("Settings: " + dictionary.Count + " old entries cleared out of the settings file")); dictionary.Clear(); } } catch (Exception ex2) { Log.LogWarning((object)("Settings: old entries not cleared: " + ex2.Message)); } HudPreset.SettingChanged += delegate { ResetStyles("the preset was changed to " + HudPreset.Value); NotePreset(); }; string text2 = ""; try { if (File.Exists(PresetNote)) { text2 = File.ReadAllText(PresetNote).Trim(); } } catch (Exception) { } if (text2 != "" && text2 != HudPreset.Value) { ResetStyles("the preset changed from " + text2 + " to " + HudPreset.Value + " since the last start"); } NotePreset(); ((BaseUnityPlugin)this).Config.Save(); new Harmony("rivolus.controllersupportplus").PatchAll(Assembly.GetExecutingAssembly()); Log.LogInfo((object)"Controller Support Plus 1.0.0 loaded"); } private static void NotePreset() { try { File.WriteAllText(PresetNote, HudPreset.Value); } catch (Exception) { } } private static void ResetStyles(string why) { ConfigEntryBase[] array = (ConfigEntryBase[])(object)new ConfigEntryBase[7] { (ConfigEntryBase)ResourceStyle, (ConfigEntryBase)HotbarStyle, (ConfigEntryBase)BottomBarSide, (ConfigEntryBase)RpgMap, (ConfigEntryBase)ShowMinimap, (ConfigEntryBase)BuffStyle, (ConfigEntryBase)BuffPos }; foreach (ConfigEntryBase val in array) { if (val != null && !object.Equals(val.BoxedValue, val.DefaultValue)) { val.BoxedValue = val.DefaultValue; } } if (PresetBottom && HotbarStyle != null && HotbarStyle.Value != "Row") { HotbarStyle.Value = "Row"; } if (PresetActionRpg) { if (BuffStyle != null) { BuffStyle.Value = "Detailed"; } if (BuffPos != null) { BuffPos.Value = "TopLeft"; } } if (PresetBottom && BuffStyle != null) { BuffStyle.Value = "Detailed"; } if (FeedPos != null) { FeedPos.Value = ((HudPreset.Value == "Vanilla") ? "Vanilla" : "New"); } if (EquipProgress != null) { EquipProgress.Value = ((HudPreset.Value == "Vanilla") ? "Vanilla" : "Ring"); } Log.LogInfo((object)("HUD styles reset to their defaults: " + why)); } private void Update() { Perf.Frame(); Deposit.Tick(); long num = Perf.Now(); try { Favorites.WorldUpdate(); } catch (Exception e) { Core.Fail(e); } num = Perf.Lap("hotbar", num); try { Pro.Update(); Remap.Update(); } catch (Exception e2) { Remap.Reset(); Core.Fail(e2); } num = Perf.Lap("button remaps", num); try { BuildCursor.Update(); } catch (Exception e3) { BuildCursor.Stop(); Core.Fail(e3); } Perf.Lap("build cursor", num); } private void LateUpdate() { long num = Perf.Now(); try { Hints.Arrange(); } catch (Exception e) { Core.Fail(e); } num = Perf.Lap("button guide", num); try { HudBehind.Tick(); } catch (Exception e2) { Core.Fail(e2); } try { PickupFeed.Tick(); } catch (Exception ex) { Log.LogWarning((object)("Pickup feed: " + ex.Message)); } try { Landed.Tick(); } catch (Exception e3) { Core.Fail(e3); } try { HoldMark.Tick(); } catch (Exception e4) { Core.Fail(e4); } num = Perf.Lap("inventory extras", num); try { MapPlace.Tick(); } catch (Exception ex2) { Log.LogWarning((object)("Minimap place: " + ex2.Message)); } num = Perf.Lap("minimap", num); try { Vitals.Tick(); } catch (Exception ex3) { Vitals.Off(); Log.LogWarning((object)("Vitals: " + ex3.Message)); } try { Buffs.Tick(); } catch (Exception ex4) { Buffs.Off(); Log.LogWarning((object)("Buffs: " + ex4.Message)); } GameHotbar.Tick(); try { ModSettings.MenuTick(); } catch (Exception ex5) { ModSettings.Close(); Log.LogWarning((object)("Settings button: " + ex5)); } try { ModSettings.LateTick(); } catch (Exception ex6) { ModSettings.Close(); Log.LogWarning((object)("Settings window: " + ex6.Message)); } try { HudPick.LateCheck(); HudPick.Tick(); } catch (Exception ex7) { Log.LogWarning((object)("HUD pick: " + ex7.Message)); } try { MessageNudge.Tick(); } catch (Exception ex8) { Log.LogWarning((object)("Message nudge: " + ex8.Message)); } num = Perf.Lap("resource bars", num); try { if (Cursor.On || BuildCursor.On) { Scroll.Hold(); } else { Scroll.Release(); } } catch (Exception e5) { Scroll.Release(); Core.Fail(e5); } num = Perf.Lap("list scrolling", num); } } internal static class HintsLink { public static void FromMod() { int num = (Plugin.ShowMapHints.Value ? 1 : 0); if (PlatformPrefs.GetInt("KeyHints", 1) != num) { PlatformPrefs.SetInt("KeyHints", num); try { PlatformPrefs.Save(); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Button hints: the game's setting not saved: " + ex.Message)); } if ((Object)(object)KeyHints.instance != (Object)null) { KeyHints.instance.ApplySettings(); } } } public static void FromGame() { bool flag = PlatformPrefs.GetInt("KeyHints", 1) == 1; if (Plugin.ShowMapHints != null && Plugin.ShowMapHints.Value != flag) { Plugin.ShowMapHints.Value = flag; } } } [HarmonyPatch(typeof(KeyHints), "ApplySettings")] internal static class Patch_KeyHintsApply { private static void Postfix() { try { HintsLink.FromGame(); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Button hints: " + ex.Message)); } } } [HarmonyPatch(typeof(ZInput), "GetButtonDown")] internal static class Patch_GetButtonDown { private static void Postfix(string name, ref bool __result) { if (Core.Bypass) { return; } if (ModSettings.Blocking && name.StartsWith("Joy")) { __result = false; return; } if (Core.PadRadialLt && name == "JoyRadial") { __result = false; return; } if (name == "JoyMap" && ModSettings.MenuButtonUp) { __result = false; return; } if ((name == "JoyChat" || name == "JoyMap") && ModSettings.LtSelectChord) { __result = false; return; } if (name == "JoyMenu" && __result && Favorites.QuickChord) { __result = false; return; } if (Cursor.On) { if (name.Length > 9 && name[3] == 'L' && name[4] == 'S') { __result = false; return; } if (Cursor.OffGrid && name == "JoyButtonA") { __result = false; return; } } if (Core.Assigning || Time.frameCount == Core.AssignEndFrame) { switch (name) { case "JoyMenu": case "JoyStart": case "JoyToggleHUD": case "JoyTabLeft": case "JoyTabRight": case "JoyLBumper": case "JoyRBumper": __result = false; return; } } if (Core.FavLT && Core.TakenByFavorites(name)) { __result = false; return; } if (Core.FavFace && Core.InGuiUpdate && name == "JoyButtonY") { __result = false; return; } if (HudPick.TakesY && Core.InGuiUpdate && name == "JoyButtonY") { __result = false; return; } if (__result && Deposit.Swallow(name)) { __result = false; return; } if (Core.FavWorld) { switch (name) { case "JoyHotbarLeft": case "JoyHotbarRight": case "JoyHotbarUse": __result = false; return; } if (Core.DownOwned) { if (Core.DownIsGP && name == "JoyGP") { __result = Core.TakeInject(); return; } if (!Core.DownIsGP && name == "JoySit") { __result = false; return; } } } if (!__result) { return; } if (Core.InGuiUpdate) { if (Core.SuppressY && name == "JoyButtonY") { __result = false; return; } if (Core.SuppressB && name == "JoyButtonB") { __result = false; return; } } if (Core.InGridUpdate && (Core.SuppressGridAll || (Core.SuppressA && name == "JoyButtonA") || (Core.SuppressAX && (name == "JoyButtonA" || name == "JoyButtonX")) || (Core.SuppressX && name == "JoyButtonX"))) { __result = false; } } } [HarmonyPatch(typeof(ZInput), "GetButtonUp")] internal static class Patch_GetButtonUp { private static void Postfix(string name, ref bool __result) { if (!Core.Bypass && ModSettings.Blocking && name.StartsWith("Joy")) { __result = false; } else if (!Core.Bypass && Core.PadRadialLt && name == "JoyRadial") { __result = false; } else if (Core.FavLT && Core.TakenByFavorites(name)) { __result = false; } else if (__result && !Core.Bypass && Deposit.Swallow(name)) { __result = false; } else if (Core.FavWorld && Core.DownOwned && !Core.DownIsGP && name == "JoySit") { __result = Core.TakeInject(); } } } [HarmonyPatch(typeof(ZInput), "GetButtonPressedTimer")] internal static class Patch_GetButtonPressedTimer { private static void Postfix(string name, ref float __result) { if (Core.FavLT && name == "JoyRadial") { __result = 0f; } } } [HarmonyPatch(typeof(ZInput), "GetButton")] internal static class Patch_GetButton { private static void Postfix(string name, ref bool __result) { if (__result && !Core.Bypass) { if (ModSettings.Blocking && name.StartsWith("Joy")) { __result = false; } else if (Core.PadRadialLt && name == "JoyRadial") { __result = false; } else if (name == "JoyMap" && ModSettings.MenuButtonUp) { __result = false; } else if ((name == "JoyChat" || name == "JoyMap") && ModSettings.LtSelectChord) { __result = false; } else if (Remap.NoCrouch && name == "JoyCrouch") { __result = false; } else if (Deposit.Swallow(name)) { __result = false; } else if (Cursor.On && name.Length > 9 && name[3] == 'L' && name[4] == 'S') { __result = false; } else if (Core.FavLT && Core.TakenByFavorites(name)) { __result = false; } else if (Core.InGridUpdate && Core.SuppressTriggers && (name == "JoyLTrigger" || name == "JoyRTrigger")) { __result = false; } else if (Core.FavWorld && Core.DownOwned && !Core.DownIsGP && name == "JoySit") { __result = false; } } } } [HarmonyPatch(typeof(InventoryGrid), "UpdateGamepad")] internal static class Patch_GridGamepad { private static void Prefix() { Core.InGridUpdate = true; } private static void Finalizer() { Core.InGridUpdate = false; } } [HarmonyPatch(typeof(InventoryGui), "Update")] internal static class Patch_GuiUpdate { private static void Prefix(InventoryGui __instance) { try { Core.BeginFrame(__instance); } catch (Exception e) { Core.Fail(e); } Core.InGuiUpdate = true; } private static void Postfix(InventoryGui __instance) { Core.InGuiUpdate = false; long num = Perf.Now(); try { Core.Process(__instance); } catch (Exception e) { Core.Fail(e); } Perf.Lap("inventory", num); } private static void Finalizer() { Core.InGuiUpdate = false; } } internal static class Perf { private static readonly double ToMs = 1000.0 / (double)Stopwatch.Frequency; private static double frameMs; private static double worstMs; private static double minuteSum; private static double minuteWorst; private static string worstPart = "-"; private static string minuteWorstPart = "-"; private static int frames; private static float minuteFrom = -1f; public static long Now() { return Stopwatch.GetTimestamp(); } public static long Lap(string part, long from) { long num = Now(); double num2 = (double)(num - from) * ToMs; frameMs += num2; if (num2 > worstMs) { worstMs = num2; worstPart = part; } return num; } public static void Frame() { float unscaledTime = Time.unscaledTime; float num = Time.unscaledDeltaTime * 1000f; if (num > 50f && minuteFrom >= 0f && frameMs >= 5.0) { Plugin.Log.LogInfo((object)("Performance: hitch, the frame took " + num.ToString("0") + " ms; Controller Support Plus's share " + frameMs.ToString("0.00") + " ms (most in " + worstPart + ": " + worstMs.ToString("0.00") + " ms)")); } minuteSum += frameMs; frames++; if (frameMs > minuteWorst) { minuteWorst = frameMs; minuteWorstPart = worstPart; } if (minuteFrom < 0f) { minuteFrom = unscaledTime; } else if (unscaledTime - minuteFrom >= 60f && frames > 0) { minuteFrom = unscaledTime; minuteSum = 0.0; minuteWorst = 0.0; frames = 0; } frameMs = 0.0; worstMs = 0.0; worstPart = "-"; } } [HarmonyPatch(typeof(Hud), "UpdateActionProgress")] internal static class Patch_ActionBar { private static void Postfix(Hud __instance) { if (Plugin.EquipRing && (Object)(object)__instance.m_actionBarRoot != (Object)null && __instance.m_actionBarRoot.activeSelf) { __instance.m_actionBarRoot.SetActive(false); } } } [HarmonyPatch(typeof(Hud), "UpdateCrosshair")] internal static class Patch_Crosshair { private const float Dot = 6f; private const float RingSize = 26f; private const float Linger = 0.15f; private const float LabelGap = 10f; private const float LabelFade = 0.15f; private static Sprite cross; private static Vector2 crossSize; private static bool saved; private static bool dotted; private static GameObject ring; private static Image ringTrack; private static Image ringFill; private static float lastProgress; private static float fullUntil = -1f; private static bool dotHidden; private static float labelAlpha = 1f; private static TMP_Text ringText; private static string label = ""; private static string shownLabel = ""; private static void Postfix(Hud __instance) { //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_0098: 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) try { Image crosshair = __instance.m_crosshair; if (!((Object)(object)crosshair == (Object)null)) { RectTransform rectTransform = ((Graphic)crosshair).rectTransform; if (!saved) { cross = crosshair.sprite; crossSize = rectTransform.sizeDelta; saved = true; } bool flag = Plugin.Enabled.Value && Plugin.DotCrosshair.Value && ZInput.IsGamepadActive(); if (flag != dotted) { dotted = flag; crosshair.sprite = (flag ? Hints.Disc() : cross); rectTransform.sizeDelta = (Vector2)(flag ? new Vector2(6f, 6f) : crossSize); } long num = Perf.Now(); Progress(__instance, rectTransform); Perf.Lap("crosshair ring", num); } } catch (Exception ex) { Plugin.Log.LogWarning((object)("Crosshair: " + ex.Message)); } } private static void Progress(Hud h, RectTransform cross) { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: 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_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; float num = -1f; if (Plugin.EquipRing && (Object)(object)localPlayer != (Object)null && ((Component)cross).gameObject.activeInHierarchy) { string text = default(string); float num2 = default(float); MinorActionData val = default(MinorActionData); localPlayer.GetActionProgress(ref text, ref num2, ref val); float num3 = ((Plugin.EquipRingFor.Value == "VanillaBarsOnly") ? 0.5f : 0f); if (!string.IsNullOrEmpty(text) && val != null && val.m_duration > num3) { num = Mathf.Clamp01(num2); label = ((val.m_duration > 0.5f && Localization.instance != null) ? Localization.instance.Localize(text) : ""); } } float unscaledTime = Time.unscaledTime; if (num < 0f && lastProgress > 0.85f) { fullUntil = unscaledTime + 0.15f; } lastProgress = num; bool flag = num < 0f && unscaledTime < fullUntil; bool flag2 = num >= 0f || flag; if ((Object)(object)ring == (Object)null) { if (!flag2) { return; } Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); ring = Hints.New("ControllerPro_ActionRing", ((Transform)cross).parent); Hints.Place(ring, val2, val2, val2, Vector2.zero, new Vector2(26f, 26f)); ringTrack = Hints.Img(Hints.New("track", ring.transform), Hints.Ring(), new Color(1f, 1f, 1f, 0.12f)); Hints.Place(((Component)ringTrack).gameObject, Vector2.zero, Vector2.one, val2, Vector2.zero, Vector2.zero); ringFill = Hints.Img(Hints.New("fill", ring.transform), Hints.Ring(), Color.white); Hints.Place(((Component)ringFill).gameObject, Vector2.zero, Vector2.one, val2, Vector2.zero, Vector2.zero); ringFill.type = (Type)3; ringFill.fillMethod = (FillMethod)4; ringFill.fillOrigin = 2; ringFill.fillClockwise = true; Image obj = ringTrack; bool raycastTarget = (((Graphic)ringFill).raycastTarget = false); ((Graphic)obj).raycastTarget = raycastTarget; TMP_Text val3 = (TMP_Text)(((Object)(object)h.m_hoverName != (Object)null) ? ((object)h.m_hoverName) : ((object)h.m_actionName)); if ((Object)(object)val3 != (Object)null) { Vector2 pivot = default(Vector2); ((Vector2)(ref pivot))..ctor(0f, 0.5f); ringText = Hints.Text(Hints.New("label", ring.transform), val3, val3.fontSize, ((Graphic)val3).color, (TextAlignmentOptions)4097); if ((Object)(object)ringText.font != (Object)null) { ringText.fontSharedMaterial = ((TMP_Asset)ringText.font).material; } ringText.enableWordWrapping = false; ((Graphic)ringText).raycastTarget = false; Hints.Place(((Component)ringText).gameObject, new Vector2(1f, 0.5f), new Vector2(1f, 0.5f), pivot, new Vector2(10f, 0f), new Vector2(400f, 26f)); } } if ((Object)(object)ringText != (Object)null) { if (num >= 0f) { shownLabel = label; } bool flag4 = flag2 && Plugin.EquipRingLabel.Value && !string.IsNullOrEmpty(shownLabel); if (((Component)ringText).gameObject.activeSelf != flag4) { ((Component)ringText).gameObject.SetActive(flag4); } if (flag4 && ringText.text != shownLabel) { ringText.text = shownLabel; } TMP_Text hoverName = (TMP_Text)(object)h.m_hoverName; bool flag5 = (Object)(object)hoverName != (Object)null && ((Component)hoverName).gameObject.activeInHierarchy && ((Behaviour)hoverName).enabled && !string.IsNullOrEmpty(hoverName.text); labelAlpha = Mathf.MoveTowards(labelAlpha, flag5 ? 0f : 1f, Time.unscaledDeltaTime / 0.15f); if (flag4) { ringText.alpha = labelAlpha; } } if (ring.activeSelf != flag2) { ring.SetActive(flag2); } Image crosshair = h.m_crosshair; if ((Object)(object)crosshair != (Object)null && dotHidden != flag2) { dotHidden = flag2; ((Graphic)crosshair).canvasRenderer.SetAlpha(flag2 ? 0f : 1f); } if (flag2) { ring.transform.position = ((Transform)cross).position; ringFill.fillAmount = (flag ? 1f : num); } } } [HarmonyPatch(typeof(PlayerController), "TakeInput")] internal static class Patch_TakeInput { private static void Postfix(ref bool __result) { if (ModSettings.Open || HudPick.Open) { __result = false; } } } [HarmonyPatch(typeof(KeyHints), "UpdateHints")] internal static class Patch_KeyHints { private static void Postfix(KeyHints __instance) { long num = Perf.Now(); if (ModSettings.Open && Plugin.ShowMapHints.Value) { if ((Object)(object)__instance.m_combatHints != (Object)null && !__instance.m_combatHints.activeSelf) { __instance.m_combatHints.SetActive(true); } if ((Object)(object)__instance.m_inventoryHints != (Object)null) { __instance.m_inventoryHints.SetActive(false); } if ((Object)(object)__instance.m_inventoryWithContainerHints != (Object)null) { __instance.m_inventoryWithContainerHints.SetActive(false); } } try { HudHints.ApplyAll(__instance.m_combatHints, combat: true); HudHints.ApplyAll(__instance.m_buildHints, combat: false); HudHints.ApplyAll(__instance.m_radialHints, combat: false, wheel: true); } catch (Exception ex) { Plugin.Log.LogWarning((object)("HUD hints: " + ex.Message)); } Perf.Lap("gameplay hints", num); if (Plugin.Enabled.Value && (ZInput.IsGamepadActive() || Plugin.KbmPreset) && !Plugin.ShowMapHints.Value) { if ((Object)(object)__instance.m_combatHints != (Object)null && __instance.m_combatHints.activeSelf) { __instance.m_combatHints.SetActive(false); } if ((Object)(object)__instance.m_buildHints != (Object)null && __instance.m_buildHints.activeSelf) { __instance.m_buildHints.SetActive(false); } if ((Object)(object)__instance.m_radialHints != (Object)null && __instance.m_radialHints.activeSelf) { __instance.m_radialHints.SetActive(false); } } bool flag = Plugin.Enabled.Value && ZInput.IsGamepadActive() && InventoryGui.IsVisible(); if ((Core.StripShowing || flag) && Plugin.HideVanillaHints.Value) { if ((Object)(object)__instance.m_inventoryHints != (Object)null) { __instance.m_inventoryHints.SetActive(false); } if ((Object)(object)__instance.m_inventoryWithContainerHints != (Object)null) { __instance.m_inventoryWithContainerHints.SetActive(false); } } } } internal static class CursorLook { private const float Grow = 0.25f; private const float Ease = 0.1f; private static readonly string[] Rings = new string[4] { "ring", "shade", "holdTrack", "holdFill" }; public static void Hover(GameObject root, ref float k, bool over) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { return; } k = Mathf.MoveTowards(k, over ? 1f : 0f, Time.unscaledDeltaTime / 0.1f); float num = k * k * (3f - 2f * k); float num2 = 1f + 0.25f * (1f - num); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num2, num2, 1f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(num, num, 1f); string[] rings = Rings; foreach (string text in rings) { Transform val3 = root.transform.Find(text); if ((Object)(object)val3 != (Object)null && val3.localScale != val) { val3.localScale = val; } } Transform val4 = root.transform.Find("dot"); if ((Object)(object)val4 != (Object)null && val4.localScale != val2) { val4.localScale = val2; } } } internal static class Cursor { public static bool On; public static bool OffGrid; public static bool Outside; public static bool OverButton; public static InventoryGrid PanelGrid; public static Vector2 Pos; private static bool overTarget; private static bool inPanel; private static Selectable hover; private static Selectable selected; private static GameObject root; private static Selectable[] buttons; private static int bumperFrame = -10; private static float buttonsAt; private static readonly FieldInfo F_elements = AccessTools.Field(typeof(InventoryGrid), "m_elements"); private static readonly FieldInfo F_dragGo = AccessTools.Field(typeof(InventoryGui), "m_dragGo"); private static readonly MethodInfo M_SetActiveGroup = AccessTools.Method(typeof(InventoryGui), "SetActiveGroup", new Type[2] { typeof(UIGroupHandler), typeof(bool) }, (Type[])null); private static readonly MethodInfo M_OnDropOutside = AccessTools.Method(typeof(InventoryGui), "OnDropOutside", (Type[])null, (Type[])null); private static readonly Vector3[] corners = (Vector3[])(object)new Vector3[4]; private static int lastGroup = -1; private static float travel; private static GameObject parked; private static Image curRing; private static Image curDot; private static Image curTrack; private static Image curFill; private static float hoverK; private static bool onSomething; public static void Stop() { Unpark(); On = (OffGrid = (Outside = (OverButton = false))); PanelGrid = null; hover = (selected = null); if ((Object)(object)root != (Object)null) { root.SetActive(false); } } public static void Pause() { if ((Object)(object)root != (Object)null) { root.SetActive(false); } } public static bool Over(RectTransform rt) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rt != (Object)null && ((Component)rt).gameObject.activeInHierarchy) { return RectTransformUtility.RectangleContainsScreenPoint(rt, Pos, (Camera)null); } return false; } public static bool OverPanel(RectTransform rt) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rt == (Object)null || !((Component)rt).gameObject.activeInHierarchy) { return false; } Vector2 val = default(Vector2); if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(rt, Pos, (Camera)null, ref val)) { return false; } Rect rect = rt.rect; if (val.x >= ((Rect)(ref rect)).xMin - 26f && val.x <= ((Rect)(ref rect)).xMax + 26f && val.y >= ((Rect)(ref rect)).yMin - 26f) { return val.y <= ((Rect)(ref rect)).yMax + 26f; } return false; } private static bool Focus(InventoryGui gui, out Vector2 at) { //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_016f: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: 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) at = new Vector2((float)Screen.width * 0.5f, (float)Screen.height * 0.5f); RectTransform val = null; InventoryGrid playerGrid = gui.m_playerGrid; InventoryGrid val2 = (gui.IsContainerOpen() ? gui.ContainerGrid : null); if ((Object)(object)playerGrid != (Object)null && (Object)(object)playerGrid.m_uiGroup != (Object)null && playerGrid.m_uiGroup.IsActive) { val = playerGrid.GetGamepadSelectedElement(); } else if ((Object)(object)val2 != (Object)null && (Object)(object)val2.m_uiGroup != (Object)null && val2.m_uiGroup.IsActive) { val = val2.GetGamepadSelectedElement(); } else { int activeGroup = gui.ActiveGroup; UIGroupHandler val3 = ((gui.m_uiGroups != null && activeGroup >= 0 && activeGroup < gui.m_uiGroups.Length) ? gui.m_uiGroups[activeGroup] : null); GameObject val4 = (((Object)(object)EventSystem.current != (Object)null) ? EventSystem.current.currentSelectedGameObject : null); if ((Object)(object)val3 != (Object)null) { val = (RectTransform)(((Object)(object)val4 != (Object)null && val4.transform.IsChildOf(((Component)val3).transform)) ? /*isinst with value type is only supported in some contexts*/: ((!((Object)(object)val3.m_defaultElement != (Object)null)) ? /*isinst with value type is only supported in some contexts*/: /*isinst with value type is only supported in some contexts*/)); } } if ((Object)(object)val == (Object)null) { return false; } val.GetWorldCorners(corners); at = Vector2.op_Implicit((corners[0] + corners[2]) * 0.5f); return true; } public static void Step(InventoryGui gui) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: 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_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: 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_0477: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.CursorEnabled.Value) { Stop(); return; } Vector2 joyLeftStick = ZInput.GetJoyLeftStick(); float magnitude = ((Vector2)(ref joyLeftStick)).magnitude; if (!On) { if (magnitude < 0.35f) { return; } On = true; OffGrid = (Outside = (OverButton = false)); travel = 0f; Focus(gui, out Pos); lastGroup = gui.ActiveGroup; } else { if (Core.RawHeld("JoyDPadLeft") || Core.RawHeld("JoyDPadRight") || Core.RawHeld("JoyDPadUp") || Core.RawHeld("JoyDPadDown")) { Stop(); return; } if (Core.RawDown("JoyTabLeft") || Core.RawDown("JoyTabRight") || Core.RawDown("JoyLBumper") || Core.RawDown("JoyRBumper")) { bumperFrame = Time.frameCount; } if (gui.ActiveGroup != lastGroup && Time.frameCount - bumperFrame <= 3) { Focus(gui, out Pos); travel = 0f; } } float unscaledDeltaTime = Time.unscaledDeltaTime; if (magnitude > 0.15f) { travel = ((!overTarget && !inPanel) ? Mathf.Min(1f, travel + unscaledDeltaTime / 0.18f) : 0f); float num = (overTarget ? Plugin.CursorSlotSpeed.Value : (inPanel ? Plugin.CursorPanelSpeed.Value : Mathf.Lerp(Plugin.CursorPanelSpeed.Value, Plugin.CursorTravelSpeed.Value, travel))); float num2 = num * ((float)Screen.height / 1080f) * Mathf.Pow(Mathf.Min(1f, magnitude), 1.6f); Pos += joyLeftStick / magnitude * num2 * unscaledDeltaTime; Pos.x = Mathf.Clamp(Pos.x, 4f, (float)Screen.width - 4f); Pos.y = Mathf.Clamp(Pos.y, 4f, (float)Screen.height - 4f); } else { travel = 0f; } InventoryGrid val = null; Vector2i gamepadSelection = default(Vector2i); for (int i = 0; i < 2; i++) { if (!((Object)(object)val == (Object)null)) { break; } InventoryGrid val2 = ((i == 0) ? gui.m_playerGrid : (gui.IsContainerOpen() ? gui.ContainerGrid : null)); if ((Object)(object)val2 == (Object)null || !((Component)val2).gameObject.activeInHierarchy || !(F_elements.GetValue(val2) is List<InventoryElement> list)) { continue; } foreach (InventoryElement item in list) { if ((Object)(object)item != (Object)null && Over((RectTransform)/*isinst with value type is only supported in some contexts*/)) { val = val2; gamepadSelection = item.Position; break; } } if ((Object)(object)val != (Object)null) { break; } float num3 = float.MaxValue; InventoryElement val3 = null; foreach (InventoryElement item2 in list) { RectTransform val4 = (RectTransform)(((Object)(object)item2 != (Object)null) ? /*isinst with value type is only supported in some contexts*/: null); if (!((Object)(object)val4 == (Object)null) && ((Component)val4).gameObject.activeInHierarchy) { val4.GetWorldCorners(corners); float num4 = Mathf.Max(Mathf.Max(corners[0].x - Pos.x, Pos.x - corners[2].x), 0f); float num5 = Mathf.Max(Mathf.Max(corners[0].y - Pos.y, Pos.y - corners[2].y), 0f); float num6 = Mathf.Max(num4, num5); if (num6 < num3) { num3 = num6; val3 = item2; } } } if ((Object)(object)val3 != (Object)null && num3 <= 5f * Mathf.Max(0.01f, ((Component)val3).transform.lossyScale.y)) { val = val2; gamepadSelection = val3.Position; } } hover = null; if ((Object)(object)val != (Object)null) { OffGrid = (Outside = false); val.SetGamepadSelection(gamepadSelection); if ((Object)(object)val.m_uiGroup != (Object)null && !val.m_uiGroup.IsActive && M_SetActiveGroup != null) { M_SetActiveGroup.Invoke(gui, new object[2] { val.m_uiGroup, false }); } RectTransform gamepadSelectedElement = val.GetGamepadSelectedElement(); Selectable val5 = (((Object)(object)gamepadSelectedElement != (Object)null) ? ((Component)gamepadSelectedElement).GetComponent<Selectable>() : null); if ((Object)(object)val5 != (Object)null && (Object)(object)selected != (Object)(object)val5) { val5.Select(); selected = val5; } } else { OffGrid = true; hover = FindButton(gui); if ((Object)(object)hover != (Object)null && (Object)(object)hover != (Object)(object)selected) { hover.Select(); selected = hover; } else if ((Object)(object)hover == (Object)null) { Park(gui); } } inPanel = (Object)(object)val != (Object)null || OverPanel(gui.m_player) || OverPanel(gui.m_container) || OverPanel(gui.m_crafting) || OverPanel(gui.m_info); PanelGrid = null; if ((Object)(object)val == (Object)null && (Object)(object)hover == (Object)null) { if (gui.IsContainerOpen() && OverPanel(gui.m_container)) { PanelGrid = gui.ContainerGrid; } else if (OverPanel(gui.m_player)) { PanelGrid = gui.m_playerGrid; } } Outside = OffGrid && (Object)(object)hover == (Object)null && !inPanel; lastGroup = gui.ActiveGroup; OverButton = (Object)(object)hover != (Object)null; overTarget = (Object)(object)val != (Object)null || (Object)(object)hover != (Object)null; object? value = F_dragGo.GetValue(gui); bool flag = (Object)((value is GameObject) ? value : null) != (Object)null; onSomething = (Object)(object)hover != (Object)null || ((Object)(object)val != (Object)null && (flag || (val.GetInventory() != null && val.GetInventory().GetItemAt(gamepadSelection.x, gamepadSelection.y) != null))); Draw(gui); } private static Selectable FindButton(InventoryGui gui) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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) if (buttons == null || Time.unscaledTime > buttonsAt) { buttons = ((Component)gui).GetComponentsInChildren<Selectable>(false); buttonsAt = Time.unscaledTime + 0.5f; } Selectable result = null; float num = float.MaxValue; Selectable[] array = buttons; foreach (Selectable val in array) { if ((Object)(object)val == (Object)null || (!(val is Button) && !(val is Toggle)) || !((Behaviour)val).isActiveAndEnabled || !val.IsInteractable() || ((Object)val).name.StartsWith("cp_") || (Object)(object)((Component)val).GetComponentInParent<InventoryElement>() != (Object)null || (Object)(object)val == (Object)(object)gui.m_dropButton) { continue; } Transform transform = ((Component)val).transform; RectTransform val2 = (RectTransform)(object)((transform is RectTransform) ? transform : null); if (Over(val2)) { Rect rect = val2.rect; float width = ((Rect)(ref rect)).width; Rect rect2 = val2.rect; float num2 = Mathf.Abs(width * ((Rect)(ref rect2)).height); if (num2 < num) { result = val; num = num2; } } } return result; } public static bool OverThis(Selectable s) { if ((Object)(object)s != (Object)null) { return (Object)(object)hover == (Object)(object)s; } return false; } private static void Park(InventoryGui gui) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) selected = null; if (!((Object)(object)EventSystem.current == (Object)null)) { if ((Object)(object)parked == (Object)null) { parked = new GameObject("cp_nothing", new Type[1] { typeof(RectTransform) }); Selectable val = parked.AddComponent<Selectable>(); val.transition = (Transition)0; Navigation navigation = default(Navigation); ((Navigation)(ref navigation)).mode = (Mode)0; val.navigation = navigation; ((RectTransform)parked.transform).sizeDelta = Vector2.zero; } int activeGroup = gui.ActiveGroup; Transform val2 = ((gui.m_uiGroups != null && activeGroup >= 0 && activeGroup < gui.m_uiGroups.Length && (Object)(object)gui.m_uiGroups[activeGroup] != (Object)null) ? ((Component)gui.m_uiGroups[activeGroup]).transform : ((Component)gui).transform); if ((Object)(object)parked.transform.parent != (Object)(object)val2) { parked.transform.SetParent(val2, false); parked.layer = ((Component)val2).gameObject.layer; } if ((Object)(object)EventSystem.current.currentSelectedGameObject != (Object)(object)parked) { EventSystem.current.SetSelectedGameObject(parked); } } } private static void Unpark() { if ((Object)(object)parked != (Object)null && (Object)(object)EventSystem.current != (Object)null && (Object)(object)EventSystem.current.currentSelectedGameObject == (Object)(object)parked) { EventSystem.current.SetSelectedGameObject((GameObject)null); } } public static void Click(InventoryGui gui) { if (!((Object)(object)hover == (Object)null)) { UIGroupHandler componentInParent = ((Component)hover).GetComponentInParent<UIGroupHandler>(); Selectable obj = hover; Button val = (Button)(object)((obj is Button) ? obj : null); Selectable obj2 = hover; Toggle val2 = (Toggle)(object)((obj2 is Toggle) ? obj2 : null); if ((Object)(object)val != (Object)null) { ((UnityEvent)val.onClick).Invoke(); } else if ((Object)(object)val2 != (Object)null) { val2.isOn = !val2.isOn; } if ((Object)(object)componentInParent != (Object)null && !componentInParent.IsActive && M_SetActiveGroup != null) { M_SetActiveGroup.Invoke(gui, new object[2] { componentInParent, false }); } lastGroup = gui.ActiveGroup; } } public static void Drop(InventoryGui gui) { if (M_OnDropOutside != null) { M_OnDropOutside.Invoke(gui, null); } } public static void FollowDrag(InventoryGui gui) { //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_00d0: 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_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) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (!On) { return; } object? value = F_dragGo.GetValue(gui); GameObject val = (GameObject)((value is GameObject) ? value : null); if (!((Object)(object)val == (Object)null)) { Transform val2 = val.transform.Find("icon"); Vector3 val3 = Vector3.zero; if ((Object)(object)val2 != (Object)null) { ((RectTransform)val2).GetWorldCorners(corners); val3 = val.transform.position - (corners[0] + corners[2]) * 0.5f; } float num = (float)Screen.height / 1080f; val.transform.position = new Vector3(Pos.x + 14f * num, Pos.y - 14f * num, val.transform.position.z) + new Vector3(val3.x, val3.y, 0f); } } public static void ShowHold(float r) { if (!((Object)(object)root == (Object)null) && !((Object)(object)curFill == (Object)null)) { bool flag = r > 0f; if (((Behaviour)curRing).enabled == flag) { Image obj = curRing; bool enabled = (((Behaviour)curDot).enabled = !flag); ((Behaviour)obj).enabled = enabled; Image obj2 = curTrack; bool enabled2 = (((Behaviour)curFill).enabled = flag); ((Behaviour)obj2).enabled = enabled2; } curFill.fillAmount = r; } } private static void Draw(InventoryGui gui) { //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0085: 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) //IL_0098: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 0.5f); root = Hints.New("ControllerPro_Cursor", ((Component)gui).transform); Hints.Place(root, val, val, val, Vector2.zero, new Vector2(30f, 30f)); Image val2 = Hints.Img(Hints.New("shade", root.transform), Hints.Ring(), new Color(0f, 0f, 0f, 0.7f)); Hints.Place(((Component)val2).gameObject, val, val, val, Vector2.zero, new Vector2(30f, 30f)); curRing = Hints.Img(Hints.New("ring", root.transform), Hints.Ring(), Color.white); Hints.Place(((Component)curRing).gameObject, val, val, val, Vector2.zero, new Vector2(26f, 26f)); curDot = Hints.Img(Hints.New("dot", root.transform), Hints.Disc(), Color.white); Hints.Place(((Component)curDot).gameObject, val, val, val, Vector2.zero, new Vector2(5f, 5f)); curTrack = Hints.Img(Hints.New("holdTrack", root.transform), Hints.Ring(), new Color(1f, 1f, 1f, 0.25f)); Hints.Place(((Component)curTrack).gameObject, val, val, val, Vector2.zero, new Vector2(26f, 26f)); curFill = Hints.Img(Hints.New("holdFill", root.transform), Hints.Ring(), Color.white); Hints.Place(((Component)curFill).gameObject, val, val, val, Vector2.zero, new Vector2(26f, 26f)); curFill.type = (Type)3; curFill.fillMethod = (FillMethod)4; curFill.fillOrigin = 2; curFill.fillClockwise = true; Image obj = curTrack; bool enabled = (((Behaviour)curFill).enabled = false); ((Behaviour)obj).enabled = enabled; } root.SetActive(true); root.transform.SetAsLastSibling(); root.transform.position = new Vector3(Pos.x, Pos.y, root.transform.position.z); CursorLook.Hover(root, ref hoverK, onSomething); } } [HarmonyPatch(typeof(InventoryGrid), "UpdateGui")] internal static class Patch_GridMarkers { private class Slot { public TMP_Text number; public TMP_Text mark; public bool numberOn; public bool looked; public float inset = -1f; public RectTransform levels; public readonly List<Image> diamonds = new List<Image>(); } private const float MarkScale = 0.8f; private const float Diamond = 5f; private const float DiamondPitch = 8f; private static readonly FieldInfo F_elements = AccessTools.Field(typeof(InventoryGrid), "m_elements"); private static readonly Vector3[] ic = (Vector3[])(object)new Vector3[4]; private static readonly Dictionary<InventoryElement, Slot> slots = new Dictionary<InventoryElement, Slot>(); private static float Inset(InventoryElement el) { //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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)el).transform; RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null); TMP_Text amount = el.m_amount; if ((Object)(object)val == (Object)null || (Object)(object)amount == (Object)null) { return 3f; } amount.ForceMeshUpdate(false, false); Bounds textBounds = amount.textBounds; if (((Bounds)(ref textBounds)).size.x <= 0f) { amount.rectTransform.GetWorldCorners(ic); } else { ref Vector3 reference = ref ic[2]; reference = amount.transform.TransformPoint(((Bounds)(ref textBounds)).max); ref Vector3 reference2 = ref ic[0]; reference2 = amount.transform.TransformPoint(((Bounds)(ref textBounds)).min); } Vector3 val2 = ((Transform)val).InverseTransformPoint(new Vector3(ic[2].x, ic[0].y, 0f)); Rect rect = val.rect; float num = ((Rect)(ref rect)).xMax - val2.x; float y = val2.y; Rect rect2 = val.rect; float num2 = Mathf.Max(num, y - ((Rect)(ref rect2)).yMin); if (!(num2 >= 2f) || !(num2 <= 12f)) { return 3f; } return Mathf.Max(2f, num2 - 2f); } private static void Postfix(InventoryGrid __instance) { //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: 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) long num = Perf.Now(); try { InventoryGui instance = InventoryGui.instance; if ((Object)(object)instance == (Object)null) { return; } bool flag = (Object)(object)__instance == (Object)(object)instance.m_playerGrid; List<InventoryElement> list = F_elements.GetValue(__instance) as List<InventoryElement>; Inventory inventory = __instance.GetInventory(); if (list == null || inventory == null) { return; } bool flag2 = Plugin.Enabled.Value && ZInput.IsGamepadActive(); bool flag3 = flag && flag2 && Plugin.FavEnabled.Value; bool flag4 = flag3 && Plugin.FavMarkers.Value; Vector2 val3 = default(Vector2); foreach (InventoryElement item in list) { if ((Object)(object)item == (Object)null) { continue; } if (!slots.TryGetValue(item, out var value) || !value.looked) { value = new Slot(); value.looked = true; Transform val = ((Component)item).transform.Find("binding"); value.number = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent<TMP_Text>() : null); value.numberOn = (Object)(object)value.number != (Object)null && ((Behaviour)value.number).enabled; slots[item] = value; } ItemData it = (item.m_used ? inventory.GetItemAt(item.Position.x, item.Position.y) : null); Levels(item, value, null); if (!flag) { continue; } Deposit.Grey(item, it); if ((Object)(object)value.number != (Object)null) { bool flag5 = value.numberOn && !flag3; if (((Behaviour)value.number).enabled != flag5) { ((Behaviour)value.number).enabled = flag5; } } string text = ((flag4 && item.Position.y == 0) ? Favorites.ColumnGlyph(item.Position.x) : null); bool flag6 = !string.IsNullOrEmpty(text); if ((Object)(object)value.mark == (Object)null) { if (!flag6) { continue; } TMP_Text val2 = (((Object)(object)value.number != (Object)null) ? value.number : (((Object)(object)instance.m_weight != (Object)null) ? instance.m_weight : instance.m_containerName)); GameObject go = Hints.New("ControllerPro_Fav", ((Component)item).transform); value.mark = Hints.Text(go, val2, val2.fontSize * 0.8f, Color.white, (TextAlignmentOptions)257); ((Graphic)value.mark).raycastTarget = false; ((Vector2)(ref val3))..ctor(0f, 1f); float num2 = SlotInset(item, value); Hints.Place(go, val3, val3, val3, new Vector2(num2, 0f - num2), new Vector2(24f, 18f)); } if (((Component)value.mark).gameObject.activeSelf != flag6) { ((Component)value.mark).gameObject.SetActive(flag6); } if (flag6 && value.mark.text != text) { value.mark.text = text; } } } catch (Exception e) { Core.Fail(e); } finally { Perf.Lap("bag marks", num); } } private static float SlotInset(InventoryElement el, Slot s) { if (s.inset < 0f) { s.inset = Inset(el); } return s.inset; } private static void Levels(InventoryElement el, Slot s, ItemData it) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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) TMP_Text quality = el.m_quality; int num = ((it != null && (Object)(object)quality != (Object)null && ((Behaviour)quality).enabled) ? Mathf.Clamp(it.m_quality, 0, 10) : 0); if (num > 0) { ((Behaviour)quality).enabled = false; if ((Object)(object)s.levels == (Object)null) { Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(1f, 1f); float num2 = SlotInset(el, s); s.levels = Hints.Place(Hints.New("ControllerPro_Level", ((Component)el).transform), val, val, val, new Vector2(0f - num2, 0f - num2), new Vector2(7.1f, 80f)); } Vector2 val3 = default(Vector2); Vector2 pivot = default(Vector2); while (s.diamonds.Count < num) { Image val2 = Hints.Img(Hints.New("d" + s.diamonds.Count, (Transform)(object)s.levels), Hints.Solid(), Color.white); ((Graphic)val2).raycastTarget = false; ((Vector2)(ref val3))..ctor(0.5f, 1f); ((Vector2)(ref pivot))..ctor(0.5f, 0.5f); Hints.Place(((Component)val2).gameObject, val3, val3, pivot, new Vector2(0f, 0f - (3.55f + (float)s.diamonds.Count * 8f)), new Vector2(5f, 5f)); ((Component)val2).transform.localRotation = Quaternion.Euler(0f, 0f, 45f); s.diamonds.Add(val2); } } if ((Object)(object)s.levels == (Object)null) { return; } if (((Component)s.levels).gameObject.activeSelf != num > 0) { ((Component)s.levels).gameObject.SetActive(num > 0); } for (int i = 0; i < s.diamonds.Count; i++) { bool flag = i < num; if (((Component)s.diamonds[i]).gameObject.activeSelf != flag) { ((Component)s.diamonds[i]).gameObject.SetActive(flag); } if (flag && (Object)(object)quality != (Object)null) { ((Graphic)s.diamonds[i]).color = ((Graphic)quality).color; } } } } internal static class HudHints { private class Saved { public RectTransform rt; public Vector2 aMin; public Vector2 aMax; public Vector2 pivot; public Vector2 pos; public Vector2 size; public TMP_Text text; public bool wrap; public TextAlignmentOptions align; } private class Block { public RectTransform box; public HorizontalLayoutGroup row; public ContentSizeFitter fitter; public bool applied; public bool rowWasOn; public bool fitterWasOn; public List<Saved> saved = new List<Saved>(); public TMP_Text dodge; public TMP_Text sneak; public string dodgeGame; public string dodgeOurs; public bool logged; } public const float StackRow = 26f; private const float WheelGap = 28f; private static readonly Dictionary<GameObject, Block> blocks = new Dictionary<GameObject, Block>(); private static readonly Vector3[] corners = (Vector3[])(object)new Vector3[4]; private static readonly Dictionary<TMP_Text, string> rewritten = new Dictionary<TMP_Text, string>(); private static float wheelRight = float.MinValue; private static float wheelMid; private static float wheelK; private static bool wheelLogged; private static Transform wheelCentre; private static readonly Dictionary<TMP_Text, string> firsted = new Dictionary<TMP_Text, string>(); private static readonly Dictionary<GameObject, List<GameObject>> rowsOf = new Dictionary<GameObject, List<GameObject>>(); private static TMP_Text Copy(TMP_Text like, string name, int index) { GameObject val = Object.Instantiate<GameObject>(((Component)like).gameObject, like.transform.parent); ((Object)val).name = name; val.transform.SetSiblingIndex(index); MonoBehaviour[] components = val.GetComponents<MonoBehaviour>(); foreach (MonoBehaviour val2 in components) { if ((Object)(object)val2 != (Object)null && !(val2 is TMP_Text) && ((object)val2).GetType().Name.IndexOf("Locali", StringComparison.OrdinalIgnoreCase) >= 0) { Object.Destroy((Object)(object)val2); } } return val.GetComponent<TMP_Text>(); } private static void Set(TMP_Text t, bool on, string text) { if (!((Object)(object)t == (Object)null)) { if (((Component)t).gameObject.activeSelf != on) { ((Component)t).gameObject.SetActive(on); } if (on && t.text != text) { t.text = text; } } } private static void Remapped(Block b) { if ((Object)(object)b.dodge == (Object)null) { return; } bool flag = Plugin.Enabled.Value && ZInput.IsGamepadActive() && Remap.DodgeLayout(); string text = b.dodge.text; if (text != b.dodgeOurs) { b.dodgeGame = text; } if (flag && !string.IsNullOrEmpty(b.dodgeGame)) { int num = b.dodgeGame.IndexOf("<mspace", StringComparison.Ordinal); int num2 = b.dodgeGame.IndexOf("<sprite", StringComparison.Ordinal); if (num < 0 || (num2 >= 0 && num2 < num)) { num = num2; } string text2 = ((num > 0) ? b.dodgeGame.Substring(0, num) : "Dodge").Trim(); b.dodgeOurs = text2 + " " + Hints.Glyph("JoyDodge"); if (text != b.dodgeOurs) { b.dodge.text = b.dodgeOurs; } if (!b.logged) { b.logged = true; Plugin.Log.LogInfo((object)("Dodge hint: the game's text is '" + b.dodgeGame + "', the PRO text is '" + b.dodgeOurs + "'")); } } else if (b.dodgeOurs != null) { if (text == b.dodgeOurs && b.dodgeGame != null) { b.dodge.text = b.dodgeGame; } b.dodgeOurs = null; } bool activeSelf = ((Component)b.dodge).gameObject.activeSelf; Set(b.sneak, flag && activeSelf, "Hold · Sneak " + Hints.Glyph("JoyDodge")); } public static bool InkRight(TMP_Text t, out float right) { //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) right = float.MinValue; TMP_TextInfo textInfo = t.textInfo; if (textInfo == null || textInfo.characterInfo == null) { return false; } int num = Mathf.Min(textInfo.characterCount, textInfo.characterInfo.Length); for (int i = 0; i < num; i++) { TMP_CharacterInfo val = textInfo.characterInfo[i]; if (val.isVisible && val.topRight.x > right) { right = val.topRight.x; } } return right > float.MinValue; } private static Saved Keep(RectTransform rt) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) Saved saved = new Saved(); saved.rt = rt; saved.aMin = rt.anchorMin; saved.aMax = rt.anchorMax; saved.pivot = rt.pivot; saved.pos = rt.anchoredPosition; saved.size = rt.sizeDelta; saved.text = ((Component)rt).GetComponent<TMP_Text>(); if ((Object)(object)saved.text != (Object)null) { saved.wrap = saved.text.enableWordWrapping; saved.align = saved.text.alignment; } return saved; } private static void ButtonsLast(TMP_Text t) { string text = t.text; if (string.IsNullOrEmpty(text) || (rewritten.TryGetValue(t, out var value) && value == text)) { return; } int num = text.LastIndexOf("<sprite", StringComparison.Ordinal); int num2 = ((num >= 0) ? text.IndexOf('>', num) : (-1)); if (num2 < 0) { rewritten[t] = text; return; } string input = text.Substring(num2 + 1); string text2 = Regex.Replace(input, "<[^>]*>", "").Trim(); if (text2.Length == 0) { rewritten[t] = text; return; } int num3 = text.IndexOf("<mspace", StringComparison.Ordinal); if (num3 < 0) { num3 = text.IndexOf("<sprite", StringComparison.Ordinal); } string text3 = Regex.Replace(input, "[^<]*(<[^>]*>)?", "$1"); string value2 = (t.text = text.Substring(0, num3).TrimEnd() + " " + text2 + " " + text.Substring(num3, num2 + 1 - num3) + text3); rewritten[t] = value2; } private static bool WheelEdge(out float right, out float midY) { //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) right = 0f; midY = 0f; RadialBase val = (((Object)(object)Hud.instance != (Object)null) ? Hud.instance.m_radialMenu : null); if ((Object)(object)val == (Object)null || !val.Active) { wheelRight = float.MinValue; return false; } if (wheelRight == float.MinValue) { RadialMenuElement val2 = null; RadialMenuElement[] componentsInChildren = ((Component)val).GetComponentsInChildren<RadialMenuElement>(false); int num = 0; if (num < componentsInChildren.Length) { RadialMenuElement val3 = componentsInChildren[num]; val2 = val3; } if ((Object)(object)val2 == (Object)null) { return false; } Transform val4 = (((Object)(object)((Component)val2).transform.parent != (Object)null) ? ((Component)val2).transform.parent : ((Component)val).transform); RadialDataSO sO = RadialData.SO; Rect rect = ((RectTransform)((Component)val2).transform).rect; float width = ((Rect)(ref rect)).width; float num2 = (((Object)(object)sO != (Object)null) ? (sO.ElementsDistance + width * 0.5f * Mathf.Max(1f, sO.ElementScaleFactor) + (sO.NudgeSelectedElement ? sO.NudgeDistance : 0f)) : (width * 2f)); if ((Object)(object)sO != (Object)null && sO.RadialReferenceWidth > 0f && sO.RadialReferenceWidth * 0.5f <= num2 * 3f) { num2 = Mathf.Max(num2, sO.RadialReferenceWidth * 0.5f); } num2 = Mathf.Max(num2, Plugin.WheelReachSeen.Value); wheelCentre = val4; wheelK = val4.lossyScale.x; num2 += Mathf.Max(0f, Plugin.WheelHintsExtra.Value); float x = val4.lossyScale.x; wheelRight = val4.position.x + num2 * x; wheelMid = val4.position.y; Plugin.Log.LogInfo((object)string.Concat("Wheel hints: reference width ", ((Object)(object)sO != (Object)null) ? sO.RadialReferenceWidth : 0f, ", element distance ", ((Object)(object)sO != (Object)null) ? sO.ElementsDistance : 0f, "; wheel centre ", val4.position, " (", ((Object)val4).name, "), reach ", num2, " x ", x, ", item size ", width)); } if ((Object)(object)wheelCentre != (Object)null && wheelK > 0f) { float num3 = 0f; RadialMenuElement[] componentsInChildren2 = ((Component)val).GetComponentsInChildren<RadialMenuElement>(false); foreach (RadialMenuElement val5 in componentsInChildren2) { CanvasGroup component = ((Component)val5).GetComponent<CanvasGroup>(); if (!((Object)(object)component != (Object)null) || !(component.alpha < 0.05f)) { ((RectTransform)((Component)val5).transform).GetWorldCorners(corners); for (int j = 0; j < 4; j++) { num3 = Mathf.Max(num3, corners[j].x - wheelCentre.position.x); } } } float num4 = num3 / wheelK; if (num4 > Plugin.WheelReachSeen.Value + 4f) { Plugin.WheelReachSeen.Value = Mathf.Ceil(num4); Plugin.Log.LogInfo((object)("Wheel hints: widest wheel now " + Plugin.WheelReachSeen.Value)); } } right = wheelRight; midY = wheelMid; return true; } private static void ButtonsFirst(TMP_Text t) { string text = t.text; if (!string.IsNullOrEmpty(text) && (!firsted.TryGetValue(t, out var value) || !(value == text))) { int num = text.IndexOf("<mspace", StringComparison.Ordinal); if (num < 0) { num = text.IndexOf("<sprite", StringComparison.Ordinal); } int num2 = Math.Max(text.LastIndexOf("</mspace>", StringComparison.Ordinal), -1); int num3 = ((num2 >= 0) ? (num2 + "</mspace>".Length) : (-1)); if (num3 < 0) { int num4 = text.LastIndexOf("<sprite", StringComparison.Ordinal); num3 = ((num4 >= 0) ? (text.IndexOf('>', num4) + 1) : (-1)); } if (num <= 0 || num3 <= num) { firsted[t] = text; return; } string text2 = (text.Substring(0, num).Trim() + " " + text.Substring(num3).Trim()).Trim(); string value2 = (t.text = text.Substring(num, num3 - num) + " " + text2); firsted[t] = value2; } } private static void BesideWheel(Block b) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_00a8: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: 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_0228: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0284: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Expected O, but got Unknown //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Expected O, but got Unknown //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknow