Merge pull request #1024 from argonui/non-interactable

Fixed search lib
This commit is contained in:
dscarpac 2024-11-21 19:13:27 -06:00 committed by GitHub
commit 08dc28e595
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 24 additions and 16 deletions

View File

@ -245,7 +245,7 @@
0, 0,
0 0
], ],
"SaveName": "Arkham SCE - 4.0.2", "SaveName": "Arkham SCE - 4.0.3",
"Sky": "Sky_Museum", "Sky": "Sky_Museum",
"SkyURL": "https://i.imgur.com/GkQqaOF.jpg", "SkyURL": "https://i.imgur.com/GkQqaOF.jpg",
"SnapPoints_path": "SnapPoints.json", "SnapPoints_path": "SnapPoints.json",

View File

@ -85,7 +85,7 @@
}, },
"tooltip": "None", "tooltip": "None",
"value": [ "value": [
"Arkham Horror LCG SCE 4.0.2 - 11/21/2024" "Arkham Horror LCG SCE 4.0.3 - 11/21/2024"
] ]
}, },
{ {
@ -124,7 +124,7 @@
}, },
"tooltip": "None", "tooltip": "None",
"value": [ "value": [
"Changes from 4.0.2\n- added ability for 'number typing' to the chaos token draw button\n- added \"0 uses\" metadata for Charles Ross\n- added \"imprinting\" to Charisma / Relic Hunter (drop them on a playermat!)\n- turned \"randomize\" feature of action / ability tokens into a context menu entry\n- turned upgradesheets into XML and their boxes into crosses\n- fixed Clean Up Helper toggling the \"subtract doom\" feature\n- fixed DES scripting\n- fixed error with Navigation Overlay\n- fixed error with investigator placing on playermats\n- fixed error with Kohaku feedback messages\n- fixed issues with Campaign Importer / Exporter\n- fixed handling for cards with attachments (Deck Importer)\n\nHighlights from 4.0.0\n\nNew Stuff\n- added Parallel Mateo\n- added a global UI for the Bless / Curse manager\n- added a \"shuffle discard into deck\" button to playermats (for example for the mulligan)\n- added XML helper for \"Stella Clark\", \"The Red Clock\" and \"Elle Rubash\"\n- added \"clickability\" to damage / horror tokens and updated the font / image\n- added investigator specific things spawning when placing (e.g. Bounty tokens for Tony)\n- added a right-click function to the left-most \"Discard\" button on playermats\n- added ability for the \"doom in play\" counter to subtract from the total (e.g. Longest Night)\n\nBugfixes\n- fixed hotkey for multi-handed Upkeep\n- fixed wrong visibility of playermat option panels after loading\n- fixed issues with token redrawing\n- fixed issues with scenario reference card detection\n- updated Navigation Overlay to not break with removed playermats\n- Clean Up Helper: 'nil' handling for scenario, mini card detection and action token resetting\n\nThe campaigns were also updated with improved helpers and upgraded campaign logs!\nPreviewed / spoiled cards for the upcoming cycle \"The Drowned City\" can be accessed\nvia the download menu (bottom right corner of your screen).\n" "Changes from 4.0.3\n- added ability for 'number typing' to the chaos token draw button\n- added \"0 uses\" metadata for Charles Ross\n- added \"imprinting\" to Charisma / Relic Hunter (drop them on a playermat!)\n- turned \"randomize\" feature of action / ability tokens into a context menu entry\n- turned upgradesheets into XML and their boxes into crosses\n- fixed Clean Up Helper toggling the \"subtract doom\" feature\n- fixed DES scripting\n- fixed error with Navigation Overlay\n- fixed error with investigator placing on playermats\n- fixed error with Kohaku feedback messages\n- fixed issues with Campaign Importer / Exporter\n- fixed handling for cards with attachments (Deck Importer)\n\nHighlights from 4.0.0\n\nNew Stuff\n- added Parallel Mateo\n- added a global UI for the Bless / Curse manager\n- added a \"shuffle discard into deck\" button to playermats (for example for the mulligan)\n- added XML helper for \"Stella Clark\", \"The Red Clock\" and \"Elle Rubash\"\n- added \"clickability\" to damage / horror tokens and updated the font / image\n- added investigator specific things spawning when placing (e.g. Bounty tokens for Tony)\n- added a right-click function to the left-most \"Discard\" button on playermats\n- added ability for the \"doom in play\" counter to subtract from the total (e.g. Longest Night)\n\nBugfixes\n- fixed hotkey for multi-handed Upkeep\n- fixed wrong visibility of playermat option panels after loading\n- fixed issues with token redrawing\n- fixed issues with scenario reference card detection\n- updated Navigation Overlay to not break with removed playermats\n- Clean Up Helper: 'nil' handling for scenario, mini card detection and action token resetting\n\nThe campaigns were also updated with improved helpers and upgraded campaign logs!\nPreviewed / spoiled cards for the upcoming cycle \"The Drowned City\" can be accessed\nvia the download menu (bottom right corner of your screen).\n"
] ]
} }
], ],

