Fixed Take Clue GameKey with Clickable Clues

This commit is contained in:
Entrox-Licher 2023-08-08 16:32:58 -04:00
parent 79f7861f1e
commit 1213771ef9
2 changed files with 15 additions and 6 deletions

View File

@ -1,6 +1,7 @@
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
local playmatApi = require("playermat/PlaymatApi")
local victoryDisplayApi = require("core/VictoryDisplayApi")
local optionPanelApi = require("core/OptionPanelApi")
function onLoad()
addHotkey("Add Doom to Agenda", addDoomToAgenda)
@ -98,14 +99,18 @@ function takeClueFromLocation(playerColor, hoveredObject)
return
end
local clickableClues = optionPanelApi.getOptions()["useClueClickers"]
local playerName = Player[playerColor].steam_name
local matColor = playmatApi.getMatColor(playerColor)
local pos = playmatApi.transformLocalPosition({x = -1.12, y = 0.05, z = 0.7}, matColor)
local rot = playmatApi.returnRotation(matColor)
if cardName == "" or cardName == nil then
cardName = "nameless card"
local matColor = playmatApi.getMatColor(playerColor)
local pos = nil
if clickableClues then
pos = {x = 0.49, y = 2.66, z = 0.00}
playmatApi.updateClueClicker(playerColor, playmatApi.getClueCount(clickableClues, playerColor) + 1)
else
pos = playmatApi.transformLocalPosition({x = -1.12, y = 0.05, z = 0.7}, matColor)
end
local rot = playmatApi.returnRotation(matColor)
-- check if found clue is a stack or single token
if clue.getQuantity() > 1 then

View File

@ -191,6 +191,10 @@ do
end
end
PlaymatApi.updateClueClicker = function(playerColor, val)
return getObjectFromGUID(CLUE_CLICKER_GUIDS[playerColor]).call("updateVal", val)
end
-- Convenience function to look up a mat's object by color, or get all mats.
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
-- accepts "All" as a special value which will return all four mats.