diff --git a/objects/Configuration.03804b.json b/objects/Configuration.03804b.json index 65744db5..749e13c7 100644 --- a/objects/Configuration.03804b.json +++ b/objects/Configuration.03804b.json @@ -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, diff --git a/src/arkhamdb/Configuration.ttslua b/src/arkhamdb/Configuration.ttslua index bddf9eff..2d8220d9 100644 --- a/src/arkhamdb/Configuration.ttslua +++ b/src/arkhamdb/Configuration.ttslua @@ -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('Adam') + 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 diff --git a/src/arkhamdb/DeckImporter.ttslua b/src/arkhamdb/DeckImporter.ttslua index cececf41..ef0482be 100644 --- a/src/arkhamdb/DeckImporter.ttslua +++ b/src/arkhamdb/DeckImporter.ttslua @@ -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.