ExperimentalGear/scripts/multi/roomList/getroom.lua

123 lines
4.8 KiB
Lua
Raw Normal View History

2022-06-05 18:33:12 +02:00
local Dim = require("common.dimensions")
local textscramble = require("components.textscrambler")
local difbar = require("components.diff_rectangle")
local desw, desh = Dim.design.width,Dim.design.height
local l_panel = gfx.CreateSkinImage("multi/roomselect/room_panel.png",1);
local n_cost,l_pw = gfx.CreateSkinImage("multi/roomselect/pw_or_price_panel.png",1);
local n_panel = gfx.CreateSkinImage("multi/roomselect/nautica/nautica_panel.png",1);
local n_panel_ja = gfx.CreateSkinImage("multi/roomselect/nautica/nautica_bg_jacket.png",1);
local n_nodif = gfx.CreateSkinImage("multi/roomselect/nautica/no_dif.png",1);
local n_play_dot = gfx.CreateSkinImage("multi/roomselect/nautica/nautica_pl_dot.png",1);
local info_panel = gfx.CreateSkinImage("multi/roomselect/room_panel_name_or_song.png",1);
local getroom = function(song,x,y,downloaded)
--multiplayer room list
if screenState == "roomList" then
-- local jw,jh = gfx.ImageSize(l_panel);
-- gfx.BeginPath();
-- gfx.ImageRect(lobbypanelX, lobbypanelY, jw, jh, l_panel,1,0);
-- do the lobby oder here
draw_rooms(desw/2, desh - 290);
end
--nautica song list
if screenState ~= "roomList" then
local jw,jh = gfx.ImageSize(l_panel); -- if bpm is a think change l_panel to n_panel
gfx.BeginPath();
gfx.ImageRect(x,y, jw, jh, l_panel,1,0);
local jw,jh = gfx.ImageSize(n_panel_ja);
gfx.BeginPath();
gfx.ImageRect(x+3,y+5, jw, jh, n_panel_ja,1,0);
if song.jacket_url ~= nil and song.jacket == jacketFallback then
song.jacket = gfx.LoadWebImageJob(song.jacket_url, jacketFallback, 250, 250)
end
gfx.BeginPath()
gfx.ImageRect(x+3+8.9,y+5+19, jw/1.19, jh/1.3, song.jacket, 1, 0)
local jw,jh = gfx.ImageSize(n_nodif);
for i=1,4 do
gfx.BeginPath();
gfx.ImageRect(x+30+(i*115),y+106, jw/1.09, jh/1.09, n_nodif,1,0);
end
local jw,jh = gfx.ImageSize(info_panel);
gfx.BeginPath();
gfx.ImageRect(x+147,y+5, jw, jh, info_panel,1,0);
local xnum = 190
local ynum = 24
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
gfx.Scissor(0, 0,1080,1040)
textscramble.textmaker(song.title,30,500,x+xnum,y+ynum,500,30,500,0,1)
textscramble.textmaker(song.artist,30,420,x+xnum,y+ynum+40,420,30,500,0,1)
local jw,jh = gfx.ImageSize(n_play_dot);
gfx.BeginPath();
gfx.SetImageTint(255,9,253)
gfx.ImageRect(x+764, y+11, jw, jh, n_play_dot,1,0);
gfx.SetImageTint(255,255,255)
local jw,jh = gfx.ImageSize(n_nodif);
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);
elseif diff.difficulty == 4 then ---mxm and up
difbar.render(deltaTime, x+260+(2*115),y+106, jw/150, diff.difficulty+1, diff.level);
end
end
local jw,jh = gfx.ImageSize(n_cost);
gfx.BeginPath();
gfx.ImageRect(x+650,y+69, jw, jh, n_cost,1,0);
local buy = 8000
gfx.FontSize(30)
if not downloaded[song.id] then
gfx.BeginPath()
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE)
gfx.Text(buy.." AP",x+830,y+92)
elseif downloaded[song.id] then
buy = "0"--downloaded[song.id]
gfx.BeginPath()
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE)
gfx.Text(buy.." AP", x+830,y+92)
end
if song.status == "Playing" then
gfx.BeginPath()
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE)
gfx.FontSize(24)
gfx.Text(song.status, x+878-50, y+24)
local jw,jh = gfx.ImageSize(n_play_dot);
gfx.BeginPath();
gfx.SetImageTint(0,246,2)
gfx.ImageRect(x+764, y+11, jw, jh, n_play_dot,1,0);
gfx.SetImageTint(255,255,255)
end
end
end
return getroom