update camera position
This commit is contained in:
parent
ca79dcb1a0
commit
26c65700e7
@ -32,7 +32,7 @@
|
|||||||
"IgnoreFoW": false,
|
"IgnoreFoW": false,
|
||||||
"LayoutGroupSortIndex": 0,
|
"LayoutGroupSortIndex": 0,
|
||||||
"Locked": false,
|
"Locked": false,
|
||||||
"LuaScript": "require(\"core/NavigationOverlay\")",
|
"LuaScript": "",
|
||||||
"LuaScriptState": "",
|
"LuaScriptState": "",
|
||||||
"MeasureMovement": false,
|
"MeasureMovement": false,
|
||||||
"Name": "Custom_Tile",
|
"Name": "Custom_Tile",
|
||||||
|
@ -641,7 +641,13 @@ function onClick_load()
|
|||||||
UI.hide('load_button')
|
UI.hide('load_button')
|
||||||
end
|
end
|
||||||
|
|
||||||
function onClick_toggleUi(_, title)
|
function onClick_toggleUi(color, title)
|
||||||
|
if title == "Navigation Overlay" then
|
||||||
|
local navigationOverlayHandler = getObjectFromGUID("797ede")
|
||||||
|
navigationOverlayHandler.call("cycleVisibility", color)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
UI.hide('optionPanel')
|
UI.hide('optionPanel')
|
||||||
UI.hide('load_ui')
|
UI.hide('load_ui')
|
||||||
|
|
||||||
|
@ -39,34 +39,34 @@ playButtonData = {
|
|||||||
playermatData = {
|
playermatData = {
|
||||||
{
|
{
|
||||||
guid = '8b081b',
|
guid = '8b081b',
|
||||||
origin = { x = -54.42, y = 0, z = 20.96 },
|
origin = { x = -55, y = 0, z = 21 },
|
||||||
scale = { x = 36.63, y = 5.10, z = 14.59 },
|
scale = { x = 36.6, y = 5.10, z = 15 },
|
||||||
orientation = { x = 0, y = 270, z = 0 },
|
orientation = { x = 0, y = 270, z = 0 },
|
||||||
minX = -61.4,
|
minX = -61.4,
|
||||||
maxX = -48.6,
|
maxX = -48.6,
|
||||||
minZ = -2.39,
|
minZ = -2.4,
|
||||||
maxZ = 24.53,
|
maxZ = 24.5,
|
||||||
xOffset = 0.07,
|
xOffset = 0.07,
|
||||||
zOffset = 0.03,
|
zOffset = 0.02,
|
||||||
claims = { true, false, false, false }
|
claims = { true, false, false, false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
guid = 'bd0ff4',
|
guid = 'bd0ff4',
|
||||||
origin = { x = -54.42, y = 0, z = -20.96 },
|
origin = { x = -55, y = 0, z = -21 },
|
||||||
scale = { x = 36.63, y = 5.10, z = 14.59 },
|
scale = { x = 36.6, y = 5.1, z = 15 },
|
||||||
orientation = { x = 0, y = 270, z = 0 },
|
orientation = { x = 0, y = 270, z = 0 },
|
||||||
minX = -61.4,
|
minX = -61.4,
|
||||||
maxX = -48.6,
|
maxX = -48.6,
|
||||||
minZ = -24.53,
|
minZ = -24.5,
|
||||||
maxZ = 2.39,
|
maxZ = 2.4,
|
||||||
xOffset = 0.07,
|
xOffset = 0.07,
|
||||||
zOffset = 0.02,
|
zOffset = 0.02,
|
||||||
claims = { false, true, false, false }
|
claims = { false, true, false, false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
guid = '383d8b',
|
guid = '383d8b',
|
||||||
origin = { x = -25.00, y = 0, z = 26.20 },
|
origin = { x = -25, y = 0, z = 26.5 },
|
||||||
scale = { x = 31.5, y = 5.10, z = 14.59 },
|
scale = { x = 31.5, y = 5.1, z = 15 },
|
||||||
orientation = { x = 0, y = 0, z = 0 },
|
orientation = { x = 0, y = 0, z = 0 },
|
||||||
minX = -44.43,
|
minX = -44.43,
|
||||||
maxX = -17.44,
|
maxX = -17.44,
|
||||||
@ -78,8 +78,8 @@ playermatData = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
guid = '0840d5',
|
guid = '0840d5',
|
||||||
origin = { x = -25.00, y = 0, z = -26.60 },
|
origin = { x = -25, y = 0, z = -26.5 },
|
||||||
scale = { x = 31.5, y = 5.10, z = 14.59 },
|
scale = { x = 31.5, y = 5.1, z = 15 },
|
||||||
orientation = { x = 0, y = 180, z = 0 },
|
orientation = { x = 0, y = 180, z = 0 },
|
||||||
minX = -44.43,
|
minX = -44.43,
|
||||||
maxX = -17.44,
|
maxX = -17.44,
|
||||||
@ -112,13 +112,8 @@ defaultCameraParams = {
|
|||||||
{ position = { -59.077, 1.462, -85.472 }, pitch = 74, yaw = 90, distance = 27 } -- 18. Additions
|
{ position = { -59.077, 1.462, -85.472 }, pitch = 74, yaw = 90, distance = 27 } -- 18. Additions
|
||||||
}
|
}
|
||||||
|
|
||||||
editing = false
|
local editing = false
|
||||||
claiming = false
|
local claiming = false
|
||||||
selectedEditButton = -1
|
|
||||||
editPos = { 0, 0, 0 }
|
|
||||||
editPitch = 0
|
|
||||||
editYaw = 0
|
|
||||||
editDistance = 0
|
|
||||||
|
|
||||||
function onSave()
|
function onSave()
|
||||||
local allclaims = {}
|
local allclaims = {}
|
||||||
@ -228,6 +223,9 @@ function closeOverlay(_, color)
|
|||||||
setVisibility("close", color)
|
setVisibility("close", color)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function cycleVisibility(color)
|
||||||
|
setVisibility("next", color)
|
||||||
|
end
|
||||||
function setVisibility(type, color)
|
function setVisibility(type, color)
|
||||||
local colors = getColors(color)
|
local colors = getColors(color)
|
||||||
local visibility
|
local visibility
|
||||||
@ -242,6 +240,16 @@ function setVisibility(type, color)
|
|||||||
|
|
||||||
for _, v in ipairs(colors) do
|
for _, v in ipairs(colors) do
|
||||||
if v > 0 then
|
if v > 0 then
|
||||||
|
-- override visibility to cycle to the next
|
||||||
|
if type == "next" then
|
||||||
|
if fullVisibility[v] then
|
||||||
|
visibility = { full = false, play = true }
|
||||||
|
elseif playVisibility[v] then
|
||||||
|
visibility = { full = false, play = false }
|
||||||
|
else
|
||||||
|
visibility = { full = true, play = false }
|
||||||
|
end
|
||||||
|
end
|
||||||
fullVisibility[v] = visibility.full
|
fullVisibility[v] = visibility.full
|
||||||
playVisibility[v] = visibility.play
|
playVisibility[v] = visibility.play
|
||||||
end
|
end
|
||||||
@ -573,32 +581,25 @@ function loadCamera(player, _, idValue)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local dx, dz, centerX, centerZ, yaw
|
local divisor
|
||||||
|
|
||||||
-- White/Orange
|
-- White/Orange
|
||||||
if index > 3 and index < 6 then
|
if index == 3 or index == 4 then
|
||||||
dx = maxX - minX
|
divisor = {x = 1, z = 1.6 } -- screen ratio * 1.2 (for my macbook pro, no idea how to generalize this)
|
||||||
dz = (maxZ - minZ) / 1.6 -- screen ratio * 1.2 (for my macbook pro, no idea how to generalize this)
|
-- Green/Red
|
||||||
yaw = playermatData[newMatIndex].orientation.y + 180
|
|
||||||
|
|
||||||
-- 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
|
else
|
||||||
dx = (maxX - minX) / 1.6
|
divisor = {x = 1.6, z = 1}
|
||||||
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
|
end
|
||||||
|
|
||||||
local scale = math.max(dx, dz)
|
|
||||||
local d = 0.64 * scale + 7
|
|
||||||
|
|
||||||
-- need to wait if the player color changed
|
-- need to wait if the player color changed
|
||||||
Wait.frames(
|
Wait.frames(
|
||||||
function() player.lookAt({ position = { centerX, 0, centerZ }, pitch = 75.823, yaw = yaw, distance = d }) end, 2)
|
function() player.lookAt({
|
||||||
|
position = { (minX + maxX) / 2, 0, (minZ + maxZ) / 2 },
|
||||||
|
pitch = 75.823,
|
||||||
|
yaw = playermatData[newMatIndex].orientation.y + 180,
|
||||||
|
distance = 0.64 * math.max((maxX - minX) / divisor.x, (maxZ - minZ) / divisor.z) + 7
|
||||||
|
})
|
||||||
|
end, 2)
|
||||||
else
|
else
|
||||||
Wait.frames(function() player.lookAt(cameraParams[newMatIndex][index]) end, 2)
|
Wait.frames(function() player.lookAt(cameraParams[newMatIndex][index]) end, 2)
|
||||||
end
|
end
|
||||||
@ -615,6 +616,13 @@ function beginSetCamera(object, color)
|
|||||||
updateOverlay()
|
updateOverlay()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TO-DO: update this
|
||||||
|
editPos = { 0, 0, 0 }
|
||||||
|
editPitch = 0
|
||||||
|
editYaw = 0
|
||||||
|
editDistance = 0
|
||||||
|
selectedEditButton = -1
|
||||||
|
|
||||||
function updateEditCamera(params)
|
function updateEditCamera(params)
|
||||||
editPos = params[1]
|
editPos = params[1]
|
||||||
editPitch = params[2]
|
editPitch = params[2]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user