updated positions

This commit is contained in:
Chr1Z93 2023-03-09 23:55:40 +01:00
parent 39b7b3a245
commit 2343cd8eb0
4 changed files with 24 additions and 12 deletions

View File

@ -850,17 +850,17 @@ function applyOptionPanelChange(id, state)
-- option: Show hand helper for each player -- option: Show hand helper for each player
elseif id == "showHandHelper" then elseif id == "showHandHelper" then
optionPanel[id][1] = spawnOrRemoveHelper(state, "Hand Helper", {-50.85, 1.6, 7.32}, {0, 270, 0}) optionPanel[id][1] = spawnOrRemoveHelper(state, "Hand Helper", playmatAPI.transformLocalPosition({0.05, 0, -1.182}, "White") , {0, 270, 0})
optionPanel[id][2] = spawnOrRemoveHelper(state, "Hand Helper", {-50.85, 1.6, -24.88}, {0, 270, 0}) optionPanel[id][2] = spawnOrRemoveHelper(state, "Hand Helper", playmatAPI.transformLocalPosition({0.05, 0, -1.182}, "Orange"), {0, 270, 0})
optionPanel[id][3] = spawnOrRemoveHelper(state, "Hand Helper", {-39.13, 1.6, 22.45}, {0, 000, 0}) optionPanel[id][3] = spawnOrRemoveHelper(state, "Hand Helper", playmatAPI.transformLocalPosition({0.05, 0, -1.182}, "Green"), {0, 000, 0})
optionPanel[id][4] = spawnOrRemoveHelper(state, "Hand Helper", {-21.57, 1.6, -22.45}, {0, 180, 0}) optionPanel[id][4] = spawnOrRemoveHelper(state, "Hand Helper", playmatAPI.transformLocalPosition({0.05, 0, -1.182}, "Red"), {0, 180, 0})
-- option: Show search assistant for each player -- option: Show search assistant for each player
elseif id == "showSearchAssistant" then elseif id == "showSearchAssistant" then
optionPanel[id][1] = spawnOrRemoveHelper(state, "Search Assistant", {-50.85, 1.6, 10.25}, {0, 270, 0}) optionPanel[id][1] = spawnOrRemoveHelper(state, "Search Assistant", playmatAPI.transformLocalPosition({-0.3, 0, -1.182}, "White"), {0, 270, 0})
optionPanel[id][2] = spawnOrRemoveHelper(state, "Search Assistant", {-50.85, 1.6, -21.95}, {0, 270, 0}) optionPanel[id][2] = spawnOrRemoveHelper(state, "Search Assistant", playmatAPI.transformLocalPosition({-0.3, 0, -1.182}, "Orange"), {0, 270, 0})
optionPanel[id][3] = spawnOrRemoveHelper(state, "Search Assistant", {-36.20, 1.6, 22.45}, {0, 000, 0}) optionPanel[id][3] = spawnOrRemoveHelper(state, "Search Assistant", playmatAPI.transformLocalPosition({-0.3, 0, -1.182}, "Green"), {0, 000, 0})
optionPanel[id][4] = spawnOrRemoveHelper(state, "Search Assistant", {-24.50, 1.6, -22.45}, {0, 180, 0}) optionPanel[id][4] = spawnOrRemoveHelper(state, "Search Assistant", playmatAPI.transformLocalPosition({-0.3, 0, -1.182}, "Red"), {0, 180, 0})
-- option: Show chaos bag manager -- option: Show chaos bag manager
elseif id == "showChaosBagManager" then elseif id == "showChaosBagManager" then

View File

@ -700,6 +700,10 @@ function returnGlobalDiscardPosition()
return self.positionToWorld(DISCARD_PILE_POSITION) return self.positionToWorld(DISCARD_PILE_POSITION)
end end
function transformLocalPosition(localPos)
return self.positionToWorld(localPos)
end
-- Sets this playermat's draw 1 button to visible -- Sets this playermat's draw 1 button to visible
---@param visible Boolean. Whether the draw 1 button should be visible ---@param visible Boolean. Whether the draw 1 button should be visible
function showDrawButton(visible) function showDrawButton(visible)

View File

@ -48,7 +48,7 @@ do
return mat.call("getHandColor") return mat.call("getHandColor")
end end
-- Returns if there is the card"Dream-Enhancing Serum" on the requested playermat -- Returns if there is the card "Dream-Enhancing Serum" on the requested playermat
---@param matColor String Color of the playermat ---@param matColor String Color of the playermat
PlaymatApi.isDES = function(matColor) PlaymatApi.isDES = function(matColor)
local mat = getObjectFromGUID(MAT_IDS[matColor]) local mat = getObjectFromGUID(MAT_IDS[matColor])
@ -70,6 +70,14 @@ do
return mat.call("returnGlobalDiscardPosition") return mat.call("returnGlobalDiscardPosition")
end end
-- Transforms a local position into a global position
---@param localPos Table Local position to be transformed
---@param matColor String Color of the playermat
PlaymatApi.transformLocalPosition = function(localPos, matColor)
local mat = getObjectFromGUID(MAT_IDS[matColor])
return mat.call("transformLocalPosition", localPos)
end
-- Sets the requested playermat's snap points to limit snapping to matching card types or not. If -- Sets the requested playermat's snap points to limit snapping to matching card types or not. If
-- matchTypes is true, the main card slot snap points will only snap assets, while the -- matchTypes is true, the main card slot snap points will only snap assets, while the
-- investigator area point will only snap Investigators. If matchTypes is false, snap points will -- investigator area point will only snap Investigators. If matchTypes is false, snap points will

View File

@ -28,9 +28,9 @@ do
playerMatGuids["White"] = "8b081b" playerMatGuids["White"] = "8b081b"
playerMatGuids["Green"] = "383d8b" playerMatGuids["Green"] = "383d8b"
local commonZones = {} local commonZones = {}
commonZones["Investigator"] = { -1.17702, 0, 0.00209 } commonZones["Investigator"] = { -1.17702, 0, 0.00209 }
commonZones["Minicard"] = { -0.16, 0, -1.222326 } commonZones["Minicard"] = { -1.17702, 0, -1.45 }
commonZones["Deck"] = { -1.822724, 0, -0.02940192 } commonZones["Deck"] = { -1.822724, 0, -0.02940192 }
commonZones["Discard"] = { -1.822451, 0, 0.6092291 } commonZones["Discard"] = { -1.822451, 0, 0.6092291 }
commonZones["Ally"] = { -0.6157398, 0, 0.02435675 } commonZones["Ally"] = { -0.6157398, 0, 0.02435675 }
@ -48,7 +48,7 @@ do
commonZones["Threat3"] = { 0.002246313, 0, -0.6430681 } commonZones["Threat3"] = { 0.002246313, 0, -0.6430681 }
commonZones["Threat4"] = { 0.4590618, 0, -0.6432732 } commonZones["Threat4"] = { 0.4590618, 0, -0.6432732 }
local zoneData = {} local zoneData = {}
zoneData["White"] = {} zoneData["White"] = {}
zoneData["White"]["Investigator"] = commonZones["Investigator"] zoneData["White"]["Investigator"] = commonZones["Investigator"]
zoneData["White"]["Minicard"] = commonZones["Minicard"] zoneData["White"]["Minicard"] = commonZones["Minicard"]