2019-05-22 22:57:34 -05:00
|
|
|
local TitleScene = Scene:extend()
|
|
|
|
|
2020-12-19 19:31:14 -06:00
|
|
|
TitleScene.title = "Title"
|
2020-12-19 19:44:24 -06:00
|
|
|
TitleScene.restart_message = false
|
2020-12-19 19:31:14 -06:00
|
|
|
|
2019-05-22 22:57:34 -05:00
|
|
|
local main_menu_screens = {
|
|
|
|
ModeSelectScene,
|
2021-12-04 23:17:25 -06:00
|
|
|
ReplaySelectScene,
|
2020-12-20 08:45:49 -06:00
|
|
|
SettingsScene,
|
2020-12-20 09:28:34 -06:00
|
|
|
CreditsScene,
|
2020-11-06 19:49:44 -06:00
|
|
|
ExitScene,
|
2019-05-22 22:57:34 -05:00
|
|
|
}
|
|
|
|
|
2020-10-10 20:17:48 -05:00
|
|
|
local mainmenuidle = {
|
2020-11-06 19:49:44 -06:00
|
|
|
"Idle",
|
|
|
|
"On title screen",
|
|
|
|
"On main menu screen",
|
|
|
|
"Twiddling their thumbs",
|
|
|
|
"Admiring the main menu's BG",
|
|
|
|
"Waiting for spring to come",
|
|
|
|
"Actually not playing",
|
|
|
|
"Contemplating collecting stars",
|
|
|
|
"Preparing to put the block!!",
|
|
|
|
"Having a nap",
|
|
|
|
"In menus",
|
|
|
|
"Bottom text",
|
2021-09-25 18:33:04 -05:00
|
|
|
"Trying to see all the funny rpc messages (maybe)",
|
|
|
|
"Not not not playing",
|
|
|
|
"AFK",
|
2021-09-26 20:55:42 -05:00
|
|
|
"Preparing for their next game",
|
|
|
|
"Who are those people on that boat?",
|
|
|
|
"Welcome to Cambridge!",
|
|
|
|
"who even reads these",
|
|
|
|
"Made with love in LOVE!",
|
|
|
|
"This is probably the longest RPC string out of every possible RPC string that can be displayed."
|
2020-10-10 20:17:48 -05:00
|
|
|
}
|
2020-10-09 17:43:22 -05:00
|
|
|
|
2019-05-22 22:57:34 -05:00
|
|
|
function TitleScene:new()
|
|
|
|
self.main_menu_state = 1
|
2020-12-24 21:58:06 -06:00
|
|
|
self.frames = 0
|
|
|
|
self.snow_bg_opacity = 0
|
|
|
|
self.y_offset = 0
|
|
|
|
self.text = ""
|
|
|
|
self.text_flag = false
|
2020-10-10 20:17:48 -05:00
|
|
|
DiscordRPC:update({
|
2020-11-06 19:49:44 -06:00
|
|
|
details = "In menus",
|
2021-12-08 20:23:00 -06:00
|
|
|
state = mainmenuidle[love.math.random(#mainmenuidle)],
|
2021-12-08 20:30:09 -06:00
|
|
|
largeImageKey = "icon2",
|
|
|
|
largeImageText = version
|
2020-11-06 19:49:44 -06:00
|
|
|
})
|
2019-05-22 22:57:34 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
function TitleScene:update()
|
2020-12-24 21:58:06 -06:00
|
|
|
if self.text_flag then
|
|
|
|
self.frames = self.frames + 1
|
|
|
|
self.snow_bg_opacity = self.snow_bg_opacity + 0.01
|
|
|
|
end
|
|
|
|
if self.frames < 125 then self.y_offset = self.frames
|
|
|
|
elseif self.frames < 185 then self.y_offset = 125
|
|
|
|
else self.y_offset = 310 - self.frames end
|
2019-05-22 22:57:34 -05:00
|
|
|
end
|
|
|
|
|
2022-02-07 19:39:26 -06:00
|
|
|
local block_offsets = {
|
|
|
|
{color = "M", x = 0, y = 0},
|
|
|
|
{color = "G", x = 32, y = 0},
|
|
|
|
{color = "Y", x = 64, y = 0},
|
|
|
|
{color = "B", x = 0, y = 32},
|
|
|
|
{color = "O", x = 0, y = 64},
|
|
|
|
{color = "C", x = 32, y = 64},
|
|
|
|
{color = "R", x = 64, y = 64}
|
|
|
|
}
|
|
|
|
|
2019-05-22 22:57:34 -05:00
|
|
|
function TitleScene:render()
|
2021-10-16 23:34:30 -05:00
|
|
|
love.graphics.setFont(font_3x5_4)
|
2020-12-24 21:58:06 -06:00
|
|
|
love.graphics.setColor(1, 1, 1, 1 - self.snow_bg_opacity)
|
2023-07-16 00:52:02 -05:00
|
|
|
drawBackground("title_no_icon") -- title, title_night
|
2022-02-07 19:39:26 -06:00
|
|
|
|
|
|
|
-- 490, 192
|
|
|
|
for _, b in ipairs(block_offsets) do
|
|
|
|
love.graphics.draw(
|
|
|
|
blocks["2tie"][b.color],
|
|
|
|
490 + b.x, 192 + b.y, 0,
|
|
|
|
2, 2
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2021-12-08 20:30:09 -06:00
|
|
|
--[[
|
2021-10-16 23:34:30 -05:00
|
|
|
love.graphics.draw(
|
|
|
|
misc_graphics["icon"],
|
2022-02-07 19:39:26 -06:00
|
|
|
490, 192, 0,
|
2021-10-16 23:34:30 -05:00
|
|
|
2, 2
|
|
|
|
)
|
2021-12-08 20:30:09 -06:00
|
|
|
]]
|
2021-12-08 20:37:34 -06:00
|
|
|
--love.graphics.printf("Thanks for 1 year!", 430, 280, 160, "center")
|
2019-05-22 22:57:34 -05:00
|
|
|
|
2021-10-16 23:34:30 -05:00
|
|
|
love.graphics.setFont(font_3x5_2)
|
2020-12-24 21:58:06 -06:00
|
|
|
love.graphics.setColor(1, 1, 1, self.snow_bg_opacity)
|
2023-07-16 00:49:26 -05:00
|
|
|
drawBackground("snow")
|
2020-12-24 21:58:06 -06:00
|
|
|
|
|
|
|
love.graphics.draw(
|
|
|
|
misc_graphics["santa"],
|
|
|
|
400, -205 + self.y_offset,
|
|
|
|
0, 0.5, 0.5
|
|
|
|
)
|
|
|
|
love.graphics.print("Happy Holidays!", 320, -100 + self.y_offset)
|
|
|
|
|
2021-01-08 19:33:44 -06:00
|
|
|
love.graphics.setColor(1, 1, 1, 1)
|
2020-12-19 19:44:24 -06:00
|
|
|
love.graphics.print(self.restart_message and "Restart Cambridge..." or "", 0, 0)
|
|
|
|
|
2019-05-22 22:57:34 -05:00
|
|
|
love.graphics.setColor(1, 1, 1, 0.5)
|
|
|
|
love.graphics.rectangle("fill", 20, 278 + 20 * self.main_menu_state, 160, 22)
|
|
|
|
|
|
|
|
love.graphics.setColor(1, 1, 1, 1)
|
|
|
|
for i, screen in pairs(main_menu_screens) do
|
|
|
|
love.graphics.printf(screen.title, 40, 280 + 20 * i, 120, "left")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function TitleScene:changeOption(rel)
|
|
|
|
local len = table.getn(main_menu_screens)
|
|
|
|
self.main_menu_state = (self.main_menu_state + len + rel - 1) % len + 1
|
|
|
|
end
|
|
|
|
|
2020-11-08 14:55:06 -06:00
|
|
|
function TitleScene:onInputPress(e)
|
2021-10-21 19:52:42 -05:00
|
|
|
if e.input == "menu_decide" or e.scancode == "return" then
|
2020-10-09 16:50:05 -05:00
|
|
|
playSE("main_decide")
|
2019-05-22 22:57:34 -05:00
|
|
|
scene = main_menu_screens[self.main_menu_state]()
|
2021-10-21 19:52:42 -05:00
|
|
|
elseif e.input == "up" or e.scancode == "up" then
|
2019-05-22 22:57:34 -05:00
|
|
|
self:changeOption(-1)
|
2020-10-09 16:50:05 -05:00
|
|
|
playSE("cursor")
|
2021-10-21 19:52:42 -05:00
|
|
|
elseif e.input == "down" or e.scancode == "down" then
|
2019-05-22 22:57:34 -05:00
|
|
|
self:changeOption(1)
|
2020-10-09 16:50:05 -05:00
|
|
|
playSE("cursor")
|
2021-10-21 19:52:42 -05:00
|
|
|
elseif e.input == "menu_back" or e.scancode == "backspace" or e.scancode == "delete" then
|
2020-11-06 19:49:44 -06:00
|
|
|
love.event.quit()
|
2020-12-24 21:58:06 -06:00
|
|
|
else
|
2021-10-16 23:34:30 -05:00
|
|
|
self.text = self.text .. (e.scancode or "")
|
2020-12-24 21:58:06 -06:00
|
|
|
if self.text == "ffffff" then
|
|
|
|
self.text_flag = true
|
2021-09-26 22:12:05 -05:00
|
|
|
DiscordRPC:update({
|
|
|
|
largeImageKey = "snow"
|
|
|
|
})
|
2020-12-24 21:58:06 -06:00
|
|
|
end
|
2019-05-22 22:57:34 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return TitleScene
|