This commit is contained in:
RealFD 2022-02-27 18:59:29 +01:00
parent 2e52788d51
commit f522c00c91
3 changed files with 75 additions and 40 deletions

View File

@ -17,6 +17,8 @@ local m_host_panel = gfx.CreateSkinImage("multi/lobby/user_panel.png", 1);
local m_bpm_panel = gfx.CreateSkinImage("multi/lobby/lane_speed_panel.png", 1); local m_bpm_panel = gfx.CreateSkinImage("multi/lobby/lane_speed_panel.png", 1);
local m_info_panel = gfx.CreateSkinImage("multi/lobby/button_panel.png", 1); local m_info_panel = gfx.CreateSkinImage("multi/lobby/button_panel.png", 1);
local temppanels = gfx.CreateSkinImage("song_select/textboard.png", 1);
local headerMatchingImage = gfx.CreateSkinImage("titlescreen/entry.png", 1); local headerMatchingImage = gfx.CreateSkinImage("titlescreen/entry.png", 1);
local m_4pb_panels = gfx.CreateSkinImage("multi/lobby/user_panel_2.png", 1); local m_4pb_panels = gfx.CreateSkinImage("multi/lobby/user_panel_2.png", 1);
@ -37,7 +39,7 @@ local mposx = 0;
local mposy = 0; local mposy = 0;
local hovered = nil; local hovered = nil;
local buttonWidth = resX*(3/4); local buttonWidth = resX*(3/4);
local buttonHeight = 75; local buttonHeight = 20;
local buttonBorder = 2; local buttonBorder = 2;
local portrait local portrait
local jacket_size; local jacket_size;
@ -72,6 +74,16 @@ local missing_song = false;
local placeholderJacket = gfx.CreateSkinImage("song_select/loading.png", 0) local placeholderJacket = gfx.CreateSkinImage("song_select/loading.png", 0)
local did_exit = false; local did_exit = false;
-- Aspect Ratios
local landscapeWidescreenRatio = 16 / 9
local landscapeStandardRatio = 4 / 3
local portraitWidescreenRatio = 9 / 16
-- Portrait sizes
local fullX, fullY
local desw = 1080
local desh = 1920
local irHeartbeatRequested = false; local irHeartbeatRequested = false;
local irText = '' local irText = ''
@ -314,49 +326,73 @@ m_info_part = function () -- the info panel
gfx.BeginPath(); gfx.BeginPath();
gfx.ImageRect(475, 1590, jw/1.18, jh/1.18, m_info_panel,1,0); gfx.ImageRect(475, 1590, jw/1.18, jh/1.18, m_info_panel,1,0);
local check = 770 draw_checkbox("Excessive", 635, 1639.25, toggle_hard, hard_mode, not start_game_soon)
draw_checkbox("Mirror",676.2, 1677.5, toggle_mirror, mirror_mode, not start_game_soon)
draw_checkbox("Excessive", check - 200, 1625, toggle_hard, hard_mode, not start_game_soon) draw_checkbox("Rotate",854.1, 1677.5, toggle_rotate, do_rotate,
draw_checkbox("Mirror Mode",check - 15, 1625, toggle_mirror, mirror_mode, not start_game_soon)
draw_checkbox("Rotate Host",check + 175, 1625, toggle_rotate, do_rotate,
(owner == user_id or host == user_id) and not start_game_soon) (owner == user_id or host == user_id) and not start_game_soon)
for i, user in ipairs(lobby_users) do gfx.FillColor(255,255,255,100)
gfx.Text("Leave",892.5, 1640)
buttonY = 1775 gfx.FillColor(255,255,255)
gfx.FontSize(24)
local side_button_off = 0 -- gfx.Text("FX-L/FX-R TO READY UP",765.5,1859)
if owner == user_id and user.id ~= user_id then gfx.Text("FX-L/FX-R TO EXCEED SEX",765.5,1859)
draw_button("K",525+side_button_off, buttonY, 50, function()
kick_user(user);
end)
side_button_off = 60;
end
if (owner == user_id or host == user_id) and user.id ~= host then
draw_button("H",525+side_button_off, buttonY+85, 50, function()
change_host(user);
end)
end
end
end end
user_setup = function () -- (semi new) user layering user_setup = function () -- (semi new) user layering
local distance = 350 local distance = 350
for i, user in ipairs(lobby_users) do for i, user in ipairs(lobby_users) do
buttonY = 1142-360/1.2
if owner == user_id and user.id ~= user_id then
draw_button("K",525+distance, buttonY, 100, function()
kick_user(user);
end)
end
if i == 1 then if i == 1 then
draw_user(user, -distance, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5) draw_user(user, -distance, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5)
if (owner == user_id or host == user_id) and user.id ~= host then
draw_button("H",-distance, buttonY, 50, function()
change_host(user);end)
end
elseif i == 2 then elseif i == 2 then
draw_user(user, 16, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5) draw_user(user, 16, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5)
if (owner == user_id or host == user_id) and user.id ~= host then
draw_button("H",16, buttonY+250, 50, function()
change_host(user);end)
end
elseif i == 3 then elseif i == 3 then
draw_user(user, 16+distance, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5) draw_user(user, 16+distance, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5)
if (owner == user_id or host == user_id) and user.id ~= host then
draw_button("H",16+distance, buttonY, 50, function()
change_host(user);end)
end
elseif i == 4 then elseif i == 4 then
draw_user(user, 16+distance+distance, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5) draw_user(user, 16+distance+distance, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5)
if (owner == user_id or host == user_id) and user.id ~= host then
draw_button("H",16+distance+distance, buttonY, 50, function()
change_host(user);end)
end
elseif i > 4 then elseif i > 4 then
draw_user(user, 16+distance+distance+distance+distance, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5) draw_user(user, 16+distance+distance+distance+distance, 1142-360/1.2, 420/1.2, 330/1.2, i,215,245.5)
if (owner == user_id or host == user_id) and user.id ~= host then
draw_button("H",16+distance+distance+distance, buttonY, 25, function()
change_host(user);end)
end
end end
end end
end end
@ -407,27 +443,22 @@ draw_room = function(name, x, y, selected, hoverindex)
end; end;
draw_button = function(name, x, y, buttonWidth, hoverindex) draw_button = function(name, x, y, buttonWidth, hoverindex)
draw_button_color(name, x, y, buttonWidth, hoverindex, 40,40,40, 0,128,255) draw_button_color(name, x, y, buttonWidth, hoverindex, temppanels)
end end
draw_button_color = function(name, x, y, buttonWidth, hoverindex,r,g,b, olr,olg,olb) draw_button_color = function(name, x, y, buttonWidth, hoverindex,img)
local rx = x - (buttonWidth / 2); local rx = x - (buttonWidth / 2);
local ty = y - (buttonHeight / 2); local ty = y - (buttonHeight / 2);
gfx.BeginPath(); gfx.BeginPath();
gfx.FillColor(olr, olg, olb); gfx.ImageRect(rx,ty,buttonWidth,buttonHeight,img,1,0)
if mouse_clipped(rx,ty, buttonWidth, buttonHeight) then if mouse_clipped(rx,ty, buttonWidth, buttonHeight) then
hovered = hoverindex; hovered = hoverindex;
gfx.FillColor(255,128,0);
end end
gfx.Rect(rx - buttonBorder, gfx.Rect(rx - buttonBorder,
ty - buttonBorder, ty - buttonBorder,
buttonWidth + (buttonBorder * 2), buttonWidth + (buttonBorder * 2),
buttonHeight + (buttonBorder * 2)); buttonHeight + (buttonBorder * 2));
gfx.Fill();
gfx.BeginPath(); gfx.BeginPath();
gfx.FillColor(r,g,b);
gfx.Rect(rx, ty, buttonWidth, buttonHeight);
gfx.Fill();
gfx.BeginPath(); gfx.BeginPath();
gfx.FillColor(255,255,255); gfx.FillColor(255,255,255);
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE); gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE);
@ -439,13 +470,12 @@ draw_checkbox = function(text, x, y, hoverindex, current, can_click)
gfx.BeginPath(); gfx.BeginPath();
if can_click then if can_click then
gfx.FillColor(255,255,255); gfx.FillColor(255,255,255,100);
else else
gfx.FillColor(150,100,100); gfx.FillColor(100,100,100,100);
end end
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE); gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE);
gfx.FontSize(35); gfx.FontSize(30);
gfx.FillColor(201,0,0);
gfx.Text(text, x, y) gfx.Text(text, x, y)
local xmin,ymin,xmax,ymax = gfx.TextBounds(x, y, text); local xmin,ymin,xmax,ymax = gfx.TextBounds(x, y, text);
@ -460,13 +490,11 @@ draw_checkbox = function(text, x, y, hoverindex, current, can_click)
if current then if current then
-- Draw checkmark -- Draw checkmark
gfx.BeginPath(); gfx.BeginPath();
gfx.FillColor(0, 236, 0); gfx.FillColor(0, 236, 0,100);
gfx.Text(text, x, y) gfx.Text(text, x, y)
gfx.Fill();
end end
end; end;
--look into user changing -- IMPORTANT !!!
draw_user = function(user, x, y , w, h, rank, breadx,bready) draw_user = function(user, x, y , w, h, rank, breadx,bready)
local name = user.name local name = user.name
local showthing = false local showthing = false
@ -969,6 +997,13 @@ button_pressed = function(button)
if button == game.BUTTON_BTC then if button == game.BUTTON_BTC then
toggle_rotate(); toggle_rotate();
end end
if button == game.BUTTON_BTD then
for i, user in ipairs(lobby_users) do
if lobby_users[i] == user then
kick_user(user);
end
end
end
end end
-- Handle the escape key around the UI -- Handle the escape key around the UI

Binary file not shown.

Before

Width:  |  Height:  |  Size: 221 KiB

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 175 KiB