Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/core/GameKeyHandler.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,14 @@ function switchSeat(playerColor, direction)

-- get current seat index
local index
for i, color in ipairs(usedColors) do
if color == vColor then
for i, matColor in ipairs(usedColors) do
local handColor = PlayermatApi.getPlayerColor(matColor)
if handColor == vColor then
index = i
break
end
end

if not index then
broadcastToColor("Couldn't detect investigator.", playerColor, "Orange")
return
Expand All @@ -543,7 +545,7 @@ function switchSeat(playerColor, direction)
end

-- swap color
NavigationOverlayApi.loadCamera(Player[vColor] or Player[playerColor], _, usedColors[index])
NavigationOverlayApi.loadCamera(Player[vColor] or Player[playerColor], nil, usedColors[index])
end

function takeClueAsColor(matColor, hoveredObject)
Expand Down
6 changes: 4 additions & 2 deletions src/core/NavigationOverlayApi.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ do
---@param player tts__Player Player whose camera should be moved
---@param index? number Index of the camera view to load
---@param matColor? string Color of the playermat to swap to
function NavigationOverlayApi.loadCamera(player, index, matColor)
---@param skipZoom? boolean True if player's camera 0 should be loaded instead of zooming to mat
function NavigationOverlayApi.loadCamera(player, index, matColor, skipZoom)
getNOHandler().call("loadCameraFromApi", {
player = player,
index = index,
matColor = matColor
matColor = matColor,
skipZoom = skipZoom
})
end

Expand Down
2 changes: 1 addition & 1 deletion src/core/NavigationOverlayHandler.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function getDynamicViewBounds(objList)
end

function loadCameraFromApi(params)
loadCamera(params.player, params.index, params.matColor)
loadCamera(params.player, params.index, params.matColor, params.skipZoom)
end

-- loads the specified camera for a player
Expand Down
2 changes: 1 addition & 1 deletion src/playermat/PlayermatApi.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ do
function PlayermatApi.getUsedInvestigatorCards()
local usedCards = {}
for matColor, mat in pairs(getMatForColor("All")) do
local searchPos = mat.positionToWorld(localInvestigatorPosition)
local searchPos = mat.positionToWorld(localInvestigatorPosition)
local searchResult = SearchLib.atPosition(searchPos, "isCardOrDeck")
if #searchResult > 0 then
usedCards[matColor] = searchResult[1]
Expand Down
Loading