Allow swapping ArkhamDB importer to use AdamDB

This commit is contained in:
Adam Goldsmith 2024-07-28 01:27:40 -04:00
parent 7ff2e0e27b
commit 36080a8cb7
3 changed files with 25 additions and 4 deletions

View File

@ -20,7 +20,7 @@
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"Locked": false,
"LuaScript": "require(\"arkhamdb/Configuration\")",
"LuaScriptState": "",
"MeasureMovement": false,
@ -33,9 +33,9 @@
],
"Tooltip": true,
"Transform": {
"posX": 78,
"posY": 1.395,
"posZ": 4.352,
"posX": -8.44,
"posY": 2,
"posZ": 77,
"rotX": 0,
"rotY": 270,
"rotZ": 180,

View File

@ -7,3 +7,20 @@ configuration = {
cards = "card",
taboo = "taboos"
}
function onRotate(spin, flip, player_color, old_spin, old_flip)
local builder = getObjectFromGUID("a28140")
if flip == 0 then
configuration.api_uri = "https://arkhamdb.adamgoldsmith.name/api/public"
builder.UI.setXml('<Text fontSize="25" color="orange" position="17 -74 -11" rotation="0 0 180">Adam</Text>')
else
configuration.api_uri = "https://arkhamdb.com/api/public"
builder.UI.setXml('')
end
builder.call("arkhamdb_reinit", {})
print("Set URL to " .. configuration.api_uri)
end

View File

@ -40,6 +40,10 @@ function onLoad(script_state)
arkhamDb.initialize()
end
function arkhamdb_reinit()
arkhamDb.initialize()
end
function onSave() return JSON.encode(getUiState()) end
-- Returns a table with the full state of the UI, including options and deck IDs.