View File

@ -34,6 +34,6 @@ ENCOUNTER_DECK_POS = Vector(-3.93, 1.5, 5.76)
ENCOUNTER_DISCARD_POSITION = Vector(-3.85, 1.5, 10.38) ENCOUNTER_DISCARD_POSITION = Vector(-3.85, 1.5, 10.38)
-- online functionality related variables -- online functionality related variables
MOD_VERSION = "4.0.2" MOD_VERSION = "4.0.3"
SOURCE_REPO = "https://github.com/Chr1Z93/SCED-downloads/releases/latest/download/" SOURCE_REPO = "https://github.com/Chr1Z93/SCED-downloads/releases/latest/download/"
--SOURCE_REPO = "https://github.com/Chr1Z93/SCED-downloads/releases/download/v1.0.1/" --SOURCE_REPO = "https://github.com/Chr1Z93/SCED-downloads/releases/download/v1.0.1/"

View File

@ -85,7 +85,7 @@ function takeCardIntoThreatArea(playerColor, hoveredObject)
-- work out the new rotation -- work out the new rotation
local matRotation = playermatApi.returnRotation(matColor) local matRotation = playermatApi.returnRotation(matColor)
local newCardRot = cardRot:setAt("y", matRotation.y + cardRot.y - ownerRotation.y) local newCardRot = cardRot:setAt("y", roundToMultiple(matRotation.y + cardRot.y - ownerRotation.y, 45))
-- move the main card to threat area -- move the main card to threat area
GlobalApi.moveCardWithTokens(hoveredObject, threatAreaPos, newCardRot) GlobalApi.moveCardWithTokens(hoveredObject, threatAreaPos, newCardRot)

View File

@ -221,7 +221,8 @@ function onObjectEnterZone(zone, object)
not tokenChecker.isChaosToken(object) and not tokenChecker.isChaosToken(object) and
object.type == "Tile" and object.type == "Tile" and
object.getMemo() and object.getMemo() and
not object.getLock() then not object.getLock() and
object.interactable == true then
local matcolor = playermatApi.getMatColorByPosition(object.getPosition()) local matcolor = playermatApi.getMatColorByPosition(object.getPosition())
local trash = guidReferenceApi.getObjectByOwnerAndType(matcolor, "Trash") local trash = guidReferenceApi.getObjectByOwnerAndType(matcolor, "Trash")
trash.putObject(object) trash.putObject(object)
@ -303,6 +304,10 @@ function onPlayerAction(player, action, targets)
end end
end end
function onObjectPickUp(_, object)
stopTokenTransformUpdating(object)
end
--------------------------------------------------------- ---------------------------------------------------------
-- chaos token drawing -- chaos token drawing
--------------------------------------------------------- ---------------------------------------------------------
@ -1590,8 +1595,8 @@ end
-- first hit is the table surface, additional hits means something is there -- first hit is the table surface, additional hits means something is there
---@return boolean: True if empty ---@return boolean: True if empty
function checkPositionForContentSpawn(checkPos) function checkPositionForContentSpawn(checkPos)
local searchResult = searchLib.atPosition(checkPos) local searchResult = searchLib.atPosition(checkPos, "isInteractable")
return #searchResult == 1 return #searchResult == 0
end end
-- downloading of the library file -- downloading of the library file
@ -2846,9 +2851,8 @@ function moveCardWithTokens(params)
local position = params.position local position = params.position
local rotation = params.rotation local rotation = params.rotation
if not cardTokens[card] then stopTokenTransformUpdating(card)
storeTokenTransform(card) storeTokenTransform(card)
end
if rotation then if rotation then
card.setRotation(rotation) card.setRotation(rotation)
@ -2912,7 +2916,9 @@ function stopTokenTransformUpdating(card)
end end
end end
cardTokens[card] = nil cardTokens[card] = nil
card.use_hands = true if card ~= nil then
card.use_hands = true
end
end end
-- removes tokens from the provided card/deck -- removes tokens from the provided card/deck
@ -2948,7 +2954,8 @@ function removeTokensFromObject(params)
elseif obj.getGUID() ~= "4ee1f2" and -- table elseif obj.getGUID() ~= "4ee1f2" and -- table
obj ~= self and obj ~= self and
obj.memo ~= nil and obj.memo ~= nil and
obj.getLock() == false then obj.getLock() == false and
obj.interactable == true then
trash.putObject(obj) trash.putObject(obj)
end end
end end

