wip misc things, no real implementation change
This commit is contained in:
parent
c71b020243
commit
6f0c35ac30
|
@ -86,6 +86,8 @@ end
|
|||
---@param params AnimationParams
|
||||
---@return Animation
|
||||
function Animation.new(animPath, params)
|
||||
local self = CreateInstance(Animation, params)
|
||||
|
||||
local frames, frameCount = loadSequentialAnimationFrames(animPath);
|
||||
|
||||
local instance = {
|
||||
|
|
|
@ -80,7 +80,7 @@ end
|
|||
--- Check if a file or directory exists in this path
|
||||
---@param file string # relative path to game file
|
||||
---@return boolean # file exists
|
||||
---@return string # error message
|
||||
---@return string? # error message
|
||||
function IsFileExists(file)
|
||||
local gamepath, sep = getGamePath()
|
||||
file = gamepath .. sep .. file
|
||||
|
|
|
@ -484,14 +484,14 @@ local crew = game.GetSkinSetting("single_idol")
|
|||
---@field _idolAnimationState AnimationState
|
||||
local MainMenuPage = {
|
||||
__name = "MainMenuPage",
|
||||
anims = {
|
||||
ANIM = {
|
||||
idolAnimation = Animation.new("crew/anim/" .. crew, {
|
||||
fps = 30, loop = true,
|
||||
centered = true, x = Dim.design.width / 2, y = Dim.design.height / 2,
|
||||
width = Dim.design.width, height = Dim.design.height,
|
||||
})
|
||||
},
|
||||
audiosamples = {
|
||||
AUDIO = {
|
||||
bgm = AudioSample.new{path = "titlescreen/bgm.wav", exclusive = true, loop = true},
|
||||
}
|
||||
}
|
||||
|
@ -503,8 +503,8 @@ function MainMenuPage.new(params)
|
|||
end
|
||||
|
||||
function MainMenuPage:init()
|
||||
self._idolAnimationState = self.anims.idolAnimation:start()
|
||||
self.audiosamples.bgm:play()
|
||||
self._idolAnimationState = self.ANIM.idolAnimation:start()
|
||||
self.AUDIO.bgm:play()
|
||||
end
|
||||
|
||||
function MainMenuPage:drawBackground(deltaTime)
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
require "common.class"
|
||||
|
||||
local Dim = require "common.dimensions"
|
||||
|
||||
local Lang = require "language.call"
|
||||
|
||||
local AudioSample = require "api.audiosample"
|
||||
local Page = require "api.page.page"
|
||||
|
||||
|
@ -10,30 +14,123 @@ local crew = game.GetSkinSetting("single_idol")
|
|||
---@class ModeSelectPage: Page
|
||||
local ModeSelectPage = {
|
||||
__name = "ModeSelectPage",
|
||||
images = {
|
||||
IMAGES = {
|
||||
selectorBgImage = gfx.CreateSkinImage("titlescreen/selector_bg.png", 0),
|
||||
selectorArrowsImage = gfx.CreateSkinImage("titlescreen/selector_arrows.png", 0),
|
||||
unselectedButtonImage = gfx.CreateSkinImage("titlescreen/unselected_button.png", 0),
|
||||
selectedButtonBgImage = gfx.CreateSkinImage("titlescreen/selected_button_bg.png", 0),
|
||||
selectedButtonOverImage = gfx.CreateSkinImage("titlescreen/selected_button_over.png", 0)
|
||||
},
|
||||
anims = {
|
||||
ANIMS = {
|
||||
|
||||
},
|
||||
audiosamples = {
|
||||
cursorChange = AudioSample.new{path = "titlescreen/cursor_change.wav"},
|
||||
cursorSelect = AudioSample.new{path = "titlescreen/cursor_select.wav"}
|
||||
AUDIO = {
|
||||
cursorChange = AudioSample.new { path = "titlescreen/cursor_change.wav" },
|
||||
cursorSelect = AudioSample.new { path = "titlescreen/cursor_select.wav" }
|
||||
},
|
||||
labels = {
|
||||
LABELS = {
|
||||
selectorDescriptionLabel = gfx.CreateLabel(Lang.Start.desc, 22, 0),
|
||||
selectorLegendScrollLabel = gfx.CreateLabel(Lang.Start.sc, 20, 0),
|
||||
selectorLegendSelectLabel = gfx.CreateLabel(Lang.Start.st3, 20, 0)
|
||||
}
|
||||
},
|
||||
SELECTOR_BAR_OFFSET_FROM_CENTER = 128
|
||||
}
|
||||
|
||||
function ModeSelectPage.new(params)
|
||||
local self = CreateInstance(ModeSelectPage, params, Page)
|
||||
|
||||
local buttons = {
|
||||
{
|
||||
labelImage = gfx.CreateSkinImage("titlescreen/labels/skill.png", 0),
|
||||
labelWidth = 412,
|
||||
action = nil, -- Menu.Challenges,
|
||||
description = Lang.Challanges.ch,
|
||||
details = Lang.Challanges.ch1,
|
||||
},
|
||||
{
|
||||
labelImage = gfx.CreateSkinImage("titlescreen/labels/friend.png", 0),
|
||||
labelWidth = 169,
|
||||
action = nil, -- Menu.Multiplayer,
|
||||
description = Lang.Multiplayer.mp,
|
||||
details = Lang.Multiplayer.mp2,
|
||||
},
|
||||
{
|
||||
labelImage = gfx.CreateSkinImage("titlescreen/labels/normal.png", 0),
|
||||
labelWidth = 210,
|
||||
action = nil, -- Menu.Start,
|
||||
description = Lang.Start.st,
|
||||
details = Lang.Start.st2,
|
||||
},
|
||||
{
|
||||
labelImage = gfx.CreateSkinImage("titlescreen/labels/nautica.png", 0),
|
||||
labelWidth = 230,
|
||||
action = nil, -- Menu.DLScreen,
|
||||
description = Lang.Nautica.dls,
|
||||
details = Lang.Nautica.dls2,
|
||||
},
|
||||
{
|
||||
labelImage = gfx.CreateSkinImage("titlescreen/labels/settings.png", 0),
|
||||
labelWidth = 247,
|
||||
action = nil, -- Menu.Settings,
|
||||
description = Lang.Settings.se,
|
||||
details = Lang.Settings.se1,
|
||||
},
|
||||
{
|
||||
labelImage = gfx.CreateSkinImage("titlescreen/labels/exit.png", 0),
|
||||
labelWidth = 110,
|
||||
action = nil, -- Menu.Exit,
|
||||
description = Lang.Exit.ex,
|
||||
details = Lang.Exit.ex2,
|
||||
},
|
||||
}
|
||||
|
||||
local buttonHeight = 100
|
||||
|
||||
local miscButtons = {
|
||||
upArrow = {
|
||||
x = Dim.design.width - 265,
|
||||
y = Dim.design.height / 2 + self.SELECTOR_BAR_OFFSET_FROM_CENTER - buttonHeight + 4,
|
||||
w = 64,
|
||||
h = 36
|
||||
},
|
||||
downArrow = {
|
||||
x = Dim.design.width - 265,
|
||||
y = Dim.design.height / 2 + self.SELECTOR_BAR_OFFSET_FROM_CENTER + buttonHeight / 2 + 28,
|
||||
w = 64,
|
||||
h = 36
|
||||
},
|
||||
mainButton = {
|
||||
x = Dim.design.width - 512,
|
||||
y = Dim.design.height / 2 + self.SELECTOR_BAR_OFFSET_FROM_CENTER - buttonHeight / 2 - 28,
|
||||
w = 505,
|
||||
h = 196
|
||||
},
|
||||
upButton1 = {
|
||||
x = Dim.design.width - 512,
|
||||
y = Dim.design.height / 2 + self.SELECTOR_BAR_OFFSET_FROM_CENTER - 128 - buttonHeight,
|
||||
w = 1026 / 2,
|
||||
h = 257 / 2
|
||||
},
|
||||
upButton2 = {
|
||||
x = Dim.design.width - 512,
|
||||
y = Dim.design.height / 2 + self.SELECTOR_BAR_OFFSET_FROM_CENTER - 128 - buttonHeight * 2,
|
||||
w = 1026 / 2,
|
||||
h = 257 / 2
|
||||
},
|
||||
downButton1 = {
|
||||
x = Dim.design.width - 512,
|
||||
y = Dim.design.height / 2 + self.SELECTOR_BAR_OFFSET_FROM_CENTER + 128 + 10,
|
||||
w = 1026 / 2,
|
||||
h = 257 / 2
|
||||
},
|
||||
downButton2 = {
|
||||
x = Dim.design.width - 512,
|
||||
y = Dim.design.height / 2 + self.SELECTOR_BAR_OFFSET_FROM_CENTER + 128 + buttonHeight + 10,
|
||||
w = 1026 / 2,
|
||||
h = 257 / 2
|
||||
},
|
||||
}
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue