automatically set description of chaos tokens
This commit is contained in:
parent
1f49718fae
commit
99ed76417e
@ -33,6 +33,7 @@ local hideTitleSplashWaitFunctionId = nil
|
||||
local playmatApi = require("playermat/playmatApi")
|
||||
local tokenManager = require("core/token/TokenManager")
|
||||
local playAreaAPI = require("core/PlayAreaApi")
|
||||
local mythosAreaApi = require("core/MythosAreaApi")
|
||||
local tokenArrangerApi = require("accessories/TokenArrangerApi")
|
||||
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
|
||||
|
||||
@ -300,7 +301,15 @@ function drawChaosToken(params)
|
||||
position = mat.positionToWorld(tokenOffset),
|
||||
rotation = mat.getRotation()
|
||||
})
|
||||
trackChaosToken(token.getName(), mat.getGUID())
|
||||
|
||||
-- get data for token description
|
||||
local name = token.getName()
|
||||
local tokenData = mythosAreaApi.returnTokenData().tokenData or {}
|
||||
local specificData = tokenData[name] or {}
|
||||
token.setDescription(specificData.description or "")
|
||||
|
||||
-- track the chaos token (for stat tracker and future returning)
|
||||
trackChaosToken(name, mat.getGUID())
|
||||
chaosTokens[#chaosTokens + 1] = token
|
||||
return
|
||||
else
|
||||
|
@ -62,7 +62,10 @@ function onCollisionEnter(collisionInfo)
|
||||
-- trigger update if a change was detected and push new data
|
||||
if updateNeeded then
|
||||
local metadata = JSON.decode(object.getGMNotes()) or {}
|
||||
if not metadata["tokens"] then return end
|
||||
if not metadata["tokens"] then
|
||||
tokenData = {}
|
||||
return
|
||||
end
|
||||
tokenData = metadata["tokens"][(useFrontData and "front" or "back")]
|
||||
fireTokenDataChangedEvent()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user