added more options
This commit is contained in:
parent
8c165b6fa0
commit
8c98334979
@ -39,6 +39,11 @@
|
|||||||
"Type": 0,
|
"Type": 0,
|
||||||
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Name": "option_button",
|
||||||
|
"Type": 0,
|
||||||
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2466368617694733080/433021454606C80875A2D25480910CDFC05DC115/"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Name": "font_arkhamicons",
|
"Name": "font_arkhamicons",
|
||||||
"Type": 1,
|
"Type": 1,
|
||||||
|
@ -352,6 +352,11 @@
|
|||||||
"Name": "option_off",
|
"Name": "option_off",
|
||||||
"Type": 0,
|
"Type": 0,
|
||||||
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "option_button",
|
||||||
|
"Type": 0,
|
||||||
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2466368617694733080/433021454606C80875A2D25480910CDFC05DC115/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Description": "",
|
"Description": "",
|
||||||
|
@ -352,6 +352,11 @@
|
|||||||
"Name": "option_off",
|
"Name": "option_off",
|
||||||
"Type": 0,
|
"Type": 0,
|
||||||
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "option_button",
|
||||||
|
"Type": 0,
|
||||||
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2466368617694733080/433021454606C80875A2D25480910CDFC05DC115/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Description": "",
|
"Description": "",
|
||||||
|
@ -352,6 +352,11 @@
|
|||||||
"Name": "option_off",
|
"Name": "option_off",
|
||||||
"Type": 0,
|
"Type": 0,
|
||||||
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "option_button",
|
||||||
|
"Type": 0,
|
||||||
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2466368617694733080/433021454606C80875A2D25480910CDFC05DC115/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Description": "",
|
"Description": "",
|
||||||
|
@ -352,6 +352,11 @@
|
|||||||
"Name": "option_off",
|
"Name": "option_off",
|
||||||
"Type": 0,
|
"Type": 0,
|
||||||
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2462982115668996901/D6438ECBB11DECC6DB9987589FF526FBAD4D2368/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "option_button",
|
||||||
|
"Type": 0,
|
||||||
|
"URL": "https://steamusercontent-a.akamaihd.net/ugc/2466368617694733080/433021454606C80875A2D25480910CDFC05DC115/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Description": "",
|
"Description": "",
|
||||||
|
@ -11,7 +11,7 @@ function onLoad()
|
|||||||
buttonParamaters.hover_color = "White"
|
buttonParamaters.hover_color = "White"
|
||||||
buttonParamaters.label = 0
|
buttonParamaters.label = 0
|
||||||
buttonParamaters.click_function = "none"
|
buttonParamaters.click_function = "none"
|
||||||
buttonParamaters.position = Vector(0, 0.11, -0.4)
|
buttonParamaters.position = Vector(0, 0.11, -0.2)
|
||||||
buttonParamaters.height = 0
|
buttonParamaters.height = 0
|
||||||
buttonParamaters.width = 0
|
buttonParamaters.width = 0
|
||||||
buttonParamaters.font_size = 500
|
buttonParamaters.font_size = 500
|
||||||
@ -20,7 +20,7 @@ function onLoad()
|
|||||||
|
|
||||||
-- index 1: button to toggle "des"
|
-- index 1: button to toggle "des"
|
||||||
buttonParamaters.label = "DES: ✗"
|
buttonParamaters.label = "DES: ✗"
|
||||||
buttonParamaters.position.z = 0.25
|
buttonParamaters.position.z = 0.45
|
||||||
buttonParamaters.font_size = 120
|
buttonParamaters.font_size = 120
|
||||||
self.createButton(buttonParamaters)
|
self.createButton(buttonParamaters)
|
||||||
|
|
||||||
|
@ -267,11 +267,6 @@ function onObjectNumberTyped(hoveredObject, playerColor, number)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TTS event, used to redraw the playermat slot symbols after a delay to account for the custom font loading
|
|
||||||
function onPlayerChangeColor()
|
|
||||||
Wait.time(function() playermatApi.redrawSlotSymbols("All") end, 0.2)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- disable delete action (only applies to promoted players) and discard objects instead
|
-- disable delete action (only applies to promoted players) and discard objects instead
|
||||||
function onPlayerAction(player, action, targets)
|
function onPlayerAction(player, action, targets)
|
||||||
if action == Player.Action.Delete and not player.admin then
|
if action == Player.Action.Delete and not player.admin then
|
||||||
|
@ -14,8 +14,17 @@ local availableOptions = {
|
|||||||
{
|
{
|
||||||
id = "slotEditing",
|
id = "slotEditing",
|
||||||
title = "Enable Slot Edit Mode",
|
title = "Enable Slot Edit Mode",
|
||||||
tooltip = "Makes each slot clickable to change the symbol.",
|
|
||||||
type = "toggle"
|
type = "toggle"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id = "textureSelect",
|
||||||
|
title = "Select Playermat Texture",
|
||||||
|
type = "button"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id = "handColorSelect",
|
||||||
|
title = "Select Hand Color",
|
||||||
|
type = "button"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -68,7 +77,7 @@ local ENCOUNTER_DISCARD_POSITION = { x = -3.85, y = 1.5, z = 10.38 }
|
|||||||
local buttonParameters = {
|
local buttonParameters = {
|
||||||
label = "Upkeep",
|
label = "Upkeep",
|
||||||
click_function = "doUpkeep",
|
click_function = "doUpkeep",
|
||||||
tooltip = "Right-click to change color",
|
tooltip = "Right-click to skip resource gain and card draw",
|
||||||
function_owner = self,
|
function_owner = self,
|
||||||
position = { x = 1.82, y = 0.1, z = -0.45 },
|
position = { x = 1.82, y = 0.1, z = -0.45 },
|
||||||
scale = { 0.12, 0.12, 0.12 },
|
scale = { 0.12, 0.12, 0.12 },
|
||||||
@ -309,11 +318,6 @@ function doUpkeepFromHotkey(clickedByColor)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function doUpkeep(_, clickedByColor, isRightClick)
|
function doUpkeep(_, clickedByColor, isRightClick)
|
||||||
if isRightClick then
|
|
||||||
changeColor(clickedByColor)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
updateMessageColor(clickedByColor)
|
updateMessageColor(clickedByColor)
|
||||||
|
|
||||||
-- unexhaust cards in play zone, flip action tokens and find Forced Learning / Dream-Enhancing Serum
|
-- unexhaust cards in play zone, flip action tokens and find Forced Learning / Dream-Enhancing Serum
|
||||||
@ -379,6 +383,11 @@ function doUpkeep(_, clickedByColor, isRightClick)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if isRightClick then
|
||||||
|
printToColor("Skipping resource gain and card draw", messageColor)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- gain a resource (or two if playing Jenny Barnes)
|
-- gain a resource (or two if playing Jenny Barnes)
|
||||||
if string.match(activeInvestigatorId, "%d%d%d%d%d") == "02003" then
|
if string.match(activeInvestigatorId, "%d%d%d%d%d") == "02003" then
|
||||||
updateCounter({ type = "ResourceCounter", modifier = 2 })
|
updateCounter({ type = "ResourceCounter", modifier = 2 })
|
||||||
@ -715,15 +724,22 @@ function createXML()
|
|||||||
local bounds = self.getBoundsNormalized()
|
local bounds = self.getBoundsNormalized()
|
||||||
local setAsideDirection = bounds.center.z > 0 and 1 or -1
|
local setAsideDirection = bounds.center.z > 0 and 1 or -1
|
||||||
|
|
||||||
|
-- work out the size
|
||||||
|
local rowHeight = {
|
||||||
|
header = 200,
|
||||||
|
groupHeader = 150,
|
||||||
|
option = 150
|
||||||
|
}
|
||||||
|
local totalHeight = rowHeight.header
|
||||||
|
local scale = 0.11
|
||||||
|
|
||||||
-- main window
|
-- main window
|
||||||
local optionPanelXML = {
|
local optionPanelXML = {
|
||||||
tag = "TableLayout",
|
tag = "TableLayout",
|
||||||
attributes = {
|
attributes = {
|
||||||
scale = "0.11 0.11",
|
scale = scale .. " " .. scale,
|
||||||
width = "1000",
|
width = "1000",
|
||||||
height = "1200",
|
|
||||||
rotation = "0 0 180",
|
rotation = "0 0 180",
|
||||||
position = (setAsideDirection * 270) .. " -35 -58",
|
|
||||||
--active = "false",
|
--active = "false",
|
||||||
raycastTarget = "true",
|
raycastTarget = "true",
|
||||||
color = "#000000",
|
color = "#000000",
|
||||||
@ -737,7 +753,7 @@ function createXML()
|
|||||||
-- header
|
-- header
|
||||||
{
|
{
|
||||||
tag = "Row",
|
tag = "Row",
|
||||||
attributes = { preferredHeight = "200" },
|
attributes = { preferredHeight = rowHeight.header },
|
||||||
children = {
|
children = {
|
||||||
{
|
{
|
||||||
tag = "Cell",
|
tag = "Cell",
|
||||||
@ -761,10 +777,11 @@ function createXML()
|
|||||||
|
|
||||||
-- add options groups
|
-- add options groups
|
||||||
for groupName, groupData in pairs(availableOptions) do
|
for groupName, groupData in pairs(availableOptions) do
|
||||||
|
totalHeight = totalHeight + rowHeight.groupHeader
|
||||||
-- group header
|
-- group header
|
||||||
local groupXML = {
|
local groupXML = {
|
||||||
tag = "Row",
|
tag = "Row",
|
||||||
attributes = { preferredHeight = "150" },
|
attributes = { preferredHeight = rowHeight.groupHeader },
|
||||||
children = {
|
children = {
|
||||||
{
|
{
|
||||||
tag = "Cell",
|
tag = "Cell",
|
||||||
@ -788,13 +805,10 @@ function createXML()
|
|||||||
|
|
||||||
-- options
|
-- options
|
||||||
for _, optionData in ipairs(groupData) do
|
for _, optionData in ipairs(groupData) do
|
||||||
local optionXML = {}
|
totalHeight = totalHeight + rowHeight.option
|
||||||
if optionData.type ~= "toggle" then
|
local optionXML = {
|
||||||
log("This isn't implemented yet ;)")
|
|
||||||
else
|
|
||||||
optionXML = {
|
|
||||||
tag = "Row",
|
tag = "Row",
|
||||||
attributes = { preferredHeight = "150", tooltip = optionData.tooltip, tooltipPosition = "Left", tooltipBackgroundColor = "rgba(0,0,0,1)" },
|
attributes = { preferredHeight = rowHeight.option},
|
||||||
children = {
|
children = {
|
||||||
-- option title
|
-- option title
|
||||||
{
|
{
|
||||||
@ -813,8 +827,12 @@ function createXML()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
-- option button
|
}
|
||||||
{
|
}
|
||||||
|
|
||||||
|
local typeXML
|
||||||
|
if optionData.type == "toggle" then
|
||||||
|
typeXML = {
|
||||||
tag = "Cell",
|
tag = "Cell",
|
||||||
attributes = { padding = "10 10 5 5", color = "#333333" },
|
attributes = { padding = "10 10 5 5", color = "#333333" },
|
||||||
children = {
|
children = {
|
||||||
@ -827,23 +845,88 @@ function createXML()
|
|||||||
rectAlignment = "MiddleRight",
|
rectAlignment = "MiddleRight",
|
||||||
offsetXY = "-30 0",
|
offsetXY = "-30 0",
|
||||||
colors = "#FFFFFF|#dfdfdf",
|
colors = "#FFFFFF|#dfdfdf",
|
||||||
height = "72",
|
height = "108",
|
||||||
width = "130",
|
width = "195",
|
||||||
ignoreLayout = "True"
|
ignoreLayout = "True"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif optionData.type == "button" then
|
||||||
|
typeXML = {
|
||||||
|
tag = "Cell",
|
||||||
|
attributes = { padding = "10 10 5 5", color = "#333333" },
|
||||||
|
children = {
|
||||||
|
{
|
||||||
|
tag = "Button",
|
||||||
|
attributes = {
|
||||||
|
id = optionData.id,
|
||||||
|
image = "option_button",
|
||||||
|
onClick = "onClick_" .. optionData.id,
|
||||||
|
rectAlignment = "MiddleRight",
|
||||||
|
offsetXY = "-30 0",
|
||||||
|
colors = "#FFFFFF|#dfdfdf",
|
||||||
|
height = "108",
|
||||||
|
width = "195",
|
||||||
|
ignoreLayout = "True"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
table.insert(optionXML.children, typeXML)
|
||||||
table.insert(optionPanelXML.children, optionXML)
|
table.insert(optionPanelXML.children, optionXML)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert(xml, optionPanelXML)
|
table.insert(xml, optionPanelXML)
|
||||||
|
|
||||||
|
-- set correct height
|
||||||
|
optionPanelXML.attributes.height = totalHeight
|
||||||
|
|
||||||
|
-- set correct position to align with playermat
|
||||||
|
optionPanelXML.attributes.position = (setAsideDirection * 270) .. " " .. (- 95 + scale * totalHeight / 2) .. " -65"
|
||||||
|
|
||||||
self.UI.setXmlTable(xml)
|
self.UI.setXmlTable(xml)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function onClick_textureSelect(player)
|
||||||
|
local textureList = {}
|
||||||
|
for texture, url in pairs(nameToTexture) do
|
||||||
|
table.insert(textureList, texture)
|
||||||
|
end
|
||||||
|
player.showOptionsDialog("Select a texture:", textureList, _, updateTexture)
|
||||||
|
end
|
||||||
|
|
||||||
|
function onClick_handColorSelect(player)
|
||||||
|
local colorList = Player.getColors()
|
||||||
|
|
||||||
|
-- remove existing colors from the list of choices
|
||||||
|
for _, existingColor in ipairs(Player.getAvailableColors()) do
|
||||||
|
for i, newColor in ipairs(colorList) do
|
||||||
|
if existingColor == newColor or newColor == "Black" or newColor == "Grey" then
|
||||||
|
table.remove(colorList, i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- show the option dialog for color selection to the player that triggered this
|
||||||
|
player.showOptionsDialog("Select a new color:", colorList, _, function(color)
|
||||||
|
-- update the color of the hand zone
|
||||||
|
local handZone = ownedObjects.HandZone
|
||||||
|
handZone.setValue(color)
|
||||||
|
|
||||||
|
-- if the seated player clicked this, reseat him to the new color
|
||||||
|
if player.color == playerColor then
|
||||||
|
navigationOverlayApi.copyVisibility(playerColor, color)
|
||||||
|
Player[playerColor].changeColor(color)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- update the internal variable
|
||||||
|
playerColor = color
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
-- changes the UI state and the internal variable for the togglebuttons
|
-- changes the UI state and the internal variable for the togglebuttons
|
||||||
function onClick_toggleOption(player, _, id)
|
function onClick_toggleOption(player, _, id)
|
||||||
local state = optionPanelData[id]
|
local state = optionPanelData[id]
|
||||||
@ -932,40 +1015,6 @@ function resetSlotSymbols()
|
|||||||
updateSlotSymbols()
|
updateSlotSymbols()
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------
|
|
||||||
-- color related functions
|
|
||||||
---------------------------------------------------------
|
|
||||||
|
|
||||||
-- changes the player color
|
|
||||||
function changeColor(clickedByColor)
|
|
||||||
local colorList = Player.getColors()
|
|
||||||
|
|
||||||
-- remove existing colors from the list of choices
|
|
||||||
for _, existingColor in ipairs(Player.getAvailableColors()) do
|
|
||||||
for i, newColor in ipairs(colorList) do
|
|
||||||
if existingColor == newColor or newColor == "Black" or newColor == "Grey" then
|
|
||||||
table.remove(colorList, i)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- show the option dialog for color selection to the player that triggered this
|
|
||||||
Player[clickedByColor].showOptionsDialog("Select a new color:", colorList, _, function(color)
|
|
||||||
-- update the color of the hand zone
|
|
||||||
local handZone = ownedObjects.HandZone
|
|
||||||
handZone.setValue(color)
|
|
||||||
|
|
||||||
-- if the seated player clicked this, reseat him to the new color
|
|
||||||
if clickedByColor == playerColor then
|
|
||||||
navigationOverlayApi.copyVisibility(playerColor, color)
|
|
||||||
Player[playerColor].changeColor(color)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- update the internal variable
|
|
||||||
playerColor = color
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
-- playermat token spawning
|
-- playermat token spawning
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
@ -249,7 +249,7 @@
|
|||||||
<Cell class="group-header">
|
<Cell class="group-header">
|
||||||
<Panel class="group-header"
|
<Panel class="group-header"
|
||||||
image="header_cover">
|
image="header_cover">
|
||||||
<Text class="group-header">PLAYERMAT SETTINGS</Text>
|
<Text class="group-header">GLOBAL PLAYERMAT SETTINGS</Text>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
|
Loading…
Reference in New Issue
Block a user