2022-06-05 18:33:12 +02:00
|
|
|
local Dim = require("common.dimensions")
|
|
|
|
local difbar = require("components.diff_rectangle")
|
|
|
|
|
|
|
|
local desw, desh = Dim.design.width,Dim.design.height
|
|
|
|
|
2022-06-12 14:39:22 +02:00
|
|
|
local xnum = 190
|
|
|
|
local ynum = 24
|
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
local ImageStorage = {
|
|
|
|
plate = gfx.CreateSkinImage("nautica/room_panel.png", 1),
|
|
|
|
nameplate = gfx.CreateSkinImage("nautica/panel_name.png", 1),
|
|
|
|
price = gfx.CreateSkinImage("nautica/pw_or_price_panel.png", 1),
|
|
|
|
jacket = gfx.CreateSkinImage("nautica/bg_jacket.png", 1),
|
|
|
|
nodif = gfx.CreateSkinImage("nautica/no_dif.png", 1),
|
|
|
|
dot = gfx.CreateSkinImage("nautica/dot.png", 1),
|
|
|
|
}
|
2022-06-05 18:33:12 +02:00
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
local DrawSongPlate = function(song,x,y,downloaded)
|
2022-06-05 18:33:12 +02:00
|
|
|
--nautica song list
|
|
|
|
if screenState ~= "roomList" then
|
2023-12-02 23:58:03 +01:00
|
|
|
local jw,jh = gfx.ImageSize(ImageStorage.plate); -- if bpm is a think change l_panel to n_panel
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.BeginPath();
|
2023-12-02 23:58:03 +01:00
|
|
|
gfx.ImageRect(x,y, jw/1.17, jh/1.17, ImageStorage.plate,1,0);
|
2022-07-05 20:44:14 +02:00
|
|
|
|
|
|
|
that = 9.5
|
|
|
|
why = 1
|
2022-06-05 18:33:12 +02:00
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
local jw,jh = gfx.ImageSize(ImageStorage.jacket);
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.BeginPath();
|
2023-12-02 23:58:03 +01:00
|
|
|
gfx.ImageRect(x+that,y+5+why, jw/1.17, jh/1.17, ImageStorage.jacket,1,0);
|
2022-06-12 14:39:22 +02:00
|
|
|
|
|
|
|
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.BeginPath()
|
2022-07-05 20:44:14 +02:00
|
|
|
gfx.ImageRect(x+that+8.9,y+5+19, jw/1.4, jh/1.4, song.jacket, 1, 0)
|
2022-06-05 18:33:12 +02:00
|
|
|
|
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
local jw,jh = gfx.ImageSize(ImageStorage.nodif);
|
2022-06-05 18:33:12 +02:00
|
|
|
for i=1,4 do
|
|
|
|
gfx.BeginPath();
|
2023-12-02 23:58:03 +01:00
|
|
|
gfx.ImageRect(x+30+(i*115),y+106, jw/1.09, jh/1.09, ImageStorage.nodif,1,0);
|
2022-06-05 18:33:12 +02:00
|
|
|
end
|
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
local jw,jh = gfx.ImageSize(ImageStorage.nameplate);
|
2022-07-05 20:44:14 +02:00
|
|
|
gfx.BeginPath();
|
2023-12-02 23:58:03 +01:00
|
|
|
gfx.ImageRect(x+147,y+5, jw/1.17, jh/1.17, ImageStorage.nameplate,1,0);
|
2022-06-05 18:33:12 +02:00
|
|
|
|
|
|
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
2022-06-12 14:39:22 +02:00
|
|
|
gfx.FontSize(30)
|
|
|
|
gfx.Text(song.title,x+xnum,y+ynum)
|
|
|
|
gfx.Text(song.artist,x+xnum,y+ynum+40)
|
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
local jw,jh = gfx.ImageSize(ImageStorage.dot);
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.BeginPath();
|
|
|
|
gfx.SetImageTint(255,9,253)
|
2023-12-02 23:58:03 +01:00
|
|
|
gfx.ImageRect(x,y, jw/1.17, jh/1.17, ImageStorage.dot,1,0);
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.SetImageTint(255,255,255)
|
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
local jw,jh = gfx.ImageSize(ImageStorage.nodif);
|
2022-06-05 18:33:12 +02:00
|
|
|
for i, diff in ipairs(song.charts) do
|
|
|
|
if diff.difficulty == 1 then --nov
|
|
|
|
difbar.render(deltaTime, x+260+(-1*115),y+106, jw/150, diff.difficulty, diff.level);
|
|
|
|
elseif diff.difficulty == 2 then --adv
|
|
|
|
difbar.render(deltaTime, x+260+(0*115),y+106, jw/150, diff.difficulty, diff.level);
|
|
|
|
elseif diff.difficulty == 3 then --exh
|
|
|
|
difbar.render(deltaTime, x+260+(1*115),y+106, jw/150, diff.difficulty, diff.level);
|
|
|
|
elseif diff.difficulty == 4 then ---mxm and up
|
|
|
|
difbar.render(deltaTime, x+260+(2*115),y+106, jw/150, diff.difficulty, diff.level);
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
local jw,jh = gfx.ImageSize(ImageStorage.price);
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.BeginPath();
|
2023-12-02 23:58:03 +01:00
|
|
|
gfx.ImageRect(x+650,y+69, jw/1.17, jh/1.17, ImageStorage.price,1,0);
|
2022-06-05 18:33:12 +02:00
|
|
|
|
2022-06-12 14:39:22 +02:00
|
|
|
local buy = "AP 8000"
|
2022-07-05 20:44:14 +02:00
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
local jw,jh = gfx.ImageSize(ImageStorage.dot);
|
2022-06-12 14:39:22 +02:00
|
|
|
|
|
|
|
gfx.FontSize(30)
|
|
|
|
gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE)
|
|
|
|
if not downloaded[song.id] then
|
|
|
|
gfx.BeginPath()
|
2022-07-05 20:44:14 +02:00
|
|
|
gfx.Text(string.upper(buy),x+868,y+90)
|
2022-06-12 14:39:22 +02:00
|
|
|
elseif downloaded[song.id] == "Downloading" then
|
|
|
|
gfx.BeginPath()
|
2022-07-05 20:44:14 +02:00
|
|
|
gfx.Text(string.upper(buy), x+868,y+90)
|
2022-06-12 14:39:22 +02:00
|
|
|
elseif downloaded[song.id] == "Downloaded" then
|
|
|
|
gfx.BeginPath()
|
2022-07-05 20:44:14 +02:00
|
|
|
gfx.Text(string.upper(buy), x+868,y+90)
|
2022-06-12 14:39:22 +02:00
|
|
|
end
|
2022-06-05 22:06:08 +02:00
|
|
|
if song.status == "Playing" then
|
|
|
|
gfx.BeginPath()
|
|
|
|
gfx.FontSize(24)
|
2022-06-12 14:39:22 +02:00
|
|
|
gfx.Text(string.upper(song.status), x+878-10, y+25)
|
2022-06-05 22:06:08 +02:00
|
|
|
end
|
2022-07-05 20:44:14 +02:00
|
|
|
|
2022-06-12 14:39:22 +02:00
|
|
|
if downloaded[song.id] == "Downloaded" then
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.BeginPath()
|
2022-06-12 14:39:22 +02:00
|
|
|
gfx.SetImageTint(240,246,0)
|
2023-12-02 23:58:03 +01:00
|
|
|
gfx.ImageRect(x,y, jw/1.17, jh/1.17, ImageStorage.dot,1,0);
|
2022-06-12 14:39:22 +02:00
|
|
|
gfx.SetImageTint(255,255,255)
|
|
|
|
elseif downloaded[song.id] == "Downloading" then
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.BeginPath()
|
2022-06-12 14:39:22 +02:00
|
|
|
gfx.SetImageTint(240,20,0)
|
2023-12-02 23:58:03 +01:00
|
|
|
gfx.ImageRect(x,y, jw/1.17, jh/1.17, ImageStorage.dot,1,0);
|
2022-06-12 14:39:22 +02:00
|
|
|
gfx.SetImageTint(255,255,255)
|
|
|
|
end
|
|
|
|
if song.status == "Playing" then
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.BeginPath();
|
2022-06-12 14:39:22 +02:00
|
|
|
gfx.SetImageTint(0,246,2)
|
2023-12-02 23:58:03 +01:00
|
|
|
gfx.ImageRect(x,y, jw/1.17, jh/1.17, ImageStorage.dot,1,0);
|
2022-06-05 18:33:12 +02:00
|
|
|
gfx.SetImageTint(255,255,255)
|
|
|
|
end
|
2022-06-12 14:39:22 +02:00
|
|
|
|
2022-06-05 18:33:12 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-12-02 23:58:03 +01:00
|
|
|
return {draw = DrawSongPlate}
|