2024-01-06 21:32:29 -05:00
|
|
|
-- Bundled by luabundle {"version":"1.6.0"}
|
|
|
|
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
|
|
|
|
local loadingPlaceholder = {[{}] = true}
|
|
|
|
|
|
|
|
local register
|
|
|
|
local modules = {}
|
|
|
|
|
|
|
|
local require
|
|
|
|
local loaded = {}
|
|
|
|
|
|
|
|
register = function(name, body)
|
|
|
|
if not modules[name] then
|
|
|
|
modules[name] = body
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
require = function(name)
|
|
|
|
local loadedModule = loaded[name]
|
|
|
|
|
|
|
|
if loadedModule then
|
|
|
|
if loadedModule == loadingPlaceholder then
|
|
|
|
return nil
|
|
|
|
end
|
|
|
|
else
|
|
|
|
if not modules[name] then
|
|
|
|
if not superRequire then
|
|
|
|
local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
|
|
|
|
error('Tried to require ' .. identifier .. ', but no such module has been registered')
|
|
|
|
else
|
|
|
|
return superRequire(name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
loaded[name] = loadingPlaceholder
|
|
|
|
loadedModule = modules[name](require, loaded, register, modules)
|
|
|
|
loaded[name] = loadedModule
|
|
|
|
end
|
|
|
|
|
|
|
|
return loadedModule
|
|
|
|
end
|
|
|
|
|
|
|
|
return require, loaded, register, modules
|
|
|
|
end)(nil)
|
|
|
|
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
|
|
require("core/GUIDReferenceHandler")
|
|
|
|
end)
|
|
|
|
__bundle_register("core/GUIDReferenceHandler", function(require, _LOADED, __bundle_register, __bundle_modules)
|
|
|
|
local GuidReferences = {
|
|
|
|
White = {
|
|
|
|
ClueCounter = "d86b7c",
|
|
|
|
ClickableClueCounter = "db85d6",
|
|
|
|
DamageCounter = "eb08d6",
|
|
|
|
HandZone = "a70eee",
|
|
|
|
HorrorCounter = "468e88",
|
|
|
|
InvestigatorSkillTracker = "e598c2",
|
|
|
|
Playermat = "8b081b",
|
|
|
|
ResourceCounter = "4406f0",
|
|
|
|
TokenDiscardZone = "457de3",
|
|
|
|
Trash = "147e80"
|
|
|
|
},
|
|
|
|
Orange = {
|
|
|
|
ClueCounter = "1769ed",
|
|
|
|
ClickableClueCounter = "3f22e5",
|
|
|
|
DamageCounter = "e64eec",
|
|
|
|
HandZone = "5fe087",
|
|
|
|
HorrorCounter = "0257d9",
|
|
|
|
InvestigatorSkillTracker = "b4a5f7",
|
|
|
|
Playermat = "bd0ff4",
|
|
|
|
ResourceCounter = "816d84",
|
|
|
|
TokenDiscardZone = "457de4",
|
|
|
|
Trash = "f7b6c8"
|
|
|
|
},
|
|
|
|
Green = {
|
|
|
|
ClueCounter = "032300",
|
|
|
|
ClickableClueCounter = "891403",
|
|
|
|
DamageCounter = "1f5a0a",
|
|
|
|
HandZone = "0285cc",
|
|
|
|
HorrorCounter = "7b5729",
|
|
|
|
InvestigatorSkillTracker = "af7ed7",
|
2024-02-04 10:51:51 -05:00
|
|
|
PoolResources = "0168ae",
|
|
|
|
PoolDamage = "b0ef6c",
|
|
|
|
PoolHorror = "ae1a4e",
|
|
|
|
PoolClues = "fae2f6",
|
|
|
|
PoolDoom = "16724b",
|
2024-01-06 21:32:29 -05:00
|
|
|
Playermat = "383d8b",
|
|
|
|
ResourceCounter = "cd15ac",
|
|
|
|
TokenDiscardZone = "457de5",
|
2024-02-04 10:51:51 -05:00
|
|
|
TokenRemover = "2ba7a5",
|
2024-01-06 21:32:29 -05:00
|
|
|
Trash = "5f896a"
|
|
|
|
},
|
|
|
|
Red = {
|
|
|
|
ClueCounter = "37be78",
|
|
|
|
ClickableClueCounter = "4111de",
|
|
|
|
DamageCounter = "591a45",
|
|
|
|
HandZone = "be2f17",
|
|
|
|
HorrorCounter = "beb964",
|
|
|
|
InvestigatorSkillTracker = "e74881",
|
2024-02-04 10:51:51 -05:00
|
|
|
PoolResources = "fd617a",
|
|
|
|
PoolDamage = "93f4a0",
|
|
|
|
PoolHorror = "7bd2a0",
|
|
|
|
PoolClues = "3b2550",
|
|
|
|
PoolDoom = "16fcd6",
|
2024-01-06 21:32:29 -05:00
|
|
|
Playermat = "0840d5",
|
|
|
|
ResourceCounter = "a4b60d",
|
|
|
|
TokenDiscardZone = "457de6",
|
2024-02-04 10:51:51 -05:00
|
|
|
TokenRemover = "39b175",
|
2024-01-06 21:32:29 -05:00
|
|
|
Trash = "4b8594"
|
|
|
|
},
|
|
|
|
Mythos = {
|
2024-02-04 10:51:51 -05:00
|
|
|
AdditionalPlayerCardsBag = "2cba6b",
|
2024-01-06 21:32:29 -05:00
|
|
|
AllCardsBag = "15bb07",
|
|
|
|
BlessCurseManager = "5933fb",
|
|
|
|
CampaignThePathToCarcosa = "aca04c",
|
2024-02-04 10:51:51 -05:00
|
|
|
ChaosBagZone = "83ef06",
|
2024-01-06 21:32:29 -05:00
|
|
|
DataHelper = "708279",
|
|
|
|
DeckImporter = "a28140",
|
|
|
|
DoomCounter = "85c4c6",
|
|
|
|
DoomInPlayCounter = "652ff3",
|
|
|
|
InvestigatorCounter = "f182ee",
|
|
|
|
MasterClueCounter = "4a3aa4",
|
|
|
|
MythosArea = "9f334f",
|
|
|
|
NavigationOverlayHandler = "797ede",
|
|
|
|
OptionPanelSource = "830bd0",
|
|
|
|
PlaceholderBoxDummy = "a93466",
|
|
|
|
PlayArea = "721ba2",
|
2024-02-04 10:51:51 -05:00
|
|
|
PlayAreaImageSelector = "b7b45b",
|
2024-01-06 21:32:29 -05:00
|
|
|
PlayAreaZone = "a2f932",
|
|
|
|
PlayerCardPanel = "2d30ee",
|
|
|
|
ResourceTokenBag = "9fadf9",
|
|
|
|
RulesReference = "d99993",
|
|
|
|
SoundCube = "3c988f",
|
|
|
|
TokenArranger = "022907",
|
|
|
|
TokenSource = "124381",
|
|
|
|
TokenSpawnTracker = "e3ffc9",
|
|
|
|
TourStarter = "0e5aa8",
|
|
|
|
Trash = "70b9f6",
|
|
|
|
VictoryDisplay = "6ccd6d"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-04 10:51:51 -05:00
|
|
|
local editsToIndex = {
|
|
|
|
White = {},
|
|
|
|
Orange = {},
|
|
|
|
Green = {},
|
|
|
|
Red = {},
|
|
|
|
Mythos = {}
|
|
|
|
}
|
|
|
|
|
|
|
|
-- save function to keep edits to the index
|
|
|
|
function onSave() return JSON.encode({ editsToIndex = editsToIndex }) end
|
|
|
|
|
|
|
|
-- load function to restore edits to the index
|
|
|
|
function onLoad(savedData)
|
|
|
|
if savedData and savedData ~= "" then
|
|
|
|
local loadedData = JSON.decode(savedData)
|
|
|
|
editsToIndex = loadedData.editsToIndex
|
|
|
|
updateMainIndex()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- merges the main index and the edits
|
|
|
|
function updateMainIndex()
|
|
|
|
for owner, subTable in pairs(editsToIndex) do
|
|
|
|
for type, guid in pairs(subTable) do
|
|
|
|
GuidReferences[owner][type] = guid
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- returns an object reference for the requested owner and type
|
2024-01-06 21:32:29 -05:00
|
|
|
function getObjectByOwnerAndType(params)
|
|
|
|
local owner = params.owner or "Mythos"
|
|
|
|
local type = params.type
|
|
|
|
return getObjectFromGUID(GuidReferences[owner][type])
|
|
|
|
end
|
|
|
|
|
2024-02-04 10:51:51 -05:00
|
|
|
-- returns a list of objects for the requested type
|
2024-01-06 21:32:29 -05:00
|
|
|
function getObjectsByType(type)
|
|
|
|
local objList = {}
|
|
|
|
for owner, objects in pairs(GuidReferences) do
|
|
|
|
local obj = getObjectFromGUID(objects[type])
|
|
|
|
if obj then
|
|
|
|
objList[owner] = obj
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return objList
|
|
|
|
end
|
|
|
|
|
2024-02-04 10:51:51 -05:00
|
|
|
-- returns a list of objects for the requested owner
|
2024-01-06 21:32:29 -05:00
|
|
|
function getObjectsByOwner(owner)
|
|
|
|
local objList = {}
|
|
|
|
for type, guid in pairs(GuidReferences[owner]) do
|
|
|
|
local obj = getObjectFromGUID(guid)
|
|
|
|
if obj then
|
|
|
|
objList[type] = obj
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return objList
|
|
|
|
end
|
2024-02-04 10:51:51 -05:00
|
|
|
|
|
|
|
-- makes an edit to the main index
|
|
|
|
function editIndex(params)
|
|
|
|
editsToIndex[params.owner][params.type] = params.guid
|
|
|
|
updateMainIndex()
|
|
|
|
end
|
2024-01-06 21:32:29 -05:00
|
|
|
end)
|
|
|
|
return __bundle_require("__root")
|