Merge branch 'main' into removeuse

This commit is contained in:
Chr1Z93 2024-07-26 23:49:07 +02:00
commit b5482b55dd
6 changed files with 74 additions and 6 deletions

View File

@ -51,8 +51,8 @@
"RoundSequence.2eca7c",
"ActionDescription.fb09d4",
"InvestigatorCount.f182ee",
"Detailedphasereference.68fe54",
"RulesIndex.91c83e",
"DetailedPhaseReference.68fe54",
"LearntoPlay.4ff3b0",
"Clues.3f22e5",
"Clues.db85d6",
"Clues.891403",

View File

@ -37,7 +37,7 @@
"LuaScriptState": "",
"MeasureMovement": false,
"Name": "Card",
"Nickname": "Detailed phase reference",
"Nickname": "Detailed Phase Reference",
"SidewaysCard": false,
"Snap": true,
"Sticky": true,

View File

@ -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": ""
}

View File

@ -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")
@ -134,7 +135,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
@ -142,7 +144,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
@ -169,6 +171,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
@ -239,7 +246,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)

View File

@ -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")

View File

@ -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