diff --git a/src/core/NavigationOverlayHandler.ttslua b/src/core/NavigationOverlayHandler.ttslua index ad8f37d4..cf5084aa 100644 --- a/src/core/NavigationOverlayHandler.ttslua +++ b/src/core/NavigationOverlayHandler.ttslua @@ -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("This playermat seems to be removed.", 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 },