fixed references

This commit is contained in:
Chr1Z93 2023-10-19 17:04:44 +02:00
parent 7042fd9968
commit 77bb65bfa0

View File

@ -30,8 +30,6 @@ local NOT_INTERACTABLE = {
"975c39", -- vertical border right
}
local guidHandler, DATA_HELPER
-- global variable for access
chaosTokens = {}
local chaosTokensLastMat = nil
@ -150,7 +148,6 @@ function onLoad(savedData)
if obj ~= nil then obj.interactable = false end
end
DATA_HELPER = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DataHelper")
resetChaosTokenStatTracker()
getModVersion()
math.randomseed(os.time())
@ -469,6 +466,7 @@ function fillContainer(args)
end
function getDataValue(storage, key)
local DATA_HELPER = guidReferenceApi.getObjectByOwnerAndType("Mythos", "DataHelper")
local data = DATA_HELPER.getTable(storage)
if data ~= nil then
local value = data[key]
@ -1005,7 +1003,7 @@ function applyOptionPanelChange(id, state)
optionPanel[id] = state
-- update master clue counter
local counter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "MasterClueCounter" })
local counter = guidReferenceApi.getObjectByOwnerAndType("Mythos", "MasterClueCounter")
counter.setVar("useClickableCounters", state)
-- option: Play area snap tags
@ -1077,7 +1075,7 @@ end
---@param position Table Desired position of the object
---@param rotation Table Desired rotation of the object (defaults to object's rotation)
function spawnHelperObject(name, position, rotation)
local sourceBag = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "OptionPanelSource" })
local sourceBag = guidReferenceApi.getObjectByOwnerAndType("Mythos","OptionPanelSource")
-- error handling for missing sourceBag
if not sourceBag then