gave variables better names

This commit is contained in:
Chr1Z93 2022-12-12 22:42:12 +01:00
parent 74bc2807f6
commit c908719245
2 changed files with 10 additions and 10 deletions

View File

@ -45,14 +45,14 @@ local RESOURCE_COUNTER
-- global variable so it can be reset by the Clean Up Helper
activeInvestigatorId = "00000"
local drawButton = false
local isDrawButtonVisible = false
function onSave()
return JSON.encode({
zoneID = zoneID,
playerColor = PLAYER_COLOR,
activeInvestigatorId = activeInvestigatorId,
drawButton = drawButton
isDrawButtonVisible = isDrawButtonVisible
})
end
@ -104,10 +104,10 @@ function onLoad(save_state)
zoneID = state.zoneID
PLAYER_COLOR = state.playerColor
activeInvestigatorId = state.activeInvestigatorId
drawButton = state.drawButton
isDrawButtonVisible = state.isDrawButtonVisible
end
showDrawButton(drawButton)
showDrawButton(isDrawButtonVisible)
if getObjectFromGUID(zoneID) == nil then spawnDeckZone() end
COLLISION_ENABLED = true
@ -662,10 +662,10 @@ end
-- Sets this playermat's draw 1 button to visible
---@param visible Boolean. Whether the draw 1 button should be visible
function showDrawButton(visible)
drawButton = visible
isDrawButtonVisible = visible
-- create the "Draw 1" button
if drawButton then
if isDrawButtonVisible then
self.createButton({
label = "Draw 1",
click_function = "doDrawOne",

View File

@ -24,17 +24,17 @@ do
end
-- Sets the requested playermat's draw 1 button to visible
---@param visibleButton Boolean. Whether the draw 1 button should be visible or not
---@param isDrawButtonVisible Boolean. Whether the draw 1 button should be visible or not
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
-- accepts "All" as a special value which will apply the setting to all four mats.
PlaymatApi.showDrawButton = function(visibleButton, matColor)
PlaymatApi.showDrawButton = function(isDrawButtonVisible, matColor)
for _, mat in ipairs(internal.getMatForColor(matColor)) do
mat.call("showDrawButton", visibleButton)
mat.call("showDrawButton", isDrawButtonVisible)
end
end
-- Shows or hides the clickable clue counter for the requested playermat
---@param visibleButton Boolean. Whether the clickable counter should be present or not
---@param showCounter Boolean. Whether the clickable counter should be present or not
---@param matColor String for one of the active player colors - White, Orange, Green, Red. Also
-- accepts "All" as a special value which will apply the setting to all four mats.
PlaymatApi.clickableClues = function(showCounter, matColor)