Example #1
0
            private static bool Prefix(BagItem __instance)
            {
                try
                {
                    var isMouseInButton = (bool)BagItem_isMouseInButton.GetValue(__instance);
                    var rmbClicked      = isMouseInButton && UnityEngine.Input.GetMouseButtonDown(1);
                    if (!rmbClicked)
                    {
                        return(true);
                    }

                    var item         = __instance.GetItem();
                    var moneyHovered = (item != null) && (item.id == 9027);
                    if (moneyHovered)
                    {
                        return(true);
                    }

                    if (BaseBag.PickItem != null)
                    {
                        var count = KeyBindings.GetKey(KeyBindingType.Unpack) ? 10 : 1;
                        BagItemUtil.FillWithPickedItem(__instance, count);
                        return(false);
                    }
                }
                catch (Exception e) { Log.ExceptionOnce(e); }

                return(true);
            }