formatting

This commit is contained in:
Chr1Z93 2024-01-16 23:48:49 +01:00
parent d41f452f86
commit dc3ce69801
4 changed files with 26 additions and 30 deletions

View File

@ -13,7 +13,7 @@
}, },
"Rotation": { "Rotation": {
"x": 64.34, "x": 64.34,
"y": 90.33, "y": 90,
"z": 0 "z": 0
}, },
"Zoomed": false "Zoomed": false

View File

@ -12,16 +12,16 @@ tourCardTemplate = {
position = "0 300 30", position = "0 300 30",
showAnimation = "FadeIn", showAnimation = "FadeIn",
hideAnimation = "FadeOut", hideAnimation = "FadeOut",
active=false, active = false,
}, },
children = { children = {
{ {
tag = "Image", tag = "Image",
attributes = { attributes = {
id = "tourNarratorImageLeft", id = "tourNarratorImageLeft",
height=120, height = 120,
width=80, width = 80,
rectAlignment="UpperLeft", rectAlignment = "UpperLeft",
offsetXY = "-80 0", offsetXY = "-80 0",
-- Image will be set when the card is updated -- Image will be set when the card is updated
} }
@ -31,9 +31,9 @@ tourCardTemplate = {
attributes = { attributes = {
id = "tourNarratorImageRight", id = "tourNarratorImageRight",
active = false, active = false,
height=125, height = 125,
width=80, width = 80,
rectAlignment="UpperRight", rectAlignment = "UpperRight",
offsetXY = "80 0" offsetXY = "80 0"
-- Image will be set when the card is updated -- Image will be set when the card is updated
} }
@ -47,7 +47,7 @@ tourCardTemplate = {
width = 330, width = 330,
rectAlignment = "MiddleCenter", rectAlignment = "MiddleCenter",
image = "SpeechBubble", image = "SpeechBubble",
}, }
}, },
{ {
tag = "Text", tag = "Text",
@ -76,7 +76,7 @@ tourCardTemplate = {
rectAlignment = "LowerRight", rectAlignment = "LowerRight",
offsetXY = "-5 -45", offsetXY = "-5 -45",
image = "NextArrow" image = "NextArrow"
}, }
}, },
{ {
tag = "Image", tag = "Image",
@ -88,6 +88,6 @@ tourCardTemplate = {
offsetXY = "35 -45", offsetXY = "35 -45",
image = "Exit" image = "Exit"
} }
}, }
} }
} }

View File

