Merge branch 'main' into tour

This commit is contained in:
Buhallin 2022-12-19 14:25:15 -08:00
commit afe36b3dea
No known key found for this signature in database
GPG Key ID: DB3C362823852294
99 changed files with 872 additions and 987 deletions

View File

@ -22,7 +22,7 @@
},
"Lighting_path": "Lighting.json",
"LuaScript": "require(\"core/Global\")",
"LuaScriptState": "{\"optionPanel\":[false,false,false,false,false,false,false,false]}",
"LuaScriptState": "{\"optionPanel\":{\"useSnapTags\":true,\"showDrawButton\":false,\"useClueClickers\":false,\"showTokenArranger\":false,\"showCleanUpHelper\":false,\"showHandHelper\":false}}",
"MusicPlayer_path": "MusicPlayer.json",
"Note": "",
"ObjectStates_order": [
@ -60,7 +60,7 @@
"Custom_Tile.2eca7c",
"Custom_Tile.fb09d4",
"3DText.65eb7e",
"setactiveinvestigators.f182ee",
"InvestigatorCount.f182ee",
"ScriptingTrigger.c506bf",
"ScriptingTrigger.cbc751",
"ScriptingTrigger.57c22c",

BIN
img/headers/acolyte.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
img/headers/cover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
img/headers/ruins.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -257,9 +257,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 29.464,
"posX": 34.158,
"posY": 1.551,
"posZ": -8.293,
"posZ": -8.612,
"rotX": 0,
"rotY": 90,
"rotZ": 0,

View File

@ -63,4 +63,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -63,4 +63,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -63,4 +63,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -63,4 +63,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
@ -57,4 +57,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
@ -57,4 +57,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
@ -57,4 +57,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",
@ -57,4 +57,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "Core.2585f4.luascriptstate",
"LuaScript_path": "Core.2585f4.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Core",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState": "{\"ml\":[]}",
"LuaScript_path": "CoreNightoftheZealot.64a613.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Core/Night of the Zealot",
@ -53,7 +53,7 @@
"Transform": {
"posX": 58.53,
"posY": 1.481,
"posZ": 28.525,
"posZ": 28.5,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,6}, rotation={0,0,0}, height=500, width=1600,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "EdgeoftheEarth.895eaa.luascriptstate",
"LuaScript_path": "EdgeoftheEarth.895eaa.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Edge of the Earth",
@ -53,7 +53,7 @@
"Transform": {
"posX": 45.414,
"posY": 1.486,
"posZ": 0.38,
"posZ": 0,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,6}, rotation={0,0,0}, height=500, width=1600,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "EdgeoftheEarthInvestigators.a32f43.luascriptstate",
"LuaScript_path": "EdgeoftheEarthInvestigators.a32f43.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Edge of the Earth Investigators",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -1,11 +1,3 @@
-- Chaos Bag Manager
-- made by: Chr1Z
-- description: for easier managing of the chaos bag (adding / removing tokens)
information = {
version = "1.5",
last_updated = "24.11.2022"
}
local TOKEN_URL = {
ElderSign = "https://i.imgur.com/nEmqjmj.png",
plusOne = "https://i.imgur.com/uIx8jbY.png",
@ -61,7 +53,7 @@ buttonParameters.width = 300
buttonParameters.height = 300
local UPDATING = false
local tokenarranger
local tokenArranger
local name
local tokens = {}
@ -87,11 +79,10 @@ function onLoad()
self.addContextMenuItem("More Information", function()
printToAll("------------------------------", "White")
printToAll("Chaos Bag Manager v" .. information["version"] .. " by Chr1Z", "Orange")
printToAll("last updated: " .. information["last_updated"], "White")
printToAll("Chaos Bag Manager by Chr1Z", "Orange")
end)
tokenarranger = getObjectFromGUID("022907")
tokenArranger = getObjectFromGUID("022907")
end
-- get chaos bag from scripting zone and description
@ -182,11 +173,11 @@ function spawnCallback(obj)
end
function updateTokenArranger()
if tokenarranger and not UPDATING then
if tokenArranger and not UPDATING then
UPDATING = true
Wait.time(function()
UPDATING = false
tokenarranger.call("layout")
tokenArranger.call("layout")
end, 1.5)
end
end

View File

@ -31,12 +31,12 @@
{
"Type": 0,
"Name": "option_on",
"URL": "http://cloud-3.steamusercontent.com/ugc/2024961953545431779/1D892EC9A38B06B8D34692642CDEEECF928DCE1C/"
"URL": "http://cloud-3.steamusercontent.com/ugc/2024962321889555728/22ABD35CBB49A001F3A5318E4AFCFB22D24FEA39/"
},
{
"Type": 0,
"Name": "option_off",
"URL": "http://cloud-3.steamusercontent.com/ugc/2024961953545431709/07AD4D32B5C29A3B9F0917924CF7010A29DC3CE4/"
"URL": "http://cloud-3.steamusercontent.com/ugc/2024962321889555661/6643E5CC9160FF4624672C255D0DF7B313DA00A5/"
}
],
"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.",
@ -68,9 +68,9 @@
"rotX": 0,
"rotY": 270,
"rotZ": 0,
"scaleX": 2,
"scaleX": 1.5,
"scaleY": 1,
"scaleZ": 2
"scaleZ": 1.5
},
"Value": 0,
"XmlUI_path": "Fan-MadeAccessories.aa8b38/CleanUpHelper.26cf4b.xml"

View File

@ -165,6 +165,7 @@ function cleanUp()
printToAll("Clean up started!", "Orange")
printToAll("Resetting counters...", "White")
ignoreCustomDataHelper()
getTrauma()
updateCounters(DAMAGE_HORROR_GUIDS, RESET_VALUES, "Damage / Horror")
updateCounters(RESOURCE_GUIDS, 5, "Resources")
@ -227,6 +228,13 @@ function resetDoomCounter()
end
end
-- gets the GUID of a custom data helper (if present) and adds it to the ignore list
function ignoreCustomDataHelper()
local playArea = getObjectFromGUID("721ba2")
local guid = playArea.getVar("custom_data_helper_guid")
if guid then table.insert(IGNORE_GUIDS, guid) end
end
-- read values for trauma from campaign log if enabled
function getTrauma()
RESET_VALUES = {

View File

@ -1,26 +1,26 @@
<!-- 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"/>
<Text class="h1" fontSize="160" font="font_teutonic-arkham"/>
<Text class="h2" fontSize="120" font="font_teutonic-arkham"/>
<Text class="p" fontSize="60" alignment="UpperLeft"/>
<Panel rotation="0 0 180"/>
<Panel class="window" width="1000" height="1000" color="black" outline="white" outlineSize="8 8"/>
<Panel class="window" width="1500" height="1500" color="white" outline="white" outlineSize="10 10"/>
<Row dontUseTableRowBackground="true"/>
<Row class="header" color="#707070"/>
<Row class="option" preferredHeight="130" color="#9e9e9e"/>
<Row class="option" preferredHeight="200" color="#9e9e9e"/>
<!-- heights: 45 x lines + 40 -->
<!-- row heights: 70 x lines + 50 -->
<Row class="description" color="#cfcfcf"/>
<Button class="optionToggle" rectAlignment="MiddleRight" offsetXY="-20 0" colors="#FFFFFF|#dfdfdf" height="108" width="225" ignoreLayout="True" fontSize="60"/>
<Button class="optionToggle" rectAlignment="MiddleRight" offsetXY="-30 0" colors="#FFFFFF|#dfdfdf" height="160" width="288" 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">
<Panel id="options" class="window" offsetXY="-580 200" scale="0.5 0.5" active="false" showAnimation="FadeIn" hideAnimation="FadeOut">
<TableLayout cellPadding="25 25 15 15">
<!-- Header -->
<Row class="header">
<Cell>
@ -32,12 +32,12 @@
<Row class="option">
<Cell>
<Text class="h2">Import trauma</Text>
<Button id="importTrauma" onClick="optionButtonClick(importTrauma)" class="optionToggle" image="option_on"/>
<Button class="optionToggle" id="importTrauma" onClick="optionButtonClick(importTrauma)" image="option_on"/>
</Cell>
</Row>
<Row class="description" preferredHeight="220">
<Row class="description" preferredHeight="330">
<Cell>
<Text class="p">Controls whether trauma values should be imported from the campaign log (if possible).&#xA;Enter players in the campaign log in this order:&#xA;White, Orange, Green, Red.</Text>
<Text class="p">Enables importing trauma values from the campaign log (custom content might give wrong values!).&#xA;Enter players in the campaign log in this order:&#xA;White, Orange, Green, Red.</Text>
</Cell>
</Row>
@ -45,10 +45,10 @@
<Row class="option">
<Cell>
<Text class="h2">Tidy playermats</Text>
<Button id="tidyPlayermats" onClick="optionButtonClick(tidyPlayermats)" class="optionToggle" image="option_on"/>
<Button class="optionToggle" id="tidyPlayermats" onClick="optionButtonClick(tidyPlayermats)" image="option_on"/>
</Cell>
</Row>
<Row class="description" preferredHeight="130">
<Row class="description" preferredHeight="190">
<Cell>
<Text class="p">Controls whether the playermats should get tidied (removal of all cards and tokens).</Text>
</Cell>
@ -58,10 +58,10 @@
<Row class="option">
<Cell>
<Text class="h2">Remove drawn lines</Text>
<Button id="removeDrawnLines" onClick="optionButtonClick(removeDrawnLines)" class="optionToggle" image="option_off"/>
<Button class="optionToggle" id="removeDrawnLines" onClick="optionButtonClick(removeDrawnLines)" image="option_off"/>
</Cell>
</Row>
<Row class="description" preferredHeight="85">
<Row class="description" preferredHeight="120">
<Cell>
<Text class="p">Controls whether all drawn lines should be removed.</Text>
</Cell>

View File

@ -243,14 +243,14 @@ local DATA = {
Name = "VIII - Before the Black Throne 2",
URL = "https://i.ibb.co/VNtgH4v/Circle-Undone-8-Before-the-Black-Throne-Greg-Bobrowski.jpg"
} },
["Side Scenarios (Fan-made)"] = { {
["Side Scenarios (FM)"] = { {
Name = "Consternation on the Constellation",
URL = "https://i.ibb.co/Tw2xBP1/Consternation-Constellation.jpg"
}, {
Name = "Symphony of Erich Zann",
URL = "https://i.ibb.co/SNr8tqN/Symphony-of-Erich-Zann-Hazel-Yingling.jpg"
} },
["Cyclopean Foundations (Fan-made)"] = { {
["Cyclopean Foundations (FM)"] = { {
Name = "I - Lost Moorings 1",
URL = "https://i.ibb.co/DQ76z3c/Cyclopean-1-Lost-Moorings-Care-Line-Art.png"
}, {
@ -290,7 +290,7 @@ local DATA = {
Name = "VIII - Tomb of Dead Dreams 3",
URL = "https://i.ibb.co/vmBM8x2/Cyclopean-8-Tomb-of-Dead-Dreams-Walter-Brocca.png"
} },
["Dark Matter (Fan-made)"] = { {
["Dark Matter (FM)"] = { {
Name = "I - Tatterdemalion 1",
URL = "https://i.ibb.co/DRMPGVt/Dark-Matter-1-Tatterdemalion-Andrey-Vozny.jpg"
}, {
@ -676,9 +676,9 @@ local CycleList = {
"The Innsmouth Conspiracy",
"Edge of the Earth",
"Side Scenarios",
"Cyclopean Foundations (Fan-made)",
"Dark Matter (Fan-made)",
"Side Scenarios (Fan-made)"
"Cyclopean Foundations (FM)",
"Dark Matter (FM)",
"Side Scenarios (FM)"
}
-- save the index of selected cycle and table with spawnData
@ -699,6 +699,7 @@ function onLoad(savedData)
buttonParameters.click_function = "selectCycle"
buttonParameters.tooltip = "Select a cycle"
buttonParameters.label = CycleList[CycleIndex]
buttonParameters.font_size = 90
self.createButton(buttonParameters)
-- index 1: display button

View File

@ -1,12 +1,3 @@
-- Hand Helper
-- updated by: Chr1Z
-- original by: -
-- description: counts cards in your hand (all or unique), can discard a random card
information = {
version = "1.2",
last_updated = "11.10.2022"
}
MAT_GUIDS = { "8b081b", "bd0ff4", "383d8b", "0840d5" }
local BUTTON_PARAMETERS = {}
@ -69,8 +60,7 @@ function onLoad(saved_data)
-- context menu to display additional information
self.addContextMenuItem("More Information", function()
printToAll("------------------------------", "White")
printToAll("Hand Helper v" .. information["version"] .. " by Chr1Z", "Orange")
printToAll("last updated: " .. information["last_updated"], "White")
printToAll("Hand Helper by Chr1Z", "Orange")
printToAll("original by Tikatoy", "White")
printToAll("Note: 'Hidden' cards can't be randomly discarded.", "Yellow")
printToAll("Set them aside beforehand!", "Yellow")
@ -135,6 +125,11 @@ function updateValue()
self.editButton({index = 0, font_color = des and "Green" or "White", label = size})
end
-- allows change of color via external call
function externalColorChange(newColor)
changeColor(_, _, _, newColor)
end
-- get index of current color and move up one step (or down for right-click)
function changeColor(_, _, isRightClick, color)
if color then

View File

@ -1 +1 @@
{"":[0,11],"Auto-fail":[-100,7],"Bless":[101,8],"Cultist":[-2,4],"Curse":[-100,9],"Elder Sign":[100,2],"Elder Thing":[-4,6],"Frost":[-99,10],"Skull":[-1,3],"Tablet":[-3,5]}
{"":[0,11],"Auto-fail":[-100,7],"Bless":[101,8],"Cultist":[-2,4],"Curse":[-101,9],"Elder Sign":[100,2],"Elder Thing":[-4,6],"Frost":[-99,10],"Skull":[-1,3],"Tablet":[-3,5]}

View File

@ -1,14 +1,5 @@
-- Token Arranger
-- created by: Chr1Z
-- original by: Whimsical
-- description: displays the content of the chaos bag
information = {
version = "1.7",
last_updated = "13.11.2022"
}
-- names of tokens in order
local token_names = {
local TOKEN_NAMES = {
"Elder Sign",
"Skull",
"Cultist",
@ -23,7 +14,7 @@ local token_names = {
-- token modifiers for sorting (and order for same modifier)
-- order starts at 2 because there is a "+1" token
local token_precedence = {
local TOKEN_PRECEDENCE = {
["Elder Sign"] = { 100, 2 },
["Skull"] = { -1, 3 },
["Cultist"] = { -2, 4 },
@ -54,16 +45,13 @@ inputParameters.alignment = 3
inputParameters.validation = 2
inputParameters.tab = 2
-- tag for cloned tokens
TO_DELETE_TAG = "to_be_deleted"
updating = false
function onSave() return JSON.encode(token_precedence) end
function onSave() return JSON.encode(TOKEN_PRECEDENCE) end
function onLoad(save_state)
if save_state ~= nil then
token_precedence = JSON.decode(save_state)
TOKEN_PRECEDENCE = JSON.decode(save_state)
end
-- create UI
@ -82,7 +70,7 @@ function onLoad(save_state)
buttonParameters.click_function = attachIndex("tokenClick", i)
inputParameters.input_function = attachIndex2("tokenInput", i)
inputParameters.value = token_precedence[token_names[i]][1]
inputParameters.value = TOKEN_PRECEDENCE[TOKEN_NAMES[i]][1]
self.createButton(buttonParameters)
self.createInput(inputParameters)
@ -100,27 +88,29 @@ function onLoad(save_state)
self.addContextMenuItem("More Information", function()
printToAll("------------------------------", "White")
printToAll("Token Arranger v" .. information["version"] .. " by Chr1Z", "Orange")
printToAll("last updated: " .. information["last_updated"], "White")
printToAll("Token Arranger by Chr1Z", "Orange")
printToAll("original concept by Whimsical", "White")
end)
-- send object reference to bless/curse manager
Wait.time(function()
getObjectFromGUID("5933fb").setVar("tokenArranger", self)
end, 1)
Wait.time(function() getObjectFromGUID("5933fb").setVar("tokenArranger", self) end, 1)
end
function onDestroy()
deleteCopiedTokens()
-- remove object reference from bless/curse manager
getObjectFromGUID("5933fb").setVar("tokenArranger", nil)
end
function onPickUp()
deleteCopiedTokens()
end
-- helper functions to carry index
function attachIndex(click_function, index)
local fn_name = click_function .. index
_G[fn_name] = function(obj, player_color, alt_click)
_G[click_function](obj, player_color, alt_click, index)
_G[fn_name] = function(obj, player_color, isRightClick)
_G[click_function](obj, player_color, isRightClick, index)
end
return fn_name
end
@ -134,26 +124,23 @@ function attachIndex2(input_function, index)
end
-- click_function for buttons on chaos tokens
function tokenClick(obj, player_color, alt_click, index)
function tokenClick(_, _, isRightClick, index)
if not updating then
updating = true
if alt_click then
token_precedence[token_names[index]][1] = token_precedence[token_names[index]][1] - 1
else
token_precedence[token_names[index]][1] = token_precedence[token_names[index]][1] + 1
end
self.editInput({ index = index - 1, value = token_precedence[token_names[index]][1] })
local change = tonumber(isRightClick and "-1" or "1")
TOKEN_PRECEDENCE[TOKEN_NAMES[index]][1] = TOKEN_PRECEDENCE[TOKEN_NAMES[index]][1] + change
self.editInput({ index = index - 1, value = TOKEN_PRECEDENCE[TOKEN_NAMES[index]][1] })
layout()
end
end
-- input_function for input_boxes
function tokenInput(obj, player_color, input, selected, index)
function tokenInput(_, _, input, selected, index)
if selected == false and not updating then
updating = true
local num = tonumber(input)
if num ~= nil then
token_precedence[token_names[index]][1] = num
TOKEN_PRECEDENCE[TOKEN_NAMES[index]][1] = num
end
layout()
end
@ -194,10 +181,14 @@ function getChaosBag()
return chaosbag
end
-- deletes previously placed tokens
function deleteCopiedTokens()
for _, token in ipairs(getObjectsWithTag("to_be_deleted")) do token.destruct() end
end
-- main function (delete old tokens, clone chaos bag content, sort it and position it)
function layout(_, _, isRightClick)
-- delete previously pulled out tokens
for _, token in ipairs(getObjectsWithTag(TO_DELETE_TAG)) do token.destruct() end
deleteCopiedTokens()
-- stop here if right-clicked
if isRightClick then return end
@ -212,25 +203,24 @@ function layout(_, _, isRightClick)
smooth = false,
callback_function = function(tok)
chaos_bag.putObject(tok.clone())
tok.addTag(TO_DELETE_TAG)
tok.addTag("to_be_deleted")
end
}
end
-- wait until all tokens have finished spawning
Wait.condition(function() do_position() end,
function() return #chaos_bag_objects == #getObjectsWithTag(TO_DELETE_TAG) end)
Wait.condition(function() placeTokens() end, function() return #chaos_bag_objects == #getObjectsWithTag("to_be_deleted") end)
end
-- position tokens sorted by value
function do_position()
function placeTokens()
local data = {}
-- create table with tokens
for i, token in ipairs(getObjectsWithTag(TO_DELETE_TAG)) do
for i, token in ipairs(getObjectsWithTag("to_be_deleted")) do
local name = token.getName() or ""
local value = tonumber(name)
local precedence = token_precedence[name]
local precedence = TOKEN_PRECEDENCE[name]
data[i] = {
token = token,

View File

@ -14,10 +14,9 @@
"r": 1
},
"ContainedObjects_order": [
"SecretObjectivesUltimatums.b2077d",
"FanContentIndex.2e32b1",
"Fan-MadeCampaigns.89c32e",
"Fan-MadeStandaloneScenarios.5db60c",
"Fan-MadeCampaigns.89c32e"
"SecretObjectivesUltimatums.b2077d"
],
"ContainedObjects_path": "Fan-MadeScenariosCampaignsMiscellany.66e97c",
"CustomMesh": {
@ -51,8 +50,8 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScript": "",
"LuaScriptState": "{\"ml\":[]}",
"LuaScriptState_path": "Fan-MadeScenariosCampaignsMiscellany.66e97c.luascriptstate",
"LuaScript_path": "Fan-MadeScenariosCampaignsMiscellany.66e97c.ttslua",
"MaterialIndex": -1,
"MeasureMovement": false,
"MeshIndex": -1,
@ -63,8 +62,8 @@
"Tooltip": true,
"Transform": {
"posX": 34.21,
"posY": 1.866,
"posZ": 0.357,
"posY": 1.867,
"posZ": 0,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -0,0 +1 @@
{"ml":{"5db60c":{"lock":false,"pos":{"x":25.5,"y":1.4815,"z":-3.499},"rot":{"x":0,"y":270,"z":0}},"89c32e":{"lock":false,"pos":{"x":25.5,"y":1.4815,"z":3.5},"rot":{"x":0,"y":270,"z":0}},"b2077d":{"lock":false,"pos":{"x":20.4548,"y":1.2965,"z":0},"rot":{"x":0,"y":0,"z":0}}}}

View File

@ -0,0 +1,504 @@
-- Utility memory bag by Directsun
-- Version 2.5.2
-- Fork of Memory Bag 2.0 by MrStump
function updateSave()
local data_to_save = {["ml"]=memoryList}
saved_data = JSON.encode(data_to_save)
self.script_state = saved_data
end
function combineMemoryFromBagsWithin()
local bagObjList = self.getObjects()
for _, bagObj in ipairs(bagObjList) do
local data = bagObj.lua_script_state
if data ~= nil then
local j = JSON.decode(data)
if j ~= nil and j.ml ~= nil then
for guid, entry in pairs(j.ml) do
memoryList[guid] = entry
end
end
end
end
end
function updateMemoryWithMoves()
memoryList = memoryListBackup
--get the first transposed object's coordinates
local obj = getObjectFromGUID(moveGuid)
-- p1 is where needs to go, p2 is where it was
local refObjPos = memoryList[moveGuid].pos
local deltaPos = findOffsetDistance(obj.getPosition(), refObjPos, nil)
local movedRotation = obj.getRotation()
for guid, entry in pairs(memoryList) do
memoryList[guid].pos.x = entry.pos.x - deltaPos.x
memoryList[guid].pos.y = entry.pos.y - deltaPos.y
memoryList[guid].pos.z = entry.pos.z - deltaPos.z
-- memoryList[guid].rot.x = movedRotation.x
-- memoryList[guid].rot.y = movedRotation.y
-- memoryList[guid].rot.z = movedRotation.z
end
--theList[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()
--}
moveList = {}
end
function onload(saved_data)
fresh = true
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
moveList = {}
moveGuid = nil
if next(memoryList) == nil then
createSetupButton()
else
fresh = false
createMemoryActionButtons()
end
end
--Beginning Setup
--Make setup button
function createSetupButton()
self.createButton({
label="Setup", click_function="buttonClick_setup", function_owner=self,
position={0,0.1,-6}, rotation={0,0,0}, height=500, width=1200,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by Transpose button
function buttonClick_transpose()
moveGuid = nil
broadcastToAll("Select one object and move it- all objects will move relative to the new location", {0.75, 0.75, 1})
memoryListBackup = duplicateTable(memoryList)
memoryList = {}
moveList = {}
self.clearButtons()
createButtonsOnAllObjects(true)
createSetupActionButtons(true)
end
--Triggered by setup button,
function buttonClick_setup()
memoryListBackup = duplicateTable(memoryList)
memoryList = {}
self.clearButtons()
createButtonsOnAllObjects(false)
createSetupActionButtons(false)
end
function getAllObjectsInMemory()
local objTable = {}
local curObj = {}
for guid in pairs(memoryListBackup) do
curObj = getObjectFromGUID(guid)
table.insert(objTable, curObj)
end
return objTable
-- return getAllObjects()
end
--Creates selection buttons on objects
function createButtonsOnAllObjects(move)
local howManyButtons = 0
local objsToHaveButtons = {}
if move == true then
objsToHaveButtons = getAllObjectsInMemory()
else
objsToHaveButtons = getAllObjects()
end
for _, obj in ipairs(objsToHaveButtons) 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 * 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 + 4
objPos.z = objPos.z * globalScaleFactor
--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, move) end
local color = {0.75,0.25,0.25,0.6}
local colorMove = {0,0,1,0.6}
if move == true then
color = colorMove
end
self.setVar(funcName, func)
self.createButton({
click_function=funcName, function_owner=self,
position=objPos, rotation=rot, height=1000, width=1000,
color=color,
})
howManyButtons = howManyButtons + 1
end
end
end
--Creates submit and cancel buttons
function createSetupActionButtons(move)
self.createButton({
label="Cancel", click_function="buttonClick_cancel", function_owner=self,
position={0,1,-2}, rotation={0,0,0}, height=240, width=550,
font_size=150, color={0,0,0}, font_color={1,1,1}
})
self.createButton({
label="Submit", click_function="buttonClick_submit", function_owner=self,
position={-1.2,1,-2}, rotation={0,0,0}, height=240, width=570,
font_size=150, color={0,0,0}, font_color={1,1,1}
})
if move == false then
self.createButton({
label="Add", click_function="buttonClick_add", function_owner=self,
position={-1.2,1,2}, rotation={0,0,0}, height=240, width=550,
font_size=150, color={0,0,0}, font_color={0.25,1,0.25}
})
if fresh == false then
self.createButton({
label="Set New", click_function="buttonClick_setNew", function_owner=self,
position={0,1,2}, rotation={0,0,0}, height=240, width=600,
font_size=150, color={0,0,0}, font_color={0.75,0.75,1}
})
self.createButton({
label="Remove", click_function="buttonClick_remove", function_owner=self,
position={1.3,1,2}, rotation={0,0,0}, height=240, width=600,
font_size=150, color={0,0,0}, font_color={1,0.25,0.25}
})
end
end
self.createButton({
label="Reset", click_function="buttonClick_reset", function_owner=self,
position={1.2,1,-2}, rotation={0,0,0}, height=240, width=500,
font_size=150, color={0,0,0}, font_color={1,1,1}
})
end
--During Setup
--Checks or unchecks buttons
function buttonClick_selection(index, obj, move)
local colorMove = {0,0,1,0.6}
local color = {0,1,0,0.6}
previousGuid = selectedGuid
selectedGuid = obj.getGUID()
theList = memoryList
if move == true then
theList = moveList
if previousGuid ~= nil and previousGuid ~= selectedGuid then
local prevObj = getObjectFromGUID(previousGuid)
prevObj.highlightOff()
self.editButton({index=previousIndex, color=colorMove})
theList[previousGuid] = nil
end
previousIndex = index
end
if theList[selectedGuid] == 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
theList[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}
if move == true then
color = colorMove
end
self.editButton({index=index, color=color})
theList[obj.getGUID()] = nil
obj.highlightOff()
end
end
--Cancels selection process
function buttonClick_cancel()
memoryList = memoryListBackup
moveList = {}
self.clearButtons()
if next(memoryList) == nil then
createSetupButton()
else
createMemoryActionButtons()
end
removeAllHighlights()
broadcastToAll("Selection Canceled", {1,1,1})
moveGuid = nil
end
--Saves selections
function buttonClick_submit()
fresh = false
if next(moveList) ~= nil then
for guid in pairs(moveList) do
moveGuid = guid
end
if memoryListBackup[moveGuid] == nil then
broadcastToAll("Item selected for moving is not already in memory", {1, 0.25, 0.25})
else
broadcastToAll("Moving all items in memory relative to new objects position!", {0.75, 0.75, 1})
self.clearButtons()
createMemoryActionButtons()
local count = 0
for guid in pairs(moveList) do
moveGuid = guid
count = count + 1
local obj = getObjectFromGUID(guid)
if obj ~= nil then obj.highlightOff() end
end
updateMemoryWithMoves()
updateSave()
buttonClick_place()
end
elseif next(memoryList) == nil and moveGuid == nil then
memoryList = memoryListBackup
broadcastToAll("No selections made.", {0.75, 0.25, 0.25})
end
combineMemoryFromBagsWithin()
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()
moveGuid = nil
end
function combineTables(first_table, second_table)
for k,v in pairs(second_table) do first_table[k] = v end
end
function buttonClick_add()
fresh = false
combineTables(memoryList, memoryListBackup)
broadcastToAll("Adding internal bags and selections to existing memory", {0.25, 0.75, 0.25})
combineMemoryFromBagsWithin()
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
function buttonClick_remove()
broadcastToAll("Removing Selected Entries From Memory", {1.0, 0.25, 0.25})
self.clearButtons()
createMemoryActionButtons()
local count = 0
for guid in pairs(memoryList) do
count = count + 1
memoryListBackup[guid] = nil
local obj = getObjectFromGUID(guid)
if obj ~= nil then obj.highlightOff() end
end
broadcastToAll(count.." Objects Removed", {1,1,1})
memoryList = memoryListBackup
updateSave()
end
function buttonClick_setNew()
broadcastToAll("Setting new position relative to items in memory", {0.75, 0.75, 1})
self.clearButtons()
createMemoryActionButtons()
local count = 0
for _, obj in ipairs(getAllObjects()) do
guid = obj.guid
if memoryListBackup[guid] ~= nil then
count = count + 1
memoryListBackup[guid].pos = obj.getPosition()
memoryListBackup[guid].rot = obj.getRotation()
memoryListBackup[guid].lock = obj.getLock()
end
end
broadcastToAll(count.." Objects Saved", {1,1,1})
memoryList = memoryListBackup
updateSave()
end
--Resets bag to starting status
function buttonClick_reset()
fresh = true
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="Place", click_function="buttonClick_place", function_owner=self,
position={0.7,1,2}, rotation={0,0,0}, height=280, width=600,
font_size=200, color={0,0,0}, font_color={1,1,1}
})
self.createButton({
label="Recall", click_function="buttonClick_recall", function_owner=self,
position={-0.7,1,2}, rotation={0,0,0}, height=280, width=650,
font_size=200, color={0,0,0}, font_color={1,1,1}
})
self.createButton({
label="Setup", click_function="buttonClick_setup", function_owner=self,
position={0,1,-2}, rotation={0,0,0}, height=240, width=500,
font_size=150, color={0,0,0}, font_color={1,1,1}
})
--- self.createButton({
--- label="Move", click_function="buttonClick_transpose", function_owner=self,
--- position={-2.8,0.3,0}, rotation={0,0,0}, height=350, width=800,
--- font_size=250, color={0,0,0}, font_color={0.75,0.75,1}
--- })
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, smooth=false
})
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 yOffset = 0
if obj ~= nil then
local bounds = obj.getBounds()
yOffset = (bounds.size.y - bounds.offset.y)
end
local deltaPos = {}
deltaPos.x = (p2.x-p1.x)
deltaPos.y = (p2.y-p1.y) + yOffset
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=objPos.x+x, y=objPos.y+desiredPos.y, z=objPos.z+z}
return {x=x, y=desiredPos.y, z=z}
end
function rotateMyCoordinates(desiredPos, obj)
local angle = math.rad(obj.getRotation().y)
local x = desiredPos.x * math.sin(angle)
local z = 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

View File

@ -88,9 +88,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 29.09,
"posY": 2.259,
"posZ": 14.5,
"posX": 25.5,
"posY": 1.481,
"posZ": 3.5,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -93,9 +93,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 27.717,
"posY": 2.255,
"posZ": 12.42,
"posX": 25.5,
"posY": 1.481,
"posZ": -3.499,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,48 +0,0 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"b": 1,
"g": 1,
"r": 1
},
"Description": "",
"DragSelectable": true,
"GMNotes": "",
"GUID": "2e32b1",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScript": "",
"LuaScriptState": "",
"MeasureMovement": false,
"Name": "Tablet",
"Nickname": "Fan Content Index",
"Snap": true,
"Sticky": true,
"Tablet": {
"PageURL": "https://www.google.com/"
},
"Tooltip": true,
"Transform": {
"posX": 29.09,
"posY": 2.507,
"posZ": 14.301,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
"scaleX": 1,
"scaleY": 1,
"scaleZ": 1
},
"Value": 0,
"XmlUI": ""
}

View File

@ -42,9 +42,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 14.548,
"posY": 2.275,
"posZ": -36.314,
"posX": 20.455,
"posY": 1.296,
"posZ": 0,
"rotX": 0,
"rotY": 0,
"rotZ": 0,

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "0",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -34,10 +34,10 @@
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"core/ActiveInvestigatorCounter\")",
"LuaScriptState": "[true,2]",
"LuaScriptState": "2",
"MeasureMovement": false,
"Name": "Custom_Token",
"Nickname": "set active investigators\n",
"Nickname": "Investigator Count",
"Snap": true,
"Sticky": true,
"Tooltip": true,
@ -54,4 +54,4 @@
},
"Value": 0,
"XmlUI": ""
}
}

View File

@ -1 +1 @@
{"ml":{"77a5f9":{"lock":false,"pos":{"x":24.4908065795898,"y":1.4814989566803,"z":8.42890167236328},"rot":{"x":-8.97855017001348E-08,"y":269.999816894531,"z":-3.17670227900635E-08}},"9f6801":{"lock":false,"pos":{"x":24.4866199493408,"y":1.4814989566803,"z":0.270817786455154},"rot":{"x":-7.39079695222244E-08,"y":270.000183105469,"z":-1.78800675598723E-07}}}}
{"ml":{"77a5f9":{"lock":false,"pos":{"x":25.5,"y":1.4815,"z":18},"rot":{"x":0,"y":270,"z":0}},"9f6801":{"lock":false,"pos":{"x":25.5,"y":1.4815,"z":11},"rot":{"x":0,"y":270,"z":0}}}}

View File

@ -63,9 +63,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 24.487,
"posX": 25.5,
"posY": 1.481,
"posZ": 0.271,
"posZ": 11,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -67,9 +67,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 24.491,
"posX": 25.5,
"posY": 1.481,
"posZ": 8.429,
"posZ": 18,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "5",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "5",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "5",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -33,7 +33,7 @@
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/GenericCounter\")",
"LuaScript": "require(\"core/GenericCounter\")",
"LuaScriptState": "5",
"MeasureMovement": false,
"Name": "Custom_Token",

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "ReturntoTheCircleUndone.757324.luascriptstate",
"LuaScript_path": "ReturntoTheCircleUndone.757324.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Return to The Circle Undone",
@ -53,7 +53,7 @@
"Transform": {
"posX": 66.907,
"posY": 1.866,
"posZ": -27.912,
"posZ": -27.9,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,1,-2}, rotation={0,0,0}, height=240, width=800,
font_size=150, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "ReturntoTheDunwichLegacy.ce9130.luascriptstate",
"LuaScript_path": "ReturntoTheDunwichLegacy.ce9130.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Return to The Dunwich Legacy",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,1,-2}, rotation={0,0,0}, height=240, width=800,
font_size=150, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "ReturntoTheForgottenAge.479ff3.luascriptstate",
"LuaScript_path": "ReturntoTheForgottenAge.479ff3.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Return to The Forgotten Age",
@ -53,7 +53,7 @@
"Transform": {
"posX": 66.994,
"posY": 1.866,
"posZ": -14.341,
"posZ": -14.35,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,1,-2}, rotation={0,0,0}, height=240, width=800,
font_size=150, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "ReturntoThePathtoCarcosa.e9889a.luascriptstate",
"LuaScript_path": "ReturntoThePathtoCarcosa.e9889a.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Return to The Path to Carcosa",
@ -53,7 +53,7 @@
"Transform": {
"posX": 66.991,
"posY": 1.866,
"posZ": 0.141,
"posZ": 0,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,1,-2}, rotation={0,0,0}, height=240, width=800,
font_size=150, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "ReturntotheNightoftheZealot.56270d.luascriptstate",
"LuaScript_path": "ReturntotheNightoftheZealot.56270d.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Return to the Night of the Zealot",
@ -53,7 +53,7 @@
"Transform": {
"posX": 66.983,
"posY": 1.866,
"posZ": 28.532,
"posZ": 28.5,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,1,-2}, rotation={0,0,0}, height=240, width=800,
font_size=150, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "StarterDeckInvestigators.35fb9c.luascriptstate",
"LuaScript_path": "StarterDeckInvestigators.35fb9c.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Starter Deck Investigators",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheCircleUndone.0dcbe8.luascriptstate",
"LuaScript_path": "TheCircleUndone.0dcbe8.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Circle Undone",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheCircleUndone.63e097.luascriptstate",
"LuaScript_path": "TheCircleUndone.63e097.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Circle Undone",
@ -53,7 +53,7 @@
"Transform": {
"posX": 58.453,
"posY": 1.486,
"posZ": -27.881,
"posZ": -27.9,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,6}, rotation={0,0,0}, height=500, width=1600,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheDream-Eaters.a16a1a.luascriptstate",
"LuaScript_path": "TheDream-Eaters.a16a1a.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Dream-Eaters",
@ -53,7 +53,7 @@
"Transform": {
"posX": 45.159,
"posY": 1.486,
"posZ": 28.518,
"posZ": 28.5,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,6}, rotation={0,0,0}, height=500, width=1600,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheDream-Eaters.a34f34.luascriptstate",
"LuaScript_path": "TheDream-Eaters.a34f34.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Dream-Eaters",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheDunwichLegacy.2898f6.luascriptstate",
"LuaScript_path": "TheDunwichLegacy.2898f6.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Dunwich Legacy",
@ -53,7 +53,7 @@
"Transform": {
"posX": 58.548,
"posY": 1.481,
"posZ": 14.464,
"posZ": 14.5,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,6}, rotation={0,0,0}, height=500, width=1600,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheDunwichLegacy.5889dd.luascriptstate",
"LuaScript_path": "TheDunwichLegacy.5889dd.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Dunwich Legacy",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheForgottenAge.03b888.luascriptstate",
"LuaScript_path": "TheForgottenAge.03b888.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Forgotten Age",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheForgottenAge.0bcf19.luascriptstate",
"LuaScript_path": "TheForgottenAge.0bcf19.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Forgotten Age",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,6}, rotation={0,0,0}, height=500, width=1600,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheInnsmouthConspiracy.10bd18.luascriptstate",
"LuaScript_path": "TheInnsmouthConspiracy.10bd18.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Innsmouth Conspiracy",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheInnsmouthConspiracy.465aab.luascriptstate",
"LuaScript_path": "TheInnsmouthConspiracy.465aab.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Innsmouth Conspiracy",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,6}, rotation={0,0,0}, height=500, width=1600,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "ThePathtoCarcosa.899c3a.luascriptstate",
"LuaScript_path": "ThePathtoCarcosa.899c3a.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Path to Carcosa",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "ThePathtoCarcosa.aca04c.luascriptstate",
"LuaScript_path": "ThePathtoCarcosa.aca04c.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Path to Carcosa",
@ -53,7 +53,7 @@
"Transform": {
"posX": 58.506,
"posY": 1.481,
"posZ": 0.122,
"posZ": 0,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,6}, rotation={0,0,0}, height=500, width=1600,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheScarletKeys.300fcc.luascriptstate",
"LuaScript_path": "TheScarletKeys.300fcc.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Scarlet Keys",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,6}, rotation={0,0,0}, height=500, width=1600,
font_size=350, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -43,7 +43,7 @@
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScriptState_path": "TheScarletKeys.a4fd1b.luascriptstate",
"LuaScript_path": "TheScarletKeys.a4fd1b.ttslua",
"LuaScript": "require(\"core/DownloadBox\")",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "The Scarlet Keys",

View File

@ -1,22 +0,0 @@
function onload(saved_data)
createDownloadButton()
end
--Beginning Setup
--Make Download button
function createDownloadButton()
self.createButton({
label="Download", click_function="buttonClick_download", function_owner=self,
position={0,0.1,7}, rotation={0,0,0}, height=850, width=3300,
font_size=700, color={0,0,0}, font_color={1,1,1}
})
end
--Triggered by download button,
function buttonClick_download()
local params = { url = self.getGMNotes(), replace = self.guid }
Global.call('placeholder_download', params)
end

View File

@ -119,7 +119,7 @@
"Transform": {
"posX": 30.368,
"posY": 1.481,
"posZ": 28.527,
"posZ": 28.5,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -1,134 +1,3 @@
DEBUG = false
require("core/GenericCounter")
MIN_VALUE = 1
MAX_VALUE = 4
function onload(saved_data)
self.interactable = DEBUG
light_mode = false
val = 0
if saved_data ~= "" then
local loaded_data = JSON.decode(saved_data)
light_mode = loaded_data[1]
val = loaded_data[2]
end
createAll()
end
function updateSave()
local data_to_save = {light_mode, val}
saved_data = JSON.encode(data_to_save)
self.script_state = saved_data
end
function createAll()
s_color = {0.5, 0.5, 0.5, 95}
if light_mode then
f_color = {1,1,1,95}
else
f_color = {0,0,0,100}
end
self.createButton({
label=tostring(val),
click_function="add_subtract",
function_owner=self,
position={0,0.05,0},
height=600,
width=1000,
alignment = 3,
scale={x=1.5, y=1.5, z=1.5},
font_size=600,
font_color=f_color,
color={0,0,0,0}
})
if light_mode then
lightButtonText = "[ Set dark ]"
else
lightButtonText = "[ Set light ]"
end
end
function removeAll()
self.removeInput(0)
self.removeInput(1)
self.removeButton(0)
self.removeButton(1)
self.removeButton(2)
end
function reloadAll()
removeAll()
createAll()
updateSave()
end
function swap_fcolor(_obj, _color, alt_click)
light_mode = not light_mode
reloadAll()
end
function swap_align(_obj, _color, alt_click)
center_mode = not center_mode
reloadAll()
end
function editName(_obj, _string, value)
self.setName(value)
setTooltips()
end
function add_subtract(_obj, _color, alt_click)
mod = alt_click and -1 or 1
new_value = math.min(math.max(val + mod, MIN_VALUE), MAX_VALUE)
if val ~= new_value then
val = new_value
updateVal()
updateSave()
end
end
function updateVal()
self.editButton({
index = 0,
label = tostring(val),
})
end
function reset_val()
val = 0
updateVal()
updateSave()
end
function setTooltips()
self.editInput({
index = 0,
value = self.getName(),
tooltip = ttText
})
self.editButton({
index = 0,
value = tostring(val),
tooltip = ttText
})
end
function null()
end
function keepSample(_obj, _string, value)
reloadAll()
end

View File

@ -1,15 +1,39 @@
function onLoad()
self.createButton({
local notes = self.getGMNotes()
-- default parameters (e.g. scenarios)
local buttonParameters = {
label = "Download",
click_function = "buttonClick_download",
function_owner = self,
position = { 0, 0.1, 2.2 },
height = 240,
position = { x = 0, y = 0.1, z = 2.1 },
height = 250,
width = 800,
font_size = 150,
color = { 0, 0, 0 },
font_color = { 1, 1, 1 }
})
}
-- return to boxes
if string.match(notes, "................") == "campaigns/return" then
buttonParameters.position.z = -2
-- official campaign boxes
elseif string.match(notes, ".........") == "campaigns" then
buttonParameters.position.z = 6
buttonParameters.height = 500
buttonParameters.width = 1700
buttonParameters.font_size = 350
-- investigator boxes
elseif string.match(notes, ".............") == "investigators" then
buttonParameters.position.z = 7
buttonParameters.height = 850
buttonParameters.width = 3400
buttonParameters.font_size = 700
end
self.createButton(buttonParameters)
end
function buttonClick_download()

View File

@ -11,6 +11,9 @@ optionPanel = {}
-- GUID of data helper
DATA_HELPER_GUID = "708279"
-- GUID of fan-made accessories bag (also just called "barrel")
BARREL_GUID = "aa8b38"
-- GUIDs that will not be interactable (e.g. parts of the table)
local NOT_INTERACTABLE = {
"6161b4",
@ -634,52 +637,6 @@ function onClick_load()
UI.hide('load_button')
end
function onClick_defaultSettings()
print("Dummy: Load default settings")
end
function onClick_toggleOption(_, id)
local state = self.UI.getAttribute("toggle" .. id, "isOn")
-- flip state (and handle stupid "False" value)
if state == "False" then
state = true
else
state = false
end
self.UI.setAttribute("toggle" .. id, "isOn", state)
id = tonumber(id)
optionPanel[id] = state
applyOptionPanelChange(id, state)
end
-- sets the option panel to the correct state (corresponding to 'optionPanel')
function updateOptionPanelState()
for id, enabled in pairs(optionPanel) do
if enabled then self.UI.setAttribute("toggle" .. id, "isOn", true) end
end
end
function applyOptionPanelChange(id, state)
-- option 1: Snap tags
if id == 1 then
playmatAPI.setLimitSnapsByType(state, "All")
-- option 2: Draw 1 button
elseif id == 2 then
playmatAPI.showDrawButton(state, "All")
-- option 3: Clickable clue counters
elseif id == 3 then
playmatAPI.clickableClues(state, "All")
-- update master clue counter
getObjectFromGUID("4a3aa4").setVar("useClickableCounters", state)
end
end
function onClick_toggleUi(_, title)
UI.hide('optionPanel')
UI.hide('load_ui')
@ -825,3 +782,142 @@ function urldecode(str)
function (h) return string.char(tonumber(h, 16)) end)
return str
end
---------------------------------------------------------
-- Option Panel related functionality
---------------------------------------------------------
-- loads the default options
function onClick_defaultSettings()
print("Dummy: Load default settings")
end
-- called by toggling an option
function onClick_toggleOption(_, id)
local state = self.UI.getAttribute(id, "isOn")
-- flip state (and handle stupid "False" value)
if state == "False" then
state = true
else
state = false
end
self.UI.setAttribute(id, "isOn", state)
optionPanel[id] = state
applyOptionPanelChange(id, state)
end
-- sets the option panel to the correct state (corresponding to 'optionPanel')
function updateOptionPanelState()
for id, enabled in pairs(optionPanel) do
if enabled then
self.UI.setAttribute(id, "isOn", true)
end
end
end
-- handles the applying of option selections and calls the respective functions based
---@param id String ID of the option that was selected or deselected
---@param state Boolean State of the option (true = enabled)
function applyOptionPanelChange(id, state)
-- option: Snap tags
if id == "useSnapTags" then
playmatAPI.setLimitSnapsByType(state, "All")
-- option: Draw 1 button
elseif id == "showDrawButton" then
playmatAPI.showDrawButton(state, "All")
-- option: Clickable clue counters
elseif id == "useClueClickers" then
playmatAPI.clickableClues(state, "All")
-- update master clue counter
getObjectFromGUID("4a3aa4").setVar("useClickableCounters", state)
-- option: Show token arranger
elseif id == "showTokenArranger" then
-- delete previously pulled out tokens
for _, token in ipairs(getObjectsWithTag("to_be_deleted")) do token.destruct() end
spawnOrRemoveHelper(state, "Token Arranger", {-42.3, 1.4, -46.5})
-- option: Show clean up helper
elseif id == "showCleanUpHelper" then
spawnOrRemoveHelper(state, "Clean Up Helper", {-68, 1.6, 35.5})
-- option: Show hand helper for each player
elseif id == "showHandHelper" then
spawnOrRemoveHelper(state, "Hand Helper", {-50.84, 1.6, 7.02}, {0, 270, 0}, "White")
spawnOrRemoveHelper(state, "Hand Helper", {-50.90, 1.6, -25.10}, {0, 270, 0}, "Orange")
spawnOrRemoveHelper(state, "Hand Helper", {-34.38, 1.6, 22.44}, {0, 000, 0}, "Green")
spawnOrRemoveHelper(state, "Hand Helper", {-16.69, 1.6, -22.42}, {0, 180, 0}, "Red")
-- option: Show chaos bag manager
elseif id == "showChaosBagManager" then
spawnOrRemoveHelper(state, "Chaos Bag Manager", {-67.8, 1.4, -49.5})
end
end
-- handler for spawn / remove functions of helper objects
---@param state Boolean Contains the state of the option: true = spawn it, false = remove it
---@param name String Name of the helper object
---@param position Vector Position of the object (where it will spawn or where it will be removed from)
---@param rotation Vector Rotation of the object for spawning (default: {0, 270, 0})
---@param color Color This is only needed for correctly setting the color of the "Hand Helper"
function spawnOrRemoveHelper(state, name, position, rotation, color)
if state then
spawnHelperObject(name, position, rotation, color)
Player["White"].pingTable(position)
else
removeHelperObject(name, position)
end
end
-- copies the specified tool (by name) from the barrel
---@param name String Name of the object that should be copied
---@param position Position Desired position of the object
function spawnHelperObject(name, position, rotation, color)
if rotation == nil then rotation = {0, 270, 0} end
for _, obj in ipairs(getObjectFromGUID(BARREL_GUID).getData().ContainedObjects) do
if obj["Nickname"] == name then
spawnObjectData({
data = obj,
position = position,
rotation = rotation,
callback_function = function(object)
if name == "Hand Helper" then
Wait.time(function() object.call("externalColorChange", color) end, 1)
elseif name == "Token Arranger" then
Wait.time(function() object.call("layout") end, 1)
end
end
})
return
end
end
end
-- removes the specified tool (by name) from the provided position
---@param name String Name of the object that should be removed
---@param position Position Position of the object
function removeHelperObject(name, position)
local search = Physics.cast({
direction = { 0, 1, 0 },
max_distance = 1,
type = 3,
size = {1, 1, 1},
origin = position,
orientation = { 0, 270, 0 }
})
for _, obj in ipairs(search) do
obj = obj.hit_object
if obj.getName() == name then
obj.destruct()
return
end
end
end

View File

@ -174,9 +174,7 @@ end
function doReset(color)
-- delete previously pulled out tokens by the token arranger
if tokenArranger then
for _, token in ipairs(getObjectsWithTag(tokenArranger.getVar("TO_DELETE_TAG"))) do
token.destruct()
end
tokenArranger.call("deleteCopiedTokens")
end
playerColor = color

View File

@ -3,14 +3,14 @@
<Text color="white" alignment="MiddleLeft"/>
<Toggle isOn="False" rectAlignment="MiddleRight"/>
<VerticalLayout class="window" active="false" color="black" visibility="Admin" outlineSize="1 1" outline="grey" allowDragging="true" returnToOriginalPositionWhenReleased="false" width="500" height="800"/>
<VerticalLayout class="group" outlineSize="1 1" outline="grey" color="#222222" padding="10" spacing="5"/>
<VerticalLayout class="text-column" padding="5 20 0 0"/>
<VerticalLayout class="window" visibility="Admin" active="false" color="black" width="500" height="700" outlineSize="1 1" outline="grey" showAnimation="SlideIn_Right" hideAnimation="SlideOut_Right" animationDuration="0.1"/>
<VerticalLayout class="group" visibility="Admin" outlineSize="1 1" outline="grey" color="#222222" padding="10" spacing="5"/>
<VerticalLayout class="text-column" visibility="Admin" padding="5 20 0 0"/>
<HorizontalLayout class="group-content" color="#444444" padding="5" spacing="5"/>
<HorizontalLayout class="group-content" visibility="Admin" color="#444444" padding="5" spacing="5"/>
<Text class="group-header" fontSize="24" font="font_teutonic-arkham"/>
<Text class="option-header" fontSize="16" font="font_teutonic-arkham"/>
<Text class="option-header" fontSize="18" font="font_teutonic-arkham"/>
<Text class="description" fontSize="12"/>
<Button class="bottomButtons" hoverClass="hover" pressClass="press" selectClass="select" color="#888888" minHeight="35" fontSize="24" font="font_teutonic-arkham"/>
@ -20,99 +20,84 @@
</Defaults>
<!-- Option Panel -->
<VerticalLayout id="optionPanel" class="window">
<VerticalLayout id="optionPanel" class="window" rectAlignment="LowerRight" offsetXY="-50 60">
<Panel minHeight="45" flexibleHeight="0" padding="10 10 0 0">
<Text font="font_teutonic-arkham" fontSize="35">Options</Text>
</Panel>
<VerticalLayout>
<!-- Group 1 -->
<!-- Group: playermat settings -->
<VerticalLayout class="group">
<Panel minHeight="44" image="option_image1" padding="5 0 0 0">
<Text class="group-header">PLAYERMAT SETTINGS</Text>
</Panel>
<!-- Option 1 -->
<!-- Option: enable snap tags -->
<HorizontalLayout class="group-content">
<VerticalLayout class="text-column">
<Text class="option-header">Enable snap tags</Text>
<Text class="description">Only cards with the tag "Asset" will snap (official cards are supported by default).&#xA;Disable this if you are having issues with custom content.</Text>
</VerticalLayout>
<Toggle id="toggle1" onValueChanged="onClick_toggleOption(1)" />
<Toggle id="useSnapTags" onValueChanged="onClick_toggleOption(useSnapTags)" />
</HorizontalLayout>
<!-- Option 2 -->
<!-- Option: show draw 1 button -->
<HorizontalLayout class="group-content">
<VerticalLayout class="text-column">
<Text class="option-header">Show "Draw 1" button</Text>
<Text class="description">Displays a button below the "Upkeep" button that draws a card from your deck. Useful for multi-handed solo play.</Text>
</VerticalLayout>
<Toggle id="toggle2" onValueChanged="onClick_toggleOption(2)"/>
<Toggle id="showDrawButton" onValueChanged="onClick_toggleOption(showDrawButton)"/>
</HorizontalLayout>
<!-- Option 3 -->
<!-- Option: use clickable clue-counters -->
<HorizontalLayout class="group-content">
<VerticalLayout class="text-column">
<Text class="option-header">Use clickable clue-counters</Text>
<Text class="description">Instead of automatically counting clues in the respective area on your playermat, this displays a clickable counter for clues.&#xA;Take note of each player's clue count before changing this option!</Text>
<Text class="description">Instead of automatically counting clues in the respective area on your playermat, this displays a clickable counter for clues.</Text>
</VerticalLayout>
<Toggle id="toggle3" onValueChanged="onClick_toggleOption(3)"/>
<Toggle id="useClueClickers" onValueChanged="onClick_toggleOption(useClueClickers)"/>
</HorizontalLayout>
</VerticalLayout>
<!-- Group 2 -->
<!-- Group: fan-made accessories -->
<VerticalLayout class="group">
<Panel minHeight="44" image="option_image2" padding="5 0 0 0">
<Text class="group-header">FAN-MADE ACCESSORIES</Text>
</Panel>
<!-- Option 4 -->
<!-- Option: show token arranger -->
<HorizontalLayout class="group-content">
<VerticalLayout class="text-column">
<Text class="option-header">Toggle Text 4</Text>
<Text class="description">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat...</Text>
<Text class="option-header">Show "Token Arranger"</Text>
<Text class="description">See the contents of the chaos bag at a glance! This tool displays a sorted table of the tokens to allow easier guessing of your odds.</Text>
</VerticalLayout>
<Toggle id="toggle4" onValueChanged="onClick_toggleOption(4)"/>
<Toggle id="showTokenArranger" onValueChanged="onClick_toggleOption(showTokenArranger)"/>
</HorizontalLayout>
<!-- Option 5 -->
<!-- Option: show clean up helper -->
<HorizontalLayout class="group-content">
<VerticalLayout class="text-column">
<Text class="option-header">Toggle Text 5</Text>
<Text class="description">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat...</Text>
<Text class="option-header">Show "Clean Up Helper"</Text>
<Text class="description">Useful for campaign-play: It resets play areas to allow continuous gameplay in the same savegame.</Text>
</VerticalLayout>
<Toggle id="toggle5" onValueChanged="onClick_toggleOption(5)"/>
<Toggle id="showCleanUpHelper" onValueChanged="onClick_toggleOption(showCleanUpHelper)"/>
</HorizontalLayout>
<!-- Option 6 -->
<!-- Option: show hand helper -->
<HorizontalLayout class="group-content">
<VerticalLayout class="text-column">
<Text class="option-header">Toggle Text 6</Text>
<Text class="description">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat...</Text>
<Text class="option-header">Show "Hand Helper"</Text>
<Text class="description">Never count your hand cards again! This tool does that for you and can even take "Dream-Enhancing Serum" into account. Also includes a button for randomly discard a card.</Text>
</VerticalLayout>
<Toggle id="toggle6" onValueChanged="onClick_toggleOption(6)"/>
</HorizontalLayout>
</VerticalLayout>
<!-- Group 3 -->
<VerticalLayout class="group">
<Panel minHeight="30">
<Text class="group-header">Group 3</Text>
</Panel>
<!-- Option 7 -->
<HorizontalLayout class="group-content">
<VerticalLayout class="text-column">
<Text class="option-header">Toggle Text 7</Text>
<Text class="description">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat...</Text>
</VerticalLayout>
<Toggle id="toggle7" onValueChanged="onClick_toggleOption(7)"/>
<Toggle id="showHandHelper" onValueChanged="onClick_toggleOption(showHandHelper)"/>
</HorizontalLayout>
<!-- Option 8 -->
<!-- Option: show chaos bag manager -->
<HorizontalLayout class="group-content">
<VerticalLayout class="text-column">
<Text class="option-header">Toggle Text 8</Text>
<Text class="description">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat...</Text>
<Text class="option-header">Show "Chaos Bag Manager"</Text>
<Text class="description">Panel for easy addition or removal of chaos tokens to the bag - very useful for EotE because of Frost tokens!</Text>
</VerticalLayout>
<Toggle id="toggle8" onValueChanged="onClick_toggleOption(8)"/>
<Toggle id="showChaosBagManager" onValueChanged="onClick_toggleOption(showChaosBagManager)"/>
</HorizontalLayout>
</VerticalLayout>
</VerticalLayout>