initial commit

This commit is contained in:
Chr1Z93 2023-01-02 11:53:29 +01:00
parent f2dd81e5d1
commit b5d0731208
7 changed files with 778 additions and 440 deletions

View File

@ -56,446 +56,6 @@
"z": 0
}
},
{
"Position": {
"x": -43.37,
"y": 1.647,
"z": 15.19
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -43.37,
"y": 1.644,
"z": 7.57
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -43.37,
"y": 1.642,
"z": -0.03
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -43.37,
"y": 1.64,
"z": -7.7
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -43.37,
"y": 1.638,
"z": -15.28
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -36.773,
"y": 1.629,
"z": -15.28
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -36.773,
"y": 1.631,
"z": -7.7
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -36.773,
"y": 1.633,
"z": -0.03
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -36.773,
"y": 1.635,
"z": 7.57
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -36.773,
"y": 1.638,
"z": 15.19
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -30.224,
"y": 1.628,
"z": 15.19
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -30.224,
"y": 1.626,
"z": 7.57
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -30.224,
"y": 1.624,
"z": -0.03
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -30.224,
"y": 1.622,
"z": -7.7
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -30.224,
"y": 1.62,
"z": -15.28
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -23.677,
"y": 1.61,
"z": -15.28
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -23.677,
"y": 1.613,
"z": -7.7
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -23.677,
"y": 1.615,
"z": -0.03
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -23.677,
"y": 1.617,
"z": 7.57
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -23.677,
"y": 1.619,
"z": 15.19
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -17.12,
"y": 1.611,
"z": 15.19
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -17.12,
"y": 1.608,
"z": 7.57
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -17.12,
"y": 1.606,
"z": -0.03
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -17.12,
"y": 1.603,
"z": -7.7
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -17.12,
"y": 1.602,
"z": -15.28
},
"Rotation": {
"x": 0,
"y": 270,
"z": 0
}
},
{
"Position": {
"x": -43.37,
"y": 1.645,
"z": 11.46
}
},
{
"Position": {
"x": -43.37,
"y": 1.643,
"z": 3.86
}
},
{
"Position": {
"x": -43.37,
"y": 1.641,
"z": -3.83
}
},
{
"Position": {
"x": -43.37,
"y": 1.639,
"z": -11.51
}
},
{
"Position": {
"x": -36.773,
"y": 1.631,
"z": -11.51
}
},
{
"Position": {
"x": -36.773,
"y": 1.632,
"z": -3.83
}
},
{
"Position": {
"x": -36.773,
"y": 1.634,
"z": 3.86
}
},
{
"Position": {
"x": -36.773,
"y": 1.636,
"z": 11.46
}
},
{
"Position": {
"x": -30.224,
"y": 1.626,
"z": 11.46
}
},
{
"Position": {
"x": -30.224,
"y": 1.625,
"z": 3.86
}
},
{
"Position": {
"x": -30.224,
"y": 1.623,
"z": -3.83
}
},
{
"Position": {
"x": -30.224,
"y": 1.621,
"z": -11.51
}
},
{
"Position": {
"x": -23.677,
"y": 1.612,
"z": -11.51
}
},
{
"Position": {
"x": -23.677,
"y": 1.614,
"z": -3.83
}
},
{
"Position": {
"x": -23.677,
"y": 1.616,
"z": 3.86
}
},
{
"Position": {
"x": -23.677,
"y": 1.619,
"z": 11.46
}
},
{
"Position": {
"x": -17.12,
"y": 1.609,
"z": 11.46
}
},
{
"Position": {
"x": -17.12,
"y": 1.607,
"z": 3.86
}
},
{
"Position": {
"x": -17.12,
"y": 1.605,
"z": -3.83
}
},
{
"Position": {
"x": -17.12,
"y": 1.603,
"z": -11.51
}
},
{
"Position": {
"x": 22.951,

View File

@ -156,6 +156,9 @@
}
},
"Sticky": true,
"Tags": [
"Location"
],
"Tooltip": true,
"Transform": {
"posX": -50.369,

View File

@ -4,6 +4,700 @@
"y": 0,
"z": 0
},
"AttachedSnapPoints": [
{
"Position": {
"x": 1.53,
"y": 0.1,
"z": -1.09
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 1.53,
"y": 0.1,
"z": -0.76
}
},
{
"Position": {
"x": 1.53,
"y": 0.1,
"z": -0.43
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 1.53,
"y": 0.1,
"z": -0.1
}
},
{
"Position": {
"x": 1.53,
"y": 0.1,
"z": 0.23
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 1.53,
"y": 0.1,
"z": 0.56
}
},
{
"Position": {
"x": 1.53,
"y": 0.1,
"z": 0.89
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 1.53,
"y": 0.1,
"z": 1.22
}
},
{
"Position": {
"x": 1.53,
"y": 0.1,
"z": 1.55
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 1.148,
"y": 0.1,
"z": -1.09
}
},
{
"Position": {
"x": 1.148,
"y": 0.1,
"z": -0.76
}
},
{
"Position": {
"x": 1.148,
"y": 0.1,
"z": -0.43
}
},
{
"Position": {
"x": 1.148,
"y": 0.1,
"z": -0.1
}
},
{
"Position": {
"x": 1.148,
"y": 0.1,
"z": 0.23
}
},
{
"Position": {
"x": 1.148,
"y": 0.1,
"z": 0.56
}
},
{
"Position": {
"x": 1.148,
"y": 0.1,
"z": 0.89
}
},
{
"Position": {
"x": 1.148,
"y": 0.1,
"z": 1.22
}
},
{
"Position": {
"x": 1.148,
"y": 0.1,
"z": 1.55
}
},
{
"Position": {
"x": 0.765,
"y": 0.1,
"z": -1.09
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 0.765,
"y": 0.1,
"z": -0.76
}
},
{
"Position": {
"x": 0.765,
"y": 0.1,
"z": -0.43
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 0.765,
"y": 0.1,
"z": -0.1
}
},
{
"Position": {
"x": 0.765,
"y": 0.1,
"z": 0.23
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 0.765,
"y": 0.1,
"z": 0.56
}
},
{
"Position": {
"x": 0.765,
"y": 0.1,
"z": 0.89
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 0.765,
"y": 0.1,
"z": 1.22
}
},
{
"Position": {
"x": 0.765,
"y": 0.1,
"z": 1.55
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 0.383,
"y": 0.1,
"z": -1.09
}
},
{
"Position": {
"x": 0.383,
"y": 0.1,
"z": -0.76
}
},
{
"Position": {
"x": 0.383,
"y": 0.1,
"z": -0.43
}
},
{
"Position": {
"x": 0.383,
"y": 0.1,
"z": -0.1
}
},
{
"Position": {
"x": 0.383,
"y": 0.1,
"z": 0.23
}
},
{
"Position": {
"x": 0.383,
"y": 0.1,
"z": 0.56
}
},
{
"Position": {
"x": 0.383,
"y": 0.1,
"z": 0.89
}
},
{
"Position": {
"x": 0.383,
"y": 0.1,
"z": 1.22
}
},
{
"Position": {
"x": 0.383,
"y": 0.1,
"z": 1.55
}
},
{
"Position": {
"x": 0,
"y": 0.1,
"z": -1.09
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 0,
"y": 0.1,
"z": -0.76
}
},
{
"Position": {
"x": 0,
"y": 0.1,
"z": -0.43
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 0,
"y": 0.1,
"z": -0.1
}
},
{
"Position": {
"x": 0,
"y": 0.1,
"z": 0.23
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 0,
"y": 0.1,
"z": 0.56
}
},
{
"Position": {
"x": 0,
"y": 0.1,
"z": 0.89
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": 0,
"y": 0.1,
"z": 1.22
}
},
{
"Position": {
"x": 0,
"y": 0.1,
"z": 1.55
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -0.383,
"y": 0.1,
"z": -1.09
}
},
{
"Position": {
"x": -0.383,
"y": 0.1,
"z": -0.76
}
},
{
"Position": {
"x": -0.383,
"y": 0.1,
"z": -0.43
}
},
{
"Position": {
"x": -0.383,
"y": 0.1,
"z": -0.1
}
},
{
"Position": {
"x": -0.383,
"y": 0.1,
"z": 0.23
}
},
{
"Position": {
"x": -0.383,
"y": 0.1,
"z": 0.56
}
},
{
"Position": {
"x": -0.383,
"y": 0.1,
"z": 0.89
}
},
{
"Position": {
"x": -0.383,
"y": 0.1,
"z": 1.22
}
},
{
"Position": {
"x": -0.383,
"y": 0.1,
"z": 1.55
}
},
{
"Position": {
"x": -0.765,
"y": 0.1,
"z": -1.09
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -0.765,
"y": 0.1,
"z": -0.76
}
},
{
"Position": {
"x": -0.765,
"y": 0.1,
"z": -0.43
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -0.765,
"y": 0.1,
"z": -0.1
}
},
{
"Position": {
"x": -0.765,
"y": 0.1,
"z": 0.23
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -0.765,
"y": 0.1,
"z": 0.56
}
},
{
"Position": {
"x": -0.765,
"y": 0.1,
"z": 0.89
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -0.765,
"y": 0.1,
"z": 1.22
}
},
{
"Position": {
"x": -0.765,
"y": 0.1,
"z": 1.55
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -1.148,
"y": 0.1,
"z": -1.09
}
},
{
"Position": {
"x": -1.148,
"y": 0.1,
"z": -0.76
}
},
{
"Position": {
"x": -1.148,
"y": 0.1,
"z": -0.43
}
},
{
"Position": {
"x": -1.148,
"y": 0.1,
"z": -0.1
}
},
{
"Position": {
"x": -1.148,
"y": 0.1,
"z": 0.23
}
},
{
"Position": {
"x": -1.148,
"y": 0.1,
"z": 0.56
}
},
{
"Position": {
"x": -1.148,
"y": 0.1,
"z": 0.89
}
},
{
"Position": {
"x": -1.148,
"y": 0.1,
"z": 1.22
}
},
{
"Position": {
"x": -1.148,
"y": 0.1,
"z": 1.55
}
},
{
"Position": {
"x": -1.53,
"y": 0.1,
"z": -1.09
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -1.53,
"y": 0.1,
"z": -0.76
}
},
{
"Position": {
"x": -1.53,
"y": 0.1,
"z": -0.43
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -1.53,
"y": 0.1,
"z": -0.1
}
},
{
"Position": {
"x": -1.53,
"y": 0.1,
"z": 0.23
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -1.53,
"y": 0.1,
"z": 0.56
}
},
{
"Position": {
"x": -1.53,
"y": 0.1,
"z": 0.89
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
},
{
"Position": {
"x": -1.53,
"y": 0.1,
"z": 1.22
}
},
{
"Position": {
"x": -1.53,
"y": 0.1,
"z": 1.55
},
"Rotation": {
"x": 0,
"y": 0,
"z": 0
}
}
],
"Autoraise": true,
"ColorDiffuse": {
"b": 1,

View File

@ -36,6 +36,7 @@ local IS_RESHUFFLING = false
local bagSearchers = {}
local hideTitleSplashWaitFunctionId = nil
local playmatAPI = require("playermat/PlaymatApi")
local playAreaAPI = require("core/PlayAreaApi")
---------------------------------------------------------
-- data for tokens
@ -819,6 +820,11 @@ function applyOptionPanelChange(id, state)
-- update master clue counter
getObjectFromGUID("4a3aa4").setVar("useClickableCounters", state)
-- option: Draw 1 button
elseif id == "PlayAreaSnapTags" then
playAreaAPI.setLimitSnapsByType(state)
optionPanel[id] = state
-- option: Show Title on placing scenarios
elseif id == "showTitleSplash" then
optionPanel[id] = state
@ -945,6 +951,7 @@ function onClick_defaultSettings()
-- clean reset of variable
optionPanel = {
useSnapTags = true,
PlayAreaSnapTags = false,
showDrawButton = false,
useClueClickers = false,
showTitleSplash = true,

View File

@ -443,3 +443,56 @@ end
function showLocationLinks()
return not LOC_LINK_EXCLUDE_SCENARIOS[currentScenario]
end
-- Sets this playmat's snap points to limit snapping to locations or not.
-- If matchTypes is false, snap points will be reset to snap all cards.
---@param matchTypes Boolean Whether snap points should only snap for the matching card types.
function setLimitSnapsByType(matchTypes)
local snaps = self.getSnapPoints()
for i, snap in ipairs(snaps) do
local snapTags = snaps[i].tags
if matchTypes then
if snapTags == nil then
snaps[i].tags = { "Location" }
else
table.insert(snaps[i].tags, "Location")
end
else
snaps[i].tags = nil
end
end
self.setSnapPoints(snaps)
end
-- rebuilds local snap points (could be useful in the future again)
function buildSnaps()
local upperleft = { x = 1.53, z = -1.09}
local lowerright = {x = -1.53, z = 1.55}
local snaps = {}
-- creates 81 snap points, for uneven rows + columns it makes a rotation snap point
for i = 1, 9 do
for j = 1, 9 do
local snap = {}
snap.position = {}
snap.position.x = round(upperleft.x - (upperleft.x - lowerright.x) * (i - 1) / 8, 3)
snap.position.y = 0.1
snap.position.z = round(upperleft.z - (upperleft.z - lowerright.z) * (j - 1) / 8, 3)
-- enable rotation snaps for uneven rows / columns
if (i % 2 ~= 0) and (j % 2 ~= 0) then
snap.rotation = {0, 0, 0}
snap.rotation_snap = true
end
table.insert(snaps, snap)
end
end
self.setSnapPoints(snaps)
end
-- utility function
function round(num, numDecimalPlaces)
local mult = 10^(numDecimalPlaces or 0)
return math.floor(num * mult + 0.5) / mult
end

View File

@ -41,5 +41,12 @@ do
getObjectFromGUID(PLAY_AREA_GUID).call("onScenarioChanged", scenarioName)
end
-- Sets this playmat's snap points to limit snapping to locations or not.
-- If matchTypes is false, snap points will be reset to snap all cards.
---@param matchTypes Boolean Whether snap points should only snap for the matching card types.
PlayAreaApi.setLimitSnapsByType = function(matchCardTypes)
getObjectFromGUID(PLAY_AREA_GUID).call("setLimitSnapsByType", matchCardTypes)
end
return PlayAreaApi
end

View File

@ -142,6 +142,20 @@
</Cell>
</Row>
<!-- Option: play area snap tags -->
<Row class="option-text">
<Cell class="option-text">
<VerticalLayout class="text-column">
<Text class="option-header">Enable snap tags for play area</Text>
<Text class="description">Only cards with the tag "Location" will snap (official cards are supported by default). Disable this if you are having issues with custom content.</Text>
</VerticalLayout>
</Cell>
<Cell class="option-button">
<Toggle id="PlayAreaSnapTags"
onValueChanged="onClick_toggleOption(PlayAreaSnapTags)"/>
</Cell>
</Row>
<!-- Option: splash scenario name on setup -->
<Row class="option-text">
<Cell class="option-text">