investigator handling
This commit is contained in:
parent
5fba05bd57
commit
c35939402c
@ -157,15 +157,22 @@ function onDrop(playerColor)
|
|||||||
local syncObj = searchResult[1]
|
local syncObj = searchResult[1]
|
||||||
local syncName = syncObj.getName()
|
local syncName = syncObj.getName()
|
||||||
local notes = syncObj.getGMNotes()
|
local notes = syncObj.getGMNotes()
|
||||||
local metadata = JSON.decode(notes) or {}
|
local md = JSON.decode(notes) or {}
|
||||||
local syncId = metadata.id
|
|
||||||
|
|
||||||
-- loop through background table
|
-- loop through background table
|
||||||
for _, bgInfo in ipairs(BACKGROUNDS) do
|
for _, bgInfo in ipairs(BACKGROUNDS) do
|
||||||
if bgInfo.id == syncId or bgInfo.id2 == syncId then
|
if bgInfo.id == md.id or bgInfo.id2 == md.id then
|
||||||
printToColor("Background for '" .. syncName .. "' loaded!", playerColor, "Green")
|
printToColor("Background for '" .. syncName .. "' loaded!", playerColor, "Green")
|
||||||
showIcons = bgInfo.icons
|
showIcons = bgInfo.icons
|
||||||
self.setRotation(syncObj.getRotation())
|
|
||||||
|
-- update rotation
|
||||||
|
local syncRotY = syncObj.getRotation().y
|
||||||
|
if md.type == "Investigator" then
|
||||||
|
syncRotY = syncRotY + 90
|
||||||
|
end
|
||||||
|
self.setRotation(self.getRotation():setAt("y", syncRotY))
|
||||||
|
|
||||||
|
-- update the image
|
||||||
updateImage(bgInfo.url)
|
updateImage(bgInfo.url)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user