diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index 6e61ed8f..f43ddbea 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -44,10 +44,8 @@ function addDoomToAgenda() end -- moves the hovered card to the victory display -function moveCardToVictoryDisplay(playerColor, hoveredObject) - -- check if the provided object is a card - if hoveredObject == nil or hoveredObject.tag ~= "Card" then return end - getObjectFromGUID("6ccd6d").call("placeCard", hoveredObject) +function moveCardToVictoryDisplay(_, hoveredObject) + victoryDisplayApi.placeCard(hoveredObject) end -- takes a clue from a location, player needs to hover the clue directly or the location diff --git a/src/core/VictoryDisplayApi.ttslua b/src/core/VictoryDisplayApi.ttslua index bbf47b9f..2401ba43 100644 --- a/src/core/VictoryDisplayApi.ttslua +++ b/src/core/VictoryDisplayApi.ttslua @@ -8,5 +8,13 @@ do getObjectFromGUID(VD_GUID).call("startUpdate", delay) end + -- moves a card to the victory display (in the first empty spot) + ---@param object Object Object that should be checked and potentially moved + VictoryDisplayApi.placeCard = function(object) + if object ~= nil and object.tag == "Card" then + getObjectFromGUID(VD_GUID).call("placeCard", object) + end + end + return VictoryDisplayApi end