Merge branch 'main' into hotkeys

This commit is contained in:
Chr1Z93 2023-04-13 01:15:48 +02:00
commit c9dea98e24
41 changed files with 1371 additions and 1038 deletions

View File

@ -190,7 +190,8 @@
"ArkhamSCE300-1272023-Page1.f873a8",
"VictoryDisplay.6ccd6d",
"CampaignOverview.e03c01",
"OptionPanelSource.830bd0" ,
"OptionPanelSource.830bd0",
"SoundCube.3c988f",
"GameKeyHandler.fce69c"
],
"PlayArea": 1,

View File

@ -58,4 +58,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -46,7 +46,7 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": -55.458,
"posX": -55.48,
"posY": 1.65,
"posZ": -1.12,
"rotX": 0,

View File

@ -56,7 +56,7 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": -53.235,
"posX": -53.24,
"posY": 1.65,
"posZ": 1.12,
"rotX": 0,

View File

@ -46,7 +46,7 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": -55.458,
"posX": -55.48,
"posY": 1.65,
"posZ": 1.12,
"rotX": 0,

View File

@ -54,4 +54,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -41,7 +41,7 @@
"CloseEncountersoftheLV-426Kind.4f5421",
"CelticRising.4d305a",
"CallofthePlaguebearer.613b64",
"BetrayalattheMountainsofMadness084.ef939a",
"BetrayalattheMountainsofMadness.ef939a",
"TheApproachingStorm.ab6b9a",
"AliceinWonderland.39916d",
"AgesUnwound.f7e5eb",

View File

