arround 50% done of what i planned
This commit is contained in:
parent
40a0e852d4
commit
f71f57ecec
|
@ -54,7 +54,7 @@ local drawFooter = function ()
|
||||||
gfx.FontSize(20)
|
gfx.FontSize(20)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_TOP)
|
||||||
gfx.FillColor(255, 255, 255, 255);
|
gfx.FillColor(255, 255, 255, 255);
|
||||||
gfx.Text('EXPERIMENTALGEAR ' .. version.MAJOR .. '.' .. version.MINOR .. '.' .. version.PATCH .. ' - CLOSED BETA. DO. NOT. LEAK.', 8, 1895);
|
gfx.Text('EXPERIMENTALGEAR ' .. version.MAJOR .. '.' .. version.MINOR .. '.' .. version.PATCH .. " < Dev Build RealFD Branch >", 8, 1895);
|
||||||
end
|
end
|
||||||
|
|
||||||
local progressTransitions = function (deltaTime)
|
local progressTransitions = function (deltaTime)
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
local ScrollScale = 0
|
||||||
|
local ScrollOffsetX = 0
|
||||||
|
|
||||||
|
function textmaker(text, fontsize, maxWidth, x, y, w, h, scissorX, scissorY, debugX, debugY,deltaTime)
|
||||||
|
gfx.FontSize(fontsize)
|
||||||
|
local x1,y1,x2,y2 = gfx.TextBounds(x,y, text)
|
||||||
|
gfx.FillColor(255,0,0) --*
|
||||||
|
-- gfx.Text((x2-x1).." Box",x+debugX,y+debugY/1.5) --*
|
||||||
|
|
||||||
|
|
||||||
|
gfx.Scissor(x,y + scissorY,w,h)
|
||||||
|
gfx.FillColor(255,255,255)
|
||||||
|
if (x2-x1) < maxWidth then
|
||||||
|
gfx.Text(text,x,y)
|
||||||
|
else
|
||||||
|
gfx.Text(text,x-ScrollScale,y)
|
||||||
|
gfx.FillColor(255,255,0)
|
||||||
|
gfx.Text(ScrollScale,x,y-25)
|
||||||
|
end
|
||||||
|
gfx.ResetScissor()
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function tickScroll(deltaTime)
|
||||||
|
if ScrollScale < 630 then
|
||||||
|
ScrollScale = ScrollScale + deltaTime *100 -- transition should last for that time in seconds
|
||||||
|
else
|
||||||
|
ScrollScale = -422
|
||||||
|
end
|
||||||
|
ScrollOffsetX = 1000 * (1-ScrollScale);
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
textmaker = textmaker,
|
||||||
|
tickScroll = tickScroll
|
||||||
|
}
|
||||||
|
|
||||||
|
-- * = debug things
|
|
@ -182,6 +182,7 @@ draw_checkbox = function(text, x, y, hoverindex, current, can_click)
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
local Player = 0
|
||||||
local userHeight = 100
|
local userHeight = 100
|
||||||
--look into user changing -- IMPORTANT !!!
|
--look into user changing -- IMPORTANT !!!
|
||||||
draw_user = function(user, x, y, buttonWidth, rank)
|
draw_user = function(user, x, y, buttonWidth, rank)
|
||||||
|
@ -189,6 +190,7 @@ draw_user = function(user, x, y, buttonWidth, rank)
|
||||||
-- local y = 100
|
-- 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.Rect(rx - buttonBorder,
|
gfx.Rect(rx - buttonBorder,
|
||||||
ty - buttonBorder,
|
ty - buttonBorder,
|
||||||
|
@ -196,8 +198,7 @@ draw_user = function(user, x, y, buttonWidth, rank)
|
||||||
buttonHeight + (buttonBorder * 2));
|
buttonHeight + (buttonBorder * 2));
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
if host == user.id then
|
if host == user.id then
|
||||||
local y = 100
|
gfx.FillColor(0,0,40);
|
||||||
|
|
||||||
else
|
else
|
||||||
gfx.FillColor(0,0,40);
|
gfx.FillColor(0,0,40);
|
||||||
end
|
end
|
||||||
|
@ -218,11 +219,14 @@ draw_user = function(user, x, y, buttonWidth, rank)
|
||||||
name = name..' (ready)'
|
name = name..' (ready)'
|
||||||
end
|
end
|
||||||
if user.score ~= nil then
|
if user.score ~= nil then
|
||||||
name = '#'..rank..' '..name
|
name = '#'..rank..' '..name.." "
|
||||||
end
|
end
|
||||||
first_y = y - 28
|
first_y = y - 28
|
||||||
second_y = y + 28
|
second_y = y + 28
|
||||||
gfx.Text(name, x - buttonWidth/2 + 5, first_y);
|
gfx.Text(name, x - buttonWidth/2 + 5, first_y);
|
||||||
|
|
||||||
|
gfx.Text(Player, split/2, buttonY, split*3/4)
|
||||||
|
|
||||||
if user.score ~= nil then
|
if user.score ~= nil then
|
||||||
gfx.FillColor(255,255,0)
|
gfx.FillColor(255,255,0)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE);
|
gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE);
|
||||||
|
@ -259,7 +263,8 @@ draw_user = function(user, x, y, buttonWidth, rank)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE);
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE);
|
||||||
local level_text = 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()
|
||||||
|
@ -488,10 +493,6 @@ function render_lobby(deltaTime)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_LEFT);
|
gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_LEFT);
|
||||||
gfx.FillColor(255,255,255)
|
gfx.FillColor(255,255,255)
|
||||||
|
|
||||||
-- === song select ===
|
|
||||||
|
|
||||||
-- gfx.FontSize(60)
|
|
||||||
-- gfx.Text("Selected Song:", split/2 + song_x_off, 100)
|
|
||||||
gfx.FontSize(32)
|
gfx.FontSize(32)
|
||||||
if selected_song == nil then
|
if selected_song == nil then
|
||||||
if host == user_id then
|
if host == user_id then
|
||||||
|
@ -960,6 +961,12 @@ Tcp.SetTopicHandler("room.update", function(data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---THIS
|
||||||
|
local b = 1
|
||||||
|
for b, user in pairs(lobby_users) do
|
||||||
|
Player = Player+1
|
||||||
|
end
|
||||||
|
|
||||||
if user_id == host and #data.users > 1 and all_ready and not prev_all_ready then
|
if user_id == host and #data.users > 1 and all_ready and not prev_all_ready then
|
||||||
repeat_sound("click-02", 3, .1)
|
repeat_sound("click-02", 3, .1)
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,6 +4,8 @@ local Background = require('components.background')
|
||||||
local common = require('common.common')
|
local common = require('common.common')
|
||||||
local Numbers = require('common.numbers')
|
local Numbers = require('common.numbers')
|
||||||
|
|
||||||
|
local newtext = require("components.textscrambler")
|
||||||
|
|
||||||
local VolforceCalc = require('components.volforceCalc')
|
local VolforceCalc = require('components.volforceCalc')
|
||||||
|
|
||||||
local backgroundImage = gfx.CreateSkinImage("bg_pattern.png", gfx.IMAGE_REPEATX | gfx.IMAGE_REPEATY)
|
local backgroundImage = gfx.CreateSkinImage("bg_pattern.png", gfx.IMAGE_REPEATX | gfx.IMAGE_REPEATY)
|
||||||
|
@ -319,9 +321,13 @@ function drawSong(song, y)
|
||||||
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);
|
newtext.textmaker(song.title,35.35,421.5,songX+90,y+155,417,100,nil,-10,
|
||||||
|
95, -- debug remove later
|
||||||
|
-60,
|
||||||
|
1
|
||||||
|
)
|
||||||
|
|
||||||
-- Draw score badge
|
-- Draw score badge
|
||||||
local badgeImage = badgeImages[1];
|
local badgeImage = badgeImages[1];
|
||||||
|
@ -456,22 +462,34 @@ function drawData() -- Draws the song data on the left panel
|
||||||
|
|
||||||
-- Draw BPM
|
-- Draw BPM
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
gfx.FontSize(24)
|
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
||||||
gfx.Save()
|
gfx.Save()
|
||||||
gfx.LoadSkinFont('Digital-Serial-Bold.ttf')
|
gfx.LoadSkinFont('Digital-Serial-Bold.ttf')
|
||||||
gfx.GlobalAlpha(transitionAfterscrollDataOverlayAlpha) -- TODO: split this out
|
gfx.GlobalAlpha(transitionAfterscrollDataOverlayAlpha) -- TODO: split this out
|
||||||
gfx.Text(song.bpm, 85, 920);
|
newtext.textmaker(song.bpm,24,110,85,920,99,110,nil,-10,
|
||||||
|
200, -- debug remove later
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
)
|
||||||
gfx.Restore()
|
gfx.Restore()
|
||||||
|
|
||||||
-- Draw song title
|
-- Draw song title
|
||||||
gfx.FontSize(28)
|
|
||||||
gfx.GlobalAlpha(transitionAfterscrollTextSongTitle);
|
gfx.GlobalAlpha(transitionAfterscrollTextSongTitle);
|
||||||
gfx.Text(song.title, 30+(1-transitionAfterscrollTextSongTitle)*20, 955);
|
newtext.textmaker(song.title,28,495.5,30+(1-transitionAfterscrollTextSongTitle)*20,955,495,100,nil,-10,
|
||||||
|
95, -- debug remove later
|
||||||
|
-60,
|
||||||
|
1
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
-- Draw artist
|
-- Draw artist
|
||||||
gfx.GlobalAlpha(transitionAfterscrollTextSongArtist);
|
gfx.GlobalAlpha(transitionAfterscrollTextSongArtist);
|
||||||
gfx.Text(song.artist, 30+(1-transitionAfterscrollTextSongArtist)*30, 997);
|
newtext.textmaker(song.artist,28,495.5,30+(1-transitionAfterscrollTextSongArtist)*30,997,495,100,nil,-10,
|
||||||
|
95, -- debug remove later
|
||||||
|
-60,
|
||||||
|
1
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
gfx.GlobalAlpha(1);
|
gfx.GlobalAlpha(1);
|
||||||
|
|
||||||
|
@ -507,11 +525,19 @@ function drawData() -- Draws the song data on the left panel
|
||||||
drawLocalLeaderboard(diff)
|
drawLocalLeaderboard(diff)
|
||||||
drawIrLeaderboard()
|
drawIrLeaderboard()
|
||||||
|
|
||||||
gfx.FontSize(22)
|
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
||||||
gfx.GlobalAlpha(transitionAfterscrollDataOverlayAlpha);
|
gfx.GlobalAlpha(transitionAfterscrollDataOverlayAlpha);
|
||||||
gfx.Text(diff.effector, 270, 1180); -- effected by
|
newtext.textmaker(diff.effector,22,236.5,270+(1-transitionAfterscrollDataOverlayAlpha)*20,1180,236,100,nil,-10,
|
||||||
gfx.Text(diff.illustrator, 270, 1210); -- illustrated by
|
95, -- debug remove later
|
||||||
|
-60,
|
||||||
|
1
|
||||||
|
)
|
||||||
|
newtext.textmaker(diff.illustrator,22,236.5,270+(1-transitionAfterscrollDataOverlayAlpha)*30,1210,236,100,nil,-10,
|
||||||
|
95, -- debug remove later
|
||||||
|
-60,
|
||||||
|
1
|
||||||
|
)
|
||||||
gfx.GlobalAlpha(1);
|
gfx.GlobalAlpha(1);
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -953,6 +979,7 @@ end
|
||||||
|
|
||||||
render = function (deltaTime)
|
render = function (deltaTime)
|
||||||
tickTransitions(deltaTime);
|
tickTransitions(deltaTime);
|
||||||
|
tickScroll(deltaTime);
|
||||||
|
|
||||||
game.SetSkinSetting('_currentScreen', 'songwheel')
|
game.SetSkinSetting('_currentScreen', 'songwheel')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue