added option to disable connections
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 22 KiB |
BIN
img/headers/compass.png
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 19 KiB |
BIN
img/headers/header_template.pdn
Normal file
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 24 KiB |
@ -87,22 +87,22 @@
|
||||
{
|
||||
"Name": "header_cover",
|
||||
"Type": 0,
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/5118935530977312342/0D22712378B1F9A5A1FC7DA40C355943C878DDC0/"
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/2280574378889753624/53E7443E2A9957BC5CA4D73B67D5C1C30971C9F9/"
|
||||
},
|
||||
{
|
||||
"Name": "header_acolyte",
|
||||
"Type": 0,
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/5118935530977311773/B8B2021D42CFB084AFDCCA42EE6B9A57F3E30AC6/"
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/2280574378889753484/961371448C1CB9F93D574E0F78CF51A88D0D34F6/"
|
||||
},
|
||||
{
|
||||
"Name": "header_ruins",
|
||||
"Name": "header_compass",
|
||||
"Type": 0,
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/5118935530977312917/E24A34736C912186C7AC58270E3819B6A44B3EE8/"
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/2280574378889786684/52E2A801060A523AF5DD956C72A41889B5A1D2C9/"
|
||||
},
|
||||
{
|
||||
"Name": "header_olive",
|
||||
"Type": 0,
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/5118935530977377198/4E88B41107A29D027D86E6B80D47B03617335990/"
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/2280574378889753733/F67B7B37FF7AA253B6D697E577DF54A3E76030C2/"
|
||||
},
|
||||
{
|
||||
"Name": "option_on",
|
||||
|
@ -1 +1 @@
|
||||
{"acknowledgedUpgradeVersions":[],"optionPanel":{"cardLanguage":"en","changePlayAreaImage":false,"playAreaConnectionColor":{"a":1,"b":0.4,"g":0.4,"r":0.4},"playAreaSnapTags":true,"showAttachmentHelper":false,"showCleanUpHelper":false,"showCYOA":false,"showDisplacementTool":false,"showDrawButton":false,"showHandHelper":[],"showPlayermatHider":false,"showSearchAssistant":[],"showTitleSplash":true,"useClueClickers":false,"useResourceCounters":"disabled","useSnapTags":true}}
|
||||
{"acknowledgedUpgradeVersions":[],"optionPanel":{"cardLanguage":"en","changePlayAreaImage":false,"playAreaConnectionColor":{"a":1,"b":0.4,"g":0.4,"r":0.4},"playAreaConnections":true,"playAreaSnapTags":true,"showAttachmentHelper":false,"showCleanUpHelper":false,"showCYOA":false,"showDisplacementTool":false,"showDrawButton":false,"showHandHelper":[],"showPlayermatHider":false,"showSearchAssistant":[],"showTitleSplash":true,"useClueClickers":false,"useResourceCounters":"disabled","useSnapTags":true}}
|
||||
|
@ -1 +1 @@
|
||||
{"connectionColor":{"a":1,"b":0.4,"g":0.4,"r":0.4},"trackedLocations":[]}
|
||||
{"connectionColor":{"a":1,"b":0.4,"g":0.4,"r":0.4},"connectionsEnabled":true,"trackedLocations":[]}
|
||||
|
@ -1240,6 +1240,11 @@ function applyOptionPanelChange(id, state)
|
||||
local counter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "MasterClueCounter")
|
||||
counter.setVar("useClickableCounters", state)
|
||||
|
||||
-- option: Play area snap tags
|
||||
elseif id == "playAreaConnections" then
|
||||
playAreaApi.setConnectionDrawState(state)
|
||||
optionPanel[id] = state
|
||||
|
||||
-- option: Play area connection color
|
||||
elseif id == "playAreaConnectionColor" then
|
||||
playAreaApi.setConnectionColor(state)
|
||||
@ -1399,6 +1404,7 @@ function onClick_defaultSettings()
|
||||
optionPanel = {
|
||||
cardLanguage = "en",
|
||||
playAreaConnectionColor = { 0.4, 0.4, 0.4, 1 },
|
||||
playAreaConnections = true,
|
||||
playAreaSnapTags = true,
|
||||
showAttachmentHelper = false,
|
||||
showCleanUpHelper = false,
|
||||
|
@ -18,9 +18,6 @@ local ARROW_ANGLE = 25
|
||||
-- Height to draw the connector lines, places them just above the table and always below cards
|
||||
local CONNECTION_LINE_Y = 1.529
|
||||
|
||||
-- we use this to turn off collision handling until onLoad() is complete
|
||||
local collisionEnabled = false
|
||||
|
||||
-- used for recreating the link to a custom data helper after image change
|
||||
customDataHelper = nil
|
||||
|
||||
@ -51,7 +48,7 @@ local locations = {}
|
||||
local locationConnections = {}
|
||||
local draggingGuids = {}
|
||||
local missingData = {}
|
||||
local locationData, currentScenario
|
||||
local locationData, currentScenario, connectionsEnabled
|
||||
|
||||
---------------------------------------------------------
|
||||
-- general code
|
||||
@ -61,7 +58,8 @@ function onSave()
|
||||
return JSON.encode({
|
||||
trackedLocations = locations,
|
||||
currentScenario = currentScenario,
|
||||
connectionColor = connectionColor
|
||||
connectionColor = connectionColor,
|
||||
connectionsEnabled = connectionsEnabled
|
||||
})
|
||||
end
|
||||
|
||||
@ -70,8 +68,7 @@ function onLoad(savedData)
|
||||
locations = loadedData.trackedLocations or {}
|
||||
currentScenario = loadedData.currentScenario
|
||||
connectionColor = loadedData.connectionColor or { 0.4, 0.4, 0.4, 1 }
|
||||
|
||||
Wait.time(function() collisionEnabled = true end, 1)
|
||||
connectionsEnabled = loadedData.connectionsEnabled or true
|
||||
end
|
||||
|
||||
-- Called by Custom Data Helpers to push their location data into the Data Helper. This adds the
|
||||
@ -114,7 +111,7 @@ function onCollisionEnter(collisionInfo)
|
||||
local objType = obj.name
|
||||
|
||||
-- only continue for cards
|
||||
if not collisionEnabled or (objType ~= "Card" and objType ~= "CardCustom") then
|
||||
if objType ~= "Card" and objType ~= "CardCustom" then
|
||||
if objType == "Deck" then
|
||||
table.insert(missingData, obj)
|
||||
end
|
||||
@ -353,6 +350,7 @@ end
|
||||
function drawBaseConnections()
|
||||
if not showLocationLinks() then
|
||||
locationConnections = {}
|
||||
self.setVectorLines({})
|
||||
return
|
||||
end
|
||||
local cardConnectionLines = {}
|
||||
@ -557,7 +555,7 @@ function onScenarioChanged(scenarioName)
|
||||
end
|
||||
|
||||
function showLocationLinks()
|
||||
return not LOC_LINK_EXCLUDE_SCENARIOS[currentScenario]
|
||||
return not LOC_LINK_EXCLUDE_SCENARIOS[currentScenario] and connectionsEnabled
|
||||
end
|
||||
|
||||
-- Sets this playmat's snap points to limit snapping to locations or not.
|
||||
@ -580,6 +578,20 @@ function setLimitSnapsByType(matchTypes)
|
||||
self.setSnapPoints(snaps)
|
||||
end
|
||||
|
||||
-- called by the option panel to enabled / disable location connections
|
||||
function setConnectionDrawState(state)
|
||||
connectionsEnabled = state
|
||||
rebuildConnectionList()
|
||||
drawBaseConnections()
|
||||
end
|
||||
|
||||
-- called by the option panel to edit the location connection color
|
||||
function setConnectionColor(color)
|
||||
connectionColor = color
|
||||
rebuildConnectionList()
|
||||
drawBaseConnections()
|
||||
end
|
||||
|
||||
-- count victory points on locations in play area
|
||||
---@param highlightOff Boolean True if highlighting should be enabled
|
||||
---@return. Returns the total amount of VP found in the play area
|
||||
|
@ -46,10 +46,14 @@ do
|
||||
return getPlayArea().call("resetSpawnedCards")
|
||||
end
|
||||
|
||||
-- Sets whether location connections should be drawn
|
||||
PlayAreaApi.setConnectionDrawState = function(state)
|
||||
getPlayArea().call("setConnectionDrawState", state)
|
||||
end
|
||||
|
||||
-- Sets the connection color
|
||||
PlayAreaApi.setConnectionColor = function(color)
|
||||
getPlayArea().setTable("connectionColor", color)
|
||||
getPlayArea().call("drawBaseConnections")
|
||||
getPlayArea().call("setConnectionColor")
|
||||
end
|
||||
|
||||
-- Event to be called when the current scenario has changed.
|
||||
|
@ -26,8 +26,9 @@
|
||||
|
||||
<!-- group headers -->
|
||||
<Row class="group-header"
|
||||
preferredHeight="54" />
|
||||
preferredHeight="44" />
|
||||
<Cell class="group-header"
|
||||
padding="10 10 0 0"
|
||||
columnSpan="3"
|
||||
color="#222222" />
|
||||
<Panel class="group-header"
|
||||
@ -42,14 +43,18 @@
|
||||
tooltipPosition="Left"
|
||||
tooltipBackgroundColor="rgba(0,0,0,1)"/>
|
||||
<Cell class="option-text"
|
||||
padding="10 10 5 5"
|
||||
color="#333333"
|
||||
columnSpan="2"/>
|
||||
<Cell class="option-button"
|
||||
padding="10 10 5 5"
|
||||
color="#333333"/>
|
||||
<Cell class="option-singleColumn"
|
||||
padding="10 10 5 5"
|
||||
color="#333333"
|
||||
columnSpan="1"/>
|
||||
<Cell class="option-doubleColumn"
|
||||
padding="10 10 5 5"
|
||||
color="#333333"
|
||||
columnSpan="2"/>
|
||||
<Panel class="singleColumn-wrapper"
|
||||
@ -102,7 +107,7 @@
|
||||
raycastTarget="true">
|
||||
<TableLayout columnWidths="0 100 75"
|
||||
autoCalculateHeight="1"
|
||||
cellPadding="10 10 5 5">
|
||||
useGlobalCellPadding="false">
|
||||
|
||||
<!-- Group: general settings -->
|
||||
<Row class="group-header">
|
||||
@ -137,12 +142,36 @@
|
||||
</Cell>
|
||||
</Row> -->
|
||||
|
||||
<!-- Option: splash scenario name on setup -->
|
||||
<Row class="option-text"
|
||||
tooltip="Fade in the name of the scenario for 2 seconds
when placing down a scenario.">
|
||||
<Cell class="option-text">
|
||||
<Panel class="singleColumn-wrapper">
|
||||
<Text class="option-header">Show scenario title on setup</Text>
|
||||
</Panel>
|
||||
</Cell>
|
||||
<Cell class="option-button">
|
||||
<Toggle id="showTitleSplash"
|
||||
onValueChanged="onClick_toggleOption(showTitleSplash)"/>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Group: play area settings -->
|
||||
<Row class="group-header">
|
||||
<Cell class="group-header">
|
||||
<Panel class="group-header"
|
||||
image="header_compass">
|
||||
<Text class="group-header">PLAY AREA SETTINGS</Text>
|
||||
</Panel>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Option: play area snap tags -->
|
||||
<Row class="option-text"
|
||||
tooltip="Only cards with the tag 'Location' will snap (official cards are supported by default).
Disable this if you are having issues with custom content.">
|
||||
<Cell class="option-text">
|
||||
<Panel class="singleColumn-wrapper">
|
||||
<Text class="option-header">Enable snap tags for play area</Text>
|
||||
<Text class="option-header">Enable snap tags</Text>
|
||||
</Panel>
|
||||
</Cell>
|
||||
<Cell class="option-button">
|
||||
@ -151,6 +180,20 @@
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Option: location connections -->
|
||||
<Row class="option-text"
|
||||
tooltip="Automatically draw location connections based on card metadata.">
|
||||
<Cell class="option-text">
|
||||
<Panel class="singleColumn-wrapper">
|
||||
<Text class="option-header">Draw location connections</Text>
|
||||
</Panel>
|
||||
</Cell>
|
||||
<Cell class="option-button">
|
||||
<Toggle id="playAreaConnections"
|
||||
onValueChanged="onClick_toggleOption(playAreaConnections)"/>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Option: play area connection color -->
|
||||
<Row class="option-text"
|
||||
tooltip="This color will be used to draw lines
for location connections.">
|
||||
@ -168,26 +211,12 @@
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Option: splash scenario name on setup -->
|
||||
<Row class="option-text"
|
||||
tooltip="Fade in the name of the scenario for 2 seconds
when placing down a scenario.">
|
||||
<Cell class="option-text">
|
||||
<Panel class="singleColumn-wrapper">
|
||||
<Text class="option-header">Show scenario title on setup</Text>
|
||||
</Panel>
|
||||
</Cell>
|
||||
<Cell class="option-button">
|
||||
<Toggle id="showTitleSplash"
|
||||
onValueChanged="onClick_toggleOption(showTitleSplash)"/>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Option: change custom playarea image on setup -->
|
||||
<Row class="option-text"
|
||||
tooltip="Attempts to set the play area to a fitting image
from the play area image gallery.">
|
||||
<Cell class="option-text">
|
||||
<Panel class="singleColumn-wrapper">
|
||||
<Text class="option-header">Change playarea background on setup</Text>
|
||||
<Text class="option-header">Change background on setup</Text>
|
||||
</Panel>
|
||||
</Cell>
|
||||
<Cell class="option-button">
|
||||
|