From f0e0e26289d0920d8b628e030dee1e547991713f Mon Sep 17 00:00:00 2001 From: dscarpac Date: Tue, 23 Jan 2024 07:56:47 -0600 Subject: [PATCH 1/2] discard hotkey from hand --- src/core/GameKeyHandler.ttslua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index d217edc4..6aada65b 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -120,6 +120,8 @@ function getColorToDiscardFor(hoveredObject, playerColor) local discardForMatColor if inArea(pos, areaNearPlaymat) then return closestMatColor + elseif pos.y > 3 then -- discard to closest mat if card is in a hand + return closestMatColor else return playmatApi.getMatColor(playerColor) end From bf787dc5e48c10c350108cb469dcd3fc5d5f070d Mon Sep 17 00:00:00 2001 From: dscarpac Date: Sat, 27 Jan 2024 12:00:36 -0600 Subject: [PATCH 2/2] used formula instead --- src/core/GameKeyHandler.ttslua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index 6aada65b..40994cc7 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -120,7 +120,7 @@ function getColorToDiscardFor(hoveredObject, playerColor) local discardForMatColor if inArea(pos, areaNearPlaymat) then return closestMatColor - elseif pos.y > 3 then -- discard to closest mat if card is in a hand + elseif pos.y > (Player[playerColor].getHandTransform().position.y - (Player[playerColor].getHandTransform().scale.y / 2)) then -- discard to closest mat if card is in a hand return closestMatColor else return playmatApi.getMatColor(playerColor)