do local DeckImporterApi = {} local guidHandler = getObjectsWithTag("GUIDs")[1] -- Returns a table with the full state of the UI, including options and deck IDs. -- This can be used to persist via onSave(), or provide values for a load operation -- Table values: -- redDeck: Deck ID to load for the red player -- orangeDeck: Deck ID to load for the orange player -- whiteDeck: Deck ID to load for the white player -- greenDeck: Deck ID to load for the green player -- private: True to load a private deck, false to load a public deck -- loadNewest: True if the most upgraded version of the deck should be loaded -- investigators: True if investigator cards should be spawned DeckImporterApi.getUiState = function() local passthroughTable = {} local DeckImporter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DeckImporter" }) for k,v in pairs(DeckImporter.call("getUiState")) do passthroughTable[k] = v end return passthroughTable end -- Updates the state of the UI based on the provided table. Any values not provided will be left the same. ---@param uiStateTable Table of values to update on importer -- Table values: -- redDeck: Deck ID to load for the red player -- orangeDeck: Deck ID to load for the orange player -- whiteDeck: Deck ID to load for the white player -- greenDeck: Deck ID to load for the green player -- private: True to load a private deck, false to load a public deck -- loadNewest: True if the most upgraded version of the deck should be loaded -- investigators: True if investigator cards should be spawned DeckImporterApi.setUiState = function(uiStateTable) local DeckImporter = guidHandler.call("getObjectByOwnerAndType", { owner = "Mythos", type = "DeckImporter" }) return DeckImporter.call("setUiState", uiStateTable) end return DeckImporterApi end