use local discard pile and draw deck position

This commit is contained in:
Chr1Z93 2023-01-05 14:10:45 +01:00
parent 47e94ea2e5
commit d5fac353a7
12 changed files with 15 additions and 21 deletions

View File

@ -39,9 +39,9 @@
},
"Tooltip": true,
"Transform": {
"posX": 36.91,
"posX": 37.5,
"posY": 1.572,
"posZ": 28.789,
"posZ": 28.5,
"rotX": 90,
"rotY": 90,
"rotZ": 0,

View File

@ -29,7 +29,7 @@
"Snap": true,
"Sticky": true,
"Text": {
"Text": "Player card area - use the panel below to spawn cards!",
"Text": "Player card area - use the panel below to spawn cards",
"colorstate": {
"b": 1,
"g": 1,

View File

@ -211,7 +211,7 @@
"Position": {
"x": -1.82,
"y": 0.1,
"z": -0.03
"z": 0
},
"Rotation": {
"x": 0,

View File

@ -5,9 +5,6 @@
PLAYER_COLOR = "White"
PLAY_ZONE_POSITION = { x = -54.5, y = 4, z = 19 }
PLAY_ZONE_SCALE = { x = 32, y = 5, z = 12 }
DRAW_DECK_POSITION = { x = -54.8, y = 2.5, z = 4.29 }
DISCARD_PILE_POSITION = { x = -58.9, y = 4, z = 4.29 }
TRASHCAN_GUID = "147e80"
STAT_TRACKER_GUID = "e598c2"
RESOURCE_COUNTER_GUID = "4406f0"

View File

@ -211,7 +211,7 @@
"Position": {
"x": -1.82,
"y": 0.1,
"z": -0.03
"z": 0
},
"Rotation": {
"x": 0,

View File

@ -5,9 +5,6 @@
PLAYER_COLOR = "Orange"
PLAY_ZONE_POSITION = { x = -54.5, y = 4, z = -19 }
PLAY_ZONE_SCALE = { x = 32, y = 5, z = 12 }
DRAW_DECK_POSITION = { x = -54.86, y = 2.5, z = -27.82 }
DISCARD_PILE_POSITION = { x = -58.96, y = 4, z = -27.82 }
TRASHCAN_GUID = "f7b6c8"
STAT_TRACKER_GUID = "b4a5f7"
RESOURCE_COUNTER_GUID = "816d84"

View File

@ -211,7 +211,7 @@
"Position": {
"x": -1.82,
"y": 0.1,
"z": -0.03
"z": 0
},
"Rotation": {
"x": 0,

View File

@ -5,9 +5,6 @@
PLAYER_COLOR = "Green"
PLAY_ZONE_POSITION = { x = -26.5, y = 4, z = 26.5 }
PLAY_ZONE_SCALE = { x = 32, y = 5, z = 12 }
DRAW_DECK_POSITION = { x = -42.04, y = 2.5, z = 26.45 }
DISCARD_PILE_POSITION = { x = -42.04, y = 4, z = 30.55 }
TRASHCAN_GUID = "5f896a"
STAT_TRACKER_GUID = "af7ed7"
RESOURCE_COUNTER_GUID = "cd15ac"

View File

@ -211,7 +211,7 @@
"Position": {
"x": -1.82,
"y": 0.1,
"z": -0.03
"z": 0
},
"Rotation": {
"x": 0,

View File

@ -5,9 +5,6 @@
PLAYER_COLOR = "Red"
PLAY_ZONE_POSITION = { x = -26.5, y = 4, z = -26.5 }
PLAY_ZONE_SCALE = { x = 32, y = 5, z = 12 }
DRAW_DECK_POSITION = { x = -18.64, y = 2.5, z = -26.45 }
DISCARD_PILE_POSITION = { x = -18.64, y = 4, z = -30.55 }
TRASHCAN_GUID = "4b8594"
STAT_TRACKER_GUID = "e74881"
RESOURCE_COUNTER_GUID = "a4b60d"

View File

@ -49,6 +49,8 @@ local THREAT_AREA = {
}
}
local DRAW_DECK_POSITION = { x = -1.82, y = 1, z = 0 }
local DISCARD_PILE_POSITION = { x = -1.82, y = 1.5, z = 0.61 }
local PLAY_ZONE_ROTATION = self.getRotation()
local TRASHCAN
@ -391,7 +393,7 @@ end
function shuffleDiscardIntoDeck()
if not discardPile.is_face_down then discardPile.flip() end
discardPile.shuffle()
discardPile.setPositionSmooth(DRAW_DECK_POSITION, false, false)
discardPile.setPositionSmooth(self.positionToWorld(DRAW_DECK_POSITION), false, false)
drawDeck = discardPile
discardPile = nil
end
@ -619,6 +621,10 @@ function drawEncountercard(_, _, isRightClick)
Global.call("drawEncountercard", {self.positionToWorld(DRAWN_ENCOUNTER_CARD_OFFSET), self.getRotation(), isRightClick})
end
function returnGlobalDiscardPosition()
return self.positionToWorld(DISCARD_PILE_POSITION)
end
-- Sets this playermat's draw 1 button to visible
---@param visible Boolean. Whether the draw 1 button should be visible
function showDrawButton(visible)

View File

@ -53,7 +53,7 @@ do
---@param matColor String Color of the playermat
PlaymatApi.getDiscardPosition = function(matColor)
local mat = getObjectFromGUID(MAT_IDS[matColor])
return mat.getTable("DISCARD_PILE_POSITION")
return mat.call("returnGlobalDiscardPosition")
end
-- Sets the requested playermat's snap points to limit snapping to matching card types or not. If