diff --git a/config.json b/config.json index f2025a2a..34a4e973 100644 --- a/config.json +++ b/config.json @@ -245,7 +245,7 @@ 0, 0 ], - "SaveName": "Arkham SCE - 4.0.1", + "SaveName": "Arkham SCE - 4.0.2", "Sky": "Sky_Museum", "SkyURL": "https://i.imgur.com/GkQqaOF.jpg", "SnapPoints_path": "SnapPoints.json", diff --git a/objects/PatchNotes.f47225.luascriptstate b/objects/PatchNotes.f47225.luascriptstate index acb61a98..c954022c 100644 --- a/objects/PatchNotes.f47225.luascriptstate +++ b/objects/PatchNotes.f47225.luascriptstate @@ -85,7 +85,7 @@ }, "tooltip": "None", "value": [ - "Arkham Horror LCG SCE 4.0.1 - 11/20/2024" + "Arkham Horror LCG SCE 4.0.2 - 11/21/2024" ] }, { @@ -124,7 +124,7 @@ }, "tooltip": "None", "value": [ - "Changes from 4.0.1\n- added handling for moving cards with tokens on them\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.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" ] } ], diff --git a/src/core/Constants.ttslua b/src/core/Constants.ttslua index a0b0fe60..2e0f6b4a 100644 --- a/src/core/Constants.ttslua +++ b/src/core/Constants.ttslua @@ -34,6 +34,6 @@ ENCOUNTER_DECK_POS = Vector(-3.93, 1.5, 5.76) ENCOUNTER_DISCARD_POSITION = Vector(-3.85, 1.5, 10.38) -- online functionality related variables -MOD_VERSION = "4.0.1" +MOD_VERSION = "4.0.2" SOURCE_REPO = "https://github.com/Chr1Z93/SCED-downloads/releases/latest/download/" --SOURCE_REPO = "https://github.com/Chr1Z93/SCED-downloads/releases/download/v1.0.1/" diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index 373357e9..8b57ce0b 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -264,7 +264,7 @@ function removeOneUse(playerColor, hoveredObject) local indexByMemo = {} local distanceByMemo = {} for _, obj in ipairs(searchResult) do - if obj.memo or not obj.locked then + if not obj.locked then local objPos = obj.getPosition() local distance = Vector.between(cardPos, objPos):magnitude() local memo = obj.memo or "NO_MEMO" diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index d6fa4c84..23f62ad2 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -180,18 +180,6 @@ function getRandomSeed() return math.random(999) end -function onObjectDrop(_, object) - if object.type == "Card" or object.type == "Deck" then - moveCardWithTokens({ card = object }) - end -end - -function onObjectRotate(object, _, flip, _, _, oldFlip) - if flip ~= oldFlip then - stopTokenTransformUpdating(object) - end -end - -- Event hook for any object search. When chaos tokens are manipulated while the chaos bag -- container is being searched, a TTS bug can cause tokens to duplicate or vanish. We lock the -- chaos bag during search operations to avoid this. @@ -312,12 +300,6 @@ function onPlayerAction(player, action, targets) trash.putObject(target) end return false - elseif action == Player.Action.PickUp then - for _, target in ipairs(targets) do - if target.type == "Card" or target.type == "Deck" then - storeTokenTransform(target) - end - end end end @@ -2897,7 +2879,7 @@ function storeTokenTransform(card) cardTokens[card] = {} local cardRot = card.getRotation() for _, token in ipairs(searchLib.onObject(card, "isTileOrToken", 0.95)) do - if token.memo or not token.locked then + if not token.locked then -- offset to stop the token from colliding with the card local tokenPos = token.getPosition() + Vector(0, 0.05, 0) token.setPosition(tokenPos) @@ -2933,24 +2915,6 @@ function stopTokenTransformUpdating(card) card.use_hands = true end -function unregisterCard(card) - cardTokens[card] = nil -end - -function unregisterTokenFromCard(params) - local card = params.card - local token = params.token - - if cardTokens[card] == nil then return end - - for i, tokenData in ipairs(cardTokens[card] or {}) do - if tokenData.token == token then - table.remove(cardTokens[card], i) - break - end - end -end - -- removes tokens from the provided card/deck function removeTokensFromObject(params) local object = params.object diff --git a/src/core/GlobalApi.ttslua b/src/core/GlobalApi.ttslua index 229a31e7..e39a64d9 100644 --- a/src/core/GlobalApi.ttslua +++ b/src/core/GlobalApi.ttslua @@ -68,13 +68,6 @@ do Global.call("moveCardWithTokens", { card = card, position = position, rotation = rotation }) end - -- unregisters a token from a card - ---@param card tts__Object Card that might have this token added - ---@param token tts__Object Token that should get unregistered - function GlobalApi.unregisterTokenFromCard(card, token) - Global.call("unregisterTokenFromCard", { card = card, token = token }) - end - -- loads saved options ---@param options table Set a new state for the option table function GlobalApi.loadOptionPanelSettings(options) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 10993dd6..5612ed00 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -297,7 +297,7 @@ function discardListOfObjects(objList) elseif tokenChecker.isChaosToken(obj) then -- put chaos tokens back into bag (e.g. Unrelenting) chaosBagApi.returnChaosTokenToBag(obj, false) - elseif (obj.memo or not obj.getLock()) and not obj.hasTag("DontDiscard") then + elseif not obj.getLock() and not obj.hasTag("DontDiscard") then -- don't touch locked objects (like the table etc.) or specific objects (like key tokens) ownedObjects.Trash.putObject(obj) end diff --git a/src/util/SearchLib.ttslua b/src/util/SearchLib.ttslua index 3beedadf..0e37a870 100644 --- a/src/util/SearchLib.ttslua +++ b/src/util/SearchLib.ttslua @@ -6,7 +6,7 @@ do 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, isDoom = function(x) return x.memo == "clueDoom" and x.is_face_down == true end, - isTileOrToken = function(x) return (x.type == "Tile" or x.type == "Generic") and x.interactable end, + isTileOrToken = function(x) return x.type == "Tile" or x.type == "Generic" end, isUniversalToken = function(x) return x.getMemo() == "universalActionAbility" end, } @@ -31,7 +31,7 @@ do -- filter the result for matching objects local objList = {} for _, v in ipairs(searchResult) do - if not filter or filterFunc(v.hit_object) then + if (not filter or filterFunc(v.hit_object)) and v.hit_object.interactable then table.insert(objList, v.hit_object) end end diff --git a/src/util/Trashcan.ttslua b/src/util/Trashcan.ttslua index a98ea78b..6a5a6625 100644 --- a/src/util/Trashcan.ttslua +++ b/src/util/Trashcan.ttslua @@ -9,17 +9,3 @@ function emptyTrash() self.takeObject().destruct() end end - -function onObjectLeaveContainer(container, object) - if container == self then - object.locked = false - - if object.type == "Card" then - object.use_hands = true - end - - if object.type == "Card" or object.type == "Deck" then - Global.call("unregisterCard", object) - end - end -end