updated tour positioning

This commit is contained in:
Chr1Z93 2024-09-19 18:15:04 +02:00
parent b99f018891
commit e7db256d46
2 changed files with 20 additions and 18 deletions

View File

@ -8,8 +8,8 @@ tourCardTemplate = {
id = "tourCard", id = "tourCard",
height = 215, height = 215,
width = 330, width = 330,
rotation = "0 0 0", anchorMin = "0.3 0.75",
position = "0 300 30", anchorMax = "0.3 0.75",
showAnimation = "FadeIn", showAnimation = "FadeIn",
hideAnimation = "FadeOut", hideAnimation = "FadeOut",
active = false active = false

View File

@ -31,22 +31,23 @@ do
distance = 104 distance = 104
} }
-- Global XML coordinates where we can present a card -- relative XML coordinates where we can present a card
local SCREEN_POSITIONS = { local SCREEN_POSITIONS = {
center = "0 0 0", -- Center is intentionally slightly above the center
north = "0 300 0", center = "0.5 0.6",
east = "600 0 0", north = "0.5 0.75",
west = "-600 0 0", east = "0.75 0.5",
south = "0 -300 0", west = "0.25 0.5",
south = "0.5 0.25",
-- Northwest is only used by the Mandy card, move it a little right than standard so it's -- Northwest is only used by the Mandy card, move it a little right than standard so it's
-- closer to the importer -- closer to the importer
northwest = "-500 300 0", northwest = "0.3 0.75",
northeast = "600 300 0", northeast = "0.75 0.75",
southwest = "-600 -300 0", southwest = "0.25 0.25",
-- Used by the cards referencing the bottom-right panel, moved a little closer to them -- Used by the cards referencing the bottom-right panel, moved a little closer to them
southeast = "675 -365 0" southeast = "0.875 0.175"
} }
-- Tracks the current state of the tours. Keyed by player color to keep each player's tour -- Tracks the current state of the tours. Keyed by player color to keep each player's tour
@ -57,9 +58,8 @@ do
-- will then show the first card. -- will then show the first card.
---@param playerColor string Player color to start the tour for ---@param playerColor string Player color to start the tour for
TourManager.startTour = function(playerColor) TourManager.startTour = function(playerColor)
tourState[playerColor] = { tourState[playerColor] = { currentCardIndex = 1 }
currentCardIndex = 1
}
-- Camera gets really screwy when we finalize if we don't start settled in ThirdPerson at the -- Camera gets really screwy when we finalize if we don't start settled in ThirdPerson at the
-- default position before attaching to the hook. Unfortunately there are no callbacks for when -- default position before attaching to the hook. Unfortunately there are no callbacks for when
-- the movement is done, but the delay seems to handle it -- the movement is done, but the delay seems to handle it
@ -175,8 +175,10 @@ do
Global.UI.setAttribute(internal.getUiId(LEFT_NARRATOR_ID, playerColor), "image", "Inv-" .. TOUR_SCRIPT[index].narrator) Global.UI.setAttribute(internal.getUiId(LEFT_NARRATOR_ID, playerColor), "image", "Inv-" .. TOUR_SCRIPT[index].narrator)
Global.UI.setAttribute(internal.getUiId(RIGHT_NARRATOR_ID, playerColor), "image", "Inv-" .. TOUR_SCRIPT[index].narrator) Global.UI.setAttribute(internal.getUiId(RIGHT_NARRATOR_ID, playerColor), "image", "Inv-" .. TOUR_SCRIPT[index].narrator)
Global.UI.setAttribute(internal.getUiId(TEXT_ID, playerColor), "text", "\"" .. TOUR_SCRIPT[index].text .. "\"") Global.UI.setAttribute(internal.getUiId(TEXT_ID, playerColor), "text", "\"" .. TOUR_SCRIPT[index].text .. "\"")
local cardPos = TOUR_SCRIPT[index].position or "north" local cardPos = TOUR_SCRIPT[index].position or "north"
Global.UI.setAttribute(internal.getUiId(CARD_ID, playerColor), "position", SCREEN_POSITIONS[cardPos]) Global.UI.setAttribute(internal.getUiId(CARD_ID, playerColor), "anchorMin", SCREEN_POSITIONS[cardPos])
Global.UI.setAttribute(internal.getUiId(CARD_ID, playerColor), "anchorMax", SCREEN_POSITIONS[cardPos])
Global.UI.setAttribute(internal.getUiId(NEXT_BUTTON_ID, playerColor), "active", index < #TOUR_SCRIPT) Global.UI.setAttribute(internal.getUiId(NEXT_BUTTON_ID, playerColor), "active", index < #TOUR_SCRIPT)
-- Adjust images so the narrator is on the left or right, as defined by the card -- Adjust images so the narrator is on the left or right, as defined by the card