diff --git a/config.json b/config.json index cc673a4b..09d117fe 100644 --- a/config.json +++ b/config.json @@ -51,8 +51,8 @@ "RoundSequence.2eca7c", "ActionDescription.fb09d4", "InvestigatorCount.f182ee", - "Detailedphasereference.68fe54", - "RulesIndex.91c83e", + "DetailedPhaseReference.68fe54", + "LearntoPlay.4ff3b0", "Clues.3f22e5", "Clues.db85d6", "Clues.891403", diff --git a/objects/Detailedphasereference.68fe54.json b/objects/Detailedphasereference.68fe54.json index ab3ef575..20c9a06a 100644 --- a/objects/Detailedphasereference.68fe54.json +++ b/objects/Detailedphasereference.68fe54.json @@ -37,7 +37,7 @@ "LuaScriptState": "", "MeasureMovement": false, "Name": "Card", - "Nickname": "Detailed phase reference", + "Nickname": "Detailed Phase Reference", "SidewaysCard": false, "Snap": true, "Sticky": true, diff --git a/objects/LearntoPlay.4ff3b0.json b/objects/LearntoPlay.4ff3b0.json new file mode 100644 index 00000000..a14bf08c --- /dev/null +++ b/objects/LearntoPlay.4ff3b0.json @@ -0,0 +1,51 @@ +{ + "AltLookAngle": { + "x": 0, + "y": 0, + "z": 0 + }, + "Autoraise": true, + "ColorDiffuse": { + "b": 0, + "g": 0, + "r": 0 + }, + "CustomPDF": { + "PDFPage": 0, + "PDFPageOffset": 0, + "PDFPassword": "", + "PDFUrl": "https://steamusercontent-a.akamaihd.net/ugc/2466367983704704177/DB04BEC0048A15889E315B66F3D22E2CC879253D/" + }, + "Description": "", + "DragSelectable": true, + "GMNotes": "", + "GUID": "4ff3b0", + "Grid": true, + "GridProjection": false, + "Hands": false, + "HideWhenFaceDown": false, + "IgnoreFoW": false, + "LayoutGroupSortIndex": 0, + "Locked": true, + "LuaScript": "", + "LuaScriptState": "", + "MeasureMovement": false, + "Name": "Custom_PDF", + "Nickname": "Learn to Play", + "Snap": true, + "Sticky": true, + "Tooltip": true, + "Transform": { + "posX": -62, + "posY": 1.48, + "posZ": 89, + "rotX": 0, + "rotY": 270, + "rotZ": 0, + "scaleX": 4.5, + "scaleY": 1, + "scaleZ": 4.5 + }, + "Value": 0, + "XmlUI": "" +} \ No newline at end of file diff --git a/src/core/GameKeyHandler.ttslua b/src/core/GameKeyHandler.ttslua index 4e4e5dcd..89cb3819 100644 --- a/src/core/GameKeyHandler.ttslua +++ b/src/core/GameKeyHandler.ttslua @@ -3,6 +3,7 @@ local guidReferenceApi = require("core/GUIDReferenceApi") local mythosAreaApi = require("core/MythosAreaApi") local navigationOverlayApi = require("core/NavigationOverlayApi") local optionPanelApi = require("core/OptionPanelApi") +local playAreaApi = require("core/PlayAreaApi") local playermatApi = require("playermat/PlayermatApi") local searchLib = require("util/SearchLib") local tokenChecker = require("core/token/TokenChecker") @@ -132,7 +133,8 @@ function discardObject(playerColor, hoveredObject) if #selectedObjects > 0 then discardGroup(playerColor, selectedObjects) return - -- only continue if an unlocked card, deck or tile was hovered + + -- only continue if an unlocked card, deck or tile was hovered elseif hoveredObject == nil or (hoveredObject.type ~= "Card" and hoveredObject.type ~= "Deck" and hoveredObject.type ~= "Tile") or hoveredObject.locked then @@ -140,7 +142,7 @@ function discardObject(playerColor, hoveredObject) return end - -- These should probably not be discarded normally. Ask player for confirmation. + -- these should probably not be discarded normally: ask player for confirmation local tokenData = mythosAreaApi.returnTokenData() local scenarioName = tokenData.currentScenario if scenarioName ~= "Lost in Time and Space" and scenarioName ~= "The Secret Name" then @@ -167,6 +169,11 @@ function performDiscard(playerColor, hoveredObject) end end + -- update playarea connections + if hoveredObject.type == "Card" then + playAreaApi.maybeUntrackLocation(hoveredObject) + end + local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor) playermatApi.discardListOfObjects(discardForMatColor, discardTheseObjects) end @@ -237,7 +244,10 @@ end -- moves the hovered card to the victory display function moveCardToVictoryDisplay(_, hoveredObject) - victoryDisplayApi.placeCard(hoveredObject) + if hoveredObject then + playAreaApi.maybeUntrackLocation(hoveredObject) + victoryDisplayApi.placeCard(hoveredObject) + end end -- removes a use from a card (or a token if hovered) diff --git a/src/core/PlayAreaApi.ttslua b/src/core/PlayAreaApi.ttslua index 37116cec..47bba879 100644 --- a/src/core/PlayAreaApi.ttslua +++ b/src/core/PlayAreaApi.ttslua @@ -70,6 +70,12 @@ do getPlayArea().call("tryObjectEnterContainer", { container = container, object = object }) end + -- Stop tracking a location for connection drawing / VP calculation + ---@param card tts__Object Card to (maybe) stop tracking + PlayAreaApi.maybeUntrackLocation = function(card) + getPlayArea().call("maybeUntrackLocation", card) + end + -- Counts the VP on locations in the play area PlayAreaApi.countVP = function() return getPlayArea().call("countVP") diff --git a/src/util/TokenSpawnTool.ttslua b/src/util/TokenSpawnTool.ttslua index d6be72f4..479f9326 100644 --- a/src/util/TokenSpawnTool.ttslua +++ b/src/util/TokenSpawnTool.ttslua @@ -20,6 +20,7 @@ function onScriptingButtonDown(index, playerColor) local rotation = { x = 0, y = Player[playerColor].getPointerRotation(), z = 0 } local position = Player[playerColor].getPointerPosition() + Vector(0, 0.2, 0) + callback = nil -- check for subtype of resource based on card below if tokenType == "resource" then