private static Boolean ProcessLeftMouseButton(ABBGHUD __instance, DragObject dragObject)
        {
            if (!Configuration.Bombagan.ClickOnceToPlayCard)
            {
                return(HarmonyPrefixResult.CallOriginal);
            }

            if (__instance.Main.Board.Mode == ABBG.ABBG.Mode.Tutorial)
            {
                return(HarmonyPrefixResult.CallOriginal);
            }

            // Discard cards
            if (__instance.Main.Board.SelectedCards.IsMultiselectMode())
            {
                return(HarmonyPrefixResult.CallOriginal);
            }

            if (dragObject is CardHUD)
            {
                __instance.OnDoubleClick(dragObject);
                return(HarmonyPrefixResult.SkipOriginal);
            }

            return(HarmonyPrefixResult.CallOriginal);
        }
        private static Boolean ProcessRightMouseButton(ABBGHUD __instance, DragObject dragObject)
        {
            if (!Configuration.Bombagan.RightClickToDiscardCard)
            {
                return(HarmonyPrefixResult.CallOriginal);
            }

            var main = __instance.Main;

            if (main.Board.Mode == ABBG.ABBG.Mode.Tutorial)
            {
                return(HarmonyPrefixResult.CallOriginal);
            }

            Selection selectedCards = main.Board.SelectedCards;

            // Discard cards mode
            if (selectedCards.IsMultiselectMode())
            {
                return(HarmonyPrefixResult.CallOriginal);
            }

            if (main.Board.GetAblilityToDrawCards() != Board.PlayerType.Hero)
            {
                return(HarmonyPrefixResult.CallOriginal);
            }

            if (dragObject is CardHUD card)
            {
                main.AddCommand(new DrawCardsModeCommand(Board.LocationType.PlayerHand));
                main.Board.SelectedCards.Toggle(card.Item);
                main.AddCommand(new DrawCardsCommand());
            }

            return(HarmonyPrefixResult.SkipOriginal);
        }
 public static Boolean Prefix(ABBGHUD __instance, DragObject dragObject, Boolean leftButton)
 {
     return(leftButton
         ? ProcessLeftMouseButton(__instance, dragObject)
         : ProcessRightMouseButton(__instance, dragObject));
 }