@ -25,10 +25,11 @@ do
-- Default (0) position for the camera, as defined in the mod. If we don't recreate this position -- Default (0) position for the camera, as defined in the mod. If we don't recreate this position
-- EXACTLY when exiting the tour then camera controls get weird -- EXACTLY when exiting the tour then camera controls get weird
local DEFAULT_CAMERA_POS = { local DEFAULT_CAMERA_POS = {
position = { x = -22.265, y = -2.5, z = 5.2575}, position = { x = -22.26, y = -2.5, z = 5.26 },
pitch=64.343, pitch = 64.34,
yaw=90.333, yaw = 90,
distance=104.7} distance = 104
}
-- Global XML coordinates where we can present a card -- Global XML coordinates where we can present a card
local SCREEN_POSITIONS = { local SCREEN_POSITIONS = {
@ -37,11 +38,13 @@ do
east = "600 0 0", east = "600 0 0",
west = "-600 0 0", west = "-600 0 0",
south = "0 -300 0", south = "0 -300 0",
-- 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 = "-500 300 0",
northeast = "600 300 0", northeast = "600 300 0",
southwest = "-600 -300 0", southwest = "-600 -300 0",
-- Used by the Diana and Wini cards referencing the bottom-right global controls, moved a little -- Used by the Diana and Wini cards referencing the bottom-right global controls, moved a little
-- closer to them -- closer to them
southeast = "730 -365 0" southeast = "730 -365 0"
@ -49,7 +52,7 @@ do
-- 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
-- separate, will hold the camera hook and current card. -- separate, will hold the camera hook and current card.
local tourState = { } local tourState = {}
-- Kicks off the tour by initializing the card and camera hook. A callback on the hook creation -- Kicks off the tour by initializing the card and camera hook. A callback on the hook creation
-- will then show the first card. -- will then show the first card.
@ -63,6 +66,7 @@ do
-- the movement is done, but the delay seems to handle it -- the movement is done, but the delay seems to handle it
Player[playerColor].setCameraMode("ThirdPerson") Player[playerColor].setCameraMode("ThirdPerson")
Player[playerColor].lookAt(DEFAULT_CAMERA_POS) Player[playerColor].lookAt(DEFAULT_CAMERA_POS)
-- Initial camera rotation is painfully slow. White and Orange players are likely oriented -- Initial camera rotation is painfully slow. White and Orange players are likely oriented
-- correctly, but need a longer start delay for Green and Red -- correctly, but need a longer start delay for Green and Red
local delay = 0.5 local delay = 0.5
@ -72,16 +76,8 @@ do
end end
Wait.time(function() Wait.time(function()
internal.createTourCard(playerColor) internal.createTourCard(playerColor)
-- XML update to add the new card takes a few frames to load, wait for it to finish then -- XML update to add the new card takes a few frames to load, wait for it to finish then create the hook
-- create the hook Wait.condition(function() internal.createCameraHook(playerColor) end, function() return not Global.UI.loading end)
Wait.condition(
function()
internal.createCameraHook(playerColor)
end,
function()
return not Global.UI.loading
end
)
end, delay) end, delay)
end end
@ -208,7 +204,7 @@ do
posY = HOOK_CAMERA_HOME.y, posY = HOOK_CAMERA_HOME.y,
posZ = HOOK_CAMERA_HOME.z, posZ = HOOK_CAMERA_HOME.z,
rotX = 0, rotX = 0,
rotY = 270.0, rotY = 270,
rotZ = 0, rotZ = 0,
scaleX = 0.1, scaleX = 0.1,
scaleY = 0.1, scaleY = 0.1,
@ -254,9 +250,9 @@ do
tourCardTemplate.children[3].attributes.id = internal.getUiId(BUBBLE_ID, playerColor) tourCardTemplate.children[3].attributes.id = internal.getUiId(BUBBLE_ID, playerColor)
tourCardTemplate.children[4].attributes.id = internal.getUiId(TEXT_ID, playerColor) tourCardTemplate.children[4].attributes.id = internal.getUiId(TEXT_ID, playerColor)
tourCardTemplate.children[5].attributes.id = internal.getUiId(NEXT_BUTTON_ID, playerColor) tourCardTemplate.children[5].attributes.id = internal.getUiId(NEXT_BUTTON_ID, playerColor)
tourCardTemplate.children[5].attributes.onClick = self.getGUID().."/nextCard" tourCardTemplate.children[5].attributes.onClick = self.getGUID() .. "/nextCard"
tourCardTemplate.children[6].attributes.id = internal.getUiId(STOP_BUTTON_ID, playerColor) tourCardTemplate.children[6].attributes.id = internal.getUiId(STOP_BUTTON_ID, playerColor)
tourCardTemplate.children[6].attributes.onClick = self.getGUID().."/stopTour" tourCardTemplate.children[6].attributes.onClick = self.getGUID() .. "/stopTour"
internal.setDeepVisibility(tourCardTemplate, playerColor) internal.setDeepVisibility(tourCardTemplate, playerColor)
local globalXml = Global.UI.getXmlTable() local globalXml = Global.UI.getXmlTable()

View File

@ -87,5 +87,5 @@ TOUR_SCRIPT = {
text = "That's the end of the tour, but there's much more to discover if you look in the right places. Some cards have helpers on the right-click menu, and every new version adds new content and functions.\n\nDon't be afraid to explore, and best of luck out there! We'll all need it...", text = "That's the end of the tour, but there's much more to discover if you look in the right places. Some cards have helpers on the right-click menu, and every new version adds new content and functions.\n\nDon't be afraid to explore, and best of luck out there! We'll all need it...",
position = "center", position = "center",
speakerSide = "right" speakerSide = "right"
}, }
} }