@ -38,7 +38,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"States": {
"2": {
@ -81,7 +81,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -139,7 +139,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -197,7 +197,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -255,7 +255,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -313,7 +313,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -371,7 +371,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -429,7 +429,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -487,7 +487,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,

View File

@ -38,7 +38,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"States": {
"2": {
@ -81,7 +81,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -139,7 +139,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -197,7 +197,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -255,7 +255,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -313,7 +313,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -371,7 +371,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -429,7 +429,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -487,7 +487,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,

View File

@ -46,7 +46,7 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": -53.235,
"posX": -53.24,
"posY": 1.65,
"posZ": -1.12,
"rotX": 0,

View File

@ -38,7 +38,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"States": {
"2": {
@ -81,7 +81,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -139,7 +139,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -197,7 +197,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -255,7 +255,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -313,7 +313,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -371,7 +371,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -429,7 +429,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,
@ -487,7 +487,7 @@
"MeasureMovement": false,
"Memo": "horror",
"Name": "Custom_Token",
"Nickname": "Horror",
"Nickname": "",
"Snap": false,
"Sticky": true,
"Tooltip": true,

View File

@ -45,12 +45,12 @@
],
"Tooltip": true,
"Transform": {
"posX": -61.051,
"posY": 1.581,
"posZ": -0.008,
"posX": -45,
"posY": 1.62,
"posZ": 0,
"rotX": 0,
"rotY": 270,
"rotZ": 180,
"rotZ": 0,
"scaleX": 0.61,
"scaleY": 1,
"scaleZ": 0.61

View File

@ -44,7 +44,6 @@
"MeshIndex": -1,
"Name": "Bag",
"Nickname": "OptionPanel Source",
"Number": 0,
"Snap": true,
"Sticky": true,
"Tooltip": true,

View File

@ -86,4 +86,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -74,4 +74,4 @@
},
"Value": 0,
"XmlUI_path": "OptionPanelSource.830bd0/CleanUpHelper.26cf4b.xml"
}
}

View File

@ -54,4 +54,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -14,9 +14,9 @@
"r": 0.70588
},
"ContainedObjects_order": [
"NavigationOverlay.739ee5",
"Custom_Assetbundle.cecc3e",
"jaqenZannsNavigationOverlayTile.0ffbc5"
"NavigationOverlay.e5803c",
"CameraPlacementHelper.cecc3e",
"jaqenZannsNavigationOverlayTile.9f2481"
],
"ContainedObjects_path": "jaqenZannsNavigationOverlay.a8affa",
"Description": "",
@ -41,9 +41,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 30.32,
"posY": 3.899,
"posZ": -20.956,
"posX": 76.955,
"posY": 36.39,
"posZ": 4.123,
"rotX": 0,
"rotY": 180,
"rotZ": 0,

View File

@ -28,18 +28,18 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState": "{\"distance\":15,\"pitch\":75}",
"LuaScript_path": "OptionPanelSource.830bd0/jaqenZannsNavigationOverlay.a8affa/Custom_Assetbundle.cecc3e.ttslua",
"LuaScriptState": "",
"LuaScript_path": "OptionPanelSource.830bd0/jaqenZannsNavigationOverlay.a8affa/CameraPlacementHelper.cecc3e.ttslua",
"MeasureMovement": false,
"Name": "Custom_Assetbundle",
"Nickname": "",
"Nickname": "Camera Placement Helper",
"Snap": false,
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 18.148,
"posY": 3.504,
"posZ": -26.634,
"posX": -12.658,
"posY": 3.538,
"posZ": 28.573,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
@ -49,4 +49,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -0,0 +1,174 @@
--Data tables used in button creation
ref_modifyPitchButtons = {
{ offset = -0.37, func = function() click_modify(-1, 0) end },
{ offset = -1.11, func = function() click_modify(-5, 0) end },
{ offset = 0.37, func = function() click_modify(1, 0) end },
{ offset = 1.11, func = function() click_modify(5, 0) end },
}
ref_modifyDistanceButtons = {
{ offset = -0.37, func = function() click_modify(-1, 1) end },
{ offset = -1.11, func = function() click_modify(-5, 1) end },
{ offset = 0.37, func = function() click_modify(1, 1) end },
{ offset = 1.11, func = function() click_modify(5, 1) end },
}
--On-demand save function, remembers pitch and distance values
function updateSave()
self.script_state = JSON.encode({ pitch = pitch, distance = distance })
end
--Startup, loading memory
function onload(saved_data)
--Loads the tracking for if the game has started yet
if saved_data ~= "" then
local loaded_data = JSON.decode(saved_data)
pitch = loaded_data.pitch
distance = loaded_data.distance
else
pitch = 45
distance = 30
end
createInputs()
createButtons()
end
--Activated by finishing writing in the input box, updates save info
function input_entered(inputString, stillEditing, typeIndex)
if stillEditing == false then
--Check to avoid empty input strings
if tonumber(inputString) == nil then inputString = 0 end
--Update save data
if typeIndex == 0 then
pitch = inputString
else
distance = inputString
end
updateSave()
end
end
--Activated by button, the -5 -1 +1 +5 buttons
function click_modify(amount, typeIndex)
if typeIndex == 0 then
pitch = pitch + amount
self.editInput({ index = typeIndex, value = pitch })
else
distance = distance + amount
self.editInput({ index = typeIndex, value = distance })
end
updateSave()
end
--Activated by button, uses the data to move the camera
function click_setCamera(_, color)
--Check if there is another object to use instead of self
local targetObj = self
local nameGUID = string.sub(self.getName(), 1, 6)
if getObjectFromGUID(nameGUID) ~= nil then
targetObj = getObjectFromGUID(nameGUID)
end
--Check if there is an offset to use instead of 180
local offsetY = 180
local offsetString = string.sub(self.getName(), 7)
if tonumber(string.match(offsetString, "%d+")) ~= nil then
offsetY = tonumber(string.match(offsetString, "%d+"))
end
--Move camera into position around object
local pos = targetObj.getPosition()
local rot = targetObj.getRotation()
rot.y = rot.y + offsetY
Player[color].lookAt({ position = pos, pitch = pitch, yaw = rot.y, distance = distance })
--Send values to main tile
for _, v in ipairs(getObjects()) do
if v.getName() == "jaqenZann's Navigation Overlay Tile" then
v.call('updateEditCamera', { { pos.x, pos.y, pos.z }, tonumber(pitch), rot.y, tonumber(distance) })
break
end
end
end
--Button/Input creation
--Text boxes for number input
function createInputs()
local funcName = "inputFuncNamePitch"
local func = function(_, _, x, z) input_entered(x, z, 0) end
self.setVar(funcName, func)
self.createInput({
input_function = funcName,
function_owner = self,
label = "input",
alignment = 2,
position = { -3.4, 0.35, -0.21 },
rotation = { 0, 0, 0 },
height = 420,
width = 1400,
font_size = 400,
color = { 57 / 255, 46 / 255, 40 / 255 },
font_color = { 1, 1, 1 },
value = pitch,
validation = 3
})
local funcName = "inputFuncNameDistance"
local func = function(_, _, x, z) input_entered(x, z, 1) end
self.setVar(funcName, func)
self.createInput({
input_function = funcName,
function_owner = self,
label = "input",
alignment = 4,
position = { 3.4, 0.35, -0.21 },
rotation = { 0, 0, 0 },
height = 420,
width = 1400,
font_size = 400,
color = { 57 / 255, 46 / 255, 40 / 255 },
font_color = { 1, 1, 1 },
value = distance,
validation = 3
})
end
--Center button and -5 - +5 buttons
function createButtons()
self.createButton({
click_function = "click_setCamera",
function_owner = self,
position = { 0, 0.4, 0 },
height = 900,
width = 900,
color = { 1, 1, 1, 0 },
tooltip = "Set camera to this angle"
})
for i, ref in ipairs(ref_modifyPitchButtons) do
local funcName = "pitchModifyFunction_" .. i
self.setVar(funcName, ref.func)
local pos = { -3.4 + ref.offset, 0.3, 0.6 }
self.createButton({
click_function = funcName,
function_owner = self,
position = pos,
height = 240,
width = 320,
color = { 1, 1, 1, 0 }
})
end
for i, ref in ipairs(ref_modifyDistanceButtons) do
local funcName = "distanceModifyFunction_" .. i
self.setVar(funcName, ref.func)
local pos = { 3.4 + ref.offset, 0.3, 0.6 }
self.createButton({
click_function = funcName,
function_owner = self,
position = pos,
height = 240,
width = 320,
color = { 1, 1, 1, 0 }
})
end
end

View File

@ -1,162 +0,0 @@
--On-demand save function, remembers pitch and distance values
function updateSave()
saved_data = JSON.encode({pitch=pitch, distance=distance})
self.script_state = saved_data
end
--Startup, loading memory
function onload(saved_data)
--Loads the tracking for if the game has started yet
if saved_data ~= "" then
local loaded_data = JSON.decode(saved_data)
pitch = loaded_data.pitch
distance = loaded_data.distance
else
pitch = 45
distance = 30
end
createInputs()
createButtons()
end
--Activated by finishing writing in the input box, updates save info
function input_entered(inputString, stillEditing , typeIndex)
if stillEditing == false then
--Check to avoid empty input strings
if tonumber(inputString) == nil then inputString = 0 end
--Update save data
if typeIndex==0 then
pitch = inputString
else
distance = inputString
end
updateSave()
end
end
--Activated by button, the -5 -1 +1 +5 buttons
function click_modify(amount, typeIndex)
if typeIndex==0 then
pitch = pitch + amount
self.editInput({index=typeIndex, value=pitch})
else
distance = distance + amount
self.editInput({index=typeIndex, value=distance})
end
updateSave()
end
--Activated by button, uses the data to move the camera
function click_setCamera(_, color)
--Check if there is another object to use instead of self
local targetObj = self
local nameGUID = string.sub(self.getName(), 1, 6)
if getObjectFromGUID(nameGUID) ~= nil then
targetObj = getObjectFromGUID(nameGUID)
end
--Check if there is an offset to use instead of 180
local offsetY = 180
local offsetString = string.sub(self.getName(), 7)
if tonumber(string.match(offsetString, "%d+")) ~= nil then
offsetY = tonumber(string.match(offsetString, "%d+"))
end
--Move camera into position around object
local pos = targetObj.getPosition()
local rot = targetObj.getRotation()
rot.y = rot.y + offsetY
Player[color].lookAt({position=pos, pitch=pitch, yaw=rot.y, distance=distance})
local objectList = getObjects()
local AHLCGNavTile = nil
for i,v in ipairs(objectList) do
if v.getName() == 'Navigation Overlay Tile' then
AHLCGNavTile = v
break
end
end
-- local AHLCGNavTile = getObjectFromGUID("0ffbc5")
if AHLCGNavTile then
AHLCGNavTile.call('updateEditCamera', {pos, pitch, rot.y, distance})
end
end
--Button/Input creation
--Text boxes for number input
function createInputs()
local funcName = "inputFuncNamePitch"
local func = function(_,_,x,z) input_entered(x,z,0) end
self.setVar(funcName, func)
self.createInput({
input_function=funcName, function_owner=self, label="input",
alignment=2, position={-3.4,0.35,-0.21}, rotation={0,0,0}, height=420, width=1400,
font_size=400, color={57/255,46/255,40/255},
font_color={1,1,1}, value=pitch,
validation=3 -- int (1 = None, 2 = Integer, 3 = Float, 4 = Alphanumeric, 5 = Username, 6 = Name),
})
local funcName = "inputFuncNameDistance"
local func = function(_,_,x,z) input_entered(x,z,1) end
self.setVar(funcName, func)
self.createInput({
input_function=funcName, function_owner=self, label="input",
alignment=4, position={3.4,0.35,-0.21}, rotation={0,0,0}, height=420, width=1400,
font_size=400, color={57/255,46/255,40/255},
font_color={1,1,1}, value=distance,
validation=3 -- int (1 = None, 2 = Integer, 3 = Float, 4 = Alphanumeric, 5 = Username, 6 = Name),
})
end
--Center button and -5 - +5 buttons
function createButtons()
self.createButton({
click_function="click_setCamera", function_owner=self,
position={0,0.4,0}, height=900, width=900, color={1,1,1,0},
tooltip="Set camera to this angle"
})
for i, ref in ipairs(ref_modifyPitchButtons) do
local funcName = "pitchModifyFunction_"..i
self.setVar(funcName, ref.func)
local pos = {-3.4+ref.offset,0.3,0.6}
self.createButton({
click_function=funcName, function_owner=self,
position=pos, height=240, width=320, color={1,1,1,0}
})
end
for i, ref in ipairs(ref_modifyDistanceButtons) do
local funcName = "distanceModifyFunction_"..i
self.setVar(funcName, ref.func)
local pos = {3.4+ref.offset,0.3,0.6}
self.createButton({
click_function=funcName, function_owner=self,
position=pos, height=240, width=320, color={1,1,1,0}
})
end
end
--Data tables used in button creation
ref_modifyPitchButtons = {
{offset=-0.37, func=function() click_modify(-1, 0) end},
{offset=-1.11, func=function() click_modify(-5, 0) end},
{offset=0.37, func=function() click_modify(1, 0) end},
{offset=1.11, func=function() click_modify(5, 0) end},
}
ref_modifyDistanceButtons = {
{offset=-0.37, func=function() click_modify(-1, 1) end},
{offset=-1.11, func=function() click_modify(-5, 1) end},
{offset=0.37, func=function() click_modify(1, 1) end},
{offset=1.11, func=function() click_modify(5, 1) end},
}

View File

@ -13,7 +13,7 @@
"Description": "Controls a movable overlay allowing for quick movement to various parts of the table. There should only be one tile per table.\n\nFull Table: Displays a larger overlay corresponding to the whole table.\n\nPlay Area: Displays a much smaller overlay only covering the play area.",
"DragSelectable": true,
"GMNotes": "",
"GUID": "739ee5",
"GUID": "e5803c",
"Grid": true,
"GridProjection": false,
"Hands": false,
@ -60,12 +60,12 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 6.08392429,
"posY": 1.53338218,
"posZ": -32.7559,
"rotX": 0.07987893,
"rotY": 89.9998,
"rotZ": 359.983124,
"posX": -69.47138,
"posY": 1.551499,
"posZ": -50.97995,
"rotX": -6.706855e-8,
"rotY": 90.00628,
"rotZ": 3.98763333e-9,
"scaleX": 0.7,
"scaleY": 1,
"scaleZ": 0.7
@ -105,12 +105,12 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 6.083923,
"posY": 1.53338218,
"posZ": -32.75589,
"rotX": 0.07987937,
"rotY": 89.99992,
"rotZ": 359.983124,
"posX": -69.47138,
"posY": 1.55149889,
"posZ": -50.97995,
"rotX": -4.66551136e-8,
"rotY": 90.00628,
"rotZ": 9.637148e-9,
"scaleX": 0.7,
"scaleY": 1,
"scaleZ": 0.7
@ -150,12 +150,57 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 6.08392334,
"posY": 1.53338218,
"posZ": -32.7558937,
"rotX": 0.07987977,
"rotY": 89.9998856,
"rotZ": 359.983124,
"posX": -69.47138,
"posY": 1.55149889,
"posZ": -50.97995,
"rotX": -1.21061817e-7,
"rotY": 90.00628,
"rotZ": 9.462388e-8,
"scaleX": 0.7,
"scaleY": 1,
"scaleZ": 0.7
},
"Value": 0,
"XmlUI": ""
},
"5": {
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"b": 1,
"g": 1,
"r": 1
},
"Description": "Claim Color: This is useful if you are running a game where one person controls 2 colors, and one controls the other two, and you wish to have your player color switch when you click White or Red, but not if you click Green or Orange.\n\nWhen you click Claim Color, the playmat areas of the overlay will turn white. Clicking one will allow you to switch to that color with the overlay. ",
"DragSelectable": true,
"GMNotes": "",
"GUID": "516664",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScript": "",
"LuaScriptState": "",
"MeasureMovement": false,
"Name": "Notecard",
"Nickname": "Navigation Overlay: Claim Colors",
"Snap": true,
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": -38.4611664,
"posY": 1.59,
"posZ": -1.54776835,
"rotX": 5.3783765e-8,
"rotY": 90.00012,
"rotZ": 8.552772e-8,
"scaleX": 0.7,
"scaleY": 1,
"scaleZ": 0.7
@ -167,9 +212,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 18.447,
"posY": 3.599,
"posZ": -25.855,
"posX": -37.692,
"posY": 3.67,
"posZ": 9.23,
"rotX": 0,
"rotY": 90,
"rotZ": 0,

View File

@ -1,648 +0,0 @@
-- SCE Navigation Panel version 1.00
function onLoad(saved_data)
self.createButton({
label="",
tooltip="Display full overlay",
click_function="displayFull",
function_owner=self,
position={0.0,0.1,-0.57},
height=70,
width=800,
scale={x=1, y=1, z=1},
color={1,0,0,0}
})
self.createButton({
label="",
tooltip="Display only play area",
click_function="displayPlayArea",
function_owner=self,
position={0.0,0.1,-0.30},
height=70,
width=800,
scale={x=1, y=1, z=1},
color={1,0,0,0}
})
self.createButton({
label="",
tooltip="Close overlay",
click_function="closeOverlay",
function_owner=self,
position={0.0,0.1,-0.03},
height=70,
width=800,
scale={x=1, y=1, z=1},
color={1,0,0,0}
})
self.createButton({
label="",
tooltip="Modify a camera position",
click_function="beginSetCamera",
function_owner=self,
position={0.0,0.1,0.37},
height=70,
width=800,
scale={x=1, y=1, z=1},
color={1,0,0,0}
})
self.createButton({
label="",
tooltip="Reset camera positions to default",
click_function="resetCameras",
function_owner=self,
position={0.0,0.1,0.77},
height=70,
width=800,
scale={x=1, y=1, z=1},
color={1,0,0,0}
})
defaultCameraParams = {
{position={-1.626, -2.5, -0.064}, pitch=62.964, yaw=90.000, distance=17.844}, -- 1. ActAgenda
{position={-27.822, -2.5, 0.424}, pitch=75.823, yaw=90.000, distance=-1.000}, -- 2. Map
-- {position={-31.592, -2.5, 26.392}, pitch=74.238, yaw=180.000, distance=19.858}, -- 3. Green playmat
{position={-31.592, -2.5, 26.392}, pitch=74.238, yaw=180.000, distance=-1.000}, -- 3. Green playmat
{position={-55.026, -2.5, 12.052}, pitch=74.238, yaw=90.000, distance=-1.000}, -- 4. White playmat
{position={-55.026, -2.5, -11.479}, pitch=74.238, yaw=90.000, distance=-1.000}, -- 5. Orange playmat
{position={-31.592, -2.5, -26.392}, pitch=74.238, yaw=0.000, distance=-1.000}, -- 6. Red playmat
{position={-2.940, -2.5, 25.160}, pitch=73.556, yaw=90.000, distance=20.146}, -- 7. Victory / SetAside
{position={-58.216, -2.5, -71.288}, pitch=76.430, yaw=90.000, distance=20.000}, -- 8. Deckbuilder
{position={46.368, -2.5, 0.328}, pitch=69.491, yaw=90.000, distance=46.255}, -- 9. Campaigns
{position={13.875, -2.5, 0.328}, pitch=69.491, yaw=90.000, distance=37.962}, -- 10. Scenarios
{position={51.940, -2.5, 64.476}, pitch=76.430, yaw=90.000, distance=48.102}, -- 11. Level 0
{position={51.302, -2.5, -73.514}, pitch=76.430, yaw=90.000, distance=48.102}, -- 12. Upgraded
{position={-27.788, -2.5, 74.662}, pitch=76.430, yaw=90.000, distance=30.616}, -- 13. Weaknesses
{position={-61.090, -2.5, 70.762}, pitch=76.430, yaw=90.000, distance=34.188}, -- 14. Rules
{position={-18.547, -2.5, -73.514}, pitch=76.430, yaw=90.000, distance=42.249}, -- 15. Investigators
{position={-2.144, -2.5, -26.900}, pitch=73.556, yaw=90.000, distance=20.146}, -- 16. Log
{position={-45.000, -2.5, -0.228}, pitch=73.556, yaw=90.000, distance=12.000} -- 17. BlessCurse
}
fullButtonData = {
{ id = "1", width = "84", height = "38", offsetX = "1", offsetY = "-9" },
{ id = "2", width = "78", height = "50", offsetX = "1", offsetY = "-59" },
{ id = "3", width = "36", height = "70", offsetX = "-62", offsetY = "-70" },
{ id = "4", width = "70", height = "40", offsetX = "-36", offsetY = "-130" },
{ id = "5", width = "70", height = "40", offsetX = "39", offsetY = "-130" },
{ id = "6", width = "36", height = "70", offsetX = "64", offsetY = "-70" },
{ id = "7", width = "36", height = "36", offsetX = "-63", offsetY = "-9" },
{ id = "8", width = "64", height = "64", offsetX = "153", offsetY = "-128" },
{ id = "9", width = "155", height = "70", offsetX = "2", offsetY = "120" },
{ id = "10", width = "155", height = 70, offsetX = "2", offsetY = "47" },
{ id = "11", width = "120", height = "100", offsetX = "-148", offsetY = "101" },
{ id = "12", width = "120", height = "100", offsetX = "150", offsetY = "101" },
{ id = "13", width = "120", height = "80", offsetX = "-150", offsetY = "-55" },
{ id = "14", width = "120", height = "60", offsetX = "-150", offsetY = "-132" },
{ id = "15", width = "110", height = "100", offsetX = "152", offsetY = "-42" },
{ id = "16", width = "36", height = "36", offsetX = "64", offsetY = "-9" },
{ id = "17", width = "44", height = "25", offsetX = "1", offsetY = "-97" }
}
playButtonData = {
{ id = "1", width = "84", height = "38", offsetX = "0", offsetY = "59" },
{ id = "2", width = "78", height = "50", offsetX = "0", offsetY = "9" },
{ id = "3", width = "36", height = "70", offsetX = "-62", offsetY = "-1" },
{ id = "4", width = "70", height = "40", offsetX = "-37", offsetY = "-61" },
{ id = "5", width = "70", height = "40", offsetX = "39", offsetY = "-61" },
{ id = "6", width = "36", height = "70", offsetX = "63", offsetY = "-2" },
{ id = "7", width = "36", height = "36", offsetX = "-64", offsetY = "59" },
{ id = "16", width = "36", height = "36", offsetX = "63", offsetY = "59" },
{ id = "17", width = "44", height = "25", offsetX = "0", offsetY = "-28" }
}
playermatData = {
White = { guid = '8b081b', origin = { x=-54.42, y=0, z=20.96 }, scale = { x=36.63, y=5.10, z=14.59 }, orientation = { x=0, y=270, z=0 }, minX = -61.4, maxX = -48.6, minZ = -2.39, maxZ = 24.53, xOffset = 0.07, zOffset = 0.03 },
Orange = { guid = 'bd0ff4', origin = { x=-54.42, y=0, z=-20.96 }, scale = { x=36.63, y=5.10, z=14.59 }, orientation = { x=0, y=270, z=0 }, minX = -61.4, maxX = -48.6, minZ = -24.53, maxZ = 2.39, xOffset = 0.07, zOffset = 0.02 },
Green = { guid = '383d8b', origin = { x=-25.00, y=0, z=26.20 }, scale = { x=31.5, y=5.10, z=14.59 }, orientation = { x=0, y=0, z=0 }, minX = -44.43, maxX = -17.44, minZ = 20.17, maxZ = 32.97, xOffset = -0.07, zOffset = 0.00 },
Red = { guid = '0840d5', origin = { x=-25.00, y=0, z=-26.60 }, scale = { x=31.5, y=5.10, z=14.59 }, orientation = { x=0, y=180, z=0 }, minX = -44.43, maxX = -17.44, minZ = -32.97, maxZ = -20.17, xOffset = 0.07, zOffset = -0.06 }
}
editing = false
selectedEditButton = -1
editPos = {0, 0, 0}
editPitch = 0
editYaw = 0
editDistance = 0
if saved_data ~= "" then
local loaded_data = JSON.decode(saved_data)
cameraParams = loaded_data.cameras
fullVisibility = loaded_data.fullVis
playVisibility = loaded_data.playVis
resetOverlay()
else
cameraParams = {
Green = {},
White = {},
Orange = {},
Red = {}
}
for iv, v in pairs({'Green', 'White', 'Orange', 'Red'}) do
cameraParams[v] = {}
for i = 1,17 do
cameraParams[v][i] = {}
cameraParams[v][i].position = defaultCameraParams[i].position
cameraParams[v][i].pitch = defaultCameraParams[i].pitch
cameraParams[v][i].yaw = defaultCameraParams[i].yaw
cameraParams[v][i].distance = defaultCameraParams[i].distance
end
end
fullVisibility = {
Green = false,
White = false,
Orange = false,
Red = false
}
playVisibility = {
Green = false,
White = false,
Orange = false,
Red = false
}
end
end
function onSave()
return JSON.encode({
cameras = cameraParams,
fullVis = fullVisibility,
playVis = playVisibility
})
-- return ''
end
function displayFull(object, color)
local playerCount = getPlayerCount()
local colors
if playerCount == 1 then
colors = { 'Green', 'White', 'Orange', 'Red' }
else
colors = { color }
end
for i, v in ipairs(colors) do
fullVisibility[v] = true
playVisibility[v] = false
end
resetOverlay()
end
function displayPlayArea(object, color)
local playerCount = getPlayerCount()
local colors
if playerCount == 1 then
colors = { 'Green', 'White', 'Orange', 'Red' }
else
colors = { color }
end
for i, v in ipairs(colors) do
fullVisibility[v] = false
playVisibility[v] = true
end
resetOverlay()
end
function resetCameras(object, color)
local playerCount = getPlayerCount()
local colors
if playerCount == 1 then
colors = { 'Green', 'White', 'Orange', 'Red' }
else
colors = { color }
end
for iv, v in ipairs(colors) do
for i = 1,17 do
cameraParams[v][i].position = defaultCameraParams[i].position
cameraParams[v][i].pitch = defaultCameraParams[i].pitch
cameraParams[v][i].yaw = defaultCameraParams[i].yaw
cameraParams[v][i].distance = defaultCameraParams[i].distance
end
end
end
function closeOverlay(object, color)
fullVisibility[color] = false
playVisibility[color] = false
resetOverlay()
end
function resetOverlay()
local guid = self.getGUID()
local color
local panel
local existingXml = UI.getXml()
local openingXml = ''
-- try to only remove our panels
for p = 1,2 do
i, j = string.find(existingXml, '<Panel id="navPanel')
if i and i > 1 and string.len(openingXml) == 0 then
openingXml = string.sub(existingXml, 1, i-1)
end
if i then
local panelXml = string.sub(existingXml, i)
k, m = string.find(panelXml, '</Panel>')
existingXml = string.sub(panelXml, m+1)
else
break
end
end
local xml = openingXml .. [[
]] .. existingXml
local fullColors = ''
local playColors = ''
for i, v in pairs(fullVisibility) do
if v == true then
if string.len(fullColors) > 0 then
fullColors = fullColors .. '|' .. i
else
fullColors = i
end
end
end
for i, v in pairs(playVisibility) do
if v == true then
if string.len(playColors) > 0 then
playColors = playColors .. '|' .. i
else
playColors = i
end
end
end
if string.len(fullColors) > 0 then
data = fullButtonData
xml = xml .. [[<Panel id="navPanelFull" height="358" width="455" visibility="]] .. fullColors .. [[" allowDragging="true" returnToOriginalPositionWhenReleased="false" rectAlignment="LowerRight" offsetXY="-40 0">
<image id="backgroundImage" image="OverlayLarge" />]]
for i, d in ipairs(data) do
if editing then
if selectedEditButton < 0 then
color = "rgba(1,1,1,1)"
elseif tonumber(d.id) == selectedEditButton then
color = "rgba(0,1,0,1)"
else
color = "rgba(1,0,0,1)"
end
else
color = "rgba(0,1,0,0)"
end
xml = xml .. [[<button
onClick="]] .. guid .. [[/buttonClicked"
id="]] .. d.id .. [["
height="]] .. d.height .. [["
width="]] .. d.width .. [["
offsetXY="]] .. d.offsetX .. " " .. d.offsetY .. [["
color="]] .. color .. [["
>
</button>
]]
end
xml = xml .. [[ </Panel>]]
end
if string.len(playColors) > 0 then
data = playButtonData
xml = xml .. [[
<Panel id="navPanelPlay" height="208" width="205" visibility="]] .. playColors .. [[" allowDragging="true" returnToOriginalPositionWhenReleased="false" rectAlignment="LowerRight" offsetXY="-40 0">
<image id="backgroundImage" image="OverlaySmall" />]]
for i, d in ipairs(data) do
if editing then
if selectedEditButton < 0 then
color = "rgba(1,1,1,1)"
elseif tonumber(d.id) == selectedEditButton then
color = "rgba(0,1,0,1)"
else
color = "rgba(1,0,0,1)"
end
else
color = "rgba(0,1,0,0)"
end
xml = xml .. [[<button
onClick="]] .. guid .. [[/buttonClicked"
id="]] .. d.id .. [["
height="]] .. d.height .. [["
width="]] .. d.width .. [["
offsetXY="]] .. d.offsetX .. " " .. d.offsetY .. [["
color="]] .. color .. [["
>
</button>
]]
end
xml = xml .. [[ </Panel>]]
end
local existingAssets = UI.getCustomAssets()
local largeOverlay = nil
local smallOverlay = nil
for i,v in pairs(existingAssets) do
for ii,vv in pairs(v) do
if vv == 'OverlayLarge' then
largeOverlay = v
end
if vv == 'OverlaySmall' then
smallOverlay = v
end
end
end
local largeURL = 'http://cloud-3.steamusercontent.com/ugc/1745699502804112656/A34D1F30E0DA0E283F300AE6D6B63F59FFC97730/'
local smallURL = 'http://cloud-3.steamusercontent.com/ugc/1745699502804112719/CFFC89BF9FB8439204EE19CF94180EC99450CD38/'
if largeOverlay == nil then
largeOverlay = { name='OverlayLarge', url=largeURL }
table.insert(existingAssets, largeOverlay)
else
largeOverlay.url = largeURL
end
if smallOverlay == nil then
smallOverlay = { name='OverlaySmall', url=smallURL }
table.insert(existingAssets, smallOverlay)
else
smallOverlay.url = smallURL
end
UI.setXml(xml, existingAssets)
end
function buttonClicked(player, _, idValue)
if editing then
if selectedEditButton < 0 then
selectedEditButton = tonumber(idValue)
else
if tonumber(idValue) == selectedEditButton and editDistance > 0 then
local playerCount = getPlayerCount()
local colors
if playerCount == 1 then
colors = { 'Green', 'White', 'Orange', 'Red' }
else
colors = { player.color }
end
for i, v in ipairs(colors) do
cameraParams[v][selectedEditButton].position = editPos
cameraParams[v][selectedEditButton].pitch = editPitch
cameraParams[v][selectedEditButton].yaw = editYaw
cameraParams[v][selectedEditButton].distance = editDistance
end
end
editing = false
selectedEditButton = -1
end
resetOverlay()
else
loadCamera(player, _, idValue)
end
end
function loadCamera(player, _, idValue)
local index = tonumber(idValue)
local color = player.color
-- only do map zooming if te camera hasn't been specially set by user
if index == 2 and cameraParams[color][index].distance <= 0.0 then
local mapObjects = Physics.cast({
origin = { x=-29.2, y=0, z=0.0 },
direction = { x=0, y=1, z=0 },
type = 3,
size = { x=36, y=5, z=31.4 },
orientation = { x=0, y=90, z=0 }
})
local minX = 100
local maxX = -100
local minZ = 100
local maxZ = -100
for i,v in pairs(mapObjects) do
local obj = v.hit_object
if obj.type == 'Card' or obj.type == 'Infinite' then
local bounds = obj.getBounds()
local x1 = bounds['center'][1] - bounds['size'][1]/2
local x2 = bounds['center'][1] + bounds['size'][1]/2
local z1 = bounds['center'][3] - bounds['size'][3]/2
local z2 = bounds['center'][3] + bounds['size'][3]/2
if x1 < minX then
minX = x1
end
if x2 > maxX then
maxX = x2
end
if z1 < minZ then
minZ = z1
end
if z2 > maxZ then
maxZ = z2
end
end
end
if minX < 100 then
local dx = maxX - minX
local dz = (maxZ - minZ) / (1.6) -- screen ratio * 1.2 (for my macbook pro, no idea how to generalize this)
local centerX = (minX + maxX) / 2 - dx*0.12 -- offset is to move it a bit up, so the cards don't block anything
local centerZ = (minZ + maxZ) / 2
local scale = dx
if dz > dx then
scale = dz
end
-- regression line from the following data points, seems linear
-- rows 1 scale 4.5 d 12
-- rows 2 scale 11 d 16
-- rows 3 scale 14.5 d 19.6
-- rows 4 scale 19.6 d 25
-- rows 5 scale 23.25 d 28
-- rows 6 scale 30.8 d 34
-- local d = 0.8685 * scale + 7.4505
-- modified by testing
-- local d = 0.8685 * scale + 5
local d = 1.04 * scale + 5
player.lookAt({position={centerX, 0, centerZ}, pitch=75.823, yaw=90.000, distance=d})
else
player.lookAt({position={-33.667, 0, 0.014}, pitch=75.823, yaw=90.000, distance=36})
end
elseif index >= 3 and index <= 6 then
local matColor = nil
if index == 3 then
matColor = 'Green'
elseif index == 4 then
matColor = 'White'
elseif index == 5 then
matColor = 'Orange'
elseif index == 6 then
matColor = 'Red'
end
if matColor ~= nil then
local playerCount = getPlayerCount()
if playerCount <= 1 then
player.changeColor(matColor)
end
end
if cameraParams[color][index].distance <= 0.0 then
local matObjects = Physics.cast({
origin = playermatData[matColor].origin,
direction = { x=0, y=1, z=0 },
type = 3,
size = playermatData[matColor].scale,
orientation = playermatData[matColor].orientation,
-- debug=true
})
local minX = playermatData[matColor].minX
local maxX = playermatData[matColor].maxX
local minZ = playermatData[matColor].minZ
local maxZ = playermatData[matColor].maxZ
for i,v in pairs(matObjects) do
local obj = v.hit_object
if obj.type == 'Card' or obj.type == 'Infinite' then
local bounds = obj.getBounds()
local x1 = bounds['center'][1] - bounds['size'][1]/2
local x2 = bounds['center'][1] + bounds['size'][1]/2
local z1 = bounds['center'][3] - bounds['size'][3]/2
local z2 = bounds['center'][3] + bounds['size'][3]/2
if x1 < minX then
minX = x1
end
if x2 > maxX then
maxX = x2
end
if z1 < minZ then
minZ = z1
end
if z2 > maxZ then
maxZ = z2
end
end
end
local dx
local dz
local centerX
local centerZ
local scale
local yaw
local d
-- White/Orange
if index > 3 and index < 6 then
dx = maxX - minX
dz = (maxZ - minZ) / (1.6) -- screen ratio * 1.2 (for my macbook pro, no idea how to generalize this)
centerX = (minX + maxX) / 2 - dx*playermatData[matColor].xOffset -- offset is to move it a bit up, so the cards don't block anything
centerZ = (minZ + maxZ) / 2 + dz*playermatData[matColor].zOffset -- offset is to move it right a bit, so the toolbar doesn't block anything
yaw = 90
scale = dx
if dz > dx then
scale = dz
end
d = 0.64 * scale + 7
else -- Green/Red
dx = (maxX - minX) / (1.6) -- screen ratio * 1.2 (for my macbook pro, no idea how to generalize this)
dz = maxZ - minZ
centerX = (minX + maxX) / 2 + dx*playermatData[matColor].zOffset -- offset is to move it right a bit, so the toolbar doesn't block anything
centerZ = (minZ + maxZ) / 2 - dz*playermatData[matColor].xOffset -- offset is to move it a bit up, so the cards don't block anything
yaw = playermatData[matColor].orientation.y + 180
scale = dz
if dx > dz then
scale = dx
end
d = 0.64 * scale + 7
end
-- 15.46 -> 17.081
-- 18.88 -> 19.33
-- 24.34 -> 22.6
-- need to wait if the player color changed
Wait.frames(function() player.lookAt({position={centerX, 0, centerZ}, pitch=75.823, yaw=yaw, distance=d}) end, 2)
else
Wait.frames(function() player.lookAt(cameraParams[color][index]) end, 2)
end
else
player.lookAt(cameraParams[color][index])
end
end
function beginSetCamera(object, color)
editing = true
resetOverlay()
end
function updateEditCamera(params)
editPos = params[1]
editPitch = params[2]
editYaw = params[3]
editDistance = params[4]
end
function getPlayerCount()
local playerCount = 0
local playerList = getSeatedPlayers()
for i, v in ipairs(playerList) do
if v == 'Green' or v == 'White' or v == 'Orange' or v == 'Red' then
playerCount = playerCount + 1
end
end
return playerCount
end

View File

@ -18,14 +18,14 @@
"Type": 0
},
"ImageScalar": 1,
"ImageSecondaryURL": "http://cloud-3.steamusercontent.com/ugc/1745699644170918010/4E5FCD0140AE8960A1E1272A1979E575EE12C3F3/",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/1745699644170918010/4E5FCD0140AE8960A1E1272A1979E575EE12C3F3/",
"ImageSecondaryURL": "http://cloud-3.steamusercontent.com/ugc/2021591230456185506/15AF790F0622B57C1F629DB3A8C38F2A99D0EB1B/",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2021591230456185506/15AF790F0622B57C1F629DB3A8C38F2A99D0EB1B/",
"WidthScale": 0
},
"Description": "",
"DragSelectable": true,
"GMNotes": "",
"GUID": "0ffbc5",
"GUID": "9f2481",
"Grid": false,
"GridProjection": false,
"Hands": false,
@ -33,8 +33,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "OptionPanelSource.830bd0/jaqenZannsNavigationOverlay.a8affa/jaqenZannsNavigationOverlayTile.0ffbc5.luascriptstate",
"LuaScript_path": "OptionPanelSource.830bd0/jaqenZannsNavigationOverlay.a8affa/jaqenZannsNavigationOverlayTile.0ffbc5.ttslua",
"LuaScriptState": "",
"LuaScript_path": "OptionPanelSource.830bd0/jaqenZannsNavigationOverlay.a8affa/jaqenZannsNavigationOverlayTile.9f2481.ttslua",
"MeasureMovement": false,
"Name": "Custom_Tile",
"Nickname": "jaqenZann's Navigation Overlay Tile",
@ -42,15 +42,15 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 25.962,
"posY": 3.519,
"posZ": -18.624,
"rotX": 1,
"posX": -12.93,
"posY": 3.562,
"posZ": 28.568,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
"scaleX": 0.8,
"rotZ": 1,
"scaleX": 3,
"scaleY": 1,
"scaleZ": 0.8
"scaleZ": 3
},
"Value": 0,
"XmlUI": ""

