Merge pull request #876 from argonui/nav-overlay
Navigation Overlay: Handling for removed mats
This commit is contained in:
commit
11e07122e2
@ -1,3 +1,4 @@
|
|||||||
|
local guidReferenceApi = require("core/GUIDReferenceApi")
|
||||||
local playermatApi = require("playermat/PlayermatApi")
|
local playermatApi = require("playermat/PlayermatApi")
|
||||||
|
|
||||||
fullButtonData = {
|
fullButtonData = {
|
||||||
@ -185,7 +186,6 @@ end
|
|||||||
|
|
||||||
-- XML button creation
|
-- XML button creation
|
||||||
function createXmlButtonHelper(ui, params)
|
function createXmlButtonHelper(ui, params)
|
||||||
local guid = self.getGUID()
|
|
||||||
local xml = findTagWithId(ui, params.id)
|
local xml = findTagWithId(ui, params.id)
|
||||||
|
|
||||||
-- add basic image
|
-- add basic image
|
||||||
@ -202,7 +202,7 @@ function createXmlButtonHelper(ui, params)
|
|||||||
table.insert(xml.children, {
|
table.insert(xml.children, {
|
||||||
tag = "button",
|
tag = "button",
|
||||||
attributes = {
|
attributes = {
|
||||||
onClick = guid .. "/buttonClicked",
|
onClick = self.getGUID() .. "/buttonClicked",
|
||||||
id = d.id,
|
id = d.id,
|
||||||
height = d.height,
|
height = d.height,
|
||||||
width = d.width,
|
width = d.width,
|
||||||
@ -311,10 +311,18 @@ function loadCamera(player, camera)
|
|||||||
matColor = camera
|
matColor = camera
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- if mat is removed, end here
|
||||||
|
local mat = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat")
|
||||||
|
if mat == nil then
|
||||||
|
printToColor("Couldn't find this playermat.", player.color)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-- dynamic view of the play area
|
-- dynamic view of the play area
|
||||||
if index == 2 then
|
if index == 2 then
|
||||||
-- search the scripting zone on the play area for objects
|
-- search the scripting zone on the play area for objects
|
||||||
local bounds = getDynamicViewBounds(getObjectFromGUID("a2f932").getObjects())
|
local zone = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlayAreaZone")
|
||||||
|
local bounds = getDynamicViewBounds(zone.getObjects())
|
||||||
|
|
||||||
lookHere = {
|
lookHere = {
|
||||||
position = { bounds.middleX, 1.55, bounds.middleZ },
|
position = { bounds.middleX, 1.55, bounds.middleZ },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user