top of file cleanup
This commit is contained in:
parent
df32b9942d
commit
d173f45927
@ -1,3 +1,9 @@
|
||||
local blessCurseApi = require("chaosbag/BlessCurseManagerApi")
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
local deckImporterApi = require("arkhamdb/DeckImporterApi")
|
||||
local optionPanelApi = require("core/OptionPanelApi")
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
|
||||
local campaignTokenData = {
|
||||
GUID = "51b1c9",
|
||||
Name = "Custom_Model",
|
||||
@ -46,14 +52,7 @@ local DAMAGE_HORROR_GUIDS = {
|
||||
"468e88"; "0257d9"; "7b5729"; "beb964";
|
||||
}
|
||||
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local deckImporterApi = require("arkhamdb/DeckImporterApi")
|
||||
local optionPanelApi = require("core/OptionPanelApi")
|
||||
local blessCurseApi = require("chaosbag/BlessCurseManagerApi")
|
||||
|
||||
local TOUR_GUID = "0e5aa8"
|
||||
|
||||
local campaignBoxGUID
|
||||
|
||||
function onLoad(save_state)
|
||||
|
@ -1,3 +1,5 @@
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
|
||||
local TOKEN_IDS = {
|
||||
-- first row
|
||||
"p1", "0", "m1", "m2", "m3", "m4",
|
||||
@ -34,7 +36,6 @@ buttonParameters.height = 300
|
||||
|
||||
local name
|
||||
local tokens = {}
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
|
||||
function onLoad()
|
||||
-- create buttons for tokens
|
||||
|
@ -2,12 +2,13 @@
|
||||
- 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 tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
||||
local soundCubeApi = require("core/SoundCubeApi")
|
||||
local playmatApi = require("playermat/PlaymatApi")
|
||||
|
||||
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local playmatApi = require("playermat/PlaymatApi")
|
||||
local soundCubeApi = require("core/SoundCubeApi")
|
||||
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
||||
|
||||
-- these objects will be ignored
|
||||
local IGNORE_GUIDS = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
local mythosAreaApi = require("core/MythosAreaApi")
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
local mythosAreaApi = require("core/MythosAreaApi")
|
||||
|
||||
-- common parameters
|
||||
local buttonParameters = {}
|
||||
|
@ -1,6 +1,7 @@
|
||||
do
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local allCardsBagApi = require("playercards/AllCardsBagApi")
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
|
||||
local ArkhamDb = { }
|
||||
local internal = { }
|
||||
|
||||
|
@ -2,7 +2,6 @@ do
|
||||
local DeckImporterApi = {}
|
||||
local DECK_IMPORTER_GUID = "a28140"
|
||||
|
||||
|
||||
-- Returns a table with the full state of the UI, including options and deck IDs.
|
||||
-- This can be used to persist via onSave(), or provide values for a load operation
|
||||
-- Table values:
|
||||
@ -22,7 +21,7 @@ do
|
||||
end
|
||||
|
||||
-- Updates the state of the UI based on the provided table. Any values not provided will be left the same.
|
||||
-- @param uiStateTable Table of values to update on importer
|
||||
---@param uiStateTable Table of values to update on importer
|
||||
-- Table values:
|
||||
-- redDeck: Deck ID to load for the red player
|
||||
-- orangeDeck: Deck ID to load for the orange player
|
||||
|
@ -1,10 +1,10 @@
|
||||
require("arkhamdb/DeckImporterUi")
|
||||
require("playercards/PlayerCardSpawner")
|
||||
|
||||
local playmatApi = require("playermat/PlaymatApi")
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local allCardsBagApi = require("playercards/AllCardsBagApi")
|
||||
local arkhamDb = require("arkhamdb/ArkhamDb")
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local playmatApi = require("playermat/PlaymatApi")
|
||||
local zones = require("playermat/Zones")
|
||||
|
||||
function onLoad(script_state)
|
||||
|
@ -1,3 +1,5 @@
|
||||
local allCardsBagApi = require("playercards/AllCardsBagApi")
|
||||
|
||||
local INPUT_FIELD_HEIGHT = 340
|
||||
local INPUT_FIELD_WIDTH = 1500
|
||||
local FIELD_COLOR = { 0.9, 0.7, 0.5 }
|
||||
@ -23,8 +25,6 @@ local privateDeck = true
|
||||
local loadNewestDeck = true
|
||||
local loadInvestigators = false
|
||||
|
||||
local allCardsBagApi = require("playercards/AllCardsBagApi")
|
||||
|
||||
-- Returns a table with the full state of the UI, including options and deck IDs.
|
||||
-- This can be used to persist via onSave(), or provide values for a load operation
|
||||
-- Table values:
|
||||
@ -48,7 +48,7 @@ function getUiState()
|
||||
end
|
||||
|
||||
-- Updates the state of the UI based on the provided table. Any values not provided will be left the same.
|
||||
-- @param uiStateTable Table of values to update on importer
|
||||
---@param uiStateTable Table of values to update on importer
|
||||
-- Table values:
|
||||
-- redDeck: Deck ID to load for the red player
|
||||
-- orangeDeck: Deck ID to load for the orange player
|
||||
|
@ -1,3 +1,4 @@
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
local tokenArrangerApi = require("accessories/TokenArrangerApi")
|
||||
|
||||
-- common button parameters
|
||||
@ -23,8 +24,6 @@ local FONT_COLOR = {
|
||||
local whitespace = " "
|
||||
local updating
|
||||
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
|
||||
---------------------------------------------------------
|
||||
-- creating buttons and menus + initializing tables
|
||||
---------------------------------------------------------
|
||||
|
@ -1,7 +1,7 @@
|
||||
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
|
||||
local optionPanelApi = require("core/OptionPanelApi")
|
||||
local playmatApi = require("playermat/PlaymatApi")
|
||||
local victoryDisplayApi = require("core/VictoryDisplayApi")
|
||||
local optionPanelApi = require("core/OptionPanelApi")
|
||||
|
||||
function onLoad()
|
||||
addHotkey("Add Doom to Agenda", addDoomToAgenda)
|
||||
|
@ -1,7 +1,7 @@
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local tokenArrangerApi = require("accessories/TokenArrangerApi")
|
||||
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
||||
local tokenChecker = require("core/token/TokenChecker")
|
||||
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
||||
|
||||
local ENCOUNTER_DECK_AREA = {
|
||||
upperLeft = { x = 0.9, z = 0.42 },
|
||||
|
@ -1,6 +1,5 @@
|
||||
do
|
||||
local PlayAreaApi = { }
|
||||
|
||||
local PLAY_AREA_GUID = "721ba2"
|
||||
local INVESTIGATOR_COUNTER_GUID = "f182ee"
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
local controlActive = false
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
|
||||
local controlActive = false
|
||||
|
||||
-- parameters for open/close button for reusing
|
||||
local buttonParameters = {}
|
||||
buttonParameters.function_owner = self
|
||||
|
@ -1,6 +1,5 @@
|
||||
do
|
||||
local SoundCubeApi = {}
|
||||
local internal = {}
|
||||
|
||||
-- this table links the name of a trigger effect to its index
|
||||
local soundIndices = {
|
||||
@ -9,14 +8,14 @@ do
|
||||
["Dark Souls"] = 2
|
||||
}
|
||||
|
||||
internal.playTriggerEffect = function(index)
|
||||
local function playTriggerEffect(index)
|
||||
getObjectsWithTag("SoundCube")[1].AssetBundle.playTriggerEffect(index)
|
||||
end
|
||||
|
||||
-- plays the by name requested sound
|
||||
---@param soundName String Name of the sound to play
|
||||
SoundCubeApi.playSoundByName = function(soundName)
|
||||
internal.playTriggerEffect(soundIndices[soundName])
|
||||
playTriggerEffect(soundIndices[soundName])
|
||||
end
|
||||
|
||||
return SoundCubeApi
|
||||
|
@ -1,14 +1,17 @@
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local tokenChecker = require("core/token/TokenChecker")
|
||||
|
||||
local pendingCall = false
|
||||
local messageSent = {}
|
||||
local missingData = {}
|
||||
local countedVP = {}
|
||||
|
||||
local highlightMissing = false
|
||||
local highlightCounted = false
|
||||
|
||||
local TRASHCAN
|
||||
local TRASHCAN_GUID = "70b9f6"
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
|
||||
-- button creation when loading the game
|
||||
function onLoad()
|
||||
|
@ -1,7 +1,7 @@
|
||||
do
|
||||
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local optionPanelApi = require("core/OptionPanelApi")
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local tokenSpawnTrackerApi = require("core/token/TokenSpawnTrackerApi")
|
||||
|
||||
local PLAYER_CARD_TOKEN_OFFSETS = {
|
||||
[1] = {
|
||||
|
@ -1,6 +1,5 @@
|
||||
do
|
||||
local TokenSpawnTracker = { }
|
||||
|
||||
local SPAWN_TRACKER_GUID = "e3ffc9"
|
||||
|
||||
TokenSpawnTracker.hasSpawnedTokens = function(cardGuid)
|
||||
|
@ -1,11 +1,3 @@
|
||||
-- Search-A-Card
|
||||
-- made by: Chr1Z
|
||||
-- description: spawns the card(s) with the specified name
|
||||
information = {
|
||||
version = "1.2",
|
||||
last_updated = "12.11.2022"
|
||||
}
|
||||
|
||||
require("playercards/PlayerCardSpawner")
|
||||
|
||||
local allCardsBagApi = require("playercards/AllCardsBagApi")
|
||||
@ -17,9 +9,11 @@ buttonParameters.width = 1200
|
||||
buttonParameters.font_size = 75
|
||||
|
||||
local BUTTON_LABELS = {}
|
||||
|
||||
BUTTON_LABELS["spawn"] = {}
|
||||
BUTTON_LABELS["spawn"][true] = "Mode: Spawn all matching cards "
|
||||
BUTTON_LABELS["spawn"][false] = "Mode: Spawn first matching card"
|
||||
|
||||
BUTTON_LABELS["search"] = {}
|
||||
BUTTON_LABELS["search"][true] = "Mode: Name matches search term"
|
||||
BUTTON_LABELS["search"][false] = "Mode: Name contains search term"
|
||||
@ -35,13 +29,15 @@ inputParameters.height = 130
|
||||
inputParameters.font_size = 107
|
||||
|
||||
-- main code
|
||||
function onSave() return JSON.encode({ spawnAll, searchExact, inputParameters.value }) end
|
||||
function onSave()
|
||||
return JSON.encode({ spawnAll, searchExact, inputParameters.value })
|
||||
end
|
||||
|
||||
function onLoad(saved_data)
|
||||
local loaded_data = JSON.decode(saved_data)
|
||||
spawnAll = loaded_data[1] or false
|
||||
searchExact = loaded_data[2] or false
|
||||
inputParameters.value = loaded_data[3] or ""
|
||||
function onLoad(savedData)
|
||||
local loadedData = JSON.decode(savedData)
|
||||
spawnAll = loadedData[1] or false
|
||||
searchExact = loadedData[2] or false
|
||||
inputParameters.value = loadedData[3] or ""
|
||||
|
||||
-- index 0: button for spawn mode
|
||||
buttonParameters.click_function = "search"
|
||||
@ -62,11 +58,6 @@ function onLoad(saved_data)
|
||||
self.createButton(buttonParameters)
|
||||
|
||||
self.createInput(inputParameters)
|
||||
self.addContextMenuItem("More Information", function()
|
||||
printToAll("------------------------------", "White")
|
||||
printToAll("Search-A-Card v" .. information["version"] .. " by Chr1Z", "Orange")
|
||||
printToAll("last updated: " .. information["last_updated"], "White")
|
||||
end)
|
||||
end
|
||||
|
||||
function spawnMode()
|
||||
|
@ -69,8 +69,9 @@ Thus it should be implemented like this:
|
||||
----------------------------------------------------------]]
|
||||
|
||||
local blessCurseManagerApi = require("chaosbag/BlessCurseManagerApi")
|
||||
local tokenArrangerApi = require("accessories/TokenArrangerApi")
|
||||
local chaosBagApi = require("chaosbag/ChaosBagApi")
|
||||
local tokenArrangerApi = require("accessories/TokenArrangerApi")
|
||||
|
||||
local sealedTokens = {}
|
||||
local ID_URL_MAP = {}
|
||||
local tokensInBag = {}
|
||||
|
@ -1,7 +1,8 @@
|
||||
require("playercards/PlayerCardPanelData")
|
||||
local spawnBag = require("playercards/SpawnBag")
|
||||
local arkhamDb = require("arkhamdb/ArkhamDb")
|
||||
|
||||
local allCardsBagApi = require("playercards/AllCardsBagApi")
|
||||
local arkhamDb = require("arkhamdb/ArkhamDb")
|
||||
local spawnBag = require("playercards/SpawnBag")
|
||||
|
||||
-- Size and position information for the three rows of class buttons
|
||||
local CIRCLE_BUTTON_SIZE = 250
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
-- Amount to shift for the next card (zShift) or next row of cards (xShift)
|
||||
-- Note that the table rotation is weird, and the X axis is vertical while the
|
||||
-- Z axis is horizontal
|
||||
|
@ -23,14 +23,14 @@ require("playercards/PlayerCardSpawner")
|
||||
-- }
|
||||
-- See BondedBag.ttslua for an example
|
||||
do
|
||||
local allCardsBagApi = require("playercards/AllCardsBagApi")
|
||||
|
||||
local SpawnBag = { }
|
||||
local internal = { }
|
||||
|
||||
-- To assist debugging, will draw a box around the recall zone when it's set up
|
||||
local SHOW_RECALL_ZONE = false
|
||||
|
||||
local allCardsBagApi = require("playercards/AllCardsBagApi")
|
||||
|
||||
-- Distance to expand the recall zone around any added object.
|
||||
local RECALL_BUFFER_X = 0.9
|
||||
local RECALL_BUFFER_Z = 0.5
|
||||
|
@ -1,7 +1,3 @@
|
||||
-- Stat Tracker
|
||||
-- made by: Chr1Z
|
||||
-- description: helps tracking the stats of your investigator
|
||||
|
||||
local BUTTON_PARAMETERS = {}
|
||||
BUTTON_PARAMETERS.function_owner = self
|
||||
BUTTON_PARAMETERS.height = 650
|
||||
@ -15,52 +11,52 @@ function onSave() return JSON.encode(stats) end
|
||||
|
||||
-- load stats and make buttons (left to right)
|
||||
function onLoad(saved_data)
|
||||
stats = JSON.decode(saved_data) or { 1, 1, 1, 1 }
|
||||
stats = JSON.decode(saved_data) or { 1, 1, 1, 1 }
|
||||
|
||||
for i = 1, 4 do
|
||||
BUTTON_PARAMETERS.label = stats[i] .. " "
|
||||
BUTTON_PARAMETERS.position.x = BUTTON_PARAMETERS.position.x + 1.91
|
||||
BUTTON_PARAMETERS.click_function = attachIndex("button_click", i)
|
||||
self.createButton(BUTTON_PARAMETERS)
|
||||
end
|
||||
for i = 1, 4 do
|
||||
BUTTON_PARAMETERS.label = stats[i] .. " "
|
||||
BUTTON_PARAMETERS.position.x = BUTTON_PARAMETERS.position.x + 1.91
|
||||
BUTTON_PARAMETERS.click_function = attachIndex("button_click", i)
|
||||
self.createButton(BUTTON_PARAMETERS)
|
||||
end
|
||||
|
||||
self.addContextMenuItem("Reset to 1s", function() updateStats({ 1, 1, 1, 1 }) end)
|
||||
self.addContextMenuItem("Reset to 1s", function() updateStats({ 1, 1, 1, 1 }) end)
|
||||
end
|
||||
|
||||
-- helper function to carry index
|
||||
function attachIndex(click_function, index)
|
||||
local fn_name = click_function .. index
|
||||
_G[fn_name] = function(obj, player_color, isRightClick)
|
||||
_G[click_function](obj, player_color, isRightClick, index)
|
||||
end
|
||||
return fn_name
|
||||
local fn_name = click_function .. index
|
||||
_G[fn_name] = function(obj, player_color, isRightClick)
|
||||
_G[click_function](obj, player_color, isRightClick, index)
|
||||
end
|
||||
return fn_name
|
||||
end
|
||||
|
||||
function button_click(_, _, isRightClick, index)
|
||||
stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)
|
||||
changeButton(index)
|
||||
stats[index] = math.min(math.max(stats[index] + (isRightClick and -1 or 1), 0), 99)
|
||||
changeButton(index)
|
||||
end
|
||||
|
||||
function changeButton(index)
|
||||
local font_size = BUTTON_PARAMETERS.font_size
|
||||
local whitespace = " "
|
||||
local font_size = BUTTON_PARAMETERS.font_size
|
||||
local whitespace = " "
|
||||
|
||||
if stats[index] > 9 then
|
||||
font_size = BUTTON_PARAMETERS.font_size * 0.65
|
||||
whitespace = " "
|
||||
end
|
||||
if stats[index] > 9 then
|
||||
font_size = BUTTON_PARAMETERS.font_size * 0.65
|
||||
whitespace = " "
|
||||
end
|
||||
|
||||
self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = font_size })
|
||||
self.editButton({ index = index - 1, label = stats[index] .. whitespace, font_size = font_size })
|
||||
end
|
||||
|
||||
-- formatting of "newStats": {Willpower, Intellect, Fight, Agility}
|
||||
function updateStats(newStats)
|
||||
if newStats and #newStats == 4 then
|
||||
stats = newStats
|
||||
elseif newStats then
|
||||
printToAll("Provided new stats are incomplete or incorrectly formatted.", "Red")
|
||||
return
|
||||
end
|
||||
if newStats and #newStats == 4 then
|
||||
stats = newStats
|
||||
elseif newStats then
|
||||
printToAll("Provided new stats are incomplete or incorrectly formatted.", "Red")
|
||||
return
|
||||
end
|
||||
|
||||
for i = 1, 4 do changeButton(i) end
|
||||
for i = 1, 4 do changeButton(i) end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user