+ finish filterwheel leave transition & + placeholders for perm and blast cursors
This commit is contained in:
parent
32f201784d
commit
900e368a91
|
@ -3,13 +3,14 @@ local Easing = require('common.easings');
|
||||||
local SongSelectHeader = require('components.headers.songSelectHeader')
|
local SongSelectHeader = require('components.headers.songSelectHeader')
|
||||||
local Footer = require('components.footer');
|
local Footer = require('components.footer');
|
||||||
|
|
||||||
local defaultFolderBgImage = gfx.CreateSkinImage('song_select/filter_wheel/bg.png', 0)
|
local defaultFolderBgImage = gfx.CreateSkinImage(
|
||||||
|
'song_select/filter_wheel/bg.png', 0)
|
||||||
|
|
||||||
local cursorImages = {
|
local cursorImages = {
|
||||||
gfx.CreateSkinImage("song_select/cursor.png", 1), -- Effective rate or fallback
|
gfx.CreateSkinImage("song_select/cursor.png", 1), -- Effective rate or fallback
|
||||||
gfx.CreateSkinImage("song_select/cursor_exc.png", 1), -- Excessive rate
|
gfx.CreateSkinImage("song_select/cursor_exc.png", 1), -- Excessive rate
|
||||||
gfx.CreateSkinImage("song_select/cursor_exc.png", 1), -- TODO: premissive rate
|
gfx.CreateSkinImage("song_select/cursor_exc.png", 1), -- TODO: premissive rate
|
||||||
gfx.CreateSkinImage("song_select/cursor_exc.png", 1), -- TODO: blastive rate
|
gfx.CreateSkinImage("song_select/cursor_exc.png", 1) -- TODO: blastive rate
|
||||||
}
|
}
|
||||||
|
|
||||||
local ITEM_HEIGHT = 172;
|
local ITEM_HEIGHT = 172;
|
||||||
|
@ -17,27 +18,20 @@ local ITEM_HEIGHT = 172;
|
||||||
local specialFolders = {
|
local specialFolders = {
|
||||||
{
|
{
|
||||||
keys = {
|
keys = {
|
||||||
'SOUND VOLTEX BOOTH',
|
'SOUND VOLTEX BOOTH', 'SDVX BOOTH', 'SOUND VOLTEX I', 'SDVX I',
|
||||||
'SDVX BOOTH',
|
'SOUND VOLTEX 1', 'SDVX 1'
|
||||||
'SOUND VOLTEX I',
|
|
||||||
'SDVX I',
|
|
||||||
'SOUND VOLTEX 1',
|
|
||||||
'SDVX 1'
|
|
||||||
},
|
},
|
||||||
folderBg = gfx.CreateSkinImage('song_select/filter_wheel/special_folder_bgs/Booth.png', 0)
|
folderBg = gfx.CreateSkinImage(
|
||||||
},
|
'song_select/filter_wheel/special_folder_bgs/Booth.png', 0)
|
||||||
{
|
}, {
|
||||||
keys = {
|
keys = {
|
||||||
'SOUND VOLTEX INFINITE INFECTION',
|
'SOUND VOLTEX INFINITE INFECTION', 'SDVX INFINITE INFECTION',
|
||||||
'SDVX INFINITE INFECTION',
|
'SOUND VOLTEX II', 'SDVX II', 'SOUND VOLTEX 2', 'SDVX 2'
|
||||||
'SOUND VOLTEX II',
|
|
||||||
'SDVX II',
|
|
||||||
'SOUND VOLTEX 2',
|
|
||||||
'SDVX 2'
|
|
||||||
},
|
},
|
||||||
folderBg = gfx.CreateSkinImage('song_select/filter_wheel/special_folder_bgs/Infinite Infection.png', 0)
|
folderBg = gfx.CreateSkinImage(
|
||||||
},
|
'song_select/filter_wheel/special_folder_bgs/Infinite Infection.png',
|
||||||
-- {
|
0)
|
||||||
|
}, -- {
|
||||||
-- keys = {
|
-- keys = {
|
||||||
-- 'SOUND VOLTEX GRAVITY WARS',
|
-- 'SOUND VOLTEX GRAVITY WARS',
|
||||||
-- 'SDVX GRAVITY WARS',
|
-- 'SDVX GRAVITY WARS',
|
||||||
|
@ -50,37 +44,26 @@ local specialFolders = {
|
||||||
-- },
|
-- },
|
||||||
{
|
{
|
||||||
keys = {
|
keys = {
|
||||||
'SOUND VOLTEX HEAVENLY HAVEN',
|
'SOUND VOLTEX HEAVENLY HAVEN', 'SDVX HEAVENLY HAVEN',
|
||||||
'SDVX HEAVENLY HAVEN',
|
'SOUND VOLTEX IV', 'SDVX IV', 'SOUND VOLTEX 4', 'SDVX 4'
|
||||||
'SOUND VOLTEX IV',
|
|
||||||
'SDVX IV',
|
|
||||||
'SOUND VOLTEX 4',
|
|
||||||
'SDVX 4'
|
|
||||||
},
|
},
|
||||||
folderBg = gfx.CreateSkinImage('song_select/filter_wheel/special_folder_bgs/Heavenly Haven.png', 0)
|
folderBg = gfx.CreateSkinImage(
|
||||||
},
|
'song_select/filter_wheel/special_folder_bgs/Heavenly Haven.png', 0)
|
||||||
{
|
}, {
|
||||||
keys = {
|
keys = {
|
||||||
'SOUND VOLTEX VIVID WAVE',
|
'SOUND VOLTEX VIVID WAVE', 'SDVX VIVID WAVE', 'SOUND VOLTEX V',
|
||||||
'SDVX VIVID WAVE',
|
'SDVX V', 'SOUND VOLTEX 5', 'SDVX 5'
|
||||||
'SOUND VOLTEX V',
|
|
||||||
'SDVX V',
|
|
||||||
'SOUND VOLTEX 5',
|
|
||||||
'SDVX 5'
|
|
||||||
},
|
},
|
||||||
folderBg = gfx.CreateSkinImage('song_select/filter_wheel/special_folder_bgs/Vivid Wave.png', 0)
|
folderBg = gfx.CreateSkinImage(
|
||||||
},
|
'song_select/filter_wheel/special_folder_bgs/Vivid Wave.png', 0)
|
||||||
{
|
}, {
|
||||||
keys = {
|
keys = {
|
||||||
'SOUND VOLTEX EXCEED GEAR',
|
'SOUND VOLTEX EXCEED GEAR', 'SDVX EXCEED GEAR', 'SOUND VOLTEX VI',
|
||||||
'SDVX EXCEED GEAR',
|
'SDVX VI', 'SOUND VOLTEX 6', 'SDVX 6'
|
||||||
'SOUND VOLTEX VI',
|
|
||||||
'SDVX VI',
|
|
||||||
'SOUND VOLTEX 6',
|
|
||||||
'SDVX 6'
|
|
||||||
},
|
|
||||||
folderBg = gfx.CreateSkinImage('song_select/filter_wheel/special_folder_bgs/Exceed Gear.png', 0)
|
|
||||||
},
|
},
|
||||||
|
folderBg = gfx.CreateSkinImage(
|
||||||
|
'song_select/filter_wheel/special_folder_bgs/Exceed Gear.png', 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- AUDIO
|
-- AUDIO
|
||||||
|
@ -98,6 +81,7 @@ local transitionScrollScale = 0;
|
||||||
local transitionScrollOffsetY = 0;
|
local transitionScrollOffsetY = 0;
|
||||||
local scrollingUp = false;
|
local scrollingUp = false;
|
||||||
|
|
||||||
|
local transitionEnterReverse = false;
|
||||||
local transitionEnterScale = 0;
|
local transitionEnterScale = 0;
|
||||||
local transitionEnterOffsetY = 0;
|
local transitionEnterOffsetY = 0;
|
||||||
|
|
||||||
|
@ -156,7 +140,7 @@ function getFolderData(folderLabel)
|
||||||
type = folderType,
|
type = folderType,
|
||||||
label = folderLabel,
|
label = folderLabel,
|
||||||
bgImage = folderBgImage,
|
bgImage = folderBgImage,
|
||||||
isSpecial = isSpecial,
|
isSpecial = isSpecial
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -194,25 +178,24 @@ function drawFolderList()
|
||||||
folderList = filters.level;
|
folderList = filters.level;
|
||||||
end
|
end
|
||||||
|
|
||||||
yOffset = transitionEnterOffsetY + transitionScrollOffsetY
|
yOffset = transitionEnterOffsetY + transitionScrollOffsetY;
|
||||||
|
|
||||||
local i = 1;
|
local i = 1;
|
||||||
while (i <= numOfItemsAround) do
|
while (i <= numOfItemsAround) do
|
||||||
local index = getCorrectedIndex(selectedIndex, -i)
|
local index = getCorrectedIndex(selectedIndex, -i)
|
||||||
drawFolder(folderList[index], desh / 2 - ITEM_HEIGHT / 2 -
|
drawFolder(folderList[index],
|
||||||
ITEM_HEIGHT * i + yOffset)
|
desh / 2 - ITEM_HEIGHT / 2 - ITEM_HEIGHT * i + yOffset)
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Draw the selected song
|
-- Draw the selected song
|
||||||
drawFolder(folderList[selectedIndex],
|
drawFolder(folderList[selectedIndex], desh / 2 - ITEM_HEIGHT / 2 + yOffset)
|
||||||
desh / 2 - ITEM_HEIGHT / 2 + yOffset)
|
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
while (i <= numOfItemsAround) do
|
while (i <= numOfItemsAround) do
|
||||||
local index = getCorrectedIndex(selectedIndex, i)
|
local index = getCorrectedIndex(selectedIndex, i)
|
||||||
drawFolder(folderList[index], desh / 2 - ITEM_HEIGHT / 2 +
|
drawFolder(folderList[index],
|
||||||
ITEM_HEIGHT * i + yOffset)
|
desh / 2 - ITEM_HEIGHT / 2 + ITEM_HEIGHT * i + yOffset)
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -234,18 +217,31 @@ function tickTransitions(deltaTime)
|
||||||
end
|
end
|
||||||
|
|
||||||
if scrollingUp then
|
if scrollingUp then
|
||||||
transitionScrollOffsetY = Easing.inQuad(1-transitionScrollScale) * ITEM_HEIGHT;
|
transitionScrollOffsetY = Easing.inQuad(1 - transitionScrollScale) *
|
||||||
|
ITEM_HEIGHT;
|
||||||
else
|
else
|
||||||
transitionScrollOffsetY = Easing.inQuad(1-transitionScrollScale) * -ITEM_HEIGHT;
|
transitionScrollOffsetY = Easing.inQuad(1 - transitionScrollScale) *
|
||||||
|
-ITEM_HEIGHT;
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ENTRY TRANSITION
|
-- ENTRY TRANSITION
|
||||||
|
if transitionEnterReverse then
|
||||||
|
if transitionEnterScale > 0 then
|
||||||
|
transitionEnterScale = transitionEnterScale - deltaTime / 15 -- transition should last for that time in seconds
|
||||||
|
else
|
||||||
|
transitionEnterScale = 0
|
||||||
|
end
|
||||||
|
else
|
||||||
if transitionEnterScale < 1 then
|
if transitionEnterScale < 1 then
|
||||||
transitionEnterScale = transitionEnterScale + deltaTime / 15 -- transition should last for that time in seconds
|
transitionEnterScale = transitionEnterScale + deltaTime / 15 -- transition should last for that time in seconds
|
||||||
else
|
else
|
||||||
transitionEnterScale = 1
|
transitionEnterScale = 1
|
||||||
end
|
end
|
||||||
transitionEnterOffsetY = -Easing.inOutQuad(1-transitionEnterScale) * (desh+ITEM_HEIGHT*2+145);
|
end
|
||||||
|
|
||||||
|
transitionEnterOffsetY = -Easing.inOutQuad(1 - transitionEnterScale) *
|
||||||
|
(desh + ITEM_HEIGHT * 2 + 145 +
|
||||||
|
(transitionEnterReverse and -4 or 0));
|
||||||
end
|
end
|
||||||
|
|
||||||
function drawFilterWheel(deltatime)
|
function drawFilterWheel(deltatime)
|
||||||
|
@ -262,16 +258,17 @@ end
|
||||||
render = function(deltatime, shown)
|
render = function(deltatime, shown)
|
||||||
if not shown then
|
if not shown then
|
||||||
game.SetSkinSetting('_songWheelOverlayActive', 0);
|
game.SetSkinSetting('_songWheelOverlayActive', 0);
|
||||||
transitionEnterScale = 0;
|
transitionEnterReverse = true
|
||||||
|
|
||||||
|
if (transitionEnterScale > 0) then drawFilterWheel(deltatime) end
|
||||||
else
|
else
|
||||||
|
transitionEnterReverse = false
|
||||||
game.SetSkinSetting('_songWheelOverlayActive', 1);
|
game.SetSkinSetting('_songWheelOverlayActive', 1);
|
||||||
drawFilterWheel(deltatime)
|
drawFilterWheel(deltatime)
|
||||||
end
|
end
|
||||||
|
|
||||||
SongSelectHeader.draw(deltatime);
|
SongSelectHeader.draw(deltatime);
|
||||||
Footer.draw({
|
Footer.draw({noEnterTransition = true});
|
||||||
noEnterTransition = true
|
|
||||||
});
|
|
||||||
|
|
||||||
-- Debug text
|
-- Debug text
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
|
@ -279,7 +276,8 @@ render = function(deltatime, shown)
|
||||||
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('S_M: ' .. selectionMode .. ' // S_F: ' .. selectedFolder ..
|
gfx.Text('S_M: ' .. selectionMode .. ' // S_F: ' .. selectedFolder ..
|
||||||
' // S_L: ' .. selectedLevel .. ' // T_S_S: ' .. transitionScrollScale, 8, 1900);
|
' // S_L: ' .. selectedLevel .. ' // T_E_S: ' ..
|
||||||
|
transitionEnterScale, 8, 1900);
|
||||||
end
|
end
|
||||||
|
|
||||||
set_selection = function(newIndex, isFolder)
|
set_selection = function(newIndex, isFolder)
|
||||||
|
@ -298,9 +296,8 @@ set_selection = function(newIndex, isFolder)
|
||||||
transitionScrollScale = 0;
|
transitionScrollScale = 0;
|
||||||
|
|
||||||
scrollingUp = false;
|
scrollingUp = false;
|
||||||
if ((newIndex > oldIndex and not (newIndex == total and oldIndex == 1)) or (newIndex == 1 and oldIndex == total)) then
|
if ((newIndex > oldIndex and not (newIndex == total and oldIndex == 1)) or
|
||||||
scrollingUp = true;
|
(newIndex == 1 and oldIndex == total)) then scrollingUp = true; end
|
||||||
end;
|
|
||||||
|
|
||||||
game.PlaySample('song_wheel/cursor_change.wav');
|
game.PlaySample('song_wheel/cursor_change.wav');
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
require('common')
|
require('common')
|
||||||
local Easing = require('common.easings');
|
local Easing = require('common.easings');
|
||||||
local SongSelectHeader = require('components.headers.songSelectHeader');
|
|
||||||
local Footer = require('components.footer');
|
|
||||||
|
|
||||||
local HEADER_HEIGHT = 100;
|
|
||||||
local BAR_ALPHA = 191;
|
|
||||||
|
|
||||||
local backgroundImage = gfx.CreateSkinImage("song_select/bg.png", 1)
|
local backgroundImage = gfx.CreateSkinImage("song_select/bg.png", 1)
|
||||||
local dataPanelImage = gfx.CreateSkinImage("song_select/data_bg_overlay.png", 1)
|
local dataPanelImage = gfx.CreateSkinImage("song_select/data_bg_overlay.png", 1)
|
||||||
|
@ -19,8 +14,8 @@ local songPlateBottomBarOverlayImage = gfx.CreateSkinImage("song_select/plate/bo
|
||||||
local cursorImages = {
|
local cursorImages = {
|
||||||
gfx.CreateSkinImage("song_select/cursor.png", 1), -- Effective rate or fallback
|
gfx.CreateSkinImage("song_select/cursor.png", 1), -- Effective rate or fallback
|
||||||
gfx.CreateSkinImage("song_select/cursor_exc.png", 1), -- Excessive rate
|
gfx.CreateSkinImage("song_select/cursor_exc.png", 1), -- Excessive rate
|
||||||
gfx.CreateSkinImage("song_select/cursor_exc.png", 1), -- TODO: premissive rate
|
gfx.CreateSkinImage("song_select/cursor_perm.png", 1), -- Premissive rate
|
||||||
gfx.CreateSkinImage("song_select/cursor_exc.png", 1), -- TODO: blastive rate
|
gfx.CreateSkinImage("song_select/cursor_blast.png", 1), -- Blastive rate
|
||||||
}
|
}
|
||||||
|
|
||||||
local diffCursorImage = gfx.CreateSkinImage("song_select/level_cursor.png", 1)
|
local diffCursorImage = gfx.CreateSkinImage("song_select/level_cursor.png", 1)
|
||||||
|
@ -123,7 +118,7 @@ local transitionAfterscrollTextSongArtist = 0;
|
||||||
local transitionAfterscrollDifficultiesAlpha = 0;
|
local transitionAfterscrollDifficultiesAlpha = 0;
|
||||||
local transitionAfterscrollJacketBgAlpha = 0;
|
local transitionAfterscrollJacketBgAlpha = 0;
|
||||||
|
|
||||||
local transitionLeaveActive = false;
|
local transitionLeaveReverse = false;
|
||||||
local transitionLeaveScale = 0;
|
local transitionLeaveScale = 0;
|
||||||
local transitionLeaveOffsetY = 0;
|
local transitionLeaveOffsetY = 0;
|
||||||
|
|
||||||
|
@ -526,17 +521,21 @@ function tickTransitions(deltaTime)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Leave transition
|
-- Leave transition
|
||||||
|
if (transitionLeaveReverse) then
|
||||||
|
if transitionLeaveScale > 0 then
|
||||||
|
transitionLeaveScale = transitionLeaveScale - deltaTime / 15 -- transition should last for that time in seconds
|
||||||
|
else
|
||||||
|
transitionLeaveScale = 0
|
||||||
|
end
|
||||||
|
else
|
||||||
if transitionLeaveScale < 1 then
|
if transitionLeaveScale < 1 then
|
||||||
transitionLeaveScale = transitionLeaveScale + deltaTime / 15 -- transition should last for that time in seconds
|
transitionLeaveScale = transitionLeaveScale + deltaTime / 15 -- transition should last for that time in seconds
|
||||||
else
|
else
|
||||||
transitionLeaveScale = 1
|
transitionLeaveScale = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if (transitionLeaveActive) then
|
|
||||||
transitionLeaveOffsetY = Easing.inOutQuad(transitionLeaveScale) * (desh+songPlateHeight*2+145);
|
|
||||||
else
|
|
||||||
transitionLeaveOffsetY = 0;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
transitionLeaveOffsetY = Easing.inOutQuad(transitionLeaveScale) * (desh+songPlateHeight*2+145);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -559,10 +558,9 @@ render = function (deltaTime)
|
||||||
drawSearch();
|
drawSearch();
|
||||||
|
|
||||||
if (game.GetSkinSetting('_songWheelOverlayActive') ~= 1) then
|
if (game.GetSkinSetting('_songWheelOverlayActive') ~= 1) then
|
||||||
transitionLeaveActive = false;
|
transitionLeaveReverse = true;
|
||||||
transitionLeaveScale = 0;
|
|
||||||
else
|
else
|
||||||
transitionLeaveActive = true;
|
transitionLeaveReverse = false;
|
||||||
end
|
end
|
||||||
|
|
||||||
gfx.BeginPath();
|
gfx.BeginPath();
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
Loading…
Reference in New Issue