Example #1
0
            private static void Postfix(UnityModManager.UI __instance, ref Rect ___mWindowRect, ref Vector2[] ___mScrollPosition, ref int ___tabId)
            {
#if false
                // hack to fix mouse wheel which seems to gets de-magnified when the cursor is on the right side of the screen
                var scrollPosition = ___mScrollPosition[___tabId];
                var scrollOffset   = scrollOffsets.GetValueOrDefault(___tabId, scrollPosition.y);
                var mouseDelta     = UnityEngine.Input.mouseScrollDelta;
                if (mouseDelta.y != 0 || mouseDelta.x != 0)
                {
                    scrollOffset           -= 10 * mouseDelta.y;
                    scrollPosition.y        = scrollOffset;
                    scrollOffsets[___tabId] = scrollOffset;
                    var str = "";
                    foreach (var pos in ___mScrollPosition)
                    {
                        str += $"{pos} ";
                    }
                    Logger.Log($"scroll pos: {str} mouse delta: {mouseDelta}");
                }
                ___mScrollPosition[___tabId] = scrollPosition;
#endif
                // save these in case we need them inside the mod
                //Logger.Log($"Rect: {___mWindowRect}");
                Main.ummRect           = ___mWindowRect;
                Main.ummWidth          = ___mWindowRect.width;
                Main.ummScrollPosition = ___mScrollPosition;
                Main.ummTabID          = ___tabId;
            }
 private static void Postfix(UnityModManager.UI __instance, ref Rect ___mWindowRect, ref Vector2[] ___mScrollPosition, ref int ___tabId)
 {
     // save these in case we need them inside the mod
     //Logger.Log($"Rect: {___mWindowRect}");
     Main.ummRect  = ___mWindowRect;
     Main.ummWidth = ___mWindowRect.width;
     Main.ummTabID = ___tabId;
 }