Merge branch 'main' into tour
This commit is contained in:
commit
ddb690a5ef
17
config.json
17
config.json
@ -39,7 +39,7 @@
|
||||
"Custom_Assetbundle.9f95fd",
|
||||
"Custom_Assetbundle.35b95f",
|
||||
"Custom_Assetbundle.5af8f2",
|
||||
"Custom_Tile.9f334f",
|
||||
"MythosArea.9f334f",
|
||||
"Custom_Tile.91dd9b",
|
||||
"Custom_Assetbundle.5706ae",
|
||||
"Custom_Tile.6161b4",
|
||||
@ -67,6 +67,10 @@
|
||||
"ScriptingTrigger.67ce9a",
|
||||
"Detailedphasereference.68fe54",
|
||||
"RulesIndex.91c83e",
|
||||
"Clues.3f22e5",
|
||||
"Clues.db85d6",
|
||||
"Clues.891403",
|
||||
"Clues.4111de",
|
||||
"Resources.4406f0",
|
||||
"Damage.eb08d6",
|
||||
"Horror.468e88",
|
||||
@ -129,11 +133,10 @@
|
||||
"LeakedItems.42cd6e",
|
||||
"ChaosTokenReserve.106418",
|
||||
"3DText.134348",
|
||||
"Custom_Model.032300",
|
||||
"Custom_Model.1769ed",
|
||||
"Custom_Model.37be78",
|
||||
"Custom_Model.d86b7c",
|
||||
"ClueCounterSwapper.d919d6",
|
||||
"ClueCounter.37be78",
|
||||
"ClueCounter.1769ed",
|
||||
"ClueCounter.032300",
|
||||
"ClueCounter.d86b7c",
|
||||
"MasterClueCounter.4a3aa4",
|
||||
"LegacyAssets.7165a9",
|
||||
"Weaknessdecks.750fdd",
|
||||
@ -265,5 +268,5 @@
|
||||
"Tags": [],
|
||||
"Turns_path": "Turns.json",
|
||||
"VersionNumber": "v13.2.2",
|
||||
"XmlUI": "<Include src=\"Global.xml\"/>"
|
||||
"XmlUI": "\u003cInclude src=\"Global.xml\"/\u003e"
|
||||
}
|
||||
|
BIN
img/scedheadertemplate.xcf
Normal file
BIN
img/scedheadertemplate.xcf
Normal file
Binary file not shown.
@ -84,4 +84,4 @@
|
||||
"Type": 0,
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/2027213118470839572/FB133C41A6D8915A44C138BCF947ECFE3D111813/"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -4204,4 +4204,4 @@
|
||||
"z": 14.5
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -46,16 +46,16 @@
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Custom_Model",
|
||||
"Nickname": "",
|
||||
"Nickname": "Clue Counter",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -31.911,
|
||||
"posY": 1.57,
|
||||
"posZ": 30.97,
|
||||
"posX": -32.193,
|
||||
"posY": 1.52,
|
||||
"posZ": 30.977,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotY": 10,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.33,
|
||||
"scaleY": 0.33,
|
||||
@ -63,4 +63,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
@ -46,16 +46,16 @@
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Custom_Model",
|
||||
"Nickname": "",
|
||||
"Nickname": "Clue Counter",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -59.449,
|
||||
"posY": 1.57,
|
||||
"posZ": -22.628,
|
||||
"posX": -59.426,
|
||||
"posY": 1.52,
|
||||
"posZ": -22.721,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotY": 280,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.33,
|
||||
"scaleY": 0.33,
|
||||
@ -63,4 +63,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
@ -46,16 +46,16 @@
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Custom_Model",
|
||||
"Nickname": "",
|
||||
"Nickname": "Clue Counter",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -18.983,
|
||||
"posY": 1.57,
|
||||
"posZ": -31.01,
|
||||
"posX": -18.87,
|
||||
"posY": 1.52,
|
||||
"posZ": -30.977,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotY": 190,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.33,
|
||||
"scaleY": 0.33,
|
||||
@ -63,4 +63,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
@ -46,16 +46,16 @@
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Custom_Model",
|
||||
"Nickname": "",
|
||||
"Nickname": "Clue Counter",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -59.499,
|
||||
"posY": 1.57,
|
||||
"posZ": 9.561,
|
||||
"posX": -59.426,
|
||||
"posY": 1.52,
|
||||
"posZ": 9.395,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotY": 280,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.33,
|
||||
"scaleY": 0.33,
|
||||
@ -63,4 +63,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
{
|
||||
"AltLookAngle": {
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"Autoraise": true,
|
||||
"Bag": {
|
||||
"Order": 0
|
||||
},
|
||||
"ColorDiffuse": {
|
||||
"b": 1,
|
||||
"g": 0.99217,
|
||||
"r": 1
|
||||
},
|
||||
"ContainedObjects_order": [
|
||||
"Clues.3f22e5",
|
||||
"Clues.4111de",
|
||||
"Clues.891403",
|
||||
"Clues.db85d6"
|
||||
],
|
||||
"ContainedObjects_path": "ClueCounterSwapper.d919d6",
|
||||
"CustomMesh": {
|
||||
"CastShadows": true,
|
||||
"ColliderURL": "",
|
||||
"Convex": true,
|
||||
"CustomShader": {
|
||||
"FresnelStrength": 0,
|
||||
"SpecularColor": {
|
||||
"b": 1,
|
||||
"g": 1,
|
||||
"r": 1
|
||||
},
|
||||
"SpecularIntensity": 0,
|
||||
"SpecularSharpness": 2
|
||||
},
|
||||
"DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/1179328606460871995/F2AFA106E788BB456C6F9134CE7A7B14D510F973/",
|
||||
"MaterialIndex": 3,
|
||||
"MeshURL": "http://pastebin.com/raw.php?i=uWAmuNZ2",
|
||||
"NormalURL": "",
|
||||
"TypeIndex": 6
|
||||
},
|
||||
"Description": "Counter mode courtesy of tadgh's clue counter mod: https://steamcommunity.com/sharedfiles/filedetails/?id=2115363630",
|
||||
"DragSelectable": true,
|
||||
"GMNotes": "",
|
||||
"GUID": "d919d6",
|
||||
"Grid": true,
|
||||
"GridProjection": false,
|
||||
"Hands": false,
|
||||
"HideWhenFaceDown": false,
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": true,
|
||||
"LuaScript": "require(\"util/ClueCounterSwapper\")",
|
||||
"LuaScriptState_path": "ClueCounterSwapper.d919d6.luascriptstate",
|
||||
"MaterialIndex": -1,
|
||||
"MeasureMovement": false,
|
||||
"MeshIndex": -1,
|
||||
"Name": "Custom_Model_Bag",
|
||||
"Nickname": "Clue Counter Swapper",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -50.9,
|
||||
"posY": 1.51,
|
||||
"posZ": 0,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.4,
|
||||
"scaleY": 0.01,
|
||||
"scaleZ": 0.4
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
@ -1 +0,0 @@
|
||||
{"ml":{"3f22e5":{"lock":true,"pos":{"x":-59.50,"y":1.54,"z":9.56},"rot":{"x":0,"y":280,"z":0}},"4111de":{"lock":true,"pos":{"x":-59.45,"y":1.54,"z":-22.63},"rot":{"x":0,"y":280,"z":0}},"891403":{"lock":true,"pos":{"x":-31.91,"y":1.54,"z":30.97},"rot":{"x":0,"y":10,"z":0}},"db85d6":{"lock":true,"pos":{"x":-18.98,"y":1.54,"z":-31.01},"rot":{"x":0,"y":190,"z":0}}}}
|
@ -40,13 +40,16 @@
|
||||
"Nickname": "Clues",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tags": [
|
||||
"CleanUpHelper_ignore"
|
||||
],
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -59.318,
|
||||
"posY": 1.64,
|
||||
"posZ": -17.674,
|
||||
"posX": -59.426,
|
||||
"posY": 1.3,
|
||||
"posZ": -22.721,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotY": 280,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.26,
|
||||
"scaleY": 1,
|
||||
@ -54,4 +57,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
@ -40,13 +40,16 @@
|
||||
"Nickname": "Clues",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tags": [
|
||||
"CleanUpHelper_ignore"
|
||||
],
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -23.81,
|
||||
"posY": 1.589,
|
||||
"posZ": -30.927,
|
||||
"posX": -18.87,
|
||||
"posY": 1.3,
|
||||
"posZ": -30.977,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotY": 190,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.26,
|
||||
"scaleY": 1,
|
||||
@ -54,4 +57,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
@ -40,13 +40,16 @@
|
||||
"Nickname": "Clues",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tags": [
|
||||
"CleanUpHelper_ignore"
|
||||
],
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -31.911,
|
||||
"posY": 1.564,
|
||||
"posZ": 30.92,
|
||||
"posX": -32.193,
|
||||
"posY": 1.3,
|
||||
"posZ": 30.977,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotY": 10,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.26,
|
||||
"scaleY": 1,
|
||||
@ -54,4 +57,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
@ -40,13 +40,16 @@
|
||||
"Nickname": "Clues",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tags": [
|
||||
"CleanUpHelper_ignore"
|
||||
],
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -59.439,
|
||||
"posY": 1.637,
|
||||
"posZ": 9.472,
|
||||
"posX": -59.426,
|
||||
"posY": 1.3,
|
||||
"posZ": 9.395,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotY": 280,
|
||||
"rotZ": 0,
|
||||
"scaleX": 0.26,
|
||||
"scaleY": 1,
|
||||
@ -54,4 +57,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
@ -54,4 +54,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI_path": "DoomCounter.85c4c6.xml"
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,24 @@
|
||||
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/1850441528393599634/FA79B99F5544D16D38DCC8A26F1CEB3E7D9FED17/",
|
||||
"WidthScale": 0
|
||||
},
|
||||
"Description": "Cleans up the table for the next scenario.\n\nSee context menu for additional information.",
|
||||
"CustomUIAssets": [
|
||||
{
|
||||
"Type": 1,
|
||||
"Name": "font_teutonic-arkham",
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/2027213118467703445/89328E273B4C5180BF491516CE998DE3C604E162/"
|
||||
},
|
||||
{
|
||||
"Type": 0,
|
||||
"Name": "option_on",
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/2024961953545431779/1D892EC9A38B06B8D34692642CDEEECF928DCE1C/"
|
||||
},
|
||||
{
|
||||
"Type": 0,
|
||||
"Name": "option_off",
|
||||
"URL": "http://cloud-3.steamusercontent.com/ugc/2024961953545431709/07AD4D32B5C29A3B9F0917924CF7010A29DC3CE4/"
|
||||
}
|
||||
],
|
||||
"Description": "Cleans up the table for the next scenario during campaign play.\n\nThis includes moving cards and tokens into the trashcans, resetting counters and removing bless/curse tokens from the chaos bag.",
|
||||
"DragSelectable": true,
|
||||
"GMNotes": "",
|
||||
"GUID": "26cf4b",
|
||||
@ -33,7 +50,7 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": false,
|
||||
"LuaScriptState": "[true,true,true]",
|
||||
"LuaScriptState": "{\"options\":{\"importTrauma\":true,\"removeDrawnLines\":false,\"tidyPlayermats\":true}}",
|
||||
"LuaScript_path": "Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.ttslua",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Custom_Token",
|
||||
@ -51,10 +68,10 @@
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
"scaleX": 1.2,
|
||||
"scaleX": 2,
|
||||
"scaleY": 1,
|
||||
"scaleZ": 1.2
|
||||
"scaleZ": 2
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
"XmlUI_path": "Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.xml"
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
-- Clean Up Helper
|
||||
-- made by: Chr1Z
|
||||
-- description: Cleans up the table for the next scenario in a campaign:
|
||||
-- - sets counters to default values (resources and doom) or trauma values (health and sanity, if not disabled) from campaign log
|
||||
-- - puts everything on playmats and hands into respective trashcans
|
||||
-- - use the IGNORE_TAG to exclude objects from tidying (default: "CleanUpHelper_Ignore")
|
||||
--[[
|
||||
Cleans up the table for the next scenario in a campaign:
|
||||
- sets counters to default values (resources and doom) or trauma values (health and sanity, if not disabled) from campaign log
|
||||
- puts everything on playmats and hands into respective trashcans
|
||||
- use the IGNORE_TAG to exclude objects from tidying (default: "CleanUpHelper_Ignore")
|
||||
--]]
|
||||
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
|
||||
@ -30,24 +30,21 @@ local IGNORE_TAG = "CleanUpHelper_ignore"
|
||||
-- colors and order for following tables
|
||||
local COLORS = { "White"; "Orange"; "Green"; "Red"; "Agenda" }
|
||||
|
||||
-- counter GUIDS (4x damage, 4x sanity and 4x resource)
|
||||
local TOKEN_GUIDS = {
|
||||
-- counter GUIDS (4x damage and 4x horror)
|
||||
local DAMAGE_HORROR_GUIDS = {
|
||||
"eb08d6"; "e64eec"; "1f5a0a"; "591a45";
|
||||
"468e88"; "0257d9"; "7b5729"; "beb964";
|
||||
"4406f0"; "816d84"; "cd15ac"; "a4b60d"
|
||||
}
|
||||
|
||||
-- default values (4x damage, 4x horror, 4x resources)
|
||||
local DEFAULT_VALUES = {
|
||||
0; 0; 0; 0;
|
||||
0; 0; 0; 0;
|
||||
5; 5; 5; 5
|
||||
}
|
||||
local RESET_VALUES = {}
|
||||
|
||||
local PLAYERMAT_GUIDS = { "8b081b"; "bd0ff4"; "383d8b"; "0840d5" }
|
||||
local TRACKER_GUIDS = { "e598c2"; "b4a5f7"; "af7ed7"; "e74881" }
|
||||
local CLUE_GUIDS = { "d86b7c"; "1769ed"; "032300"; "37be78" }
|
||||
local TRASHCAN_GUIDS = { "147e80"; "f7b6c8"; "5f896a"; "4b8594"; "70b9f6" }
|
||||
-- GUIDS of objects (in order of ownership relating to 'COLORS')
|
||||
local PLAYERMAT_GUIDS = { "8b081b"; "bd0ff4"; "383d8b"; "0840d5" }
|
||||
local RESOURCE_GUIDS = { "4406f0"; "816d84"; "cd15ac"; "a4b60d" }
|
||||
local TRACKER_GUIDS = { "e598c2"; "b4a5f7"; "af7ed7"; "e74881" }
|
||||
local CLUE_GUIDS = { "d86b7c"; "1769ed"; "032300"; "37be78" }
|
||||
local CLUE_CLICKER_GUIDS = { "db85d6"; "3f22e5"; "891403"; "4111de" }
|
||||
local TRASHCAN_GUIDS = { "147e80"; "f7b6c8"; "5f896a"; "4b8594"; "70b9f6" }
|
||||
|
||||
-- values for physics.cast (4 entries for player zones, 5th entry for agenda/act deck, 6th for campaign log)
|
||||
local PHYSICS_POSITION = {
|
||||
@ -70,9 +67,11 @@ local PHYSICS_SCALE = {
|
||||
{ 05.0, 1, 05.0 }
|
||||
}
|
||||
|
||||
local tidyPlayermats = true
|
||||
local importTrauma = true
|
||||
local resetResources = true
|
||||
local optionsVisible = false
|
||||
local options = {}
|
||||
options["importTrauma"] = true
|
||||
options["tidyPlayermats"] = true
|
||||
options["removeDrawnLines"] = false
|
||||
|
||||
local buttonParameters = {}
|
||||
buttonParameters.function_owner = self
|
||||
@ -81,88 +80,80 @@ buttonParameters.function_owner = self
|
||||
-- option loading and GUI setup
|
||||
---------------------------------------------------------
|
||||
|
||||
function onSave() return JSON.encode({ tidyPlayermats, importTrauma, resetResources }) end
|
||||
function onSave()
|
||||
return JSON.encode({
|
||||
options = options
|
||||
})
|
||||
end
|
||||
|
||||
function onLoad(saved_data)
|
||||
local loaded_data = JSON.decode(saved_data)
|
||||
if loaded_data ~= nil then
|
||||
tidyPlayermats = loaded_data[1]
|
||||
importTrauma = loaded_data[2]
|
||||
resetResources = loaded_data[3]
|
||||
function onLoad(savedData)
|
||||
if savedData ~= nil then
|
||||
local loadedData = JSON.decode(savedData)
|
||||
options = loadedData.options
|
||||
-- update UI to match saved state
|
||||
for id, state in pairs(options) do
|
||||
self.UI.setAttribute(id, "image", state and "option_on" or "option_off")
|
||||
end
|
||||
end
|
||||
|
||||
-- context menu and buttons
|
||||
self.addContextMenuItem("More Information", function()
|
||||
printToAll("------------------------------", "White")
|
||||
printToAll("Clean Up Helper by Chr1Z", "Orange")
|
||||
printToAll("ignore tag: " .. IGNORE_TAG, "White")
|
||||
printToAll("Player order in the campaign log for trauma import:\nWhite, Orange, Green, Red", "White")
|
||||
end)
|
||||
|
||||
-- index 0: button as label
|
||||
buttonParameters.label = "Clean Up Helper"
|
||||
buttonParameters.click_function = "none"
|
||||
buttonParameters.position = { x = 0, y = 0.1, z = -1.525 }
|
||||
buttonParameters.position = { x = 0, y = 0.1, z = -1.3 }
|
||||
buttonParameters.height = 0
|
||||
buttonParameters.width = 0
|
||||
buttonParameters.font_size = 165
|
||||
buttonParameters.font_color = "Black"
|
||||
buttonParameters.font_size = 230
|
||||
buttonParameters.font_color = Color(0, 0, 0)
|
||||
self.createButton(buttonParameters)
|
||||
|
||||
-- index 1: option button for playermats
|
||||
buttonParameters.label = "Tidy playermats: " .. (tidyPlayermats and "✓" or "✗")
|
||||
buttonParameters.color = { 0, 0, 0, 0.95 }
|
||||
buttonParameters.click_function = "toggle_tidyPlayermats"
|
||||
buttonParameters.position.z = buttonParameters.position.z + 0.7
|
||||
buttonParameters.height = 275
|
||||
buttonParameters.width = 1550
|
||||
buttonParameters.font_size = 165
|
||||
-- index 1: option button
|
||||
buttonParameters.label = "Settings"
|
||||
buttonParameters.click_function = "showOrHideOptions"
|
||||
buttonParameters.color = { 0, 0, 0, 0.96 }
|
||||
buttonParameters.position.z = -0.1
|
||||
buttonParameters.height = 350
|
||||
buttonParameters.width = 1000
|
||||
buttonParameters.font_size = 190
|
||||
buttonParameters.font_color = "White"
|
||||
self.createButton(buttonParameters)
|
||||
|
||||
-- index 2: option button for trauma import
|
||||
buttonParameters.label = "Import trauma: " .. (importTrauma and "✓" or "✗")
|
||||
buttonParameters.click_function = "toggle_importTrauma"
|
||||
buttonParameters.position.z = buttonParameters.position.z + 0.7
|
||||
self.createButton(buttonParameters)
|
||||
|
||||
-- index 3: option button for resources
|
||||
buttonParameters.label = "Reset resources: " .. (resetResources and "✓" or "✗")
|
||||
buttonParameters.click_function = "toggle_resetResources"
|
||||
buttonParameters.position.z = buttonParameters.position.z + 0.7
|
||||
self.createButton(buttonParameters)
|
||||
|
||||
-- index 4: start button
|
||||
buttonParameters.label = "Start!"
|
||||
-- index 2: start button
|
||||
buttonParameters.label = "Reset play areas"
|
||||
buttonParameters.click_function = "cleanUp"
|
||||
buttonParameters.position.z = buttonParameters.position.z + 0.7
|
||||
buttonParameters.width = 775
|
||||
buttonParameters.position.z = 1.1
|
||||
buttonParameters.width = 1550
|
||||
self.createButton(buttonParameters)
|
||||
|
||||
-- create single table for ignoring
|
||||
for _, v in ipairs(CLUE_GUIDS) do table.insert(IGNORE_GUIDS, v) end
|
||||
for _, v in ipairs(CLUE_CLICKER_GUIDS) do table.insert(IGNORE_GUIDS, v) end
|
||||
for _, v in ipairs(RESOURCE_GUIDS) do table.insert(IGNORE_GUIDS, v) end
|
||||
for _, v in ipairs(TRASHCAN_GUIDS) do table.insert(IGNORE_GUIDS, v) end
|
||||
for _, v in ipairs(PLAYERMAT_GUIDS) do table.insert(IGNORE_GUIDS, v) end
|
||||
for _, v in ipairs(TOKEN_GUIDS) do table.insert(IGNORE_GUIDS, v) end
|
||||
for _, v in ipairs(DAMAGE_HORROR_GUIDS) do table.insert(IGNORE_GUIDS, v) end
|
||||
end
|
||||
|
||||
---------------------------------------------------------
|
||||
-- click functions for option buttons
|
||||
---------------------------------------------------------
|
||||
|
||||
function toggle_tidyPlayermats()
|
||||
tidyPlayermats = not tidyPlayermats
|
||||
self.editButton({ index = 1, label = "Tidy playermats: " .. (tidyPlayermats and "✓" or "✗") })
|
||||
-- changes the UI state and the internal variable for the togglebuttons
|
||||
function optionButtonClick(_, id)
|
||||
local currentState = options[id]
|
||||
local newState = (currentState and "option_off" or "option_on")
|
||||
options[id] = not currentState
|
||||
self.UI.setAttribute(id, "image", newState)
|
||||
end
|
||||
|
||||
function toggle_importTrauma()
|
||||
importTrauma = not importTrauma
|
||||
self.editButton({ index = 2, label = "Import trauma: " .. (importTrauma and "✓" or "✗") })
|
||||
end
|
||||
-- shows or hides the option panel
|
||||
function showOrHideOptions()
|
||||
optionsVisible = not optionsVisible
|
||||
|
||||
function toggle_resetResources()
|
||||
resetResources = not resetResources
|
||||
self.editButton({ index = 3, label = "Reset resources: " .. (resetResources and "✓" or "✗") })
|
||||
if optionsVisible then
|
||||
self.UI.show("options")
|
||||
else
|
||||
self.UI.hide("options")
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------
|
||||
@ -175,65 +166,76 @@ function cleanUp()
|
||||
printToAll("Resetting counters...", "White")
|
||||
|
||||
getTrauma()
|
||||
resetCounters()
|
||||
|
||||
-- bless / curse manager prints removed amounts
|
||||
updateCounters(DAMAGE_HORROR_GUIDS, RESET_VALUES, "Damage / Horror")
|
||||
updateCounters(RESOURCE_GUIDS, 5, "Resources")
|
||||
updateCounters(CLUE_CLICKER_GUIDS, 0, "Clue clickers")
|
||||
resetSkillTrackers()
|
||||
resetDoomCounter()
|
||||
removeBlessCurse()
|
||||
|
||||
printToAll("Removing vector lines...", "White")
|
||||
removeLines()
|
||||
|
||||
printToAll("Discarding player hands...", "White")
|
||||
discardHands()
|
||||
|
||||
printToAll("Tidying big playmat...", "White")
|
||||
startLuaCoroutine(self, "tidyPlaymatCoroutine")
|
||||
printToAll("Tidying main play area...", "White")
|
||||
startLuaCoroutine(self, "tidyPlayareaCoroutine")
|
||||
end
|
||||
|
||||
---------------------------------------------------------
|
||||
-- modular functions, called by other functions
|
||||
---------------------------------------------------------
|
||||
|
||||
-- set counters to reset values
|
||||
function resetCounters()
|
||||
for i, guid in ipairs(TOKEN_GUIDS) do
|
||||
-- skip this step for resource tokens when option disabled (token number 9-12)
|
||||
if resetResources or (i < 9 or i > 12) then
|
||||
local TOKEN = getObjectFromGUID(guid)
|
||||
if TOKEN ~= nil then
|
||||
TOKEN.call("updateVal", RESET_VALUES[i])
|
||||
else
|
||||
printToAll("Token number " .. i .. " could not be found and was skipped.", "Yellow")
|
||||
end
|
||||
function updateCounters(tableOfGUIDs, tableOfNewValues, info)
|
||||
if tonumber(tableOfNewValues) then
|
||||
local value = tableOfNewValues
|
||||
tableOfNewValues = {}
|
||||
for i = 1, #tableOfGUIDs do
|
||||
table.insert(tableOfNewValues, value)
|
||||
end
|
||||
end
|
||||
|
||||
-- reset doom on agenda
|
||||
-- local doomcounter = getObjectFromGUID("85c4c6")
|
||||
-- if doomcounter ~= nil then
|
||||
-- doomcounter.call("setToZero")
|
||||
-- end
|
||||
for i, guid in ipairs(tableOfGUIDs) do
|
||||
local TOKEN = getObjectFromGUID(guid)
|
||||
|
||||
if TOKEN ~= nil then
|
||||
TOKEN.call("updateVal", tableOfNewValues[i])
|
||||
else
|
||||
printToAll(info .. ": No. " .. i .. " could not be found.", "Yellow")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- set investigator skill trackers to "1, 1, 1, 1"
|
||||
function resetSkillTrackers()
|
||||
for i, guid in ipairs(TRACKER_GUIDS) do
|
||||
local obj = getObjectFromGUID(guid)
|
||||
|
||||
if obj ~= nil then
|
||||
obj.call("updateStats", { 1, 1, 1, 1 })
|
||||
else
|
||||
printToAll("Stat tracker number " .. i .. " could not be found and was skipped.", "Yellow")
|
||||
printToAll("Skill tracker number " .. i .. " could not be found.", "Yellow")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- reset doom on agenda
|
||||
function resetDoomCounter()
|
||||
local doomcounter = getObjectFromGUID("85c4c6")
|
||||
|
||||
if doomcounter ~= nil then
|
||||
doomcounter.call("updateVal")
|
||||
else
|
||||
printToAll("Doom counter could not be found.", "Yellow")
|
||||
end
|
||||
end
|
||||
|
||||
-- read values for trauma from campaign log if enabled
|
||||
function getTrauma()
|
||||
-- load default values
|
||||
RESET_VALUES = {}
|
||||
for k, v in pairs(DEFAULT_VALUES) do
|
||||
RESET_VALUES[k] = v
|
||||
end
|
||||
RESET_VALUES = {
|
||||
0; 0; 0; 0;
|
||||
0; 0; 0; 0
|
||||
}
|
||||
|
||||
-- stop here if trauma import is disabled
|
||||
if not importTrauma then
|
||||
if not options["importTrauma"] then
|
||||
printToAll("Default values for health and sanity loaded.", "Yellow")
|
||||
return
|
||||
end
|
||||
@ -260,42 +262,51 @@ function getTrauma()
|
||||
end
|
||||
end
|
||||
|
||||
-- get rid of bless/curse tokens via bless / curse manager
|
||||
-- get rid of bless/curse tokens via bless/curse manager
|
||||
function removeBlessCurse()
|
||||
local BlessCurseManager = getObjectFromGUID("5933fb")
|
||||
|
||||
if BlessCurseManager ~= nil then
|
||||
BlessCurseManager.call("doRemove", "White")
|
||||
else
|
||||
printToAll("Bless / Curse manager could not be found and thus bless/curse tokens were skipped.", "Yellow")
|
||||
end
|
||||
end
|
||||
|
||||
-- remove drawn lines
|
||||
function removeLines()
|
||||
Global.setVectorLines({})
|
||||
if options["removeDrawnLines"] then
|
||||
printToAll("Removing vector lines...", "White")
|
||||
Global.setVectorLines({})
|
||||
end
|
||||
end
|
||||
|
||||
-- discard all hand objects
|
||||
function discardHands()
|
||||
if not options["tidyPlayermats"] then return end
|
||||
for i = 1, 4 do
|
||||
local trashcan = getObjectFromGUID(TRASHCAN_GUIDS[i])
|
||||
local hand = Player[COLORS[i]].getHandObjects()
|
||||
if trashcan == nil then return end
|
||||
for j = #hand, 1, -1 do trashcan.putObject(hand[j]) end
|
||||
local hand = Player[COLORS[i]].getHandObjects()
|
||||
for j = #hand, 1, -1 do
|
||||
trashcan.putObject(hand[j])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- clean up for big playmat
|
||||
function tidyPlaymatCoroutine()
|
||||
-- clean up for play area
|
||||
function tidyPlayareaCoroutine()
|
||||
local trashcan = getObjectFromGUID(TRASHCAN_GUIDS[5])
|
||||
local PLAYMATZONE = getObjectFromGUID("a2f932")
|
||||
|
||||
if PLAYMATZONE == nil then
|
||||
printToAll("Scripting zone for big playmat could not be found!", "Red")
|
||||
printToAll("Scripting zone for main play area could not be found!", "Red")
|
||||
elseif trashcan == nil then
|
||||
printToAll("Trashcan for big playmat could not be found!", "Red")
|
||||
printToAll("Trashcan for main play area could not be found!", "Red")
|
||||
else
|
||||
for _, obj in ipairs(PLAYMATZONE.getObjects()) do
|
||||
-- ignore these elements
|
||||
if indexOf(IGNORE_GUIDS, obj.getGUID()) == nil and obj.hasTag(IGNORE_TAG) == false then
|
||||
if not tableContains(IGNORE_GUIDS, obj.getGUID()) and obj.hasTag(IGNORE_TAG) == false then
|
||||
coroutine.yield(0)
|
||||
trashcan.putObject(obj)
|
||||
end
|
||||
@ -312,8 +323,8 @@ end
|
||||
-- clean up for the four playermats and the agenda/act playmat
|
||||
function tidyPlayerMatCoroutine()
|
||||
for i = 1, 5 do
|
||||
-- skip playermat (1-4) if option disabled
|
||||
if tidyPlayermats or i == 5 then
|
||||
-- only continue for playermat (1-4) if option enabled
|
||||
if options["tidyPlayermats"] or i == 5 then
|
||||
-- delay for animation purpose
|
||||
for k = 1, 30 do coroutine.yield(0) end
|
||||
|
||||
@ -329,7 +340,7 @@ function tidyPlayerMatCoroutine()
|
||||
local desc_low = string.lower(obj.getDescription())
|
||||
|
||||
-- ignore these elements
|
||||
if indexOf(IGNORE_GUIDS, obj.getGUID()) == nil and obj.hasTag(IGNORE_TAG) == false and
|
||||
if not tableContains(IGNORE_GUIDS, obj.getGUID()) and obj.hasTag(IGNORE_TAG) == false and
|
||||
desc_low ~= "chaos bag" and desc_low ~= "action token" then
|
||||
coroutine.yield(0)
|
||||
trashcan.putObject(obj)
|
||||
@ -376,11 +387,12 @@ function findObjects(num)
|
||||
})
|
||||
end
|
||||
|
||||
-- helper to search array
|
||||
function indexOf(array, value)
|
||||
for i, v in ipairs(array) do
|
||||
-- search a table for a value, return true if found (else returns false)
|
||||
function tableContains(table, value)
|
||||
for _, v in ipairs(table) do
|
||||
if v == value then
|
||||
return i
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
70
objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.xml
Normal file
70
objects/Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.xml
Normal file
@ -0,0 +1,70 @@
|
||||
<!-- Default formatting -->
|
||||
<Defaults>
|
||||
<Text color="black" alignment="MiddleLeft"/>
|
||||
<Text class="h1" fontSize="115" font="font_teutonic-arkham"/>
|
||||
<Text class="h2" fontSize="80" font="font_teutonic-arkham"/>
|
||||
<Text class="p" fontSize="40" alignment="UpperLeft"/>
|
||||
|
||||
<Panel rotation="0 0 180"/>
|
||||
<Panel class="window" width="1000" height="1000" color="black" outline="white" outlineSize="8 8"/>
|
||||
|
||||
<Row dontUseTableRowBackground="true"/>
|
||||
<Row class="header" color="#707070"/>
|
||||
<Row class="option" preferredHeight="130" color="#9e9e9e"/>
|
||||
|
||||
<!-- heights: 45 x lines + 40 -->
|
||||
<Row class="description" color="#cfcfcf"/>
|
||||
|
||||
<Button class="optionToggle" rectAlignment="MiddleRight" offsetXY="-20 0" colors="#FFFFFF|#dfdfdf" height="108" width="225" ignoreLayout="True" fontSize="60"/>
|
||||
</Defaults>
|
||||
|
||||
<!-- Option window -->
|
||||
<Panel id="options" class="window" offsetXY="-460 0" scale="0.5 0.5" active="false" showAnimation="FadeIn" hideAnimation="FadeOut">
|
||||
<TableLayout cellPadding="15 15 5 5">
|
||||
<!-- Header -->
|
||||
<Row class="header">
|
||||
<Cell>
|
||||
<Text class="h1">Clean up Helper - Options</Text>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Option -->
|
||||
<Row class="option">
|
||||
<Cell>
|
||||
<Text class="h2">Import trauma</Text>
|
||||
<Button id="importTrauma" onClick="optionButtonClick(importTrauma)" class="optionToggle" image="option_on"/>
|
||||
</Cell>
|
||||
</Row>
|
||||
<Row class="description" preferredHeight="220">
|
||||
<Cell>
|
||||
<Text class="p">Controls whether trauma values should be imported from the campaign log (if possible).
Enter players in the campaign log in this order:
White, Orange, Green, Red.</Text>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Option -->
|
||||
<Row class="option">
|
||||
<Cell>
|
||||
<Text class="h2">Tidy playermats</Text>
|
||||
<Button id="tidyPlayermats" onClick="optionButtonClick(tidyPlayermats)" class="optionToggle" image="option_on"/>
|
||||
</Cell>
|
||||
</Row>
|
||||
<Row class="description" preferredHeight="130">
|
||||
<Cell>
|
||||
<Text class="p">Controls whether the playermats should get tidied (removal of all cards and tokens).</Text>
|
||||
</Cell>
|
||||
</Row>
|
||||
|
||||
<!-- Option -->
|
||||
<Row class="option">
|
||||
<Cell>
|
||||
<Text class="h2">Remove drawn lines</Text>
|
||||
<Button id="removeDrawnLines" onClick="optionButtonClick(removeDrawnLines)" class="optionToggle" image="option_off"/>
|
||||
</Cell>
|
||||
</Row>
|
||||
<Row class="description" preferredHeight="85">
|
||||
<Cell>
|
||||
<Text class="p">Controls whether all drawn lines should be removed.</Text>
|
||||
</Cell>
|
||||
</Row>
|
||||
</TableLayout>
|
||||
</Panel>
|
@ -46,9 +46,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -32.588,
|
||||
"posX": -32.6,
|
||||
"posY": 1.531,
|
||||
"posZ": 19.301,
|
||||
"posZ": 19.35,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
|
@ -48,7 +48,7 @@
|
||||
"Transform": {
|
||||
"posX": -47.76,
|
||||
"posY": 1.531,
|
||||
"posZ": -23.116,
|
||||
"posZ": -23.1,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -48,7 +48,7 @@
|
||||
"Transform": {
|
||||
"posX": -47.75,
|
||||
"posY": 1.531,
|
||||
"posZ": 9,
|
||||
"posZ": 9.1,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -46,9 +46,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -18.475,
|
||||
"posX": -18.6,
|
||||
"posY": 1.531,
|
||||
"posZ": -19.301,
|
||||
"posZ": -19.35,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -19.06,
|
||||
"posX": -19.17,
|
||||
"posY": 1.55,
|
||||
"posZ": -24.78,
|
||||
"posZ": -24.845,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -53.206,
|
||||
"posX": -53.219,
|
||||
"posY": 1.55,
|
||||
"posZ": 8.432,
|
||||
"posZ": 8.513,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -53.206,
|
||||
"posX": -53.219,
|
||||
"posY": 1.55,
|
||||
"posZ": 9.573,
|
||||
"posZ": 9.657,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -34.264,
|
||||
"posX": -34.293,
|
||||
"posY": 1.55,
|
||||
"posZ": 24.8,
|
||||
"posZ": 24.864,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -53.265,
|
||||
"posX": -53.269,
|
||||
"posY": 1.55,
|
||||
"posZ": -22.542,
|
||||
"posZ": -22.541,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -53.265,
|
||||
"posX": -53.269,
|
||||
"posY": 1.55,
|
||||
"posZ": -24.825,
|
||||
"posZ": -24.824,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -17.918,
|
||||
"posX": -18.025,
|
||||
"posY": 1.55,
|
||||
"posZ": -24.783,
|
||||
"posZ": -24.845,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -31.981,
|
||||
"posX": -32.011,
|
||||
"posY": 1.55,
|
||||
"posZ": 24.8,
|
||||
"posZ": 24.864,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -16.777,
|
||||
"posX": -16.887,
|
||||
"posY": 1.55,
|
||||
"posZ": -24.783,
|
||||
"posZ": -24.845,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -33.123,
|
||||
"posX": -33.149,
|
||||
"posY": 1.55,
|
||||
"posZ": 24.8,
|
||||
"posZ": 24.864,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -53.206,
|
||||
"posX": -53.219,
|
||||
"posY": 1.55,
|
||||
"posZ": 7.29,
|
||||
"posZ": 7.374,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -1157,9 +1157,9 @@
|
||||
],
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -53.265,
|
||||
"posX": -53.269,
|
||||
"posY": 1.55,
|
||||
"posZ": -23.683,
|
||||
"posZ": -23.679,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -34,7 +34,7 @@
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": true,
|
||||
"LuaScript": "require(\"core/MasterClueCounter\")",
|
||||
"LuaScriptState": "",
|
||||
"LuaScriptState": "false",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Master Clue Counter\n",
|
||||
@ -54,4 +54,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
||||
|
@ -59,18 +59,18 @@
|
||||
"IgnoreFoW": false,
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": true,
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"LuaScript": "require(\"core/MythosArea\")",
|
||||
"LuaScriptState": "[]",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Custom_Tile",
|
||||
"Nickname": "",
|
||||
"Nickname": "Mythos Area",
|
||||
"Snap": true,
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -1.309,
|
||||
"posY": 1.483,
|
||||
"posZ": 0.034,
|
||||
"posZ": 0,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
@ -57,4 +57,4 @@
|
||||
},
|
||||
"Value": 0,
|
||||
"XmlUI": ""
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
"LayoutGroupSortIndex": 0,
|
||||
"Locked": true,
|
||||
"LuaScript": "require(\"core/PlayArea\")",
|
||||
"LuaScriptState": "[]",
|
||||
"LuaScriptState": "{\"spawnedLocs\":[]}",
|
||||
"MeasureMovement": false,
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Playarea",
|
||||
|
@ -282,9 +282,9 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -54.989,
|
||||
"posX": -55,
|
||||
"posY": 1.45,
|
||||
"posZ": 16.018,
|
||||
"posZ": 16.1,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -11,5 +11,7 @@ DISCARD_PILE_POSITION = { x = -58.9, y = 4, z = 4.29 }
|
||||
TRASHCAN_GUID = "147e80"
|
||||
STAT_TRACKER_GUID = "e598c2"
|
||||
RESOURCE_COUNTER_GUID = "4406f0"
|
||||
CLUE_COUNTER_GUID = "d86b7c"
|
||||
CLUE_CLICKER_GUID = "db85d6"
|
||||
|
||||
require("playermat/Playmat")
|
||||
|
@ -11,5 +11,7 @@ DISCARD_PILE_POSITION = { x = -58.96, y = 4, z = -27.82 }
|
||||
TRASHCAN_GUID = "f7b6c8"
|
||||
STAT_TRACKER_GUID = "b4a5f7"
|
||||
RESOURCE_COUNTER_GUID = "816d84"
|
||||
CLUE_COUNTER_GUID = "1769ed"
|
||||
CLUE_CLICKER_GUID = "3f22e5"
|
||||
|
||||
require("playermat/Playmat")
|
||||
|
@ -282,9 +282,9 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -25.57,
|
||||
"posX": -25.6,
|
||||
"posY": 1.45,
|
||||
"posZ": 26.54,
|
||||
"posZ": 26.6,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
|
@ -11,5 +11,7 @@ DISCARD_PILE_POSITION = { x = -37.26, y = 4, z = 30.50 }
|
||||
TRASHCAN_GUID = "5f896a"
|
||||
STAT_TRACKER_GUID = "af7ed7"
|
||||
RESOURCE_COUNTER_GUID = "cd15ac"
|
||||
CLUE_COUNTER_GUID = "032300"
|
||||
CLUE_CLICKER_GUID = "891403"
|
||||
|
||||
require("playermat/Playmat")
|
||||
|
@ -282,9 +282,9 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": false,
|
||||
"Transform": {
|
||||
"posX": -25.493,
|
||||
"posX": -25.6,
|
||||
"posY": 1.45,
|
||||
"posZ": -26.54,
|
||||
"posZ": -26.6,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotZ": 0,
|
||||
|
@ -11,5 +11,7 @@ DISCARD_PILE_POSITION = { x = -13.78, y = 4, z = -30.48 }
|
||||
TRASHCAN_GUID = "4b8594"
|
||||
STAT_TRACKER_GUID = "e74881"
|
||||
RESOURCE_COUNTER_GUID = "a4b60d"
|
||||
CLUE_COUNTER_GUID = "37be78"
|
||||
CLUE_CLICKER_GUID = "4111de"
|
||||
|
||||
require("playermat/Playmat")
|
||||
|
@ -31,9 +31,9 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -13.738,
|
||||
"posX": -14.05,
|
||||
"posY": 1.481,
|
||||
"posZ": -28.511,
|
||||
"posZ": -28.6,
|
||||
"rotX": 0,
|
||||
"rotY": 180,
|
||||
"rotZ": 0,
|
||||
|
@ -31,7 +31,7 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -56.926,
|
||||
"posX": -57,
|
||||
"posY": 1.544,
|
||||
"posZ": 4.545,
|
||||
"rotX": 0,
|
||||
|
@ -31,9 +31,9 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -56.928,
|
||||
"posX": -57,
|
||||
"posY": 1.539,
|
||||
"posZ": -27.729,
|
||||
"posZ": -27.65,
|
||||
"rotX": 0,
|
||||
"rotY": 270,
|
||||
"rotZ": 0,
|
||||
|
@ -31,9 +31,9 @@
|
||||
"Sticky": true,
|
||||
"Tooltip": true,
|
||||
"Transform": {
|
||||
"posX": -36.964,
|
||||
"posX": -37.15,
|
||||
"posY": 1.468,
|
||||
"posZ": 28.475,
|
||||
"posZ": 28.6,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
|
@ -48,7 +48,7 @@
|
||||
"Transform": {
|
||||
"posX": 0.493,
|
||||
"posY": 1.656,
|
||||
"posZ": 0.023,
|
||||
"posZ": 0,
|
||||
"rotX": 0,
|
||||
"rotY": 0,
|
||||
"rotZ": 0,
|
||||
|
@ -1,13 +1,9 @@
|
||||
-- automatically add correct names to tokens that enter the chaos bag
|
||||
function filterObjectEnter(obj)
|
||||
local props = obj.getCustomObject()
|
||||
if props ~= nil and props.image ~= nil then
|
||||
obj.setName(Global.call("getTokenName", { url=props.image }))
|
||||
obj.setName(Global.call("getTokenName", { url = props.image }))
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function onCollisionEnter(collision_info)
|
||||
self.shuffle()
|
||||
self.shuffle()
|
||||
self.shuffle()
|
||||
end
|
||||
|
@ -675,6 +675,8 @@ function applyOptionPanelChange(id, state)
|
||||
elseif id == 3 then
|
||||
playmatAPI.clickableClues(state, "All")
|
||||
|
||||
-- update master clue counter
|
||||
getObjectFromGUID("4a3aa4").setVar("useClickableCounters", state)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1,16 +1,17 @@
|
||||
local clueCounters = {}
|
||||
local clueCounterGUIDS = {
|
||||
"37be78",
|
||||
"1769ed",
|
||||
"032300",
|
||||
"d86b7c"
|
||||
}
|
||||
count = 0
|
||||
useClickableCounters = false
|
||||
|
||||
function onLoad()
|
||||
local playmatAPI = require("playermat/PlaymatApi")
|
||||
function onSave() return JSON.encode(useClickableCounters) end
|
||||
|
||||
function onLoad(savedData)
|
||||
if savedData ~= nil then
|
||||
useClickableCounters = JSON.decode(savedData)
|
||||
end
|
||||
self.createButton({
|
||||
label = "0",
|
||||
click_function = "removeAllPlayerClues",
|
||||
tooltip = "Click here to remove all Clues from playermats",
|
||||
tooltip = "Click here to remove all collected clues",
|
||||
function_owner = self,
|
||||
position = { 0, 0.06, 0 },
|
||||
height = 900,
|
||||
@ -21,26 +22,18 @@ function onLoad()
|
||||
color = { 0, 0, 0, 0 }
|
||||
})
|
||||
|
||||
-- loading object references to the counting bowls via GUID
|
||||
for i = 1, 4 do
|
||||
clueCounters[i] = getObjectFromGUID(clueCounterGUIDS[i])
|
||||
end
|
||||
|
||||
loopID = Wait.time(sumClues, 2, -1)
|
||||
end
|
||||
|
||||
-- removes all player clues by calling the respective function from the counting bowls
|
||||
-- removes all player clues by calling the respective function from the counting bowls / clickers
|
||||
function removeAllPlayerClues()
|
||||
for i = 1, 4 do
|
||||
clueCounters[i].call("removeAllClues")
|
||||
end
|
||||
printToAll(count .. " clue(s) from playermats removed.", "White")
|
||||
playmatAPI.removeClues("All")
|
||||
self.editButton({ index = 0, label = "0" })
|
||||
end
|
||||
|
||||
-- gets the counted values from the counting bowls and sums them up
|
||||
-- gets the counted values from the counting bowls / clickers and sums them up
|
||||
function sumClues()
|
||||
local count = 0
|
||||
for i = 1, 4 do
|
||||
count = count + tonumber(clueCounters[i].getVar("exposedValue"))
|
||||
end
|
||||
count = playmatAPI.getClueCount(useClickableCounters, "All")
|
||||
self.editButton({ index = 0, label = tostring(count) })
|
||||
end
|
||||
|
33
src/core/MythosArea.ttslua
Normal file
33
src/core/MythosArea.ttslua
Normal file
@ -0,0 +1,33 @@
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
|
||||
local currentScenario
|
||||
|
||||
function onLoad(saveState)
|
||||
if saveState ~= nil then
|
||||
local loadedState = JSON.decode(saveState) or { }
|
||||
currentScenario = loadedState.currentScenario
|
||||
end
|
||||
end
|
||||
|
||||
function onSave()
|
||||
return JSON.encode({
|
||||
currentScenario = currentScenario
|
||||
})
|
||||
end
|
||||
|
||||
-- TTS event handler. Checks for a scenrio card, extracts the scenario name from the description,
|
||||
-- and fires it to the relevant listeners.
|
||||
function onCollisionEnter(collisionInfo)
|
||||
local object = collisionInfo.collision_object
|
||||
if object.getName() == "Scenario" then
|
||||
if currentScenario ~= object.getDescription() then
|
||||
currentScenario = object.getDescription()
|
||||
fireScenarioChangedEvent()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function fireScenarioChangedEvent()
|
||||
log("Firing")
|
||||
playAreaApi.onScenarioChanged(currentScenario)
|
||||
end
|
@ -25,16 +25,24 @@ local PLAY_AREA_ZONE_GUID = "a2f932"
|
||||
|
||||
local clueData = {}
|
||||
spawnedLocationGUIDs = {}
|
||||
local currentScenario
|
||||
|
||||
---------------------------------------------------------
|
||||
-- general code
|
||||
---------------------------------------------------------
|
||||
|
||||
function onSave() return JSON.encode(spawnedLocationGUIDs) end
|
||||
function onSave()
|
||||
return JSON.encode({
|
||||
spawnedLocs = spawnedLocationGUIDs,
|
||||
currentScenario = currentScenario
|
||||
})
|
||||
end
|
||||
|
||||
function onLoad(save_state)
|
||||
function onLoad(saveState)
|
||||
-- records locations we have spawned clues for
|
||||
spawnedLocationGUIDs = JSON.decode(save_state) or {}
|
||||
local saveData = JSON.decode(saveState) or {}
|
||||
spawnedLocationGUIDs = saveData.spawnedLocs or { }
|
||||
currentScenario = saveData.currentScenario
|
||||
|
||||
local TOKEN_DATA = Global.getTable('TOKEN_DATA')
|
||||
clueData = {
|
||||
@ -182,3 +190,7 @@ end
|
||||
function resetSpawnedCards()
|
||||
spawnedLocationGUIDs = {}
|
||||
end
|
||||
|
||||
function onScenarioChanged(scenarioName)
|
||||
currentScenario = scenarioName
|
||||
end
|
||||
|
@ -35,5 +35,11 @@ do
|
||||
return getObjectFromGUID(PLAY_AREA_GUID).call("resetSpawnedCards")
|
||||
end
|
||||
|
||||
-- Event to be called when the current scenario has changed.
|
||||
---@param scenarioName Name of the new scenario
|
||||
PlayAreaApi.onScenarioChanged = function(scenarioName)
|
||||
getObjectFromGUID(PLAY_AREA_GUID).call("onScenarioChanged", scenarioName)
|
||||
end
|
||||
|
||||
return PlayAreaApi
|
||||
end
|
||||
|
@ -15,6 +15,7 @@ function onLoad()
|
||||
label = "",
|
||||
click_function = "removeAllClues",
|
||||
function_owner = self,
|
||||
position = { 0, 0.1, 0 },
|
||||
height = 0,
|
||||
width = 0,
|
||||
font_color = { 0, 0, 0 },
|
||||
|
@ -688,10 +688,66 @@ function showDrawButton(visible)
|
||||
end
|
||||
end
|
||||
|
||||
-- Shows or hides the clickable clue counter for this playmat
|
||||
---@param showCounters Boolean. Whether the clickable clue counter should be present
|
||||
function clickableClues(showCounters)
|
||||
print("dummy function for clue counters")
|
||||
-- Spawns / destroys a clickable clue counter for this playmat with the correct amount of clues
|
||||
---@param showCounter Boolean Whether the clickable clue counter should be present
|
||||
function clickableClues(showCounter)
|
||||
local CLUE_COUNTER = getObjectFromGUID(CLUE_COUNTER_GUID)
|
||||
local CLUE_CLICKER = getObjectFromGUID(CLUE_CLICKER_GUID)
|
||||
local clickerPos = CLUE_CLICKER.getPosition()
|
||||
local clueCount = 0
|
||||
|
||||
if showCounter then
|
||||
-- current clue count
|
||||
clueCount = CLUE_COUNTER.getVar("exposedValue")
|
||||
|
||||
-- remove clues
|
||||
CLUE_COUNTER.call("removeAllClues")
|
||||
|
||||
-- set value for clue clickers
|
||||
CLUE_CLICKER.call("updateVal", clueCount)
|
||||
|
||||
-- move clue counters up
|
||||
clickerPos.y = 1.52
|
||||
CLUE_CLICKER.setPosition(clickerPos)
|
||||
else
|
||||
-- current clue count
|
||||
clueCount = CLUE_CLICKER.getVar("val")
|
||||
|
||||
-- move clue counters down
|
||||
clickerPos.y = 1.3
|
||||
CLUE_CLICKER.setPosition(clickerPos)
|
||||
|
||||
-- spawn clues
|
||||
local pos = self.positionToWorld({x = -1.12, y = 0.05, z = 0.7})
|
||||
for i = 1, clueCount do
|
||||
pos.y = pos.y + 0.045 * i
|
||||
spawnToken(pos, "clue")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- removes all clues (moving tokens to the trash and setting counters to 0)
|
||||
function removeClues()
|
||||
local CLUE_COUNTER = getObjectFromGUID(CLUE_COUNTER_GUID)
|
||||
local CLUE_CLICKER = getObjectFromGUID(CLUE_CLICKER_GUID)
|
||||
|
||||
CLUE_COUNTER.call("removeAllClues")
|
||||
CLUE_CLICKER.call("updateVal", 0)
|
||||
end
|
||||
|
||||
-- reports the clue count
|
||||
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||
function getClueCount(useClickableCounters)
|
||||
local count = 0
|
||||
|
||||
if useClickableCounters then
|
||||
local CLUE_CLICKER = getObjectFromGUID(CLUE_CLICKER_GUID)
|
||||
count = tonumber(CLUE_CLICKER.getVar("val"))
|
||||
else
|
||||
local CLUE_COUNTER = getObjectFromGUID(CLUE_COUNTER_GUID)
|
||||
count = tonumber(CLUE_COUNTER.getVar("exposedValue"))
|
||||
end
|
||||
return count
|
||||
end
|
||||
|
||||
-- Sets this playermat's snap points to limit snapping to matching card types or not. If matchTypes
|
||||
|
@ -6,7 +6,21 @@ do
|
||||
White = "8b081b",
|
||||
Orange = "bd0ff4",
|
||||
Green = "383d8b",
|
||||
Red = "0840d5",
|
||||
Red = "0840d5"
|
||||
}
|
||||
|
||||
local CLUE_COUNTER_GUIDS = {
|
||||
White = "37be78",
|
||||
Orange = "1769ed",
|
||||
Green = "032300",
|
||||
Red = "d86b7c"
|
||||
}
|
||||
|
||||
local CLUE_CLICKER_GUIDS = {
|
||||
White = "db85d6",
|
||||
Orange = "3f22e5",
|
||||
Green = "891403",
|
||||
Red = "4111de"
|
||||
}
|
||||
|
||||
-- Sets the requested playermat's snap points to limit snapping to matching card types or not. If
|
||||
@ -43,6 +57,25 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
-- Removes all clues (to the trash for tokens and counters set to 0) for the requested playermat
|
||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
||||
-- accepts "All" as a special value which will apply the setting to all four mats.
|
||||
PlaymatApi.removeClues = function(matColor)
|
||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
||||
mat.call("removeClues")
|
||||
end
|
||||
end
|
||||
|
||||
-- Reports the clue count for the requested playermat
|
||||
---@param useClickableCounters Boolean Controls which type of counter is getting checked
|
||||
PlaymatApi.getClueCount = function(useClickableCounters, matColor)
|
||||
local count = 0
|
||||
for _, mat in ipairs(internal.getMatForColor(matColor)) do
|
||||
count = count + tonumber(mat.call("getClueCount", useClickableCounters))
|
||||
end
|
||||
return count
|
||||
end
|
||||
|
||||
-- Convenience function to look up a mat's object by color, or get all mats.
|
||||
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
|
||||
-- accepts "All" as a special value which will return all four mats.
|
||||
|
@ -1,294 +0,0 @@
|
||||
function updateSave()
|
||||
local data_to_save = { ["ml"] = memoryList }
|
||||
saved_data = JSON.encode(data_to_save)
|
||||
self.script_state = saved_data
|
||||
end
|
||||
|
||||
function onload(saved_data)
|
||||
if saved_data ~= "" then
|
||||
local loaded_data = JSON.decode(saved_data)
|
||||
--Set up information off of loaded_data
|
||||
memoryList = loaded_data.ml
|
||||
else
|
||||
--Set up information for if there is no saved saved data
|
||||
memoryList = {}
|
||||
end
|
||||
|
||||
if next(memoryList) == nil then
|
||||
createSetupButton()
|
||||
else
|
||||
createMemoryActionButtons()
|
||||
end
|
||||
end
|
||||
|
||||
--Beginning Setup
|
||||
--Make setup button
|
||||
function createSetupButton()
|
||||
self.createButton({
|
||||
label = "Setup",
|
||||
click_function = "buttonClick_setup",
|
||||
function_owner = self,
|
||||
position = { 0, 5, -2 },
|
||||
rotation = { 0, 0, 0 },
|
||||
height = 250,
|
||||
width = 600,
|
||||
font_size = 150,
|
||||
color = { 0, 0, 0 },
|
||||
font_color = { 1, 1, 1 }
|
||||
})
|
||||
end
|
||||
|
||||
--Triggered by setup button,
|
||||
function buttonClick_setup()
|
||||
memoryListBackup = duplicateTable(memoryList)
|
||||
memoryList = {}
|
||||
self.clearButtons()
|
||||
createButtonsOnAllObjects()
|
||||
createSetupActionButtons()
|
||||
end
|
||||
|
||||
--Creates selection buttons on objects
|
||||
function createButtonsOnAllObjects()
|
||||
local howManyButtons = 0
|
||||
for _, obj in ipairs(getAllObjects()) do
|
||||
if obj ~= self then
|
||||
local dummyIndex = howManyButtons
|
||||
--On a normal bag, the button positions aren't the same size as the bag.
|
||||
globalScaleFactor = 1.25 * 1 / self.getScale().x
|
||||
--Super sweet math to set button positions
|
||||
local selfPos = self.getPosition()
|
||||
local objPos = obj.getPosition()
|
||||
local deltaPos = findOffsetDistance(selfPos, objPos, obj)
|
||||
local objPos = rotateLocalCoordinates(deltaPos, self)
|
||||
objPos.x = -objPos.x * globalScaleFactor
|
||||
objPos.y = objPos.y * globalScaleFactor
|
||||
objPos.z = objPos.z * 4
|
||||
--Offset rotation of bag
|
||||
local rot = self.getRotation()
|
||||
rot.y = -rot.y + 180
|
||||
--Create function
|
||||
local funcName = "selectButton_" .. howManyButtons
|
||||
local func = function() buttonClick_selection(dummyIndex, obj) end
|
||||
self.setVar(funcName, func)
|
||||
self.createButton({
|
||||
click_function = funcName, function_owner = self,
|
||||
position = objPos, rotation = rot, height = 1000, width = 1000,
|
||||
color = { 0.75, 0.25, 0.25, 0.6 },
|
||||
})
|
||||
howManyButtons = howManyButtons + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--Creates submit and cancel buttons
|
||||
function createSetupActionButtons()
|
||||
self.createButton({
|
||||
label = "Cancel", click_function = "buttonClick_cancel", function_owner = self,
|
||||
position = { 1.5, 5, 2 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,
|
||||
font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }
|
||||
})
|
||||
self.createButton({
|
||||
label = "Submit", click_function = "buttonClick_submit", function_owner = self,
|
||||
position = { -1.2, 5, 2 }, rotation = { 0, 0, 0 }, height = 350, width = 1100,
|
||||
font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }
|
||||
})
|
||||
self.createButton({
|
||||
label = "Reset", click_function = "buttonClick_reset", function_owner = self,
|
||||
position = { -3.5, 5, 2 }, rotation = { 0, 0, 0 }, height = 350, width = 800,
|
||||
font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }
|
||||
})
|
||||
end
|
||||
|
||||
--During Setup
|
||||
--Checks or unchecks buttons
|
||||
function buttonClick_selection(index, obj)
|
||||
local color = { 0, 1, 0, 0.6 }
|
||||
if memoryList[obj.getGUID()] == nil then
|
||||
self.editButton({ index = index, color = color })
|
||||
--Adding pos/rot to memory table
|
||||
local pos, rot = obj.getPosition(), obj.getRotation()
|
||||
--I need to add it like this or it won't save due to indexing issue
|
||||
memoryList[obj.getGUID()] = {
|
||||
pos = { x = round(pos.x, 4), y = round(pos.y, 4), z = round(pos.z, 4) },
|
||||
rot = { x = round(rot.x, 4), y = round(rot.y, 4), z = round(rot.z, 4) },
|
||||
lock = obj.getLock()
|
||||
}
|
||||
obj.highlightOn({ 0, 1, 0 })
|
||||
else
|
||||
color = { 0.75, 0.25, 0.25, 0.6 }
|
||||
self.editButton({ index = index, color = color })
|
||||
memoryList[obj.getGUID()] = nil
|
||||
obj.highlightOff()
|
||||
end
|
||||
end
|
||||
|
||||
--Cancels selection process
|
||||
function buttonClick_cancel()
|
||||
memoryList = memoryListBackup
|
||||
self.clearButtons()
|
||||
if next(memoryList) == nil then
|
||||
createSetupButton()
|
||||
else
|
||||
createMemoryActionButtons()
|
||||
end
|
||||
removeAllHighlights()
|
||||
broadcastToAll("Selection Canceled", { 1, 1, 1 })
|
||||
end
|
||||
|
||||
--Saves selections
|
||||
function buttonClick_submit()
|
||||
if next(memoryList) == nil then
|
||||
broadcastToAll("You cannot submit without any selections.", { 0.75, 0.25, 0.25 })
|
||||
else
|
||||
self.clearButtons()
|
||||
createMemoryActionButtons()
|
||||
local count = 0
|
||||
for guid in pairs(memoryList) do
|
||||
count = count + 1
|
||||
local obj = getObjectFromGUID(guid)
|
||||
if obj ~= nil then obj.highlightOff() end
|
||||
end
|
||||
broadcastToAll(count .. " Objects Saved", { 1, 1, 1 })
|
||||
updateSave()
|
||||
end
|
||||
end
|
||||
|
||||
--Resets bag to starting status
|
||||
function buttonClick_reset()
|
||||
memoryList = {}
|
||||
self.clearButtons()
|
||||
createSetupButton()
|
||||
removeAllHighlights()
|
||||
broadcastToAll("Tool Reset", { 1, 1, 1 })
|
||||
updateSave()
|
||||
end
|
||||
|
||||
--After Setup
|
||||
--Creates recall and place buttons
|
||||
function createMemoryActionButtons()
|
||||
self.createButton({
|
||||
label = "Clicker", click_function = "buttonClick_place", function_owner = self,
|
||||
position = { 4.2, 1, 0 }, rotation = { 0, 0, 0 }, height = 500, width = 1100,
|
||||
font_size = 350, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }
|
||||
})
|
||||
self.createButton({
|
||||
label = "Counter", click_function = "buttonClick_recall", function_owner = self,
|
||||
position = { -4.2, 1, -0.1 }, rotation = { 0, 0, 0 }, height = 500, width = 1300,
|
||||
font_size = 350, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }
|
||||
})
|
||||
self.createButton({
|
||||
label = "Add Draw 1 Buttons", click_function = "addDraw1Buttons", function_owner = self,
|
||||
position = { 0, 1, -2.5 }, rotation = { 0, 0, 0 }, height = 500, width = 2600,
|
||||
font_size = 250, color = { 0, 0, 0 }, font_color = { 1, 1, 1 }
|
||||
})
|
||||
--[[
|
||||
self.createButton({
|
||||
label="Setup", click_function="buttonClick_setup", function_owner=self,
|
||||
position={-6,1,0}, rotation={0,90,0}, height=500, width=1200,
|
||||
font_size=350, color={0,0,0}, font_color={1,1,1}
|
||||
})
|
||||
--]]
|
||||
end
|
||||
|
||||
function addDraw1Buttons()
|
||||
if ADD_BUTTONS_DISABLED then return end
|
||||
|
||||
local mats = { "8b081b", "bd0ff4", "383d8b", "0840d5" }
|
||||
for i, guid in ipairs(mats) do
|
||||
local mat = getObjectFromGUID(guid)
|
||||
mat.createButton({
|
||||
label = "Draw 1",
|
||||
click_function = "doDrawOne",
|
||||
function_owner = mat,
|
||||
position = { 1.84, 0.1, -0.36 },
|
||||
scale = { 0.12, 0.12, 0.12 },
|
||||
width = 800,
|
||||
height = 280,
|
||||
font_size = 180
|
||||
})
|
||||
end
|
||||
ADD_BUTTONS_DISABLED = true
|
||||
end
|
||||
|
||||
--Sends objects from bag/table to their saved position/rotation
|
||||
function buttonClick_place()
|
||||
local bagObjList = self.getObjects()
|
||||
for guid, entry in pairs(memoryList) do
|
||||
local obj = getObjectFromGUID(guid)
|
||||
--If obj is out on the table, move it to the saved pos/rot
|
||||
if obj ~= nil then
|
||||
obj.setPositionSmooth(entry.pos)
|
||||
obj.setRotationSmooth(entry.rot)
|
||||
obj.setLock(entry.lock)
|
||||
else
|
||||
--If obj is inside of the bag
|
||||
for _, bagObj in ipairs(bagObjList) do
|
||||
if bagObj.guid == guid then
|
||||
local item = self.takeObject({
|
||||
guid = guid, position = entry.pos, rotation = entry.rot,
|
||||
})
|
||||
item.setLock(entry.lock)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
broadcastToAll("Objects Placed", { 1, 1, 1 })
|
||||
end
|
||||
|
||||
--Recalls objects to bag from table
|
||||
function buttonClick_recall()
|
||||
for guid, entry in pairs(memoryList) do
|
||||
local obj = getObjectFromGUID(guid)
|
||||
if obj ~= nil then self.putObject(obj) end
|
||||
end
|
||||
broadcastToAll("Objects Recalled", { 1, 1, 1 })
|
||||
end
|
||||
|
||||
--Utility functions
|
||||
--Find delta (difference) between 2 x/y/z coordinates
|
||||
function findOffsetDistance(p1, p2, obj)
|
||||
local deltaPos = {}
|
||||
local bounds = obj.getBounds()
|
||||
deltaPos.x = (p2.x - p1.x)
|
||||
deltaPos.y = (p2.y - p1.y) + (bounds.size.y - bounds.offset.y)
|
||||
deltaPos.z = (p2.z - p1.z)
|
||||
return deltaPos
|
||||
end
|
||||
|
||||
--Used to rotate a set of coordinates by an angle
|
||||
function rotateLocalCoordinates(desiredPos, obj)
|
||||
local objPos, objRot = obj.getPosition(), obj.getRotation()
|
||||
local angle = math.rad(objRot.y)
|
||||
local x = desiredPos.x * math.cos(angle) - desiredPos.z * math.sin(angle)
|
||||
local z = desiredPos.x * math.sin(angle) + desiredPos.z * math.cos(angle)
|
||||
return { x = x, y = desiredPos.y, z = z }
|
||||
end
|
||||
|
||||
--Coroutine delay, in seconds
|
||||
function wait(time)
|
||||
local start = os.time()
|
||||
repeat coroutine.yield(0) until os.time() > start + time
|
||||
end
|
||||
|
||||
--Duplicates a table (needed to prevent it making reference to the same objects)
|
||||
function duplicateTable(oldTable)
|
||||
local newTable = {}
|
||||
for k, v in pairs(oldTable) do
|
||||
newTable[k] = v
|
||||
end
|
||||
return newTable
|
||||
end
|
||||
|
||||
--Moves scripted highlight from all objects
|
||||
function removeAllHighlights()
|
||||
for _, obj in ipairs(getAllObjects()) do
|
||||
obj.highlightOff()
|
||||
end
|
||||
end
|
||||
|
||||
--Round number (num) to the Nth decimal (dec)
|
||||
function round(num, dec)
|
||||
local mult = 10 ^ (dec or 0)
|
||||
return math.floor(num * mult + 0.5) / mult
|
||||
end
|
@ -17,7 +17,7 @@
|
||||
<Button icon="yog-sothoth" tooltip="Extras" onClick="onClick_toggleUi(Extras)"/>
|
||||
<Button icon="elder-sign" tooltip="Investigators" onClick="onClick_toggleUi(Investigators)"/>
|
||||
<Button icon="devourer" tooltip="Community Content" onClick="onClick_toggleUi(Community Content)"/>
|
||||
<Button icon="option-gear" tooltip="Options" onClick="onClick_toggleUi(Options)" active="false"/>
|
||||
<Button icon="option-gear" tooltip="Options" onClick="onClick_toggleUi(Options)"/>
|
||||
<!--<Button icon="download" tooltip="ArkhamDB Deck Importer" onClick="onClick_toggleUi(Deck Importer)"/> -->
|
||||
</VerticalLayout>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user