View File

@ -0,0 +1,845 @@
local buttonCount = 20
local cameraCount = 18
function onLoad(saved_data)
self.createButton({
label = "",
tooltip = "Display full overlay",
click_function = "displayFull",
function_owner = self,
position = { 0.0, 0.1, -0.63 },
height = 70,
width = 700,
scale = { x = 1, y = 1, z = 1 },
color = { 1, 0, 0, 0 }
})
self.createButton({
label = "",
tooltip = "Display only play area",
click_function = "displayPlayArea",
function_owner = self,
position = { 0.0, 0.1, -0.39 },
height = 70,
width = 700,
scale = { x = 1, y = 1, z = 1 },
color = { 1, 0, 0, 0 }
})
self.createButton({
label = "",
tooltip = "Close overlay",
click_function = "closeOverlay",
function_owner = self,
position = { 0.0, 0.1, -0.16 },
height = 70,
width = 700,
scale = { x = 1, y = 1, z = 1 },
color = { 1, 0, 0, 0 }
})
self.createButton({
label = "",
tooltip = "Modify a camera position",
click_function = "beginSetCamera",
function_owner = self,
position = { 0.0, 0.1, 0.19 },
height = 70,
width = 700,
scale = { x = 1, y = 1, z = 1 },
color = { 1, 0, 0, 0 }
})
self.createButton({
label = "",
tooltip = "Claim a color (you will switch to this color when clicking in the overlay)",
click_function = "beginClaimColor",
function_owner = self,
position = { -0.22, 0.1, 0.42 },
height = 70,
width = 475,
scale = { x = 1, y = 1, z = 1 },
color = { 1, 0, 0, 0 }
})
self.createButton({
label = "",
tooltip = "Reset all color claims",
click_function = "resetClaimColors",
function_owner = self,
position = { 0.48, 0.1, 0.42 },
height = 70,
width = 230,
scale = { x = 1, y = 1, z = 1 },
color = { 1, 0, 0, 0 }
})
self.createButton({
label = "",
tooltip = "Reset camera positions to default",
click_function = "resetCameras",
function_owner = self,
position = { 0.0, 0.1, 0.78 },
height = 70,
width = 700,
scale = { x = 1, y = 1, z = 1 },
color = { 1, 0, 0, 0 }
})
defaultCameraParams = {
{ position = { -1.626, -2.5, 0 }, pitch = 74, yaw = 90, distance = 17.844 }, -- 1. ActAgenda
{ position = { -27.822, -2.5, 0.424 }, pitch = 74, yaw = 90, distance = -1 }, -- 2. Map
{ position = { -31.592, -2.5, 26.392 }, pitch = 74, yaw = 180, distance = -1 }, -- 3. Green playmat
{ position = { -55.026, -2.5, 12.052 }, pitch = 74, yaw = 90, distance = -1 }, -- 4. White playmat
{ position = { -55.026, -2.5, -11.479 }, pitch = 74, yaw = 90, distance = -1 }, -- 5. Orange playmat
{ position = { -31.592, -2.5, -26.392 }, pitch = 74, yaw = 0, distance = -1 }, -- 6. Red playmat
{ position = { -3.029, 1.652, 24.296 }, pitch = 74, yaw = 90, distance = 16 }, -- 7. Victory / SetAside
{ position = { -2.936, 1.552, -26.757 }, pitch = 74, yaw = 90, distance = 16 }, -- 8. Guide
{ position = { -11.833, 1.491, -0.145 }, pitch = 74, yaw = 90, distance = 10 }, -- 9. Player count
{ position = { -48.352, 1.552, -0.055 }, pitch = 74, yaw = 90, distance = 10 }, -- 10. Bless/Curse
{ position = { 12.560, 1.912, 0.458 }, pitch = 74, yaw = 90, distance = 35 }, -- 11. Scenarios
{ position = { 57.835, 1.552, 75.385 }, pitch = 74, yaw = 90, distance = 22 }, -- 12. Player card panel
{ position = { 60.377, 1.552, 55.941 }, pitch = 74, yaw = 90, distance = 10 }, -- 13. Card search panel
{ position = { 27.482, 1.480, 71.057 }, pitch = 74, yaw = 90, distance = 35 }, -- 14. Player card area
{ position = { -19.481, 1.552, 70.880 }, pitch = 74, yaw = 90, distance = 22 }, -- 15. Deck builder
{ position = { -52.918, 1.478, 70.899 }, pitch = 74, yaw = 90, distance = 42 }, -- 16. Rules area
{ position = { 24.551, 2.222, -71.284 }, pitch = 60, yaw = 90, distance = 60 }, -- 17. Cycle area
{ position = { -59.077, 1.462, -85.472 }, pitch = 74, yaw = 90, distance = 27 } -- 18. Additions
}
fullButtonData = {
{ id = "1", width = "84", height = "33", offsetX = "1", offsetY = "2" }, -- Act/Agenda
{ id = "2", width = "78", height = "69", offsetX = "1", offsetY = "-62" }, -- Map
{ id = "3", width = "36", height = "70", offsetX = "-62", offsetY = "-66" }, -- Green
{ id = "4", width = "70", height = "36", offsetX = "-36", offsetY = "-126" }, -- White
{ id = "5", width = "70", height = "36", offsetX = "39", offsetY = "-126" }, -- Orange
{ id = "6", width = "36", height = "70", offsetX = "64", offsetY = "-66" }, -- Red
{ id = "7", width = "38", height = "38", offsetX = "-64", offsetY = "-3" }, -- Victory
{ id = "8", width = "40", height = "40", offsetX = "66", offsetY = "-3" }, -- Guide
{ id = "9", width = "56", height = "16", offsetX = "1", offsetY = "-20" }, -- Player count
{ id = "10", width = "36", height = "16", offsetX = "1", offsetY = "-102" }, -- Bless/Curse
{ id = "11", width = "168", height = "56", offsetX = "1", offsetY = "47" }, -- Scenarios
{ id = "12", width = "52", height = "53", offsetX = "-154", offsetY = "134" }, -- Player card panel
{ id = "13", width = "22", height = "22", offsetX = "-116", offsetY = "132" }, -- Search card panel
{ id = "14", width = "120", height = "75", offsetX = "-152", offsetY = "70" }, -- Player card display
{ id = "15", width = "40", height = "54", offsetX = "-150", offsetY = "-38" }, -- Deck builder
{ id = "16", width = "104", height = "84", offsetX = "-154", offsetY = "-114" }, -- Rules area
{ id = "17", width = "100", height = "170", offsetX = "152", offsetY = "72" }, -- Cycle area
{ id = "18", width = "56", height = "60", offsetX = "182", offsetY = "-124" }, -- Additions
{ id = "19", width = "20", height = "20", offsetX = "-8", offsetY = "150" }, -- Shrink
{ id = "20", width = "20", height = "20", offsetX = "12", offsetY = "150" } -- Close
}
playButtonData = {
{ id = "1", width = "80", height = "33", offsetX = "0", offsetY = "55" },
{ id = "2", width = "78", height = "70", offsetX = "0", offsetY = "-8" },
{ id = "3", width = "35", height = "66", offsetX = "-65", offsetY = "-10" },
{ id = "4", width = "68", height = "32", offsetX = "-36", offsetY = "-71" },
{ id = "5", width = "68", height = "32", offsetX = "36", offsetY = "-71" },
{ id = "6", width = "35", height = "66", offsetX = "65", offsetY = "-10" },
{ id = "7", width = "38", height = "38", offsetX = "-66", offsetY = "52" },
{ id = "8", width = "38", height = "38", offsetX = "66", offsetY = "52" },
{ id = "9", width = "50", height = "12", offsetX = "0", offsetY = "33" },
{ id = "10", width = "32", height = "12", offsetX = "0", offsetY = "-48" },
{ id = "19", width = "20", height = "20", offsetX = "-10", offsetY = "80" },
{ id = "20", width = "20", height = "20", offsetX = "10", offsetY = "80" }
}
playermatData = {
{
guid = '383d8b',
origin = { x = -25.00, y = 0, z = 26.20 },
scale = { x = 31.5, y = 5.10, z = 14.59 },
orientation = { x = 0, y = 0, z = 0 },
minX = -44.43,
maxX = -17.44,
minZ = 20.17,
maxZ = 32.97,
xOffset = -0.07,
zOffset = 0.00,
claims = { true, false, false, false }
},
{
guid = '8b081b',
origin = { x = -54.42, y = 0, z = 20.96 },
scale = { x = 36.63, y = 5.10, z = 14.59 },
orientation = { x = 0, y = 270, z = 0 },
minX = -61.4,
maxX = -48.6,
minZ = -2.39,
maxZ = 24.53,
xOffset = 0.07,
zOffset = 0.03,
claims = { false, true, false, false }
},
{
guid = 'bd0ff4',
origin = { x = -54.42, y = 0, z = -20.96 },
scale = { x = 36.63, y = 5.10, z = 14.59 },
orientation = { x = 0, y = 270, z = 0 },
minX = -61.4,
maxX = -48.6,
minZ = -24.53,
maxZ = 2.39,
xOffset = 0.07,
zOffset = 0.02,
claims = { false, false, true, false }
},
{
guid = '0840d5',
origin = { x = -25.00, y = 0, z = -26.60 },
scale = { x = 31.5, y = 5.10, z = 14.59 },
orientation = { x = 0, y = 180, z = 0 },
minX = -44.43,
maxX = -17.44,
minZ = -32.97,
maxZ = -20.17,
xOffset = 0.07,
zOffset = -0.06,
claims = { false, false, false, true }
}
}
editing = false
claiming = false
selectedEditButton = -1
editPos = { 0, 0, 0 }
editPitch = 0
editYaw = 0
editDistance = 0
if saved_data ~= "" then
local loaded_data = JSON.decode(saved_data)
cameraParams = loaded_data.cameras
fullVisibility = loaded_data.fullVis
playVisibility = loaded_data.playVis
for i = 1, 4 do
playermatData[i].claims = loaded_data.claims[i]
end
else
cameraParams = { {}, {}, {}, {} }
for cam = 1, 4 do
cameraParams[cam] = {}
for i = 1, cameraCount do
cameraParams[cam][i] = {}
cameraParams[cam][i].position = defaultCameraParams[i].position
cameraParams[cam][i].pitch = defaultCameraParams[i].pitch
cameraParams[cam][i].yaw = defaultCameraParams[i].yaw
cameraParams[cam][i].distance = defaultCameraParams[i].distance
end
end
fullVisibility = { false, false, false, false }
playVisibility = { false, false, false, false }
end
resetOverlay()
end
function onSave()
local allclaims = {}
for i = 1, 4 do
table.insert(allclaims, playermatData[i].claims)
end
return JSON.encode({
cameras = cameraParams,
fullVis = fullVisibility,
playVis = playVisibility,
claims = allclaims
})
end
function displayFull(object, color)
local playerCount = getPlayerCount()
local colors
if playerCount == 0 then
return
elseif playerCount == 1 then
colors = { 1, 2, 3, 4 }
else
colors = { getIndexForPlayerColor(color) }
end
for i, v in ipairs(colors) do
if v > 0 then
fullVisibility[v] = true
playVisibility[v] = false
end
end
resetOverlay()
end
function displayPlayArea(object, color)
local playerCount = getPlayerCount()
local colors
if playerCount == 0 then
return
elseif playerCount == 1 then
colors = { 1, 2, 3, 4 }
else
colors = { getIndexForPlayerColor(color) }
end
for _, v in ipairs(colors) do
if v > 0 then
fullVisibility[v] = false
playVisibility[v] = true
end
end
resetOverlay()
end
function resetCameras(object, color)
local playerCount = getPlayerCount()
local colors
if playerCount == 0 then
return
elseif playerCount == 1 then
colors = { 1, 2, 3, 4 }
else
colors = { getIndexForPlayerColor(color) }
end
for iv, v in ipairs(colors) do
if v > 0 then
for i = 1, cameraCount do
cameraParams[v][i].position = defaultCameraParams[i].position
cameraParams[v][i].pitch = defaultCameraParams[i].pitch
cameraParams[v][i].yaw = defaultCameraParams[i].yaw
cameraParams[v][i].distance = defaultCameraParams[i].distance
end
end
end
end
function closeOverlay(object, color)
local playerCount = getPlayerCount()
local colors
editing = false
claiming = false
if playerCount == 0 then
return
elseif playerCount == 1 then
colors = { 1, 2, 3, 4 }
else
colors = { getIndexForPlayerColor(color) }
end
for _, v in ipairs(colors) do
if v > 0 then
fullVisibility[v] = false
playVisibility[v] = false
end
end
resetOverlay()
end
function resizeOverlay(object, color)
local playerCount = getPlayerCount()
local colors
if playerCount == 0 then
return
elseif playerCount == 1 then
colors = { 1, 2, 3, 4 }
else
colors = { getIndexForPlayerColor(color) }
end
for _, v in ipairs(colors) do
if v > 0 then
local full = fullVisibility[v]
fullVisibility[v] = not full
playVisibility[v] = full
end
end
resetOverlay()
end
function resetOverlay()
local guid = self.getGUID()
local color
local panel
local existingXml = UI.getXml()
local openingXml = ''
-- try to only remove our panels
for p = 1, 2 do
i, j = string.find(existingXml, '<Panel id="navPanel')
if i and i > 1 and string.len(openingXml) == 0 then
openingXml = string.sub(existingXml, 1, i - 1)
end
if i then
local panelXml = string.sub(existingXml, i)
k, m = string.find(panelXml, '</Panel>')
existingXml = string.sub(panelXml, m + 1)
else
break
end
end
local xml = openingXml .. [[
]] .. existingXml
local fullColors = ''
local playColors = ''
for i, v in pairs(fullVisibility) do
if v == true then
local matColor = getPlayerColorForIndex(i)
if string.len(fullColors) > 0 and matColor ~= nil then
fullColors = fullColors .. '|' .. matColor
elseif matColor ~= nil then
fullColors = matColor
end
end
end
for i, v in pairs(playVisibility) do
if v == true then
local matColor = getPlayerColorForIndex(i)
if string.len(playColors) > 0 and matColor ~= nil then
playColors = playColors .. '|' .. matColor
elseif matColor ~= nil then
playColors = matColor
end
end
end
if string.len(fullColors) > 0 then
data = fullButtonData
xml = xml ..
[[<Panel id="navPanelFull" height="358" width="455" visibility="]] ..
fullColors ..
[[" allowDragging="true" returnToOriginalPositionWhenReleased="false" rectAlignment="LowerRight" offsetXY="-40 0">
<image id="backgroundImage" image="OverlayLarge" />]]
for _, d in ipairs(data) do
local buttonID = tonumber(d.id)
if editing and buttonID < 19 then
if selectedEditButton < 0 then
color = "rgba(1,1,1,1)"
elseif buttonID == selectedEditButton then
color = "rgba(0,1,0,1)"
else
color = "rgba(1,0,0,1)"
end
elseif claiming and buttonID < 19 then
if buttonID >= 3 and buttonID <= 6 then
color = "rgba(1,1,1,1)"
else
color = "rgba(1,0,0,1)"
end
else
color = "rgba(0,1,0,0)"
end
xml = xml .. [[<button
onClick="]] .. guid .. [[/buttonClicked"
id="]] .. d.id .. [["
height="]] .. d.height .. [["
width="]] .. d.width .. [["
offsetXY="]] .. d.offsetX .. " " .. d.offsetY .. [["
color="]] .. color .. [["
>
</button>
]]
end
xml = xml .. [[ </Panel>]]
end
if string.len(playColors) > 0 then
data = playButtonData
xml = xml .. [[
<Panel id="navPanelPlay" height="208" width="205" visibility="]] ..
playColors ..
[[" allowDragging="true" returnToOriginalPositionWhenReleased="false" rectAlignment="LowerRight" offsetXY="-40 0">
<image id="backgroundImage" image="OverlaySmall" />]]
for _, d in ipairs(data) do
local buttonID = tonumber(d.id)
if editing and buttonID < 19 then
if selectedEditButton < 0 then
color = "rgba(1,1,1,1)"
elseif buttonID == selectedEditButton then
color = "rgba(0,1,0,1)"
else
color = "rgba(1,0,0,1)"
end
elseif claiming and buttonID < 19 then
if buttonID >= 3 and buttonID <= 6 then
color = "rgba(1,1,1,1)"
else
color = "rgba(1,0,0,1)"
end
else
color = "rgba(0,1,0,0)"
end
xml = xml .. [[<button
onClick="]] .. guid .. [[/buttonClicked"
id="]] .. d.id .. [["
height="]] .. d.height .. [["
width="]] .. d.width .. [["
offsetXY="]] .. d.offsetX .. " " .. d.offsetY .. [["
color="]] .. color .. [["
>
</button>
]]
end
xml = xml .. [[ </Panel>]]
end
local existingAssets = UI.getCustomAssets()
local largeOverlay = nil
local smallOverlay = nil
for _, v in pairs(existingAssets) do
for _, vv in pairs(v) do
if vv == 'OverlayLarge' then
largeOverlay = v
end
if vv == 'OverlaySmall' then
smallOverlay = v
end
end
end
local largeURL = 'http://cloud-3.steamusercontent.com/ugc/2021591230441678995/7B413A821136969D8723687A2AD66773B3F8FEED/'
local smallURL = 'http://cloud-3.steamusercontent.com/ugc/2021591230447630077/18C86248B9BDAF1DE01B67791439A39EE4F97B60/'
if largeOverlay == nil then
largeOverlay = { name = 'OverlayLarge', url = largeURL }
table.insert(existingAssets, largeOverlay)
else
largeOverlay.url = largeURL
end
if smallOverlay == nil then
smallOverlay = { name = 'OverlaySmall', url = smallURL }
table.insert(existingAssets, smallOverlay)
else
smallOverlay.url = smallURL
end
UI.setXml(xml, existingAssets)
end
function buttonClicked(player, _, idValue)
local buttonID = tonumber(idValue)
if buttonID == 19 then
resizeOverlay(nil, player.color)
return
elseif buttonID == 20 then
closeOverlay(nil, player.color)
return
end
if editing then
if selectedEditButton < 0 then
selectedEditButton = buttonID
else
if buttonID == selectedEditButton and editDistance > 0 then
local playerCount = getPlayerCount()
local colors
if playerCount == 1 then
colors = { 1, 2, 3, 4 }
else
colors = { getIndexForPlayerColor(player.color) }
end
for i, v in ipairs(colors) do
cameraParams[v][selectedEditButton].position = editPos
cameraParams[v][selectedEditButton].pitch = editPitch
cameraParams[v][selectedEditButton].yaw = editYaw
cameraParams[v][selectedEditButton].distance = editDistance
end
end
editing = false
selectedEditButton = -1
end
resetOverlay()
elseif claiming then
if buttonID >= 3 and buttonID <= 6 then
local colorID = buttonID - 2
local playerIndex = getIndexForPlayerColor(player.color)
-- if we haven't claimed it, break all earlier claims
if playermatData[playerIndex].claims[colorID] == false then
for i = 1, 4 do
if i ~= colorID then
playermatData[i].claims[colorID] = false
playermatData[colorID].claims[i] = false
end
end
end
for i = 1, 4 do
if playermatData[playerIndex].claims[i] then
playermatData[i].claims[colorID] = true
playermatData[colorID].claims[i] = true
end
end
fullVisibility[colorID] = fullVisibility[playerIndex]
playVisibility[colorID] = playVisibility[playerIndex]
end
claiming = false
resetOverlay()
else
loadCamera(player, _, idValue)
end
end
function loadCamera(player, _, idValue)
local index = tonumber(idValue)
local playerColor = player.color
local playerIndex = getIndexForPlayerColor(playerColor)
-- only do map zooming if the camera hasn't been specially set by user
if index == 2 and cameraParams[playerIndex][index].distance <= 0.0 then
local mapObjects = Physics.cast({
origin = { x = -29.2, y = 0, z = 0.0 },
direction = { x = 0, y = 1, z = 0 },
type = 3,
size = { x = 36, y = 5, z = 31.4 },
orientation = { x = 0, y = 90, z = 0 }
})
local minX = 100
local maxX = -100
local minZ = 100
local maxZ = -100
for _, v in pairs(mapObjects) do
local obj = v.hit_object
if obj.type == 'Card' or obj.type == 'Infinite' then
local bounds = obj.getBounds()
local x1 = bounds['center'][1] - bounds['size'][1] / 2
local x2 = bounds['center'][1] + bounds['size'][1] / 2
local z1 = bounds['center'][3] - bounds['size'][3] / 2
local z2 = bounds['center'][3] + bounds['size'][3] / 2
minX = math.min(x1, minX)
maxX = math.max(x2, maxX)
minZ = math.min(z1, minZ)
maxZ = math.max(z2, maxZ)
end
end
if minX < 100 then
local dx = maxX - minX
local dz = (maxZ - minZ) / (1.6) -- screen ratio * 1.2 (for my macbook pro, no idea how to generalize this)
local centerX = (minX + maxX) / 2 -- offset is to move it a bit up, so the cards don't block anything
local centerZ = (minZ + maxZ) / 2
local scale = math.max(dx, dz)
-- regression line from the following data points, seems linear
-- rows 1 scale 4.5 d 12
-- rows 2 scale 11 d 16
-- rows 3 scale 14.5 d 19.6
-- rows 4 scale 19.6 d 25
-- rows 5 scale 23.25 d 28
-- rows 6 scale 30.8 d 34
-- modified by testing
local d = 0.96 * scale + 5
player.lookAt({ position = { centerX, 0, centerZ }, pitch = 74, yaw = 90, distance = d })
else
player.lookAt({ position = { -30.667, 0, 0 }, pitch = 74, yaw = 90, distance = 32 })
end
elseif index >= 3 and index <= 6 then
local newMatIndex = index - 2 -- mat index 1 - 4
local newMatColor = getPlayerColorForIndex(newMatIndex)
if newMatColor ~= nil then
local playerCount = getPlayerCount()
if playerCount <= 1 or playermatData[playerIndex].claims[newMatIndex] then
player.changeColor(newMatColor)
end
end
if cameraParams[newMatIndex][index].distance <= 0.0 then
local matObjects = Physics.cast({
origin = playermatData[newMatIndex].origin,
direction = { x = 0, y = 1, z = 0 },
type = 3,
size = playermatData[newMatIndex].scale,
orientation = playermatData[newMatIndex].orientation
})
local minX = playermatData[newMatIndex].minX
local maxX = playermatData[newMatIndex].maxX
local minZ = playermatData[newMatIndex].minZ
local maxZ = playermatData[newMatIndex].maxZ
for _, v in pairs(matObjects) do
local obj = v.hit_object
if obj.type == 'Card' or obj.type == 'Infinite' then
local bounds = obj.getBounds()
local x1 = bounds['center'][1] - bounds['size'][1] / 2
local x2 = bounds['center'][1] + bounds['size'][1] / 2
local z1 = bounds['center'][3] - bounds['size'][3] / 2
local z2 = bounds['center'][3] + bounds['size'][3] / 2
minX = math.min(x1, minX)
maxX = math.max(x2, maxX)
minZ = math.min(z1, minZ)
maxZ = math.max(z2, maxZ)
end
end
local dx, dz, centerX, centerZ, yaw
-- White/Orange
if index > 3 and index < 6 then
dx = maxX - minX
dz = (maxZ - minZ) / 1.6 -- screen ratio * 1.2 (for my macbook pro, no idea how to generalize this)
yaw = 90
-- offset is to move it a bit up and right, so the cards/toolbar don't block anything
centerX = (minX + maxX) / 2 - dx * playermatData[newMatIndex].xOffset
centerZ = (minZ + maxZ) / 2 + dz * playermatData[newMatIndex].zOffset
-- Green/Red
else
dx = (maxX - minX) / 1.6
dz = maxZ - minZ
yaw = playermatData[newMatIndex].orientation.y + 180
centerX = (minX + maxX) / 2 + dx * playermatData[newMatIndex].zOffset
centerZ = (minZ + maxZ) / 2 - dz * playermatData[newMatIndex].xOffset
end
local scale = math.max(dx, dz)
local d = 0.64 * scale + 7
-- need to wait if the player color changed
Wait.frames(function()
player.lookAt({ position = { centerX, 0, centerZ }, pitch = 75.823, yaw = yaw, distance = d })
end, 2)
else
Wait.frames(function()
player.lookAt(cameraParams[newMatIndex][index])
end, 2)
end
else
player.lookAt(cameraParams[playerIndex][index])
end
end
function beginSetCamera(object, color)
if getPlayerCount() == 0 then
return
elseif getIndexForPlayerColor(color) < 0 then
return
end
editing = true
resetOverlay()
end
function updateEditCamera(params)
editPos = params[1]
editPitch = params[2]
editYaw = params[3]
editDistance = params[4]
end
function beginClaimColor(object, color)
if getPlayerCount() == 0 then
return
elseif getIndexForPlayerColor(color) < 0 then
return
end
claiming = true
resetOverlay()
end
function resetClaimColors(object, color)
if getPlayerCount() == 0 then
return
elseif getIndexForPlayerColor(color) < 0 then
return
end
for c1 = 1, 4 do
for c2 = 1, 4 do
if c1 == c2 then
playermatData[c1].claims[c2] = true
else
playermatData[c1].claims[c2] = false
end
end
end
end
function getPlayerCount()
local playerCount = 0
local playerColors = {}
for i = 1, 4 do
local guid = playermatData[i].guid
local mat = getObjectFromGUID(guid)
local color = mat.getVar('playerColor')
playerColors[i] = color
end
for _, v in ipairs(getSeatedPlayers()) do
for _, vv in ipairs(playerColors) do
if v == vv then
playerCount = playerCount + 1
end
end
end
return playerCount
end
function getPlayerColorForIndex(index)
if index < 0 or index > 4 then
return nil
end
local guid = playermatData[index]['guid']
if guid ~= nil then
local mat = getObjectFromGUID(guid)
return mat.getVar("playerColor")
end
end
function getIndexForPlayerColor(color)
for i = 1, 4 do
local mat = getObjectFromGUID(playermatData[i].guid)
if mat ~= nil then
if mat.getVar('playerColor') == color then
return i
end
end
end
return -1
end

View File

@ -87,9 +87,9 @@
],
"Tooltip": true,
"Transform": {
"posX": -58.148,
"posY": 1.565,
"posZ": 0,
"posX": -11.3,
"posY": 1.52,
"posZ": -16,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
@ -147,9 +147,9 @@
],
"Tooltip": true,
"Transform": {
"posX": -58.148,
"posY": 1.565,
"posZ": 0,
"posX": -11.3,
"posY": 1.52,
"posZ": -16,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
@ -207,9 +207,9 @@
],
"Tooltip": true,
"Transform": {
"posX": -58.148,
"posY": 1.565,
"posZ": 0,
"posX": -11.3,
"posY": 1.52,
"posZ": -16,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
@ -227,9 +227,9 @@
],
"Tooltip": true,
"Transform": {
"posX": -58.148,
"posY": 1.565,
"posZ": 0,
"posX": -11.3,
"posY": 1.52,
"posZ": -16,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -231,9 +231,9 @@
},
{
"Position": {
"x": 1.38,
"x": 1.365,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -243,9 +243,9 @@
},
{
"Position": {
"x": 0.92,
"x": 0.91,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -255,9 +255,9 @@
},
{
"Position": {
"x": 0.46,
"x": 0.455,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -269,7 +269,7 @@
"Position": {
"x": 0,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -279,9 +279,9 @@
},
{
"Position": {
"x": -0.46,
"x": -0.455,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -291,9 +291,9 @@
},
{
"Position": {
"x": -0.92,
"x": -0.91,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -303,9 +303,9 @@
},
{
"Position": {
"x": -1.38,
"x": -1.365,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -329,7 +329,7 @@
},
"ImageScalar": 1,
"ImageSecondaryURL": "",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/1859438430150777205/4ED2E0BC2A2C4728DA5E155C06AF1BA1FCB00D3B/",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2037357630681963618/E7271737B19CE0BFAAA382BEEEF497FE3E06ECC1/",
"WidthScale": 0
},
"Description": "",

View File

@ -231,9 +231,9 @@
},
{
"Position": {
"x": 1.38,
"x": 1.365,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -243,9 +243,9 @@
},
{
"Position": {
"x": 0.92,
"x": 0.91,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -255,9 +255,9 @@
},
{
"Position": {
"x": 0.46,
"x": 0.455,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -269,7 +269,7 @@
"Position": {
"x": 0,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -279,9 +279,9 @@
},
{
"Position": {
"x": -0.46,
"x": -0.455,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -291,9 +291,9 @@
},
{
"Position": {
"x": -0.92,
"x": -0.91,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -303,9 +303,9 @@
},
{
"Position": {
"x": -1.38,
"x": -1.365,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -329,7 +329,7 @@
},
"ImageScalar": 1,
"ImageSecondaryURL": "",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/1859438430150777205/4ED2E0BC2A2C4728DA5E155C06AF1BA1FCB00D3B/",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2037357630681963618/E7271737B19CE0BFAAA382BEEEF497FE3E06ECC1/",
"WidthScale": 0
},
"Description": "",

View File

@ -231,9 +231,9 @@
},
{
"Position": {
"x": 1.38,
"x": 1.365,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -243,9 +243,9 @@
},
{
"Position": {
"x": 0.92,
"x": 0.91,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -255,9 +255,9 @@
},
{
"Position": {
"x": 0.46,
"x": 0.455,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -269,7 +269,7 @@
"Position": {
"x": 0,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -279,9 +279,9 @@
},
{
"Position": {
"x": -0.46,
"x": -0.455,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -291,9 +291,9 @@
},
{
"Position": {
"x": -0.92,
"x": -0.91,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -303,9 +303,9 @@
},
{
"Position": {
"x": -1.38,
"x": -1.365,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -329,7 +329,7 @@
},
"ImageScalar": 1,
"ImageSecondaryURL": "",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/1859438430150777205/4ED2E0BC2A2C4728DA5E155C06AF1BA1FCB00D3B/",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2037357630681963618/E7271737B19CE0BFAAA382BEEEF497FE3E06ECC1/",
"WidthScale": 0
},
"Description": "",

View File

@ -231,9 +231,9 @@
},
{
"Position": {
"x": 1.38,
"x": 1.365,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -243,9 +243,9 @@
},
{
"Position": {
"x": 0.92,
"x": 0.91,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -255,9 +255,9 @@
},
{
"Position": {
"x": 0.46,
"x": 0.455,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -269,7 +269,7 @@
"Position": {
"x": 0,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -279,9 +279,9 @@
},
{
"Position": {
"x": -0.46,
"x": -0.455,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -291,9 +291,9 @@
},
{
"Position": {
"x": -0.92,
"x": -0.91,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -303,9 +303,9 @@
},
{
"Position": {
"x": -1.38,
"x": -1.365,
"y": 0.1,
"z": -0.645
"z": -0.625
},
"Rotation": {
"x": 0,
@ -329,7 +329,7 @@
},
"ImageScalar": 1,
"ImageSecondaryURL": "",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/1859438430150777205/4ED2E0BC2A2C4728DA5E155C06AF1BA1FCB00D3B/",
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/2037357630681963618/E7271737B19CE0BFAAA382BEEEF497FE3E06ECC1/",
"WidthScale": 0
},
"Description": "",

View File

@ -35,11 +35,11 @@
"posY": 3.5,
"posZ": 0,
"rotX": 0,
"rotY": 90,
"rotY": 0,
"rotZ": 0,
"scaleX": 37,
"scaleY": 4,
"scaleZ": 36.5
"scaleZ": 37
},
"Value": 0,
"XmlUI": ""

View File

@ -0,0 +1,55 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"b": 0,
"g": 0.86837,
"r": 1
},
"CustomAssetbundle": {
"AssetbundleSecondaryURL": "",
"AssetbundleURL": "http://cloud-3.steamusercontent.com/ugc/2037356539985233174/FB2785745105BDFB2903346BEA6D090B7A4609AC/",
"LoopingEffectIndex": 0,
"MaterialIndex": 2,
"TypeIndex": 0
},
"Description": "",
"DragSelectable": true,
"GMNotes": "",
"GUID": "3c988f",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScript": "",
"LuaScriptState": "",
"MeasureMovement": false,
"Name": "Custom_Assetbundle",
"Nickname": "SoundCube",
"Snap": true,
"Sticky": true,
"Tags": [
"SoundCube"
],
"Tooltip": true,
"Transform": {
"posX": 78,
"posY": 1.645,
"posZ": -27,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"scaleX": 1,
"scaleY": 1,
"scaleZ": 1
},
"Value": 0,
"XmlUI": ""
}

View File

@ -45,15 +45,15 @@
],
"Tooltip": true,
"Transform": {
"posX": -6.755,
"posY": 1.583,
"posZ": -16.526,
"posX": -57.72,
"posY": 1.481,
"posZ": 0,
"rotX": 0,
"rotY": 90,
"rotY": 270,
"rotZ": 0,
"scaleX": 0.8,
"scaleX": 1,
"scaleY": 1,
"scaleZ": 0.8
"scaleZ": 1
},
"Value": 0,
"XmlUI": ""

View File

@ -3,72 +3,72 @@ Cleans up the table for the next scenario in a campaign:
- sets counters to default values (resources and doom) or trauma values (health and sanity, if not disabled) from campaign log
- puts everything on playmats and hands into respective trashcans
- use the IGNORE_TAG to exclude objects from tidying (default: "CleanUpHelper_Ignore")]]
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
local playmatApi = require("playermat/PlaymatApi")
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
local soundCubeApi = require("core/SoundCubeApi")
local playmatApi = require("playermat/PlaymatApi")
-- these objects will be ignored
local IGNORE_GUIDS = {
local IGNORE_GUIDS = {
-- big playmat, change image panel and investigator counter
"b7b45b"; "f182ee"; "721ba2";
"b7b45b", "f182ee", "721ba2",
-- bless/curse manager
"afa06b"; "bd0253"; "5933fb";
"afa06b", "bd0253", "5933fb",
-- stuff on agenda/act playmat
"85c4c6"; "4a3aa4"; "fea079"; "b015d8"; "11e0cf"; "9f334f"; "70b9f6"; "0a5a29";
"85c4c6", "4a3aa4", "fea079", "b015d8", "11e0cf", "9f334f", "70b9f6", "0a5a29",
-- doom/location token bag
"47ffc3"; "170f10";
"47ffc3", "170f10",
-- table
"4ee1f2"
}
-- objects with this tag will be ignored
local IGNORE_TAG = "CleanUpHelper_ignore"
local IGNORE_TAG = "CleanUpHelper_ignore"
-- colors and order for following tables
local COLORS = { "White"; "Orange"; "Green"; "Red"; "Agenda" }
local COLORS = { "White", "Orange", "Green", "Red", "Agenda" }
-- counter GUIDS (4x damage and 4x horror)
local DAMAGE_HORROR_GUIDS = {
"eb08d6"; "e64eec"; "1f5a0a"; "591a45";
"468e88"; "0257d9"; "7b5729"; "beb964";
local DAMAGE_HORROR_GUIDS = {
"eb08d6", "e64eec", "1f5a0a", "591a45",
"468e88", "0257d9", "7b5729", "beb964",
}
local RESET_VALUES = {}
local RESET_VALUES = {}
-- GUIDS of objects (in order of ownership relating to 'COLORS')
local PLAYERMAT_GUIDS = { "8b081b"; "bd0ff4"; "383d8b"; "0840d5" }
local RESOURCE_GUIDS = { "4406f0"; "816d84"; "cd15ac"; "a4b60d" }
local TRACKER_GUIDS = { "e598c2"; "b4a5f7"; "af7ed7"; "e74881" }
local CLUE_GUIDS = { "d86b7c"; "1769ed"; "032300"; "37be78" }
local CLUE_CLICKER_GUIDS = { "db85d6"; "3f22e5"; "891403"; "4111de" }
local TRASHCAN_GUIDS = { "147e80"; "f7b6c8"; "5f896a"; "4b8594"; "70b9f6" }
local PLAYERMAT_GUIDS = { "8b081b", "bd0ff4", "383d8b", "0840d5" }
local RESOURCE_GUIDS = { "4406f0", "816d84", "cd15ac", "a4b60d" }
local TRACKER_GUIDS = { "e598c2", "b4a5f7", "af7ed7", "e74881" }
local CLUE_GUIDS = { "d86b7c", "1769ed", "032300", "37be78" }
local CLUE_CLICKER_GUIDS = { "db85d6", "3f22e5", "891403", "4111de" }
local TRASHCAN_GUIDS = { "147e80", "f7b6c8", "5f896a", "4b8594", "70b9f6" }
-- values for physics.cast (4 entries for player zones, 5th entry for agenda/act deck, 6th for campaign log)
local PHYSICS_POSITION = {
{ -54.5, 2, 21 };
{ -54.5, 2, -21 };
{ -27.0, 2, 26 };
{ -27.0, 2, -26 };
{ -02.0, 2, 10 };
local PHYSICS_POSITION = {
{ -54.5, 2, 21 },
{ -54.5, 2, -21 },
{ -27.0, 2, 26 },
{ -27.0, 2, -26 },
{ -02.0, 2, 10 },
{ -00.0, 2, -27 }
}
local PHYSICS_ROTATION = { 270, 270, 0, 180, 270, 0 }
local PHYSICS_ROTATION = { 270, 270, 0, 180, 270, 0 }
local PHYSICS_SCALE = {
{ 36.6, 1, 14.5 };
{ 36.6, 1, 14.5 };
{ 34.0, 1, 14.5 };
{ 34.0, 1, 14.5 };
{ 55.0, 1, 13.5 };
local PHYSICS_SCALE = {
{ 36.6, 1, 14.5 },
{ 36.6, 1, 14.5 },
{ 34.0, 1, 14.5 },
{ 34.0, 1, 14.5 },
{ 55.0, 1, 13.5 },
{ 05.0, 1, 05.0 }
}
local optionsVisible = false
local options = {}
options["importTrauma"] = true
options["tidyPlayermats"] = true
options["removeDrawnLines"] = false
local optionsVisible = false
local options = {}
options["importTrauma"] = true
options["tidyPlayermats"] = true
options["removeDrawnLines"] = false
local buttonParameters = {}
buttonParameters.function_owner = self
@ -160,6 +160,7 @@ function cleanUp(_, color)
printToAll("Clean up started!", "Orange")
printToAll("Resetting counters...", "White")
soundCubeApi.playSoundByName("Vacuum")
ignoreCustomDataHelper()
getTrauma()
updateCounters(DAMAGE_HORROR_GUIDS, RESET_VALUES, "Damage / Horror")
@ -179,7 +180,6 @@ end
---------------------------------------------------------
-- modular functions, called by other functions
---------------------------------------------------------
function updateCounters(tableOfGUIDs, tableOfNewValues, info)
if tonumber(tableOfNewValues) then
local value = tableOfNewValues
@ -234,8 +234,8 @@ end
-- read values for trauma from campaign log if enabled
function getTrauma()
RESET_VALUES = {
0; 0; 0; 0;
0; 0; 0; 0
0, 0, 0, 0,
0, 0, 0, 0
}
-- stop here if trauma import is disabled

View File

@ -5,8 +5,8 @@ do
-- removes all taken tokens and resets the counts
BlessCurseManagerApi.removeTakenTokensAndReset = function()
local BlessCurseManager = getObjectFromGUID(MANAGER_GUID)
Wait.time(function() BlessCurseManager.call("removeType", "Bless") end, 0.05)
Wait.time(function() BlessCurseManager.call("removeType", "Curse") end, 0.10)
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Bless") end, 0.05)
Wait.time(function() BlessCurseManager.call("removeTakenTokens", "Curse") end, 0.10)
Wait.time(function() BlessCurseManager.call("doReset", "White") end, 0.15)
end

View File

@ -34,6 +34,7 @@ local hideTitleSplashWaitFunctionId = nil
local playmatApi = require("playermat/PlaymatApi")
local tokenManager = require("core/token/TokenManager")
local playAreaAPI = require("core/PlayAreaApi")
local soundCubeApi = require("core/SoundCubeApi")
local mythosAreaApi = require("core/MythosAreaApi")
local tokenArrangerApi = require("accessories/TokenArrangerApi")
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
@ -878,7 +879,7 @@ function applyOptionPanelChange(id, state)
-- option: Show attachment helper
elseif id == "showAttachmentHelper" then
optionPanel[id] = spawnOrRemoveHelper(state, "Attachment Helper", {-64, 1.4, 0})
optionPanel[id] = spawnOrRemoveHelper(state, "Attachment Helper", {-61, 1.4, 0})
-- option: Show navigation overlay
elseif id == "showNavigationOverlay" then
@ -935,6 +936,9 @@ function spawnHelperObject(name, position, rotation)
for _, obj in ipairs(sourceBag.getData().ContainedObjects) do
if obj["Nickname"] == name then
spawnTable.data = obj
spawnTable.callback_function = function(spawnedObj)
Wait.time(function() spawnedObj.setLock(true) end, 2)
end
return spawnObjectData(spawnTable)
end
end
@ -1026,5 +1030,7 @@ function titleSplash(scenarioName)
UI.hide('title_splash')
hideTitleSplashWaitFunctionId = nil
end, 4)
soundCubeApi.playSoundByName("Deep Bell")
end
end

View File

@ -0,0 +1,21 @@
do
local SoundCubeApi = {}
-- this table links the name of a trigger effect to its index
local soundIndices = {
["Vacuum"] = 0,
["Deep Bell"] = 1
}
function playTriggerEffect(index)
getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index)
end
-- plays the by name requested sound
---@param soundName String Name of the sound to play
SoundCubeApi.playSoundByName = function(soundName)
playTriggerEffect(soundIndices[soundName])
end
return SoundCubeApi
end

View File

@ -8,17 +8,13 @@ local DEBUG = false
local collisionEnabled = false
-- position offsets relative to mat [x, y, z]
local DRAWN_ENCOUNTER_CARD_OFFSET = {1.365, 0.5, -0.635}
local DRAWN_CHAOS_TOKEN_OFFSET = {-1.55, 0.5, -0.58}
local DISCARD_BUTTON_OFFSETS = {
{-1.38, 0.1, -0.94},
{-0.92, 0.1, -0.94},
{-0.46, 0.1, -0.94},
{0.00, 0.1, -0.94},
{0.46, 0.1, -0.94},
{0.92, 0.1, -0.94}
}
local DRAWN_ENCOUNTER_CARD_OFFSET = {1.365, 0.5, -0.625}
local DRAWN_CHAOS_TOKEN_OFFSET = {-1.55, 0.25, -0.58}
-- x-Values for discard buttons
local DISCARD_BUTTON_OFFSETS = {-1.365, -0.91, -0.455, 0, 0.455, 0.91}
-- defined areas for the function "inArea()""
local MAIN_PLAY_AREA = {
upperLeft = {
x = 1.98,
@ -193,7 +189,8 @@ function makeDiscardHandlerFor(searchPosition, discardPosition)
end
-- build a discard button to discard from searchPosition to discardPosition (number must be unique)
function makeDiscardButton(position, discardPosition, number)
function makeDiscardButton(xValue, discardPosition, number)
local position = { xValue, 0.1, -0.94}
local searchPosition = {-position[1], position[2], position[3] + 0.32}
local handler = makeDiscardHandlerFor(searchPosition, discardPosition)
local handlerName = 'handler' .. number
@ -694,11 +691,13 @@ end
function removeTokensFromObject(object)
for _, v in ipairs(searchArea(object.getPosition(), { 3, 1, 4 })) do
local obj = v.hit_object
-- don't remove the table surface, self, any decks/cards or chaos tokens
if obj.getGUID() ~= "4ee1f2" and
if obj.getGUID() ~= "4ee1f2" and -- table
obj ~= self and
obj.type ~= "Deck" and
obj.type ~= "Card" and
obj.getLock() == false and
obj.getDescription() ~= "Action Token" and
not tokenChecker.isChaosToken(obj) then
TRASHCAN.putObject(obj)
end

View File

@ -30,7 +30,6 @@ do
local commonZones = {}
commonZones["Investigator"] = { -1.17702, 0, 0.00209 }
commonZones["Minicard"] = { -1.17702, 0, -1.45 }
commonZones["Deck"] = { -1.822724, 0, -0.02940192 }
commonZones["Discard"] = { -1.822451, 0, 0.6092291 }
commonZones["Ally"] = { -0.6157398, 0, 0.02435675 }
@ -51,7 +50,6 @@ do
local zoneData = {}
zoneData["White"] = {}
zoneData["White"]["Investigator"] = commonZones["Investigator"]
zoneData["White"]["Minicard"] = commonZones["Minicard"]
zoneData["White"]["Deck"] = commonZones["Deck"]
zoneData["White"]["Discard"] = commonZones["Discard"]
zoneData["White"]["Ally"] = commonZones["Ally"]
@ -68,6 +66,7 @@ do
zoneData["White"]["Threat2"] = commonZones["Threat2"]
zoneData["White"]["Threat3"] = commonZones["Threat3"]
zoneData["White"]["Threat4"] = commonZones["Threat4"]
zoneData["White"]["Minicard"] = { -1, 0, -1.45 }
zoneData["White"]["SetAside1"] = { 2.345893, 0, -0.520315 }
zoneData["White"]["SetAside2"] = { 2.345893, 0, 0.042552 }
zoneData["White"]["SetAside3"] = { 2.345893, 0, 0.605419 }
@ -79,7 +78,6 @@ do
zoneData["Orange"] = {}
zoneData["Orange"]["Investigator"] = commonZones["Investigator"]
zoneData["Orange"]["Minicard"] = commonZones["Minicard"]
zoneData["Orange"]["Deck"] = commonZones["Deck"]
zoneData["Orange"]["Discard"] = commonZones["Discard"]
zoneData["Orange"]["Ally"] = commonZones["Ally"]
@ -96,6 +94,7 @@ do
zoneData["Orange"]["Threat2"] = commonZones["Threat2"]
zoneData["Orange"]["Threat3"] = commonZones["Threat3"]
zoneData["Orange"]["Threat4"] = commonZones["Threat4"]
zoneData["Orange"]["Minicard"] = { 1, 0, -1.45 }
zoneData["Orange"]["SetAside1"] = { -2.350362, 0, -0.520315 }
zoneData["Orange"]["SetAside2"] = { -2.350362, 0, 0.042552 }
zoneData["Orange"]["SetAside3"] = { -2.350362, 0, 0.605419 }