View File

@ -303,7 +303,7 @@ function placeCard(card)
-- put chaos tokens back into bag -- put chaos tokens back into bag
local chaosBag = chaosBagApi.findChaosBag() local chaosBag = chaosBagApi.findChaosBag()
chaosBag.putObject(obj) chaosBag.putObject(obj)
elseif obj.memo ~= nil and obj.getLock() == false then elseif obj.memo ~= nil and obj.getLock() == false and obj.interactable == true then
trash.putObject(obj) trash.putObject(obj)
end end
end end

View File

@ -297,7 +297,7 @@ function discardListOfObjects(objList)
elseif tokenChecker.isChaosToken(obj) then elseif tokenChecker.isChaosToken(obj) then
-- put chaos tokens back into bag (e.g. Unrelenting) -- put chaos tokens back into bag (e.g. Unrelenting)
chaosBagApi.returnChaosTokenToBag(obj, false) chaosBagApi.returnChaosTokenToBag(obj, false)
elseif not obj.getLock() and not obj.hasTag("DontDiscard") then elseif not obj.getLock() and not obj.hasTag("DontDiscard") and obj.interactable == true then
-- don't touch locked objects (like the table etc.) or specific objects (like key tokens) -- don't touch locked objects (like the table etc.) or specific objects (like key tokens)
ownedObjects.Trash.putObject(obj) ownedObjects.Trash.putObject(obj)
end end

View File

@ -6,6 +6,7 @@ do
isCardOrDeck = function(x) return x.type == "Card" or x.type == "Deck" end, isCardOrDeck = function(x) return x.type == "Card" or x.type == "Deck" end,
isClue = function(x) return x.memo == "clueDoom" and x.is_face_down == false end, isClue = function(x) return x.memo == "clueDoom" and x.is_face_down == false end,
isDoom = function(x) return x.memo == "clueDoom" and x.is_face_down == true end, isDoom = function(x) return x.memo == "clueDoom" and x.is_face_down == true end,
isInteractable = function(x) return x.interactable end,
isTileOrToken = function(x) return x.type == "Tile" or x.type == "Generic" end, isTileOrToken = function(x) return x.type == "Tile" or x.type == "Generic" end,
isUniversalToken = function(x) return x.getMemo() == "universalActionAbility" end, isUniversalToken = function(x) return x.getMemo() == "universalActionAbility" end,
} }
@ -31,7 +32,7 @@ do
-- filter the result for matching objects -- filter the result for matching objects
local objList = {} local objList = {}
for _, v in ipairs(searchResult) do for _, v in ipairs(searchResult) do
if (not filter or filterFunc(v.hit_object)) and v.hit_object.interactable then if (not filter or filterFunc(v.hit_object)) then
table.insert(objList, v.hit_object) table.insert(objList, v.hit_object)
end end
end end