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")
|
||||
|
||||
fullButtonData = {
|
||||
@ -185,7 +186,6 @@ end
|
||||
|
||||
-- XML button creation
|
||||
function createXmlButtonHelper(ui, params)
|
||||
local guid = self.getGUID()
|
||||
local xml = findTagWithId(ui, params.id)
|
||||
|
||||
-- add basic image
|
||||
@ -202,7 +202,7 @@ function createXmlButtonHelper(ui, params)
|
||||
table.insert(xml.children, {
|
||||
tag = "button",
|
||||
attributes = {
|
||||
onClick = guid .. "/buttonClicked",
|
||||
onClick = self.getGUID() .. "/buttonClicked",
|
||||
id = d.id,
|
||||
height = d.height,
|
||||
width = d.width,
|
||||
@ -311,10 +311,18 @@ function loadCamera(player, camera)
|
||||
matColor = camera
|
||||
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
|
||||
if index == 2 then
|
||||
-- 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 = {
|
||||
position = { bounds.middleX, 1.55, bounds.middleZ },
|
||||
|
Loading…
x
Reference in New Issue
Block a user