result = dan / partly multi / clear rate
This commit is contained in:
parent
08cf0a530b
commit
40a0e852d4
|
@ -1,6 +1,13 @@
|
||||||
json = require "json"
|
json = require "json"
|
||||||
|
|
||||||
local common = require('common.common');
|
local common = require('common.common');
|
||||||
|
local Background = require('components.background');
|
||||||
|
local difbar = require("components.diff_rectangle");
|
||||||
|
|
||||||
|
local bar = gfx.CreateSkinImage("song_select/textboard.png", 1);
|
||||||
|
local M_jacket = gfx.CreateSkinImage("result/panels/multi_jacket.png", 1);
|
||||||
|
|
||||||
|
local tempbg = gfx.CreateSkinImage("result/panels/multi_lobby.png", 1);
|
||||||
|
|
||||||
local resX,resY = game.GetResolution()
|
local resX,resY = game.GetResolution()
|
||||||
|
|
||||||
|
@ -145,8 +152,6 @@ draw_button_color = function(name, x, y, buttonWidth, hoverindex,r,g,b, olr,olg,
|
||||||
end;
|
end;
|
||||||
|
|
||||||
draw_checkbox = function(text, x, y, hoverindex, current, can_click)
|
draw_checkbox = function(text, x, y, hoverindex, current, can_click)
|
||||||
local rx = x - (buttonWidth / 2);
|
|
||||||
local ty = y - (buttonHeight / 2);
|
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
|
|
||||||
if can_click then
|
if can_click then
|
||||||
|
@ -156,6 +161,7 @@ draw_checkbox = function(text, x, y, hoverindex, current, can_click)
|
||||||
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(35);
|
||||||
|
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);
|
||||||
|
@ -163,50 +169,38 @@ draw_checkbox = function(text, x, y, hoverindex, current, can_click)
|
||||||
local sx = xmin - 40;
|
local sx = xmin - 40;
|
||||||
local sy = y - 15;
|
local sy = y - 15;
|
||||||
|
|
||||||
gfx.StrokeColor(0,128,255);
|
if can_click and mouse_clipped(xmin-10, ymin, xmax-xmin, ymax-ymin) then
|
||||||
if can_click and (mouse_clipped(sx, sy, 31, 30) or mouse_clipped(xmin-10, ymin, xmax-xmin, ymax-ymin)) then
|
|
||||||
hovered = hoverindex;
|
hovered = hoverindex;
|
||||||
gfx.StrokeColor(255,128,0);
|
|
||||||
end
|
end
|
||||||
|
|
||||||
gfx.Rect(sx, y - 15, 30, 30)
|
|
||||||
gfx.StrokeWidth(2)
|
|
||||||
gfx.Stroke()
|
|
||||||
|
|
||||||
if current then
|
if current then
|
||||||
-- Draw checkmark
|
-- Draw checkmark
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
gfx.MoveTo(sx+5, sy+10);
|
gfx.FillColor(0, 236, 0);
|
||||||
gfx.LineTo(sx+15, y+5);
|
gfx.Text(text, x, y)
|
||||||
gfx.LineTo(sx+35, y-15);
|
gfx.Fill();
|
||||||
gfx.StrokeWidth(5)
|
|
||||||
gfx.StrokeColor(0,255,0);
|
|
||||||
gfx.Stroke()
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
local userHeight = 100
|
local userHeight = 100
|
||||||
|
--look into user changing -- IMPORTANT !!!
|
||||||
draw_user = function(user, x, y, buttonWidth, rank)
|
draw_user = function(user, x, y, buttonWidth, rank)
|
||||||
local buttonHeight = userHeight;
|
local buttonHeight = userHeight;
|
||||||
|
-- local y = 100
|
||||||
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(256,128,255);
|
|
||||||
|
|
||||||
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();
|
||||||
if host == user.id then
|
if host == user.id then
|
||||||
gfx.FillColor(80,0,0);
|
local y = 100
|
||||||
|
|
||||||
else
|
else
|
||||||
gfx.FillColor(0,0,40);
|
gfx.FillColor(0,0,40);
|
||||||
end
|
end
|
||||||
gfx.Rect(rx, ty, buttonWidth, buttonHeight);
|
|
||||||
gfx.Fill();
|
gfx.Fill();
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
gfx.FillColor(255,255,255);
|
gfx.FillColor(255,255,255);
|
||||||
|
@ -263,11 +257,10 @@ draw_user = function(user, x, y, buttonWidth, rank)
|
||||||
if user.level ~= 0 then
|
if user.level ~= 0 then
|
||||||
gfx.FillColor(255,255,0)
|
gfx.FillColor(255,255,0)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE);
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE);
|
||||||
local level_text = 'Lvl '..user.level..' '
|
local level_text = user.level
|
||||||
gfx.Text(level_text, x-buttonWidth/2 + 5, second_y-5)
|
gfx.Text(level_text, x-buttonWidth/2 + 5, second_y-5)
|
||||||
local xmin,ymin,xmax,ymax = gfx.TextBounds(x-buttonWidth/2 + 5, second_y-5, level_text);
|
local xmin,ymin,xmax,ymax = gfx.TextBounds(x-buttonWidth/2 + 5, second_y-5, level_text);
|
||||||
|
|
||||||
|
|
||||||
if user.badge then
|
if user.badge then
|
||||||
gfx.BeginPath()
|
gfx.BeginPath()
|
||||||
local iw, ih = gfx.ImageSize(user.badge)
|
local iw, ih = gfx.ImageSize(user.badge)
|
||||||
|
@ -303,24 +296,13 @@ function render_info()
|
||||||
gfx.Save()
|
gfx.Save()
|
||||||
gfx.ResetTransform()
|
gfx.ResetTransform()
|
||||||
gfx.BeginPath()
|
gfx.BeginPath()
|
||||||
gfx.MoveTo(0, resY)
|
|
||||||
gfx.LineTo(550, resY)
|
|
||||||
gfx.LineTo(500, resY - 65)
|
|
||||||
gfx.LineTo(0, resY - 65)
|
|
||||||
gfx.ClosePath()
|
|
||||||
gfx.FillColor(33,33,33)
|
|
||||||
gfx.Fill()
|
|
||||||
gfx.FillColor(255,255,255)
|
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT, gfx.TEXT_ALIGN_BOTTOM)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT, gfx.TEXT_ALIGN_BOTTOM)
|
||||||
gfx.FontSize(70)
|
gfx.FontSize(70)
|
||||||
gfx.Text("Multiplayer", 3, resY - 15)
|
-- gfx.Text("Multiplayer", 3, resY - 15)
|
||||||
local xmin,ymin,xmax,ymax = gfx.TextBounds(3, resY - 3, "Multiplayer")
|
-- local xmin,ymin,xmax,ymax = gfx.TextBounds(3, resY - 3, "Multiplayer")
|
||||||
gfx.FontSize(20)
|
gfx.FontSize(20)
|
||||||
gfx.Text(MULTIPLAYER_VERSION, xmax + 13, resY - 15)
|
gfx.FillColor(255,255,255)
|
||||||
--gfx.Text('Server: '..'', xmax + 13, resY - 15)
|
gfx.Text(MULTIPLAYER_VERSION, 1035, 1917)
|
||||||
draw_button_color("Settings", 500-60, resY-25, 120, function()
|
|
||||||
mpScreen.OpenSettings();
|
|
||||||
end, 33,33,33, 33,33,33)
|
|
||||||
gfx.Restore()
|
gfx.Restore()
|
||||||
|
|
||||||
if searchStatus then
|
if searchStatus then
|
||||||
|
@ -330,59 +312,30 @@ function render_info()
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
||||||
gfx.Text(searchStatus, 3, 3)
|
gfx.Text(searchStatus, 3, 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
draw_diff_icon = function(diff, x, y, w, h, selected)
|
|
||||||
local shrinkX = w/4
|
draw_diff_icon = function(diff, x, y, w, h)
|
||||||
local shrinkY = h/4
|
difbar.render(deltaTime, x, y, 1, diff.difficulty, diff.level);
|
||||||
if selected then
|
|
||||||
gfx.FontSize(h/2)
|
|
||||||
shrinkX = w/6
|
|
||||||
shrinkY = h/6
|
|
||||||
else
|
|
||||||
gfx.FontSize(math.floor(h / 3))
|
|
||||||
end
|
|
||||||
gfx.BeginPath()
|
|
||||||
gfx.RoundedRectVarying(x+shrinkX,y+shrinkY,w-shrinkX*2,h-shrinkY*2,0,0,0,0)
|
|
||||||
gfx.FillColor(15,15,15)
|
|
||||||
gfx.StrokeColor(table.unpack(diffColors[diff.difficulty + 1]))
|
|
||||||
gfx.StrokeWidth(2)
|
|
||||||
gfx.Fill()
|
|
||||||
gfx.Stroke()
|
|
||||||
gfx.FillColor(255,255,255)
|
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_MIDDLE + gfx.TEXT_ALIGN_CENTER)
|
|
||||||
gfx.FastText(tostring(diff.level), x+(w/2),y+(h/2))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local doffset = 0;
|
local doffset = 0;
|
||||||
local timer = 0;
|
local timer = 0;
|
||||||
|
|
||||||
draw_cursor = function(x,y,rotation,width)
|
local possy = 1095;
|
||||||
gfx.Save()
|
local possx = 150;
|
||||||
gfx.BeginPath();
|
|
||||||
gfx.Translate(x,y)
|
|
||||||
gfx.Rotate(rotation)
|
|
||||||
gfx.StrokeColor(255,128,0)
|
|
||||||
gfx.StrokeWidth(4)
|
|
||||||
gfx.Rect(-width/2, -width/2, width, width)
|
|
||||||
gfx.Stroke()
|
|
||||||
gfx.Restore()
|
|
||||||
end
|
|
||||||
|
|
||||||
draw_diffs = function(diffs, x, y, w, h, selectedDiff)
|
draw_diffs = function(diffs, x, y, w, h, selectedDiff)
|
||||||
local diffWidth = w/2.5
|
local diffWidth = w/2
|
||||||
local diffHeight = w/2.5
|
local diffHeight = w/2
|
||||||
local diffCount = #diffs
|
local diffCount = #diffs
|
||||||
gfx.Scissor(x,y,w,h)
|
gfx.Scissor(x+84 + possx,y + possy,w/2.451,h)
|
||||||
for i = math.max(selectedDiff - 2, 1), math.max(selectedDiff - 1,1) do
|
for i = math.max(selectedDiff - 2, 1), math.max(selectedDiff - 1,1) do
|
||||||
local diff = diffs[i]
|
local diff = diffs[i]
|
||||||
local xpos = x + ((w/2 - diffWidth/2) + (selectedDiff - i + doffset)*(-0.8*diffWidth))
|
local xpos = x + ((w/2 - diffWidth/2) + (selectedDiff - i + doffset)*(-0.8*diffWidth))
|
||||||
if i ~= selectedDiff then
|
if i ~= selectedDiff then
|
||||||
draw_diff_icon(diff, xpos, y, diffWidth, diffHeight, false)
|
draw_diff_icon(diff, xpos + possx, y + possy, diffWidth, diffHeight, false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -391,21 +344,14 @@ draw_diffs = function(diffs, x, y, w, h, selectedDiff)
|
||||||
local diff = diffs[i]
|
local diff = diffs[i]
|
||||||
local xpos = x + ((w/2 - diffWidth/2) + (selectedDiff - i + doffset)*(-0.8*diffWidth))
|
local xpos = x + ((w/2 - diffWidth/2) + (selectedDiff - i + doffset)*(-0.8*diffWidth))
|
||||||
if i ~= selectedDiff then
|
if i ~= selectedDiff then
|
||||||
draw_diff_icon(diff, xpos, y, diffWidth, diffHeight, false)
|
draw_diff_icon(diff, xpos + possx, y + possy, diffWidth, diffHeight, false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local diff = diffs[selectedDiff]
|
local diff = diffs[selectedDiff]
|
||||||
local xpos = x + ((w/2 - diffWidth/2) + (doffset)*(-0.8*diffWidth))
|
local xpos = x + ((w/2 - diffWidth/2) + (doffset)*(-0.8*diffWidth))
|
||||||
draw_diff_icon(diff, xpos, y, diffWidth, diffHeight, true)
|
draw_diff_icon(diff, xpos + possx, y + possy, diffWidth, diffHeight, true)
|
||||||
gfx.BeginPath()
|
|
||||||
gfx.FillColor(0,128,255)
|
|
||||||
gfx.Rect(x,y+10,2,diffHeight-h/6)
|
|
||||||
gfx.Fill()
|
|
||||||
gfx.BeginPath()
|
|
||||||
gfx.Rect(x+w-2,y+10,2,diffHeight-h/6)
|
|
||||||
gfx.Fill()
|
|
||||||
gfx.ResetScissor()
|
gfx.ResetScissor()
|
||||||
draw_cursor(x + w/2, y +diffHeight/2, timer * math.pi, diffHeight / 1.5)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
set_diff = function(oldDiff, newDiff)
|
set_diff = function(oldDiff, newDiff)
|
||||||
|
@ -450,7 +396,7 @@ function draw_rooms(y, h)
|
||||||
local ypos = y + (h/2) - offsetY;
|
local ypos = y + (h/2) - offsetY;
|
||||||
local status = room.current..'/'..room.max
|
local status = room.current..'/'..room.max
|
||||||
if room.ingame then
|
if room.ingame then
|
||||||
status = status..' (In Game)'
|
status = status..' (IN MATCH)'
|
||||||
end
|
end
|
||||||
if room.password then
|
if room.password then
|
||||||
status = status..' <P>'
|
status = status..' <P>'
|
||||||
|
@ -494,24 +440,33 @@ function render_lobby(deltaTime)
|
||||||
-- split is how the screen is split or not
|
-- split is how the screen is split or not
|
||||||
if portrait then
|
if portrait then
|
||||||
split = resX
|
split = resX
|
||||||
jacket_size = math.min(resX/3, resY/3);
|
jacket_size = math.min(resX/4, resY/4);
|
||||||
user_y_off = 375+jacket_size + 70
|
user_y_off = 800 - 70
|
||||||
song_x_off = 0;
|
song_x_off = 0;
|
||||||
else
|
else
|
||||||
split = resX/2
|
split = resX/2
|
||||||
jacket_size = math.min(resX/2, resY/2);
|
jacket_size = math.min(resX/2, resY/2);
|
||||||
user_y_off = 0
|
user_y_off = 70
|
||||||
song_x_off = 1/2*resX;
|
song_x_off = 1/2*resX;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
gfx.BeginPath();
|
||||||
|
local tw, th = gfx.ImageSize(tempbg)
|
||||||
|
gfx.ImageRect(0,0,tw,th,tempbg,1,0);
|
||||||
|
|
||||||
|
local jw , jh = gfx.ImageSize(M_jacket);
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.ImageRect(335, 1277, jw, jh, M_jacket,1,0);
|
||||||
|
|
||||||
|
gfx.LoadSkinFont('Digital-Serial-Bold.ttf')
|
||||||
gfx.FillColor(255,255,255)
|
gfx.FillColor(255,255,255)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER, gfx.TEXT_ALIGN_BOTTOM)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT, gfx.TEXT_ALIGN_LEFT)
|
||||||
gfx.FontSize(70)
|
gfx.FontSize(24)
|
||||||
gfx.Text(selected_room.name, resX/2, 50)
|
gfx.Text(selected_room.name, 575, 1174)
|
||||||
|
|
||||||
-- === Users ===
|
-- === Users === --
|
||||||
|
|
||||||
gfx.Text("Users", split/2, user_y_off+100)
|
-- gfx.Text("Users", split/2, user_y_off+100)
|
||||||
|
|
||||||
buttonY = user_y_off + 125 + userHeight/2
|
buttonY = user_y_off + 125 + userHeight/2
|
||||||
for i, user in ipairs(lobby_users) do
|
for i, user in ipairs(lobby_users) do
|
||||||
|
@ -530,32 +485,66 @@ function render_lobby(deltaTime)
|
||||||
end
|
end
|
||||||
buttonY = buttonY + userHeight
|
buttonY = buttonY + userHeight
|
||||||
end
|
end
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE);
|
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_LEFT);
|
||||||
gfx.FillColor(255,255,255)
|
gfx.FillColor(255,255,255)
|
||||||
|
|
||||||
|
|
||||||
-- === song select ===
|
-- === song select ===
|
||||||
|
|
||||||
gfx.FontSize(60)
|
-- gfx.FontSize(60)
|
||||||
gfx.Text("Selected Song:", split/2 + song_x_off, 100)
|
-- gfx.Text("Selected Song:", split/2 + song_x_off, 100)
|
||||||
gfx.FontSize(40)
|
gfx.FontSize(32)
|
||||||
if selected_song == nil then
|
if selected_song == nil then
|
||||||
if host == user_id then
|
if host == user_id then
|
||||||
gfx.Text("Select song:", split/2 + song_x_off, 175)
|
gfx.Text("NO SONG", 535, 1236)
|
||||||
|
gfx.Text("NO ARIST", 535, 1275)
|
||||||
|
gfx.FontSize(24)
|
||||||
|
gfx.Text("NO EFFECTOR", 744, 1378)
|
||||||
|
gfx.Text("NO ILLUSTRATOR", 744, 1406)
|
||||||
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
||||||
|
gfx.FontSize(22)
|
||||||
|
gfx.Text("BPM ?",777, 1307)
|
||||||
|
gfx.FontSize(32)
|
||||||
|
gfx.Text("BPM ?",76, 1788)
|
||||||
|
gfx.Text("LANE-SPEED ?",76, 1832)
|
||||||
else
|
else
|
||||||
if missing_song then
|
if missing_song then
|
||||||
gfx.Text("Missing song!!!!", split/2 + song_x_off, 175)
|
gfx.Text("MISSING SONG!!!!", 535, 1235)
|
||||||
|
gfx.Text("MISSING ARIST!!!!", 535, 1275)
|
||||||
|
gfx.FontSize(24)
|
||||||
|
gfx.Text("MISSING EFFECTOR!!!!", 744, 1378)
|
||||||
|
gfx.Text("MISSING ILLUSTRATOR!!!!", 744, 1406)
|
||||||
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
||||||
|
gfx.FontSize(22)
|
||||||
|
gfx.Text("BPM ?",777, 1307)
|
||||||
|
gfx.FontSize(32)
|
||||||
|
gfx.Text("BPM ?",76, 1788)
|
||||||
|
gfx.Text("LANE-SPEED ?",76, 1832)
|
||||||
else
|
else
|
||||||
gfx.Text("Host is selecting song", split/2 + song_x_off, 175)
|
gfx.Text("HOST IS SELECTING SONG", 535, 1235)
|
||||||
|
gfx.Text(" ", 535, 1275)
|
||||||
|
gfx.FontSize(24)
|
||||||
|
gfx.Text(" ", 744, 1378)
|
||||||
|
gfx.Text(" ", 744, 1406)
|
||||||
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
||||||
|
gfx.FontSize(22)
|
||||||
|
gfx.Text("BPM ?",777, 1307)
|
||||||
|
gfx.FontSize(32)
|
||||||
|
gfx.Text("BPM ?",76, 1788)
|
||||||
|
gfx.Text("LANE-SPEED ?",76, 1832)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if jacket == 0 then
|
if jacket == 0 then
|
||||||
jacket = placeholderJacket
|
jacket = placeholderJacket
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
gfx.Text(selected_song.title, split/2 + song_x_off, 175)
|
gfx.Text(selected_song.title, 535, 1236)
|
||||||
|
gfx.Text(selected_song.artist, 535, 1275)
|
||||||
|
gfx.FontSize(24)
|
||||||
|
gfx.Text(selected_song.effector, 744, 1377)
|
||||||
|
gfx.Text(selected_song.illustrator, 744, 1406)
|
||||||
|
gfx.FontSize(32)
|
||||||
draw_diffs(selected_song.all_difficulties, split/2 + song_x_off - 150, 200, 300, 100, selected_song.diff_index+1)
|
draw_diffs(selected_song.all_difficulties, split/2 + song_x_off - 150, 200, 300, 100, selected_song.diff_index+1)
|
||||||
|
|
||||||
if selected_song.jacket == nil or selected_song.jacket == placeholderJacket then
|
if selected_song.jacket == nil or selected_song.jacket == placeholderJacket then
|
||||||
selected_song.jacket = gfx.LoadImageJob(selected_song.jacketPath, placeholderJacket)
|
selected_song.jacket = gfx.LoadImageJob(selected_song.jacketPath, placeholderJacket)
|
||||||
jacket = selected_song.jacket
|
jacket = selected_song.jacket
|
||||||
|
@ -563,70 +552,68 @@ function render_lobby(deltaTime)
|
||||||
end
|
end
|
||||||
gfx.Save()
|
gfx.Save()
|
||||||
gfx.BeginPath()
|
gfx.BeginPath()
|
||||||
gfx.Translate(split/2 + song_x_off, 325+jacket_size/2)
|
gfx.Translate(481, 1303+jacket_size/2)
|
||||||
gfx.ImageRect(-jacket_size/2,-jacket_size/2,jacket_size,jacket_size,jacket,1,0)
|
gfx.ImageRect(-jacket_size/2,-jacket_size/2,jacket_size,jacket_size,jacket,1,0)
|
||||||
|
|
||||||
if mouse_clipped(split/2 + song_x_off-jacket_size/2, 325, jacket_size,jacket_size) and host == user_id then
|
if mouse_clipped(481-jacket_size/2,1423+-jacket_size/2,jacket_size,jacket_size) and host == user_id then
|
||||||
hovered = function()
|
hovered = function()
|
||||||
missing_song = false
|
missing_song = false
|
||||||
mpScreen.SelectSong()
|
mpScreen.SelectSong()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
gfx.Restore()
|
gfx.Restore()
|
||||||
if start_game_soon then
|
|
||||||
draw_button("Game starting...", split/2 + song_x_off, 375+jacket_size, 600, function() end);
|
|
||||||
else
|
|
||||||
if host == user_id then
|
|
||||||
if selected_song == nil or not selected_song.self_picked then
|
|
||||||
draw_button_color("Select song", split/2 + song_x_off, 375+jacket_size, 600, function()
|
|
||||||
missing_song = false
|
|
||||||
mpScreen.SelectSong()
|
|
||||||
end, 0, math.min(255, 128 + math.floor(32 * math.cos(timer * math.pi))), 0, 0,128,255);
|
|
||||||
elseif user_ready and all_ready then
|
|
||||||
draw_button("Start game", split/2 + song_x_off, 375+jacket_size, 600, start_game)
|
|
||||||
elseif user_ready and not all_ready then
|
|
||||||
draw_button("Waiting for others", split/2 + song_x_off, 375+jacket_size, 600, function()
|
|
||||||
missing_song = false
|
|
||||||
mpScreen.SelectSong()
|
|
||||||
end)
|
|
||||||
else
|
|
||||||
draw_button("Ready", split/2 + song_x_off, 375+jacket_size, 600, ready_up);
|
|
||||||
end
|
|
||||||
elseif host == nil then
|
|
||||||
draw_button("Waiting for game to end", split/2 + song_x_off, 375+jacket_size, 600, function() end);
|
|
||||||
elseif missing_song then
|
|
||||||
draw_button("Missing Song!", split/2 + song_x_off, 375+jacket_size, 600, function() end);
|
|
||||||
elseif selected_song ~= nil then
|
|
||||||
if user_ready then
|
|
||||||
draw_button("Cancel", split/2 + song_x_off, 375+jacket_size, 600, ready_up);
|
|
||||||
else
|
|
||||||
draw_button("Ready", split/2 + song_x_off, 375+jacket_size, 600, ready_up);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
draw_button("Waiting for host", split/2 + song_x_off, 375+jacket_size, 600, function() end);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
draw_checkbox("Excessive", split/2 + song_x_off - 150, 375+jacket_size + 70, toggle_hard, hard_mode, not start_game_soon)
|
local check = 770
|
||||||
draw_checkbox("Mirror", split/2 + song_x_off, 375+jacket_size + 70, 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 Host", split/2 + song_x_off + 150 + 20, 375+jacket_size + 70, 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)
|
||||||
|
|
||||||
if selected_song ~= nil then
|
if selected_song ~= nil then
|
||||||
gfx.FillColor(255,255,255)
|
gfx.FillColor(255,255,255)
|
||||||
gfx.FontSize(20);
|
gfx.FontSize(32);
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_TOP)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
||||||
|
|
||||||
if selected_song.min_bpm ~= selected_song.max_bpm then
|
if selected_song.min_bpm ~= selected_song.max_bpm then
|
||||||
gfx.Text(string.format("BPM: %.0f-%.0f, Start BPM: %.0f, Hispeed: %.0f x %.1f = %.0f",
|
|
||||||
selected_song.min_bpm, selected_song.max_bpm, selected_song.start_bpm,
|
gfx.Text("BPM",76, 1788)
|
||||||
selected_song.speed_bpm, selected_song.hispeed, selected_song.speed_bpm * selected_song.hispeed),
|
gfx.Text(string.format("%.0f - %.0f",
|
||||||
split/2 + song_x_off, 375+jacket_size + 70 + 30)
|
selected_song.min_bpm, selected_song.max_bpm),
|
||||||
|
76 + 75, 1788)
|
||||||
|
|
||||||
|
gfx.Text("LANE-SPEED",76, 1832)
|
||||||
|
gfx.Text(string.format("%.2f = %.0f",
|
||||||
|
selected_song.hispeed, selected_song.speed_bpm * selected_song.hispeed),
|
||||||
|
76 + 175, 1832)
|
||||||
|
|
||||||
|
gfx.FontSize(22);
|
||||||
|
gfx.Text("BPM",777, 1307)
|
||||||
|
gfx.FontSize(26);
|
||||||
|
gfx.Text(string.format("%.0f - %.0f",
|
||||||
|
selected_song.min_bpm, selected_song.max_bpm),
|
||||||
|
787 + 75, 1307)
|
||||||
|
|
||||||
else
|
else
|
||||||
gfx.Text(string.format("BPM: %.0f, Hispeed: %.0f x %.1f = %.0f",
|
|
||||||
selected_song.min_bpm,
|
gfx.FontSize(32);
|
||||||
selected_song.speed_bpm, selected_song.hispeed, selected_song.speed_bpm * selected_song.hispeed),
|
gfx.Text("BPM",76, 1788)
|
||||||
split/2 + song_x_off, 375+jacket_size + 70 + 30)
|
gfx.Text(string.format("%.0f",
|
||||||
|
selected_song.min_bpm),
|
||||||
|
76 + 75, 1788)
|
||||||
|
|
||||||
|
gfx.Text("LANE-SPEED",76, 1832)
|
||||||
|
gfx.Text(string.format("%.2f = %.0f",
|
||||||
|
selected_song.hispeed, selected_song.speed_bpm * selected_song.hispeed),
|
||||||
|
76 + 175, 1832)
|
||||||
|
|
||||||
|
gfx.FontSize(22);
|
||||||
|
gfx.Text("BPM",777, 1307)
|
||||||
|
gfx.FontSize(26);
|
||||||
|
gfx.Text(string.format("%.0f",
|
||||||
|
selected_song.min_bpm),
|
||||||
|
787 + 75, 1307)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -699,19 +686,18 @@ function render_new_room_password(delta_time)
|
||||||
gfx.Text(string.rep("*",#textInput.text), resX/2, resY/2+40)
|
gfx.Text(string.rep("*",#textInput.text), resX/2, resY/2+40)
|
||||||
draw_button("Create Room", resX/2, resY*3/4, resX/2, mpScreen.NewRoomStep);
|
draw_button("Create Room", resX/2, resY*3/4, resX/2, mpScreen.NewRoomStep);
|
||||||
end
|
end
|
||||||
|
--here
|
||||||
function render_new_room_name(deltaTime)
|
function render_new_room_name(deltaTime)
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.LoadSkinFont("segoeui.ttf")
|
||||||
gfx.FillColor(255,255,255)
|
gfx.FillColor(255,255,255)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER, gfx.TEXT_ALIGN_BOTTOM)
|
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER, gfx.TEXT_ALIGN_BOTTOM)
|
||||||
gfx.FontSize(70)
|
gfx.FontSize(70)
|
||||||
gfx.Text("Create New Room", resX/2, resY/4)
|
gfx.Text("Create New Room", resX/2, resY/4)
|
||||||
|
|
||||||
gfx.FillColor(50,50,50)
|
|
||||||
gfx.BeginPath()
|
|
||||||
gfx.Rect(0, resY/2-10, resX, 60)
|
gfx.Rect(0, resY/2-10, resX, 60)
|
||||||
gfx.Fill();
|
|
||||||
|
|
||||||
gfx.FillColor(255,255,255)
|
|
||||||
gfx.Text("Please enter room name:", resX/2, resY/2-40)
|
gfx.Text("Please enter room name:", resX/2, resY/2-40)
|
||||||
gfx.Text(textInput.text, resX/2, resY/2+40)
|
gfx.Text(textInput.text, resX/2, resY/2+40)
|
||||||
draw_button("Next", resX/2, resY*3/4, resX/2, mpScreen.NewRoomStep);
|
draw_button("Next", resX/2, resY*3/4, resX/2, mpScreen.NewRoomStep);
|
||||||
|
@ -744,6 +730,9 @@ render = function(deltaTime)
|
||||||
mposx,mposy = game.GetMousePos();
|
mposx,mposy = game.GetMousePos();
|
||||||
portrait = resY > resX
|
portrait = resY > resX
|
||||||
|
|
||||||
|
Background.draw(deltaTime);
|
||||||
|
|
||||||
|
|
||||||
common.stopMusic();
|
common.stopMusic();
|
||||||
|
|
||||||
doffset = doffset * 0.9
|
doffset = doffset * 0.9
|
||||||
|
|
|
@ -46,7 +46,7 @@ local defaultJacketImage = gfx.CreateSkinImage("result/default_jacket.png", 0);
|
||||||
local bestScoreBadgeImage = gfx.CreateSkinImage("result/best.png", 0);
|
local bestScoreBadgeImage = gfx.CreateSkinImage("result/best.png", 0);
|
||||||
|
|
||||||
local appealCardImage = gfx.CreateSkinImage("crew/appeal_card.png", 0);
|
local appealCardImage = gfx.CreateSkinImage("crew/appeal_card.png", 0);
|
||||||
local danBadgeImage = gfx.CreateSkinImage("dan/inf.png", 0);
|
local danBadgeImage = gfx.CreateSkinImage("dan.png", 0);
|
||||||
|
|
||||||
local badgeLines = gfx.CreateSkinImage("result/badge_lines.png", 0);
|
local badgeLines = gfx.CreateSkinImage("result/badge_lines.png", 0);
|
||||||
local badgeGrade = gfx.CreateSkinImage("result/badge_gradient.png", 0);
|
local badgeGrade = gfx.CreateSkinImage("result/badge_gradient.png", 0);
|
||||||
|
@ -267,29 +267,61 @@ local drawRightPanel = function()
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
local tw, th = gfx.ImageSize(rightPanelImage);
|
local tw, th = gfx.ImageSize(rightPanelImage);
|
||||||
gfx.ImageRect(rightPanelX, rightPanelY, tw, th, rightPanelImage, 1, 0);
|
gfx.ImageRect(rightPanelX, rightPanelY, tw, th, rightPanelImage, 1, 0);
|
||||||
|
--[[
|
||||||
|
gfx.FontSize(19.5)
|
||||||
|
if result.speedModType == 2 then
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
local tw2, th2 = gfx.ImageSize(irpanelsB);
|
local tw2, th2 = gfx.ImageSize(irpanelsB);
|
||||||
gfx.ImageRect(1080 - 531, rightPanelY - (130+15), tw2*0.85, th2*0.8, irpanelsO, 1, 0);
|
gfx.ImageRect(1080 - 531, rightPanelY - 35 - (130+15), tw2*0.85, th2*0.8, irpanelsO, 1, 0);
|
||||||
-- my Score and something
|
-- my Score and something
|
||||||
gfx.FillColor(0,0,0,255)
|
gfx.FillColor(0,0,0,255)
|
||||||
gfx.Text("LABEL", 1080 - 515, rightPanelY - 130);
|
gfx.FontSize(19)
|
||||||
gfx.FillColor(255,255,255,255)
|
gfx.Text("NEW NATIONAL SCORE!", 1080 - 515, rightPanelY - 35 - 130);
|
||||||
|
gfx.FillColor(255,255,255,255)
|
||||||
|
gfx.FontSize(20)
|
||||||
-- my score
|
-- my score
|
||||||
gfx.Text("00000000", 1080 - 485, rightPanelY - 98);
|
gfx.Text("00000000", 1080 - 485, rightPanelY - 35 - 98);
|
||||||
-- best score
|
-- best score
|
||||||
gfx.Text("10000000", 1080 - 325, rightPanelY - 98);
|
gfx.Text("10000000", 1080 - 325, rightPanelY - 35 - 98);
|
||||||
gfx.Text("IR LABEL", 1080 - 205, rightPanelY - 98);
|
gfx.FontSize(19)
|
||||||
|
gfx.Text("NEW SCORE!", 1080 - 205, rightPanelY - 35 - 98);
|
||||||
-- my Score and something
|
-- my Score and something
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
gfx.ImageRect(1080 - 531, rightPanelY - (60+15), tw2*0.85, th2*0.8, irpanelsB, 1, 0);
|
gfx.ImageRect(1080 - 531, rightPanelY - 35 - (60+15), tw2*0.85, th2*0.8, irpanelsB, 1, 0);
|
||||||
gfx.FillColor(0,0,0,255)
|
gfx.FillColor(0,0,0,255)
|
||||||
gfx.Text("LABEL", 1080 - 515, rightPanelY - 60);
|
gfx.Text("NEW LOCATION SCORE!", 1080 - 515, rightPanelY - 35 - 60);
|
||||||
gfx.FillColor(255,255,255,255)
|
gfx.FillColor(255,255,255,255)
|
||||||
-- my score
|
-- my score
|
||||||
gfx.Text("00000000", 1080 - 485, rightPanelY - 28);
|
gfx.Text("00000000", 1080 - 485, rightPanelY - 35 - 28);
|
||||||
-- best score
|
-- best score
|
||||||
gfx.Text("10000000", 1080 - 325, rightPanelY - 28);
|
gfx.Text("10000000", 1080 - 325, rightPanelY - 35 - 28);
|
||||||
gfx.Text("IR LABEL", 1080 - 205, rightPanelY - 28);
|
gfx.Text("NEW SCORE!", 1080 - 205, rightPanelY - 35 - 28);
|
||||||
|
else
|
||||||
|
gfx.BeginPath();
|
||||||
|
local tw2, th2 = gfx.ImageSize(irpanelsB);
|
||||||
|
gfx.ImageRect(1080 - 531, rightPanelY - (130+15), tw2*0.85, th2*0.8, irpanelsO, 1, 0);
|
||||||
|
-- my Score and something
|
||||||
|
gfx.FillColor(0,0,0,255)
|
||||||
|
gfx.Text("NEW NATIONAL SCORE!", 1080 - 515, rightPanelY - 130);
|
||||||
|
gfx.FillColor(255,255,255,255)
|
||||||
|
-- my score
|
||||||
|
gfx.Text("00000000", 1080 - 485, rightPanelY - 98);
|
||||||
|
-- best score
|
||||||
|
gfx.Text("10000000", 1080 - 325, rightPanelY - 98);
|
||||||
|
gfx.Text("NEW SCORE!", 1080 - 205, rightPanelY - 98);
|
||||||
|
-- my Score and something
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.ImageRect(1080 - 531, rightPanelY - (60+15), tw2*0.85, th2*0.8, irpanelsB, 1, 0);
|
||||||
|
gfx.FillColor(0,0,0,255)
|
||||||
|
gfx.Text("NEW LOCATION SCORE!", 1080 - 515, rightPanelY - 60);
|
||||||
|
gfx.FillColor(255,255,255,255)
|
||||||
|
-- my score
|
||||||
|
gfx.Text("00000000", 1080 - 485, rightPanelY - 28);
|
||||||
|
-- best score
|
||||||
|
gfx.Text("10000000", 1080 - 325, rightPanelY - 28);
|
||||||
|
gfx.Text("NEW SCORE!", 1080 - 205, rightPanelY - 28);
|
||||||
|
end
|
||||||
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
local scoreNumber = Numbers.load_number_image("score_num");
|
local scoreNumber = Numbers.load_number_image("score_num");
|
||||||
|
@ -532,7 +564,6 @@ end
|
||||||
local drawBottomPanel = function()
|
local drawBottomPanel = function()
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
local tw, th = gfx.ImageSize(bottomPanelImage);
|
local tw, th = gfx.ImageSize(bottomPanelImage);
|
||||||
|
|
||||||
gfx.ImageRect(bottomPanelX, bottomPanelY, tw, th, bottomPanelImage, 1, 0);
|
gfx.ImageRect(bottomPanelX, bottomPanelY, tw, th, bottomPanelImage, 1, 0);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -565,7 +596,9 @@ local drawBottomPanelContent = function(deltatime)
|
||||||
gfx.Text(irText, bottomPanelX + 80, bottomPanelY + 461);
|
gfx.Text(irText, bottomPanelX + 80, bottomPanelY + 461);
|
||||||
|
|
||||||
-- Draw Performance maybe
|
-- Draw Performance maybe
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.Rect(bottomPanelX + 580, bottomPanelY + 421, 50, 109);
|
||||||
|
gfx.Fill();
|
||||||
end
|
end
|
||||||
|
|
||||||
local drawJacketPanel = function()
|
local drawJacketPanel = function()
|
||||||
|
|
|
@ -318,7 +318,7 @@ function drawSong(song, y)
|
||||||
gfx.BeginPath()
|
gfx.BeginPath()
|
||||||
Numbers.draw_number(songX+30, y+125, 1.0, selectedSongDifficulty.level, 2, difficultyNumbers, false, 0.65, 1)
|
Numbers.draw_number(songX+30, y+125, 1.0, selectedSongDifficulty.level, 2, difficultyNumbers, false, 0.65, 1)
|
||||||
|
|
||||||
-- Draw song title
|
-- Draw song title
|
||||||
gfx.FontSize(24)
|
gfx.FontSize(24)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
||||||
gfx.Text(song.title, songX+90, y+155);
|
gfx.Text(song.title, songX+90, y+155);
|
||||||
|
@ -443,6 +443,16 @@ function drawData() -- Draws the song data on the left panel
|
||||||
gfx.ImageRect(425, 724, 93/1.1, 81/1.1, badgeImage, badgeAlpha, 0)
|
gfx.ImageRect(425, 724, 93/1.1, 81/1.1, badgeImage, badgeAlpha, 0)
|
||||||
|
|
||||||
gfx.Restore()
|
gfx.Restore()
|
||||||
|
|
||||||
|
local hiScore = diff.scores[1];
|
||||||
|
|
||||||
|
|
||||||
|
gfx.LoadSkinFont('Digital-Serial-Bold.ttf')
|
||||||
|
gfx.FontSize(21)
|
||||||
|
gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE)
|
||||||
|
local gaugePct = (hiScore and hiScore.gauge*100 or nil)
|
||||||
|
local percentText = gaugePct and string.format("%.1f", gaugePct) or " "
|
||||||
|
gfx.Text(percentText.." %", 335, 838)
|
||||||
|
|
||||||
-- Draw BPM
|
-- Draw BPM
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
|
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
Loading…
Reference in New Issue