update search info textures

This commit is contained in:
Kyle Humphrey 2022-03-10 17:43:19 -06:00
parent 20e4cb4150
commit 59cf769508
3 changed files with 41 additions and 12 deletions

View File

@ -30,6 +30,7 @@ local filterInfoBgImage = gfx.CreateSkinImage("song_select/filter_info_bg.png",
local sortInfoBgImage = gfx.CreateSkinImage("song_select/sort_info_bg.png", 1)
local searchBgImage = gfx.CreateSkinImage("song_select/search_bg.png", 1)
local searchActiveImage = gfx.CreateSkinImage("song_select/search_active.png", 1)
local searchInfoPanelImage = gfx.CreateSkinImage("song_select/search_info_panel.png", 1)
local defaultJacketImage = gfx.CreateSkinImage("song_select/loading.png", 0)
@ -143,7 +144,9 @@ local transitionJacketBgScrollPosX = 0;
--search
local searchPreviousActiveState = false;
local searchInfoPreviousActiveState = false;
local transitionSearchEnterScale = 0;
local transitionSearchInfoEnterScale = 0;
local transitionSearchBackgroundAlpha = 0;
local transitionSearchbarOffsetY = 0;
local transitionSearchInfoOffsetY = 0;
@ -678,11 +681,17 @@ function drawSearch()
game.PlaySample('sort_wheel/leave.wav');
end
if (songwheel.searchText ~= '' and searchInfoPreviousActiveState == true) then
searchInfoPreviousActiveState = false;
elseif (songwheel.searchText == '' and searchInfoPreviousActiveState == false) then
searchInfoPreviousActiveState = true;
end
if (transitionSearchEnterScale == 0) then
return;
end
-- Draw dark overlay over Songwheel
-- Draw dark overlay over Songwheel
gfx.BeginPath();
gfx.FillColor(0, 0, 0, math.floor(transitionSearchBackgroundAlpha * 192));
gfx.Rect(0, 0, 1080, 1920);
@ -690,23 +699,27 @@ function drawSearch()
-- Draw search info panel
gfx.BeginPath();
local infoAlpha = 0;
if (songwheel.searchText ~= '') then
infoAlpha = 0;
else
infoAlpha = 1;
end
local infoResize = 0.855;
local sw, sh = gfx.ImageSize(searchInfoPanelImage)
sw = sw * infoResize;
sh = sh * infoResize;
local infoXPos = 0;
local infoYStartPos = desh - sh - 550;
local infoYStartPos = desh - sh - 772 + 242;
local infoYPos = infoYStartPos + transitionSearchInfoOffsetY;
gfx.ImageRect(infoXPos, infoYPos, sw, sh, searchInfoPanelImage, infoAlpha, 0)
gfx.ImageRect(infoXPos, infoYPos, sw, sh, searchInfoPanelImage, transitionSearchBackgroundInfoAlpha, 0)
-- Draw Search is Active text
gfx.BeginPath();
local activeResize = 0.855;
local activew, activeh = gfx.ImageSize(searchActiveImage)
activew = activew * activeResize;
activeh = activeh * activeResize;
local activeXPos = 0;
local activeYStartPos = desh - sh - 722;
local activeYPos = activeYStartPos + transitionSearchInfoOffsetY;
gfx.ImageRect(activeXPos, activeYPos, activew, activeh, searchActiveImage, 1, 0);
-- Draw Searchbox
gfx.BeginPath();
@ -852,6 +865,22 @@ function tickTransitions(deltaTime)
transitionSearchbarOffsetY = Easing.inOutQuad(1 - transitionSearchEnterScale) * 300
transitionSearchBackgroundAlpha = Easing.inOutQuad(transitionSearchEnterScale)
if not searchInfoPreviousActiveState then
if transitionSearchInfoEnterScale > 0 then
transitionSearchInfoEnterScale = transitionSearchInfoEnterScale - deltaTime / 0.25 -- transition should last for that time in seconds
else
transitionSearchInfoEnterScale = 0
end
else
if transitionSearchInfoEnterScale < 1 then
transitionSearchInfoEnterScale = transitionSearchInfoEnterScale + deltaTime / 0.25 -- transition should last for that time in seconds
else
transitionSearchInfoEnterScale = 1
end
end
transitionSearchBackgroundInfoAlpha = Easing.inOutQuad(transitionSearchInfoEnterScale)
-- Grade alpha
if transitionAfterscrollScale >= 0.03 and transitionAfterscrollScale < 0.033 then
transitionAfterscrollGradeAlpha = 0.5;

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB