updated Nkosi and added slot XML

This commit is contained in:
Chr1Z93 2024-04-26 01:36:58 +02:00
parent c9b8ae3a51
commit 32bf52d3b4
7 changed files with 549 additions and 472 deletions

View File

@ -1,34 +1,9 @@
[
{
"Name": "refresh",
"Type": 0,
"URL": "http://cloud-3.steamusercontent.com/ugc/1695031152736214852/EC3BBEF1A1788381A8F4C5ACB7FB27770CAF03C5/"
},
{
"Name": "close",
"Type": 0,
"URL": "http://cloud-3.steamusercontent.com/ugc/1695031152736214756/2EEB07E453A7ECF4BE5A1030A253185B37A7CDAB/"
},
{
"Name": "cthulhu",
"Type": 0,
"URL": "http://cloud-3.steamusercontent.com/ugc/1782854877010107768/BC6A97F193385D01C1A9149B68923F55A284CB2D/"
},
{
"Name": "dark-cult",
"Type": 0,
"URL": "http://cloud-3.steamusercontent.com/ugc/1782854877010108105/08594607341D6537C28A08A34CE82159025AB8DB/"
},
{
"Name": "yog-sothoth",
"Type": 0,
"URL": "http://cloud-3.steamusercontent.com/ugc/1782854877010107124/D8042D1A1B08CFB7E76488B09216B4611D85A2B9/"
},
{
"Name": "elder-sign",
"Type": 0,
"URL": "http://cloud-3.steamusercontent.com/ugc/1782854877010107442/43BC029410751208A90AE7FDEBCB587A0E9403D7/"
},
{
"Name": "devourer",
"Type": 0,
@ -55,40 +30,15 @@
"URL": "http://cloud-3.steamusercontent.com/ugc/2026086584372569912/5CB461AEAE2E59D3064D90A776EB86C46081EC78/"
},
{
"Name": "font_arkhamslim",
"Name": "font_arkhamicons",
"Type": 1,
"URL": "http://cloud-3.steamusercontent.com/ugc/2510267299454546112/8CDF773519FEC8C488569072280AC848BCC293D5/"
},
{
"Name": "font_birmingham",
"Type": 1,
"URL": "http://cloud-3.steamusercontent.com/ugc/2027213118466443497/3CF9BB9AF968D245961494CC9A151774EB9BA638/"
},
{
"Name": "font_columbus",
"Type": 1,
"URL": "http://cloud-3.steamusercontent.com/ugc/2027213118466515872/F473E4ACC75ACB6CE07457C45290B4912E0B3286/"
},
{
"Name": "font_oldremington",
"Type": 1,
"URL": "http://cloud-3.steamusercontent.com/ugc/2027213118466515932/AFCE53F1E1D9580D166F53AD9EB0D77A331D4A26/"
"URL": "http://cloud-3.steamusercontent.com/ugc/2462982115649258367/C20CC4C299A6FE5F1ECAB968E15BE590337CC019/"
},
{
"Name": "font_teutonic-arkham",
"Type": 1,
"URL": "http://cloud-3.steamusercontent.com/ugc/2027213118467703445/89328E273B4C5180BF491516CE998DE3C604E162/"
},
{
"Name": "font_uglyqua",
"Type": 1,
"URL": "http://cloud-3.steamusercontent.com/ugc/2027213118466516005/113C19D37CFFA9E554394FD5B11B32967F846A62/"
},
{
"Name": "font_chinese_fzlibian",
"Type": 1,
"URL": "http://cloud-3.steamusercontent.com/ugc/2028355502896482829/8DAB311590B97586309E66D795AC2C43D4913188/"
},
{
"Name": "header_cover",
"Type": 0,
@ -124,11 +74,6 @@
"Type": 0,
"URL": "https://i.imgur.com/6MReiEO.png"
},
{
"Name": "Inv-Roland",
"Type": 0,
"URL": "https://i.imgur.com/lx6unDY.png"
},
{
"Name": "NextArrow",
"Type": 0,
@ -139,6 +84,11 @@
"Type": 0,
"URL": "https://i.imgur.com/8qmTXwt.png"
},
{
"Name": "Inv-Roland",
"Type": 0,
"URL": "https://i.imgur.com/lx6unDY.png"
},
{
"Name": "Inv-Mandy",
"Type": 0,
@ -285,7 +235,7 @@
"URL": "http://cloud-3.steamusercontent.com/ugc/2510267932886739653/CB7AA2D73777EF5938A6E6CD664B2ABA52B6E20A/"
},
{
"Name": "token-custom",
"Name": "token-custom-token",
"Type": 0,
"URL": "http://cloud-3.steamusercontent.com/ugc/2380784374792650571/E4C2B2B69282A4EE15FE290FF6B08BEFC8FCA65C/"
}

View File

@ -57,29 +57,9 @@
},
{
"Position": {
"x": -0.631,
"y": 0.1,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.616,
"y": 0.102,
"z": 0.024
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.177,
"x": 1.758,
"y": 0.101,
"z": 0.032
"z": 0.04
},
"Tags": [
"Asset"
@ -87,28 +67,18 @@
},
{
"Position": {
"x": -0.174,
"x": 1.371,
"y": 0.1,
"z": 0.038
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.98,
"y": 0.099,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.212,
"y": 0.1,
"z": 0.559
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.217,
"y": 0.1,
"z": 0.035
},
"Tags": [
@ -127,28 +97,8 @@
},
{
"Position": {
"x": 0.605,
"x": 0.217,
"y": 0.1,
"z": 0.555
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.977,
"y": 0.099,
"z": 0.556
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.98,
"y": 0.099,
"z": 0.035
},
"Tags": [
@ -157,9 +107,9 @@
},
{
"Position": {
"x": 1.371,
"y": 0.1,
"z": 0.038
"x": -0.177,
"y": 0.101,
"z": 0.032
},
"Tags": [
"Asset"
@ -167,9 +117,9 @@
},
{
"Position": {
"x": 1.371,
"y": 0.099,
"z": 0.558
"x": -0.616,
"y": 0.102,
"z": 0.024
},
"Tags": [
"Asset"
@ -187,9 +137,59 @@
},
{
"Position": {
"x": 1.758,
"y": 0.101,
"z": 0.04
"x": 1.371,
"y": 0.099,
"z": 0.558
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.977,
"y": 0.099,
"z": 0.556
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.605,
"y": 0.1,
"z": 0.555
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.212,
"y": 0.1,
"z": 0.559
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.174,
"y": 0.099,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.631,
"y": 0.1,
"z": 0.551
},
"Tags": [
"Asset"

View File

@ -57,29 +57,9 @@
},
{
"Position": {
"x": -0.631,
"y": 0.1,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.616,
"y": 0.102,
"z": 0.024
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.177,
"x": 1.758,
"y": 0.101,
"z": 0.032
"z": 0.04
},
"Tags": [
"Asset"
@ -87,28 +67,18 @@
},
{
"Position": {
"x": -0.174,
"x": 1.371,
"y": 0.1,
"z": 0.038
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.98,
"y": 0.099,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.212,
"y": 0.1,
"z": 0.559
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.217,
"y": 0.1,
"z": 0.035
},
"Tags": [
@ -127,28 +97,8 @@
},
{
"Position": {
"x": 0.605,
"x": 0.217,
"y": 0.1,
"z": 0.555
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.977,
"y": 0.099,
"z": 0.556
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.98,
"y": 0.099,
"z": 0.035
},
"Tags": [
@ -157,9 +107,9 @@
},
{
"Position": {
"x": 1.371,
"y": 0.1,
"z": 0.038
"x": -0.177,
"y": 0.101,
"z": 0.032
},
"Tags": [
"Asset"
@ -167,9 +117,9 @@
},
{
"Position": {
"x": 1.371,
"y": 0.099,
"z": 0.558
"x": -0.616,
"y": 0.102,
"z": 0.024
},
"Tags": [
"Asset"
@ -187,9 +137,59 @@
},
{
"Position": {
"x": 1.758,
"y": 0.101,
"z": 0.04
"x": 1.371,
"y": 0.099,
"z": 0.558
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.977,
"y": 0.099,
"z": 0.556
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.605,
"y": 0.1,
"z": 0.555
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.212,
"y": 0.1,
"z": 0.559
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.174,
"y": 0.099,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.631,
"y": 0.1,
"z": 0.551
},
"Tags": [
"Asset"

View File

@ -57,29 +57,9 @@
},
{
"Position": {
"x": -0.631,
"y": 0.1,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.616,
"y": 0.102,
"z": 0.024
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.177,
"x": 1.758,
"y": 0.101,
"z": 0.032
"z": 0.04
},
"Tags": [
"Asset"
@ -87,28 +67,18 @@
},
{
"Position": {
"x": -0.174,
"x": 1.371,
"y": 0.1,
"z": 0.038
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.98,
"y": 0.099,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.212,
"y": 0.1,
"z": 0.559
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.217,
"y": 0.1,
"z": 0.035
},
"Tags": [
@ -127,28 +97,8 @@
},
{
"Position": {
"x": 0.605,
"x": 0.217,
"y": 0.1,
"z": 0.555
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.977,
"y": 0.099,
"z": 0.556
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.98,
"y": 0.099,
"z": 0.035
},
"Tags": [
@ -157,9 +107,9 @@
},
{
"Position": {
"x": 1.371,
"y": 0.1,
"z": 0.038
"x": -0.177,
"y": 0.101,
"z": 0.032
},
"Tags": [
"Asset"
@ -167,9 +117,9 @@
},
{
"Position": {
"x": 1.371,
"y": 0.099,
"z": 0.558
"x": -0.616,
"y": 0.102,
"z": 0.024
},
"Tags": [
"Asset"
@ -187,9 +137,59 @@
},
{
"Position": {
"x": 1.758,
"y": 0.101,
"z": 0.04
"x": 1.371,
"y": 0.099,
"z": 0.558
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.977,
"y": 0.099,
"z": 0.556
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.605,
"y": 0.1,
"z": 0.555
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.212,
"y": 0.1,
"z": 0.559
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.174,
"y": 0.099,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.631,
"y": 0.1,
"z": 0.551
},
"Tags": [
"Asset"

View File

@ -57,29 +57,9 @@
},
{
"Position": {
"x": -0.631,
"y": 0.1,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.616,
"y": 0.102,
"z": 0.024
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.177,
"x": 1.758,
"y": 0.101,
"z": 0.032
"z": 0.04
},
"Tags": [
"Asset"
@ -87,28 +67,18 @@
},
{
"Position": {
"x": -0.174,
"x": 1.371,
"y": 0.1,
"z": 0.038
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.98,
"y": 0.099,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.212,
"y": 0.1,
"z": 0.559
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.217,
"y": 0.1,
"z": 0.035
},
"Tags": [
@ -127,28 +97,8 @@
},
{
"Position": {
"x": 0.605,
"x": 0.217,
"y": 0.1,
"z": 0.555
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.977,
"y": 0.099,
"z": 0.556
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.98,
"y": 0.099,
"z": 0.035
},
"Tags": [
@ -157,9 +107,9 @@
},
{
"Position": {
"x": 1.371,
"y": 0.1,
"z": 0.038
"x": -0.177,
"y": 0.101,
"z": 0.032
},
"Tags": [
"Asset"
@ -167,9 +117,9 @@
},
{
"Position": {
"x": 1.371,
"y": 0.099,
"z": 0.558
"x": -0.616,
"y": 0.102,
"z": 0.024
},
"Tags": [
"Asset"
@ -187,9 +137,59 @@
},
{
"Position": {
"x": 1.758,
"y": 0.101,
"z": 0.04
"x": 1.371,
"y": 0.099,
"z": 0.558
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.977,
"y": 0.099,
"z": 0.556
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.605,
"y": 0.1,
"z": 0.555
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": 0.212,
"y": 0.1,
"z": 0.559
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.174,
"y": 0.099,
"z": 0.551
},
"Tags": [
"Asset"
]
},
{
"Position": {
"x": -0.631,
"y": 0.1,
"z": 0.551
},
"Tags": [
"Asset"

View File

@ -2,28 +2,17 @@ local chaosBagApi = require("chaosbag/ChaosBagApi")
local guidReferenceApi = require("core/GUIDReferenceApi")
local playmatApi = require("playermat/PlaymatApi")
local tokenNames = {
"Skull",
"Cultist",
"Tablet",
"Elder Thing",
"Auto-fail",
"Bless",
"Curse",
"Frost",
"Custom Token"
}
local dataForToken = {
["Skull"] = { color = "#4A0400E6", icon = "token-skull" },
["Cultist"] = { color = "#173B0BE6", icon = "token-cultist" },
["Tablet"] = { color = "#1D2238E6", icon = "token-tablet" },
["Elder Thing"] = { color = "#4D2331E6", icon = "token-elder-thing" },
["Auto-fail"] = { color = "#9B0004E6", icon = "token-auto-fail" },
["Bless"] = { color = "#9D702CE6", icon = "token-bless" },
["Curse"] = { color = "#633A84E6", icon = "token-curse" },
["Frost"] = { color = "#404450E6", icon = "token-frost" },
[""] = { color = "#77674DE6", icon = "token-custom" }
-- XML background color for each token
local tokenColor = {
["Skull"] = "#4A0400E6",
["Cultist"] = "#173B0BE6",
["Tablet"] = "#1D2238E6",
["Elder Thing"] = "#4D2331E6",
["Auto-fail"] = "#9B0004E6",
["Bless"] = "#9D702CE6",
["Curse"] = "#633A84E6",
["Frost"] = "#404450E6",
[""] = "#77674DE6"
}
local sigil
@ -36,13 +25,18 @@ function onLoad(savedData)
self.addContextMenuItem("Enable Helper", chooseSigil)
sigil = JSON.decode(savedData)
if sigil and sigil ~= nil then
makeXMLButton(sigil)
makeXMLButton()
self.clearContextMenu()
self.addContextMenuItem("Clear Helper", deleteButtons)
end
end
function makeXMLButton(chosenToken)
function makeXMLButton()
-- get name of the icon for the sigil ("token" + lowercase name without space characters)
local sigilName = Global.call("getReadableTokenName", sigil)
local iconName = "token-" .. string.lower(sigilName)
iconName = iconName:gsub("%s", "-")
self.UI.setXmlTable({
{
tag = "Button",
@ -55,15 +49,15 @@ function makeXMLButton(chosenToken)
padding = "50 50 50 50",
font = "font_teutonic-arkham",
fontSize = 300,
iconWidth = 400,
iconWidth = "400",
iconAlignment = "Right",
onClick = "resolveSigil",
id = sigil,
icon = dataForToken[sigil].icon,
color = dataForToken[sigil].color,
textColor = "White",
icon = iconName,
color = tokenColor[sigil],
textColor = "White"
},
value = "Resolve",
value = "Resolve"
}
}
)
@ -73,10 +67,18 @@ end
function chooseSigil(playerColor)
self.clearContextMenu()
self.addContextMenuItem("Clear Helper", deleteButtons)
Player[playerColor].showOptionsDialog("Choose Sigil", tokenNames, 1,
-- get list of readable names
local readableNames = {}
for token, _ in pairs(tokenColor) do
table.insert(readableNames, Global.call("getReadableTokenName", token))
end
-- prompt player to choose sigil
Player[playerColor].showOptionsDialog("Choose Sigil", readableNames, 1,
function(chosenToken)
sigil = Global.call("getChaosTokenName", chosenToken)
makeXMLButton(sigil)
makeXMLButton()
end
)
end
@ -92,14 +94,16 @@ end
function resolveSigil()
local tokensInPlay = chaosBagApi.getTokensInPlay()
local chaosbag = chaosBagApi.findChaosBag()
local match = false
for i, obj in ipairs(chaosbag.getObjects()) do
for _, obj in ipairs(chaosbag.getObjects()) do
-- if there are any sigils in the bag
if obj.nickname == sigil then
match = true
break
end
end
if not match then
broadcastToAll(Global.call("getReadableTokenName", sigil) .. " not found in chaos bag", "Red")
return
@ -107,8 +111,11 @@ function resolveSigil()
local matchingSymbolsInPlay = {}
for j, token in ipairs(tokensInPlay) do
if (token.getName() == "Cultist" or token.getName() == "Elder Thing" or token.getName() == "Tablet") and token.getName() ~= sigil then
for _, token in ipairs(tokensInPlay) do
if (token.getName() == "Cultist"
or token.getName() == "Tablet"
or token.getName() == "Elder Thing")
and token.getName() ~= sigil then
matchingSymbolsInPlay[#matchingSymbolsInPlay + 1] = token
end
end
@ -117,7 +124,7 @@ function resolveSigil()
broadcastToAll("No eligible symbol token found in play area", "Red")
return
elseif #matchingSymbolsInPlay > 1 then
for j, token in ipairs(matchingSymbolsInPlay) do
for _, token in ipairs(matchingSymbolsInPlay) do
-- draw XML to return token to bag
token.UI.setXmlTable({
{
@ -131,7 +138,7 @@ function resolveSigil()
rotation = "0 0 180",
position = "0 0 -15",
color = "rgba(0,0,0,0.7)",
onClick = self.getGUID() .. "/drawSigil(" .. token.getGUID() .. ")",
onClick = self.getGUID() .. "/drawSigil(" .. token.getGUID() .. ")"
},
children = {
{
@ -140,18 +147,18 @@ function resolveSigil()
fontSize = "100",
font = "font_teutonic-arkham",
color = "#ffffff",
text = "Nkosi",
},
text = "Nkosi"
}
},
{
tag = "Text",
attributes = {
fontSize = "125",
font = "font_arkhamslim",
font = "font_arkhamicons",
color = "#ffffff",
text = "U",
},
},
text = "u"
}
}
}
}
})
@ -162,15 +169,17 @@ function resolveSigil()
end
function drawSigil(player, tokenGUID)
returnedToken = getObjectFromGUID(tokenGUID)
local returnedToken = getObjectFromGUID(tokenGUID)
local matColor = playmatApi.getMatColorByPosition(returnedToken.getPosition())
local mat = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat")
chaosBagApi.drawChaosToken(mat, true, sigil, _, returnedToken)
local tokensInPlay = chaosBagApi.getTokensInPlay()
for j, returnedToken in ipairs(tokensInPlay) do
if returnedToken.getName() == "Cultist" or returnedToken.getName() == "Elder Thing" or returnedToken.getName() == "Tablet" then
returnedToken.UI.setXml("")
-- remove XML from tokens in play
for _, token in ipairs(chaosBagApi.getTokensInPlay()) do
if token.getName() == "Cultist"
or token.getName() == "Tablet"
or token.getName() == "Elder Thing" then
token.UI.setXml("")
end
end
end

View File

@ -142,9 +142,21 @@ function onLoad(savedData)
font_size = 180
})
self.createButton({
label = "Edit Slots",
click_function = "editSlots",
function_owner = self,
position = { 1.84, 0.1, 0.84 },
scale = { 0.12, 0.12, 0.12 },
width = 800,
height = 280,
font_size = 180
})
showDrawButton(isDrawButtonVisible)
math.randomseed(os.time())
Wait.time(function() collisionEnabled = true end, 0.1)
updateSlots()
end
---------------------------------------------------------
@ -328,7 +340,9 @@ function doUpkeep(_, clickedByColor, isRightClick)
-- draw a card (with handling for Patrice and Forced Learning)
if activeInvestigatorId == "06005" then
if forcedLearning then
printToColor("Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.", messageColor)
printToColor(
"Wow, did you really take 'Versatile' to play Patrice with 'Forced Learning'? Choose which draw replacement effect takes priority and draw cards accordingly.",
messageColor)
else
local handSize = #Player[playerColor].getHandObjects()
if handSize < 5 then
@ -497,6 +511,111 @@ function doDiscardOne()
end
end
---------------------------------------------------------
-- playmat slot modifying
---------------------------------------------------------
-- translation table for slot names to characters for special font
local slotFontCharacter = {
["any"] = "",
["Accessory"] = "C",
["Ally"] = "E",
["Arcane"] = "G",
["Body"] = "K",
["Hand (right)"] = "M",
["Hand (left)"] = "M",
["Hand x2"] = "N",
["Tarot"] = "A"
}
-- top left to bottom right
local slotData = {
"any",
"any",
"any",
"Tarot",
"Hand (left)",
"Hand (right)",
"Ally",
-- 2nd row
"any",
"any",
"any",
"Accessory",
"Arcane",
"Arcane",
"Body"
}
function updateSlots()
local xml = {}
local snapId = 0
for _, snap in ipairs(self.getSnapPoints()) do
if inArea(snap.position, MAIN_PLAY_AREA) then
snapId = snapId + 1
local slotName = slotData[snapId]
local slotRotation = "0 0 180"
if slotName == "Hand (left)" then
slotRotation = "0 180 180"
end
-- increased coordinates to account for scale (0.1)
local x = snap.position.x * 100
local y = snap.position.z * 100
local slotXML = {
tag = "Panel",
attributes = {
scale = "0.1 0.1 1",
width="150",
height="150",
rotation = slotRotation,
position = x .. " " .. y .. " -11"
},
children = {
{
tag = "Text",
attributes = {
id = "slot" .. snapId,
fontSize = "145",
font = "font_arkhamicons",
color = "#414141CB",
text = slotFontCharacter[slotName]
}
}
}
}
table.insert(xml, slotXML)
end
end
self.UI.setXmlTable(xml)
end
function editSlots()
for i = 1, #slotData do
self.UI.setAttribute("slot" .. i, "onClick", "slotClickfunction")
end
end
function slotClickfunction(player, _, id)
local index = id:gsub("slot", "")
local slotNames = {}
for slotName, _ in pairs(slotFontCharacter) do
table.insert(slotNames, slotName)
end
-- prompt player to choose symbol
player.showOptionsDialog("Choose Slot Symbol", slotNames, slotData[index],
function(chosenSlot, chosenIndex)
self.UI.setAttribute(id, "text", slotFontCharacter[chosenSlot])
slotData[chosenIndex] = chosenSlot
end
)
end
---------------------------------------------------------
-- color related functions
---------------------------------------------------------
@ -895,8 +1014,7 @@ end
function setLimitSnapsByType(matchTypes)
local snaps = self.getSnapPoints()
for i, snap in ipairs(snaps) do
local snapPos = snap.position
if inArea(snapPos, MAIN_PLAY_AREA) then
if inArea(snap.position, MAIN_PLAY_AREA) then
local snapTags = snaps[i].tags
if matchTypes then
if snapTags == nil then
@ -908,7 +1026,7 @@ function setLimitSnapsByType(matchTypes)
snaps[i].tags = nil
end
end
if inArea(snapPos, INVESTIGATOR_AREA) then
if inArea(snap.position, INVESTIGATOR_AREA) then
local snapTags = snaps[i].tags
if matchTypes then
if snapTags == nil then