updated hider to actually remove mats (no respawning yet)
This commit is contained in:
parent
6b0a889724
commit
8a2822d84e
@ -172,7 +172,6 @@
|
|||||||
"TokenSpawnTracker.e3ffc9",
|
"TokenSpawnTracker.e3ffc9",
|
||||||
"TokenSource.124381",
|
"TokenSource.124381",
|
||||||
"GameData.3dbe47",
|
"GameData.3dbe47",
|
||||||
"PlayermatClickInterceptor.3dbe55",
|
|
||||||
"SCEDTour.0e5aa8",
|
"SCEDTour.0e5aa8",
|
||||||
"InstructionGenerator.240522",
|
"InstructionGenerator.240522",
|
||||||
"PlayerCards.2d30ee",
|
"PlayerCards.2d30ee",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2115061845796985108/F0ADB7094641DA966FFA3AF0CC6987D33D2D9591/",
|
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2115061845796985108/F0ADB7094641DA966FFA3AF0CC6987D33D2D9591/",
|
||||||
"WidthScale": 0
|
"WidthScale": 0
|
||||||
},
|
},
|
||||||
"Description": "Use the buttons to show / hide a playermat.",
|
"Description": "Use the buttons to hide playermat(s).",
|
||||||
"DragSelectable": true,
|
"DragSelectable": true,
|
||||||
"GMNotes": "",
|
"GMNotes": "",
|
||||||
"GUID": "a758b2",
|
"GUID": "a758b2",
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"AltLookAngle": {
|
|
||||||
"x": 0,
|
|
||||||
"y": 0,
|
|
||||||
"z": 0
|
|
||||||
},
|
|
||||||
"Autoraise": true,
|
|
||||||
"ColorDiffuse": {
|
|
||||||
"b": 0,
|
|
||||||
"g": 0,
|
|
||||||
"r": 0
|
|
||||||
},
|
|
||||||
"Description": "This object is used to hide playmats beneath the table.",
|
|
||||||
"DragSelectable": true,
|
|
||||||
"GMNotes": "",
|
|
||||||
"GUID": "3dbe55",
|
|
||||||
"Grid": true,
|
|
||||||
"GridProjection": false,
|
|
||||||
"Hands": false,
|
|
||||||
"HideWhenFaceDown": false,
|
|
||||||
"IgnoreFoW": false,
|
|
||||||
"LayoutGroupSortIndex": 0,
|
|
||||||
"Locked": true,
|
|
||||||
"LuaScriptState": "false",
|
|
||||||
"LuaScript_path": "PlayermatClickInterceptor.3dbe55.ttslua",
|
|
||||||
"MeasureMovement": false,
|
|
||||||
"Name": "BlockSquare",
|
|
||||||
"Nickname": "PlayermatClickInterceptor",
|
|
||||||
"Snap": true,
|
|
||||||
"Sticky": true,
|
|
||||||
"Tags": [
|
|
||||||
"CameraZoom_ignore",
|
|
||||||
"CleanUpHelper_ignore",
|
|
||||||
"displacement_excluded"
|
|
||||||
],
|
|
||||||
"Tooltip": false,
|
|
||||||
"Transform": {
|
|
||||||
"posX": -27.94,
|
|
||||||
"posY": -0.5,
|
|
||||||
"posZ": 0,
|
|
||||||
"rotX": 0,
|
|
||||||
"rotY": 270,
|
|
||||||
"rotZ": 0,
|
|
||||||
"scaleX": 84,
|
|
||||||
"scaleY": 1.5,
|
|
||||||
"scaleZ": 70
|
|
||||||
},
|
|
||||||
"Value": 0,
|
|
||||||
"XmlUI": ""
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
local interactable = false
|
|
||||||
|
|
||||||
function onSave() return JSON.encode(interactable) end
|
|
||||||
|
|
||||||
function onLoad(savedData)
|
|
||||||
if savedData and savedData ~= "" then
|
|
||||||
interactable = JSON.decode(savedData)
|
|
||||||
end
|
|
||||||
self.interactable = interactable
|
|
||||||
end
|
|
||||||
|
|
||||||
function setState(state)
|
|
||||||
interactable = state
|
|
||||||
self.interactable = interactable
|
|
||||||
end
|
|
@ -1,33 +1,21 @@
|
|||||||
local guidReferenceApi = require("core/GUIDReferenceApi")
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
local playmatApi = require("playermat/PlaymatApi")
|
local playmatApi = require("playermat/PlaymatApi")
|
||||||
|
|
||||||
function onClick_hideShow(player, matColor)
|
function onClick_hide(player, matColor)
|
||||||
local objects = guidReferenceApi.getObjectsByOwner(matColor)
|
local objects = guidReferenceApi.getObjectsByOwner(matColor)
|
||||||
|
if not objects.Playermat then return end
|
||||||
|
|
||||||
|
player.showConfirmDialog("Really remove this playmat and related objects? This can't be reversed.",
|
||||||
|
function()
|
||||||
|
-- remove action tokens
|
||||||
local actionTokens = playmatApi.searchAroundPlaymat(matColor, "isActionToken")
|
local actionTokens = playmatApi.searchAroundPlaymat(matColor, "isActionToken")
|
||||||
local pos = objects.Playermat.getPosition()
|
|
||||||
local mod = (pos.y > 0) and -2 or 2
|
|
||||||
|
|
||||||
-- move all objects
|
|
||||||
for _, obj in pairs(objects) do
|
|
||||||
obj.setPosition(obj.getPosition() + Vector(0, mod, 0))
|
|
||||||
end
|
|
||||||
|
|
||||||
-- move action tokens
|
|
||||||
for _, obj in ipairs(actionTokens) do
|
for _, obj in ipairs(actionTokens) do
|
||||||
obj.setLock(pos.y > 0)
|
obj.destruct()
|
||||||
obj.setPosition(obj.getPosition() + Vector(0, mod, 0))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- set state of interceptor block
|
-- remove mat owned objects
|
||||||
local allMats = guidReferenceApi.getObjectsByType("Playermat")
|
for _, obj in pairs(objects) do
|
||||||
local state = false
|
obj.destruct()
|
||||||
for owner, mat in pairs(allMats) do
|
|
||||||
if mat.getPosition().y < 0 then
|
|
||||||
state = true
|
|
||||||
break
|
|
||||||
end
|
end
|
||||||
end
|
end)
|
||||||
|
|
||||||
local interceptor = getObjectFromGUID("3dbe55")
|
|
||||||
interceptor.call("setState", state)
|
|
||||||
end
|
end
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
</Cell>
|
</Cell>
|
||||||
<Cell>
|
<Cell>
|
||||||
<Panel>
|
<Panel>
|
||||||
<Button onClick="onClick_hideShow(White)">Show / Hide</Button>
|
<Button onClick="onClick_hide(White)">Hide</Button>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
@ -49,7 +49,7 @@
|
|||||||
</Cell>
|
</Cell>
|
||||||
<Cell>
|
<Cell>
|
||||||
<Panel>
|
<Panel>
|
||||||
<Button onClick="onClick_hideShow(Orange)">Show / Hide</Button>
|
<Button onClick="onClick_hide(Orange)">Hide</Button>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
</Cell>
|
</Cell>
|
||||||
<Cell>
|
<Cell>
|
||||||
<Panel>
|
<Panel>
|
||||||
<Button onClick="onClick_hideShow(Green)">Show / Hide</Button>
|
<Button onClick="onClick_hide(Green)">Hide</Button>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
@ -69,7 +69,7 @@
|
|||||||
</Cell>
|
</Cell>
|
||||||
<Cell>
|
<Cell>
|
||||||
<Panel>
|
<Panel>
|
||||||
<Button onClick="onClick_hideShow(Red)">Show / Hide</Button>
|
<Button onClick="onClick_hide(Red)">Hide</Button>
|
||||||
</Panel>
|
</Panel>
|
||||||
</Cell>
|
</Cell>
|
||||||
</Row>
|
</Row>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user