diff --git a/objects/LuaScriptState.luascriptstate b/objects/LuaScriptState.luascriptstate
index 727ccd58..c26d46ba 100644
--- a/objects/LuaScriptState.luascriptstate
+++ b/objects/LuaScriptState.luascriptstate
@@ -1 +1 @@
-{"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}}
+{"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":[],"showSearchAssistant":[],"showTitleSplash":true,"useClueClickers":false,"useResourceCounters":"disabled","useSnapTags":true}}
diff --git a/objects/OptionPanelSource.830bd0.json b/objects/OptionPanelSource.830bd0.json
index 7e9310a5..56ede1b5 100644
--- a/objects/OptionPanelSource.830bd0.json
+++ b/objects/OptionPanelSource.830bd0.json
@@ -17,7 +17,6 @@
"CYOACampaignGuides.e87ea2",
"AttachmentHelper.7f4976",
"SearchAssistant.17aed0",
- "PlayermatHider.a758b2",
"HandHelper.450688",
"DisplacementTool.0f1374",
"CleanUpHelper.26cf4b"
diff --git a/objects/OptionPanelSource.830bd0/PlayermatHider.a758b2.json b/objects/OptionPanelSource.830bd0/PlayermatHider.a758b2.json
deleted file mode 100644
index aa1d42cd..00000000
--- a/objects/OptionPanelSource.830bd0/PlayermatHider.a758b2.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
- "AltLookAngle": {
- "x": 0,
- "y": 0,
- "z": 0
- },
- "Autoraise": true,
- "ColorDiffuse": {
- "b": 1,
- "g": 1,
- "r": 1
- },
- "CustomImage": {
- "CustomTile": {
- "Stackable": false,
- "Stretch": true,
- "Thickness": 0.1,
- "Type": 3
- },
- "ImageScalar": 1,
- "ImageSecondaryURL": "",
- "ImageURL": "http://cloud-3.steamusercontent.com/ugc/2115061845796985108/F0ADB7094641DA966FFA3AF0CC6987D33D2D9591/",
- "WidthScale": 0
- },
- "Description": "Use the buttons to hide playermat(s).",
- "DragSelectable": true,
- "GMNotes": "",
- "GUID": "a758b2",
- "Grid": true,
- "GridProjection": false,
- "Hands": false,
- "HideWhenFaceDown": false,
- "IgnoreFoW": false,
- "LayoutGroupSortIndex": 0,
- "Locked": false,
- "LuaScript": "require(\"accessories/PlayermatHider\")",
- "LuaScriptState": "",
- "MeasureMovement": false,
- "Name": "Custom_Tile",
- "Nickname": "Playermat Hider",
- "Snap": true,
- "Sticky": true,
- "Tags": [
- "CleanUpHelper_ignore"
- ],
- "Tooltip": true,
- "Transform": {
- "posX": 0,
- "posY": 2,
- "posZ": 0,
- "rotX": 0,
- "rotY": 270,
- "rotZ": 0,
- "scaleX": 3,
- "scaleY": 1,
- "scaleZ": 3
- },
- "Value": 0,
- "XmlUI": "\u003cInclude src=\"accessories/PlayermatHider.xml\"/\u003e"
-}
diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua
index 23a336ba..9ad1d120 100644
--- a/src/core/GameKeyHandler.ttslua
+++ b/src/core/GameKeyHandler.ttslua
@@ -253,7 +253,7 @@ function switchSeat(playerColor, direction)
end
-- swap color
- navigationOverlayApi.loadCamera(playerColor, usedColors[index])
+ navigationOverlayApi.loadCamera(Player[playerColor], usedColors[index])
end
-- takes a clue from a location, player needs to hover the clue directly or the location
diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua
index 8ee04751..d785ce0c 100644
--- a/src/core/Global.ttslua
+++ b/src/core/Global.ttslua
@@ -1215,6 +1215,29 @@ function returnResourceCounterId(name)
end
end
+-- called by the playermat removal selection dropdown
+function playermatRemovalSelected(player, selectedIndex, id)
+ if selectedIndex == "0" then return end
+
+ local matColorList = { "White", "Orange", "Green", "Red" }
+ local matColor = matColorList[tonumber(selectedIndex)]
+ local mat = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat")
+
+ if mat then
+ -- confirmation dialog about deletion
+ player.showConfirmDialog("Do you really want to remove " .. matColor .. "'s playermat? This can't be reversed.", function() removePlayermat(matColor) end)
+ else
+ -- info dialog that it is already deleted
+ player.showInfoDialog(matColor .. "'s playermat has already been removed.")
+ end
+end
+
+-- removes a playermat and all related objects from play
+---@param matColor String Color of the playermat to remove
+function removePlayermat(matColor)
+
+end
+
-- sets the option panel to the correct state (corresponding to 'optionPanel')
function updateOptionPanelState()
for id, optionValue in pairs(optionPanel) do
@@ -1295,10 +1318,6 @@ function applyOptionPanelChange(id, state)
optionPanel[id][i] = spawnOrRemoveHelper(state, "Hand Helper", pos, rot)
end
- -- option: Show playermat hider
- elseif id == "showPlayermatHider" then
- optionPanel[id] = spawnOrRemoveHelper(state, "Playermat Hider", {-48, 1.6, 46})
-
-- option: Show search assistant for each player
elseif id == "showSearchAssistant" then
for i, color in ipairs(MAT_COLORS) do
@@ -1376,7 +1395,6 @@ function removeHelperObject(name)
local referenceTable = {
["Clean Up Helper"] = "showCleanUpHelper",
["Hand Helper"] = "showHandHelper",
- ["Playermat Hider"] = "showPlayermatHider",
["Search Assistant"] = "showSearchAssistant",
["Displacement Tool"] = "showDisplacementTool",
["Attachment Helper"] = "showAttachmentHelper",
@@ -1431,7 +1449,6 @@ function onClick_defaultSettings()
showDisplacementTool = false,
showDrawButton = false,
showHandHelper = {},
- showPlayermatHider = false,
showSearchAssistant = {},
showTitleSplash = true,
useClueClickers = false,
diff --git a/src/core/NavigationOverlayApi.ttslua b/src/core/NavigationOverlayApi.ttslua
index 9a94d04e..adfed08d 100644
--- a/src/core/NavigationOverlayApi.ttslua
+++ b/src/core/NavigationOverlayApi.ttslua
@@ -25,9 +25,9 @@ do
-- loads the specified camera for a player
---@param player TTSPlayerInstance Player whose camera should be moved
---@param camera Variant If number: Index of the camera view to load | If string: Color of the playermat to swap to
- NavigationOverlayApi.loadCamera = function(playerColor, camera)
+ NavigationOverlayApi.loadCamera = function(player, camera)
getNOHandler().call("loadCameraFromApi", {
- playerColor = playerColor,
+ player = player,
camera = camera
})
end
diff --git a/src/core/NavigationOverlayHandler.ttslua b/src/core/NavigationOverlayHandler.ttslua
index 55f2de16..f20beedc 100644
--- a/src/core/NavigationOverlayHandler.ttslua
+++ b/src/core/NavigationOverlayHandler.ttslua
@@ -292,7 +292,7 @@ function getDynamicViewBounds(objList)
end
function loadCameraFromApi(params)
- loadCamera(Player[params.playerColor], params.camera)
+ loadCamera(params.player, params.camera)
end
-- loads the specified camera for a player
diff --git a/xml/Global/OptionPanel.xml b/xml/Global/OptionPanel.xml
index 9400f31d..6872557c 100644
--- a/xml/Global/OptionPanel.xml
+++ b/xml/Global/OptionPanel.xml
@@ -297,6 +297,28 @@
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+ |
+
+