diff --git a/CMake/SMDefs.cmake b/CMake/SMDefs.cmake index bac18cdd9f..edae1df02f 100644 --- a/CMake/SMDefs.cmake +++ b/CMake/SMDefs.cmake @@ -1,7 +1,7 @@ # Set up version numbers according to the new scheme. set(SM_VERSION_MAJOR 0) -set(SM_VERSION_MINOR 62) -set(SM_VERSION_PATCH 1) +set(SM_VERSION_MINOR 63) +set(SM_VERSION_PATCH 0) set(SM_VERSION_TRADITIONAL "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}") execute_process(COMMAND git rev-parse --short HEAD diff --git a/Data/splash.png b/Data/splash.png index ced5e95e5d..768517017e 100644 Binary files a/Data/splash.png and b/Data/splash.png differ diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/dumbrate.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/dumbrate.lua index 19fda8b9f0..409310d7c9 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/dumbrate.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/dumbrate.lua @@ -84,9 +84,6 @@ local t = CurrentRateChangedMessageCommand = function(self) self:queuecommand("Set") end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end, TabChangedMessageCommand = function(self) self:queuecommand("Set") end, diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/msd.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/msd.lua index d12f986ec3..af608f95af 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/msd.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/msd.lua @@ -53,7 +53,6 @@ local t = end end - MESSAGEMAN:Broadcast("UpdateMSDInfo") if song and steps then cd:visible(true) else @@ -69,7 +68,7 @@ local t = CurrentRateChangedMessageCommand = function(self) self:queuecommand("Set") end, - RefreshChartInfoMessageCommand = function(self) + CurrentStepsP1ChangedMessageCommand = function(self) self:queuecommand("Set") end, TabChangedMessageCommand = function(self) @@ -94,9 +93,6 @@ local function littlebits(i) InitCommand = function(self) self:xy(frameX + offsetX, frameY + 120 + 22 * i):halign(0):valign(0):zoom(0.5):maxwidth(160 / 0.6) end, - BeginCommand = function(self) - self:queuecommand("Set") - end, SetCommand = function(self) --skillset name if song and steps then @@ -114,9 +110,6 @@ local function littlebits(i) if steps and steps:GetTimingData():HasWarps() then self:settext("") end - end, - UpdateMSDInfoCommand = function(self) - self:queuecommand("Set") end }, LoadFont("Common Large") .. @@ -124,9 +117,6 @@ local function littlebits(i) InitCommand = function(self) self:xy(frameX + 225, frameY + 120 + 22 * i):halign(1):valign(0):zoom(0.5):maxwidth(110 / 0.6) end, - BeginCommand = function(self) - self:queuecommand("Set") - end, SetCommand = function(self) if song and steps then self:settextf("%05.2f", meter[i + 1]) @@ -138,12 +128,6 @@ local function littlebits(i) if steps and steps:GetTimingData():HasWarps() then self:settext("") end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - UpdateMSDInfoCommand = function(self) - self:queuecommand("Set") end } } @@ -160,8 +144,7 @@ t[#t + 1] = end } t[#t + 1] = - LoadFont("Common Normal") .. - { + LoadFont("Common Normal") .. { InitCommand = function(self) self:xy(frameX + 5, frameY + offsetY - 9):zoom(0.6):halign(0):diffuse(getMainColor("positive")):settext( "MSD Breakdown (Wip)" @@ -169,8 +152,7 @@ t[#t + 1] = end } t[#t + 1] = - LoadFont("Common Large") .. - { + LoadFont("Common Large") .. { InitCommand = function(self) self:xy(frameX + 5, frameY + 35):zoom(0.6):halign(0):diffuse(getMainColor("positive")):maxwidth( SCREEN_CENTER_X / 0.7 @@ -182,9 +164,6 @@ t[#t + 1] = else self:settext("") end - end, - UpdateMSDInfoCommand = function(self) - self:queuecommand("Set") end } @@ -199,16 +178,12 @@ t[#t + 1] = end, SetCommand = function(self) self:settext(getCurRateDisplayString()) - end, - CurrentRateChangedCommand = function(self) - self:queuecommand("set") end } --Difficulty t[#t + 1] = - LoadFont("Common Normal") .. - { + LoadFont("Common Normal") .. { Name = "StepsAndMeter", InitCommand = function(self) self:xy(frameX + offsetX, frameY + offsetY + 50):zoom(0.5):halign(0) @@ -224,16 +199,12 @@ t[#t + 1] = self:diffuse(getDifficultyColor(GetCustomDifficulty(steps:GetStepsType(), steps:GetDifficulty()))) end end - end, - ScoreUpdateMessageCommand = function(self) - self:queuecommand("Set") end } --NPS t[#t + 1] = - LoadFont("Common Normal") .. - { + LoadFont("Common Normal") .. { Name = "NPS", InitCommand = function(self) self:xy(frameX + offsetX, frameY + 60):zoom(0.4):halign(0) @@ -251,22 +222,12 @@ t[#t + 1] = else self:settext("0.00 Average NPS") end - end, - CurrentSongChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - CurrentStepsP1ChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - CurrentStepsP2ChangedMessageCommand = function(self) - self:queuecommand("Set") end } --Negative BPMs label t[#t + 1] = - LoadFont("Common Normal") .. - { + LoadFont("Common Normal") .. { InitCommand = function(self) self:xy(frameX + 45, frameY + 135):zoom(0.8):halign(0):diffuse(getMainColor("negative")):settext("Negative Bpms") end, @@ -276,9 +237,6 @@ t[#t + 1] = else self:settext("") end - end, - UpdateMSDInfoCommand = function(self) - self:queuecommand("Set") end } diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua index 5055b3ca31..2c1c6dc9b7 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/score.lua @@ -73,7 +73,9 @@ end -- should maybe make some of these generic local function highlight(self) - self:queuecommand("Highlight") + if self:GetVisible() then + self:queuecommand("Highlight") + end end -- note: will use the local isover functionality @@ -84,20 +86,26 @@ local function highlightIfOver(self) self:diffusealpha(1) end end - +local moped -- Only works if ... it should work -- You know, if we can see the place where the scores should be. local function updateLeaderBoardForCurrentChart() local top = SCREENMAN:GetTopScreen() if top:GetMusicWheel():IsSettled() and ((getTabIndex() == 2 and nestedTab == 2) or collapsed) then - local chartkey = GAMESTATE:GetCurrentSteps(PLAYER_1):GetChartKey() - DLMAN:RequestChartLeaderBoardFromOnline(chartkey) + local steps = GAMESTATE:GetCurrentSteps(PLAYER_1) + if steps then + DLMAN:RequestChartLeaderBoardFromOnline(steps:GetChartKey()) + moped:queuecommand("ChartLeaderboardUpdate") + else + moped:queuecommand("Bort") + end end end local ret = Def.ActorFrame { BeginCommand = function(self) + moped = self:GetChild("ScoreDisplay") self:queuecommand("Set"):visible(false) self:GetChild("LocalScores"):xy(frameX, frameY):visible(false) self:GetChild("ScoreDisplay"):xy(frameX, frameY):visible(false) @@ -111,11 +119,14 @@ local ret = end, OffCommand = function(self) self:bouncebegin(0.2):xy(-500, 0):diffusealpha(0) -- visible(false) + self:GetChild("LocalScores"):visible(false) end, OnCommand = function(self) self:bouncebegin(0.2):xy(0, 0):diffusealpha(1) - if nestedTab == 1 then + if getTabIndex() == 2 and nestedTab == 1 then self:GetChild("LocalScores"):visible(true) + else + self:GetChild("LocalScores"):visible(false) end end, SetCommand = function(self) @@ -143,9 +154,6 @@ local ret = self:queuecommand("Set") updateLeaderBoardForCurrentChart() end, - UpdateChartMessageCommand = function(self) - self:queuecommand("Set") - end, CollapseCommand = function(self) collapsed = true resetTabIndex() @@ -169,11 +177,12 @@ local ret = updateLeaderBoardForCurrentChart() end, CurrentStepsP1ChangedMessageCommand = function(self) + self:queuecommand("Set") updateLeaderBoardForCurrentChart() end, CurrentRateChangedMessageCommand = function(self) if ((getTabIndex() == 2 and nestedTab == 2) or collapsed) and DLMAN:GetCurrentRateFilter() then - MESSAGEMAN:Broadcast("ChartLeaderboardUpdate") + moped:queuecommand("ChartLeaderboardUpdate") end end } @@ -334,7 +343,7 @@ local l = Def.ActorFrame{ -- stuff inside the frame.. so we can move it all at o { Name = "Score", InitCommand = function(self) - self:xy(55, 33):zoom(0.6):halign(0):settext("") + self:xy(55, 30):zoom(0.6):halign(0):settext("") end, DisplayCommand = function(self) if score:GetWifeScore() == 0 then @@ -346,11 +355,26 @@ local l = Def.ActorFrame{ -- stuff inside the frame.. so we can move it all at o end }, + LoadFont("Common Normal") .. + { + Name = "Score", + InitCommand = function(self) + self:xy(55, 43):zoom(0.5):halign(0):settext("") + end, + DisplayCommand = function(self) + if score:GetWifeScore() == 0 then + self:settext("") + else + self:settext(GAMESTATE:GetCurrentSteps(PLAYER_1):GetRelevantSkillsetsByMSDRank(getCurRateValue(), 1)) + end + end + }, + LoadFont("Common Normal") .. { Name = "ClearType", InitCommand = function(self) - self:y(41):zoom(0.5):halign(0):halign(0):settext("No Play"):diffuse( + self:y(43):zoom(0.5):halign(0):settext("No Play"):diffuse( color(colorConfig:get_data().clearType["NoPlay"]) ) end, @@ -656,9 +680,6 @@ t[#t+1] = Def.Quad { InitCommand = function(self) self:x(frameWidth):zoomto(4, 0):halign(1):valign(1):diffuse(getMainColor("highlight")):diffusealpha(0.75) end, - ScoreUpdateMessageCommand = function(self) - self:queuecommand("Set") - end, DisplayCommand = function(self) self:finishtweening() self:smooth(0.2) @@ -702,7 +723,6 @@ function nestedTabButton(i) if isOver(self) then nestedTab = i MESSAGEMAN:Broadcast("NestedTabChanged") - MESSAGEMAN:Broadcast("ChartLeaderboardUpdate") if nestedTab == 1 then self:GetParent():GetParent():GetChild("ScoreDisplay"):visible(false) self:GetParent():GetParent():GetParent():GetChild("StepsDisplay"):visible(true) @@ -711,9 +731,6 @@ function nestedTabButton(i) self:GetParent():GetParent():GetParent():GetChild("StepsDisplay"):visible(false) end end - end, - NestedTabChangedMessageCommand = function(self) - self:queuecommand("Set") end } } diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/songinfo.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/songinfo.lua index 5dead44022..e69de29bb2 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/songinfo.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/songinfo.lua @@ -1,62 +0,0 @@ -local update = false -local t = - Def.ActorFrame { - BeginCommand = function(self) - self:queuecommand("Set") - end, - OffCommand = function(self) - self:bouncebegin(0.2):xy(-500, 0) -- visible(false) - end, - OnCommand = function(self) - self:bouncebegin(0.2):xy(0, 0) - end, - SetCommand = function(self) - self:finishtweening() - if getTabIndex() == 0 then - self:queuecommand("On") - update = true - else - self:queuecommand("Off") - update = false - end - end, - TabChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - ChartPreviewOnMessageCommand = function(self) - self:visible(false) - end, - ChartPreviewOffMessageCommand = function(self) - self:visible(true) - end, -} - -t[#t + 1] = - Def.Banner { - InitCommand = function(self) - self:x(10):y(61):halign(0):valign(0):scaletoclipped( - capWideScale(get43size(384), 384), - capWideScale(get43size(120), 120) - ) - end, - SetMessageCommand = function(self) - if update then - local top = SCREENMAN:GetTopScreen() - if top:GetName() == "ScreenSelectMusic" or top:GetName() == "ScreenNetSelectMusic" then - local song = GAMESTATE:GetCurrentSong() - local group = top:GetMusicWheel():GetSelectedSection() - if song then - self:LoadFromSong(song) - elseif group then - self:LoadFromSongGroup(group) - end - end - end - self:scaletoclipped(capWideScale(get43size(384), 384), capWideScale(get43size(120), 120)) - end, - CurrentSongChangedMessageCommand = function(self) - self:queuecommand("Set") - end -} - -return t diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/wifeTwirl.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/wifeTwirl.lua index ea4d72b89d..b6b6168a3f 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/wifeTwirl.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/wifeTwirl.lua @@ -2,11 +2,9 @@ local profile = PROFILEMAN:GetProfile(PLAYER_1) local frameX = 10 local frameY = 250 + capWideScale(get43size(120), 90) local frameWidth = capWideScale(get43size(455), 455) -local scoreType = themeConfig:get_data().global.DefaultScoreType local score local song local steps -local alreadybroadcasted local noteField = false local heyiwasusingthat = false local mcbootlarder @@ -19,20 +17,26 @@ local prevrevY = 208 local update = false local t = Def.ActorFrame { - BeginCommand = function(self) - self:queuecommand("Set") - end, OffCommand = function(self) self:bouncebegin(0.2):xy(-500, 0):diffusealpha(0) end, OnCommand = function(self) self:bouncebegin(0.2):xy(0, 0):diffusealpha(1) end, - SetCommand = function(self) + MintyFreshCommand = function(self) self:finishtweening() + local bong = GAMESTATE:GetCurrentSong() + if not bong then + self:queuecommand("MilkyTarts") + end + if song ~= bong then + song = bong + self:queuecommand("MortyFarts") + end if getTabIndex() == 0 then if heyiwasusingthat and GAMESTATE:GetCurrentSong() and noteField then -- these can prolly be wrapped better too -mina mcbootlarder:visible(true) + mcbootlarder:GetChild("NoteField"):visible(true) MESSAGEMAN:Broadcast("ChartPreviewOn") heyiwasusingthat = false end @@ -41,6 +45,7 @@ local t = else if GAMESTATE:GetCurrentSong() and noteField and mcbootlarder:GetVisible() then mcbootlarder:visible(false) + mcbootlarder:GetChild("NoteField"):visible(false) MESSAGEMAN:Broadcast("ChartPreviewOff") heyiwasusingthat = true end @@ -48,21 +53,43 @@ local t = update = false end end, + MilkyTartsCommand=function(self) -- when entering pack screenselectmusic explicitly turns visibilty on notefield off -mina + if noteField and mcbootlarder:GetVisible() then + mcbootlarder:visible(false) + MESSAGEMAN:Broadcast("ChartPreviewOff") + heyiwasusingthat = true + end + end, TabChangedMessageCommand = function(self) - self:queuecommand("Set") - end + self:queuecommand("MintyFresh") + end, + CurrentStepsP1ChangedMessageCommand = function(self) + self:queuecommand("MintyFresh") + end, + Def.Quad { + InitCommand = function(self) + self:xy(frameX, frameY - 76):zoomto(110, 94):halign(0):valign(0):diffuse(color("#333333A6")) + end + }, + Def.Quad { + InitCommand = function(self) + self:xy(frameX, frameY - 76):zoomto(8, 144):halign(0):valign(0):diffuse(getMainColor("highlight")):diffusealpha(0.5) + end + },Def.Quad { + InitCommand = function(self) + self:xy(frameX, frameY + 18):zoomto(frameWidth + 4, 50):halign(0):valign(0):diffuse(color("#333333A6")) + end + } } -- Music Rate Display t[#t + 1] = - LoadFont("Common Large") .. - { + LoadFont("Common Large") .. { InitCommand = function(self) self:xy(18, SCREEN_BOTTOM - 225):visible(true):halign(0):zoom(0.4):maxwidth( - capWideScale(get43size(360), 360) / capWideScale(get43size(0.45), 0.45) - ) + capWideScale(get43size(360), 360) / capWideScale(get43size(0.45), 0.45)) end, - SetCommand = function(self) + MintyFreshCommand = function(self) self:settext(getCurRateDisplayString()) end, CodeMessageCommand = function(self, params) @@ -71,117 +98,10 @@ t[#t + 1] = self:settext(getCurRateDisplayString()) end, GoalSelectedMessageCommand = function(self) - self:queuecommand("Set") + self:queuecommand("MintyFresh") end } --- Temporary update control tower; it would be nice if the basic song/step change commands were thorough and explicit and non-redundant -t[#t + 1] = - Def.Actor { - SetCommand = function(self) - if song and not alreadybroadcasted then -- if this is true it means we've just exited a pack's songlist into the packlist - song = GAMESTATE:GetCurrentSong() -- also apprently true if we're tabbing around within a songlist and then stop... - MESSAGEMAN:Broadcast("UpdateChart") -- ms.ok(whee:GetSelectedSection( )) -- use this later to detect pack changes - MESSAGEMAN:Broadcast("RefreshChartInfo") - else - alreadybroadcasted = false - end - end, - CurrentStepsP1ChangedMessageCommand = function(self) - song = GAMESTATE:GetCurrentSong() - MESSAGEMAN:Broadcast("UpdateChart") - end, - CurrentSongChangedMessageCommand = function(self) - -- This will disable mirror when switching songs if OneShotMirror is enabled or if permamirror is flagged on the chart (it is enabled if so in screengameplayunderlay/default) - if playerConfig:get_data(pn_to_profile_slot(PLAYER_1)).OneShotMirror or profile:IsCurrentChartPermamirror() then - local modslevel = topscreen == "ScreenEditOptions" and "ModsLevel_Stage" or "ModsLevel_Preferred" - local playeroptions = GAMESTATE:GetPlayerState(PLAYER_1):GetPlayerOptions(modslevel) - playeroptions:Mirror(false) - end - if not GAMESTATE:GetCurrentSong() and noteField and mcbootlarder:GetVisible() then - mcbootlarder:visible(false) - MESSAGEMAN:Broadcast("ChartPreviewOff") - heyiwasusingthat = true - end - if heyiwasusingthat and GAMESTATE:GetCurrentSong() and noteField and getTabIndex() == 0 then - mcbootlarder:visible(true) - MESSAGEMAN:Broadcast("ChartPreviewOn") - heyiwasusingthat = false - end - self:queuecommand("Set") - end -} - -local function GetBestScoreByFilter(perc, CurRate) - local rtTable = getRateTable() - if not rtTable then - return nil - end - - local rates = tableKeys(rtTable) - local scores, score - - if CurRate then - local tmp = getCurRateString() - if tmp == "1x" then - tmp = "1.0x" - end - if tmp == "2x" then - tmp = "2.0x" - end - rates = {tmp} - if not rtTable[rates[1]] then - return nil - end - end - - table.sort( - rates, - function(a, b) - a = a:gsub("x", "") - b = b:gsub("x", "") - return a < b - end - ) - for i = #rates, 1, -1 do - scores = rtTable[rates[i]] - local bestscore = 0 - local index - - for ii = 1, #scores do - score = scores[ii] - if score:ConvertDpToWife() > bestscore then - index = ii - bestscore = score:ConvertDpToWife() - end - end - - if index and scores[index]:GetWifeScore() == 0 and GetPercentDP(scores[index]) > perc * 100 then - return scores[index] - end - - if bestscore > perc then - return scores[index] - end - end -end - -local function GetDisplayScore() - local score - score = GetBestScoreByFilter(0, true) - - if not score then - score = GetBestScoreByFilter(0.9, false) - end - if not score then - score = GetBestScoreByFilter(0.5, false) - end - if not score then - score = GetBestScoreByFilter(0, false) - end - return score -end - local function toggleNoteField() if song and not noteField then -- first time setup noteField = true @@ -207,347 +127,320 @@ end t[#t + 1] = Def.Actor { - SetCommand = function(self) + MintyFreshCommand = function(self) if song then ptags = tags:get_data().playerTags steps = GAMESTATE:GetCurrentSteps(PLAYER_1) chartKey = steps:GetChartKey() - score = GetDisplayScore() ctags = {} for k, v in pairs(ptags) do if ptags[k][chartKey] then ctags[#ctags + 1] = k end end - MESSAGEMAN:Broadcast("RefreshChartInfo") end - end, - UpdateChartMessageCommand = function(self) - self:queuecommand("Set") - end, - CurrentRateChangedMessageCommand = function() - score = GetDisplayScore() end } -t[#t + 1] = - Def.ActorFrame { - -- **frames/bars** - Def.Quad { +t[#t + 1] = Def.ActorFrame { + Name = "RateDependentStuff", -- msd/display score/bpm/songlength -mina + MintyFreshCommand = function() + score = GetDisplayScore() + end, + CurrentRateChangedMessageCommand = function(self) + self:queuecommand("MintyFresh") --steps stuff + self:queuecommand("MortyFarts") --songs stuff + end, + LoadFont("Common Large") .. { + Name = "MSD", InitCommand = function(self) - self:xy(frameX, frameY - 76):zoomto(110, 94):halign(0):valign(0):diffuse(color("#333333CC")):diffusealpha(0.66) + self:xy(frameX + 58, frameY - 62):halign(0.5):zoom(0.6):maxwidth(110 / 0.6) + end, + MintyFreshCommand = function(self) + if song then + if steps:GetStepsType() == "StepsType_Dance_Single" then + local meter = steps:GetMSD(getCurRateValue(), 1) + self:settextf("%05.2f", meter) + self:diffuse(byMSD(meter)) + else + self:settextf("%5.2f", steps:GetMeter()) -- fallthrough to pre-defined meters for non 4k charts -mina + self:diffuse(byDifficulty(steps:GetDifficulty())) + end + else + self:settext("") + end end }, - Def.Quad { + -- skillset suff (these 3 can prolly be wrapped) + LoadFont("Common Normal") .. { InitCommand = function(self) - self:xy(frameX, frameY + 18):zoomto(frameWidth + 4, 50):halign(0):valign(0):diffuse(color("#333333CC")):diffusealpha( - 0.66 - ) + self:xy(frameX + 120, frameY - 60):halign(0):zoom(0.6, maxwidth, 125) + end, + MintyFreshCommand = function(self) + if song then + self:settext(steps:GetRelevantSkillsetsByMSDRank(getCurRateValue(), 1)) + else + self:settext("") + end + end, + ChartPreviewOnMessageCommand = function(self) + self:visible(false) + end, + ChartPreviewOffMessageCommand = function(self) + self:visible(true) end }, - Def.Quad { + LoadFont("Common Normal") .. { InitCommand = function(self) - self:xy(frameX, frameY - 76):zoomto(8, 144):halign(0):valign(0):diffuse(getMainColor("highlight")):diffusealpha(0.5) + self:xy(frameX + 120, frameY - 30):halign(0):zoom(0.6, maxwidth, 125) + end, + MintyFreshCommand = function(self) + if song then + self:settext(steps:GetRelevantSkillsetsByMSDRank(getCurRateValue(), 2)) + else + self:settext("") + end + end, + ChartPreviewOnMessageCommand = function(self) + self:visible(false) + end, + ChartPreviewOffMessageCommand = function(self) + self:visible(true) + end + }, + LoadFont("Common Normal") .. { + InitCommand = function(self) + self:xy(frameX + 120, frameY):halign(0):zoom(0.6, maxwidth, 125) + end, + MintyFreshCommand = function(self) + if song then + self:settext(steps:GetRelevantSkillsetsByMSDRank(getCurRateValue(), 3)) + else + self:settext("") + end + end, + ChartPreviewOnMessageCommand = function(self) + self:visible(false) + end, + ChartPreviewOffMessageCommand = function(self) + self:visible(true) end }, -- **score related stuff** These need to be updated with rate changed commands -- Primary percent score - LoadFont("Common Large") .. - { - InitCommand = function(self) - self:xy(frameX + 55, frameY + 50):zoom(0.6):halign(0.5):maxwidth(125):valign(1) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song and score then - self:settextf("%05.2f%%", notShit.floor(score:GetWifeScore() * 10000) / 100) - self:diffuse(getGradeColor(score:GetWifeGrade())) - else - self:settext("") - end - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") + LoadFont("Common Large") .. { + InitCommand = function(self) + self:xy(frameX + 55, frameY + 50):zoom(0.6):halign(0.5):maxwidth(125):valign(1) + end, + MintyFreshCommand = function(self) + if song and score then + self:settextf("%05.2f%%", notShit.floor(score:GetWifeScore() * 10000) / 100) + self:diffuse(getGradeColor(score:GetWifeGrade())) + else + self:settext("") end - }, + end, + }, -- Rate for the displayed score - LoadFont("Common Normal") .. - { - InitCommand = function(self) - self:xy(frameX + 55, frameY + 58):zoom(0.5):halign(0.5) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song and score then - local rate = notShit.round(score:GetMusicRate(), 3) - local notCurRate = notShit.round(getCurRateValue(), 3) ~= rate - + LoadFont("Common Normal") .. { + InitCommand = function(self) + self:xy(frameX + 55, frameY + 58):zoom(0.5):halign(0.5) + end, + MintyFreshCommand = function(self) + if song and score then + local rate = notShit.round(score:GetMusicRate(), 3) + local notCurRate = notShit.round(getCurRateValue(), 3) ~= rate local rate = string.format("%.2f", rate) - if rate:sub(#rate, #rate) == "0" then - rate = rate:sub(0, #rate - 1) - end - rate = rate .. "x" - + if rate:sub(#rate, #rate) == "0" then + rate = rate:sub(0, #rate - 1) + end + rate = rate .. "x" if notCurRate then - self:settext("(" .. rate .. ")") - else - self:settext(rate) - end + self:settext("(" .. rate .. ")") else - self:settext("") + self:settext(rate) end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") + else + self:settext("") end - }, - -- Date score achieved on - LoadFont("Common Normal") .. - { - InitCommand = function(self) - self:xy(frameX + 185, frameY + 59):zoom(0.4):halign(0) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song and score then - self:settext(score:GetDate()) + end + }, + -- goal for current rate if there is one stuff + LoadFont("Common Normal") .. { + Name = "Goalll", + InitCommand = function(self) + self:xy(frameX + 135, frameY + 33):zoom(0.6):halign(0.5):valign(0) + end, + MintyFreshCommand = function(self) + if song and steps then + local goal = profile:GetEasiestGoalForChartAndRate(steps:GetChartKey(), getCurRateValue()) + if goal then + self:settextf("Target\n%.2f%%", goal:GetPercent() * 100) else self:settext("") end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") + else + self:settext("") + end + end + }, + -- Date score achieved on + LoadFont("Common Normal") .. { + InitCommand = function(self) + self:xy(frameX + 185, frameY + 59):zoom(0.4):halign(0) + end, + MintyFreshCommand = function(self) + if song and score then + self:settext(score:GetDate()) + else + self:settext("") end - }, + end + }, -- MaxCombo - LoadFont("Common Normal") .. - { - InitCommand = function(self) - self:xy(frameX + 185, frameY + 49):zoom(0.4):halign(0) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song and score then - self:settextf("Max Combo: %d", score:GetMaxCombo()) - else - self:settext("") - end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") + LoadFont("Common Normal") .. { + InitCommand = function(self) + self:xy(frameX + 185, frameY + 49):zoom(0.4):halign(0) + end, + MintyFreshCommand = function(self) + if song and score then + self:settextf("Max Combo: %d", score:GetMaxCombo()) + else + self:settext("") end - } - -- **End score related stuff** + end + }, + LoadFont("Common Normal") .. { + Name = "ClearType", + InitCommand = function(self) + self:xy(frameX + 185, frameY + 35):zoom(0.6):halign(0) + end, + MintyFreshCommand = function(self) + if song and score then + self:visible(true) + self:settext(getClearTypeFromScore(PLAYER_1, score, 0)) + self:diffuse(getClearTypeFromScore(PLAYER_1, score, 2)) + else + self:visible(false) + end + end + }, + -- **song stuff that scales with rate** + Def.BPMDisplay { + File = THEME:GetPathF("BPMDisplay", "bpm"), + Name = "BPMDisplay", + InitCommand = function(self) + self:xy(capWideScale(get43size(384), 384) + 62, SCREEN_BOTTOM - 100):halign(1):zoom(0.50) + end, + MortyFartsCommand = function(self) + if song then + self:visible(true) + self:SetFromSong(song) + else + self:visible(false) + end + end + }, + LoadFont("Common Large") .. { + Name = "PlayableDuration", + InitCommand = function(self) + self:xy((capWideScale(get43size(384), 384)) + 62, SCREEN_BOTTOM - 85):visible(true):halign(1):zoom( + capWideScale(get43size(0.6), 0.6) + ):maxwidth(capWideScale(get43size(360), 360) / capWideScale(get43size(0.45), 0.45)) + end, + MortyFartsCommand = function(self) + if song then + local playabletime = GetPlayableTime() + self:settext(SecondsToMMSS(playabletime)) + self:diffuse(byMusicLength(playabletime)) + else + self:settext("") + end + end + } } --- "Radar values" aka basic chart information +-- "Radar values", noteinfo that isn't rate dependent -mina local function radarPairs(i) local o = Def.ActorFrame { - LoadFont("Common Normal") .. - { + LoadFont("Common Normal") .. { InitCommand = function(self) self:xy(frameX + 13, frameY - 52 + 13 * i):zoom(0.5):halign(0):maxwidth(120) end, - SetCommand = function(self) + MintyFreshCommand = function(self) if song then self:settext(ms.RelevantRadarsShort[i]) else self:settext("") end - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") end }, - LoadFont("Common Normal") .. - { + LoadFont("Common Normal") .. { InitCommand = function(self) self:xy(frameX + 105, frameY + -52 + 13 * i):zoom(0.5):halign(1):maxwidth(60) end, - SetCommand = function(self) + MintyFreshCommand = function(self) if song then self:settext(steps:GetRelevantRadars(PLAYER_1)[i]) else self:settext("") end - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") end } } return o end +local r = Def.ActorFrame{ + Name = "RadarValues" +} + -- Create the radar values for i = 1, 5 do - t[#t + 1] = radarPairs(i) + r[#r + 1] = radarPairs(i) end --- Difficulty value ("meter"), need to change this later -t[#t + 1] = - LoadFont("Common Large") .. - { +-- putting neg bpm warning here i guess +r[#r + 1] = + LoadFont("Common Normal") .. { InitCommand = function(self) - self:xy(frameX + 58, frameY - 62):halign(0.5):zoom(0.6):maxwidth(110 / 0.6) + self:xy(frameX, frameY - 120):halign(0):zoom(0.6) end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song then - if steps:GetStepsType() == "StepsType_Dance_Single" then - local meter = steps:GetMSD(getCurRateValue(), 1) - self:settextf("%05.2f", meter) - self:diffuse(byMSD(meter)) - else - self:settextf("%5.2f", steps:GetMeter()) - self:diffuse(byDifficulty(steps:GetDifficulty())) - end + MintyFreshCommand = function(self) + if song and steps:GetTimingData():HasWarps() then + self:settext("NegBpms!") else self:settext("") end - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") end } --- -- test adjustment index --- t[#t+1] = LoadFont("Common normal")..{ --- InitCommand=function(self) --- self:xy(frameX+92,frameY-70):halign(0):zoom(0.4) --- end, --- ChartLeaderboardUpdateMessageCommand = function(self,params) --- local val = params.mmm --- if val then --- if val > 0 then --- self:settextf("%+5.1f", val) --- else --- self:settextf("%5.1f", val) --- end --- else --- self:settext("") --- end --- end, --- LogOutMessageCommand=function(self) --- self:settext("") --- end, --- RefreshChartInfoMessageCommand=function(self) --- if song then --- self:visible(true) --- else --- self:visible(false) --- end --- end, --- } +t[#t + 1] = r --- Song duration +-- song only stuff that doesnt change with rate t[#t + 1] = - LoadFont("Common Large") .. - { + LoadFont("Common Normal") .. { InitCommand = function(self) - self:xy((capWideScale(get43size(384), 384)) + 62, SCREEN_BOTTOM - 85):visible(true):halign(1):zoom( - capWideScale(get43size(0.6), 0.6) - ):maxwidth(capWideScale(get43size(360), 360) / capWideScale(get43size(0.45), 0.45)) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song then - local playabletime = GetPlayableTime() - self:settext(SecondsToMMSS(playabletime)) - self:diffuse(byMusicLength(playabletime)) - else - self:settext("") - end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") + self:xy(capWideScale(get43size(384), 384) + 41, SCREEN_BOTTOM - 100):halign(1):zoom(0.50) end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end - } - --- BPM display/label not sure why this was never with the chart info in the first place -t[#t + 1] = - Def.BPMDisplay { - File = THEME:GetPathF("BPMDisplay", "bpm"), - Name = "BPMDisplay", - InitCommand = function(self) - self:xy(capWideScale(get43size(384), 384) + 62, SCREEN_BOTTOM - 100):halign(1):zoom(0.50) - end, - SetCommand = function(self) - if song then - self:visible(1) - self:SetFromSong(song) - else - self:visible(0) - end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end -} - -t[#t + 1] = - LoadFont("Common Normal") .. - { - SetCommand = function(self) + MortyFartsCommand = function(self) if song then self:settext("BPM") else self:settext("") end - end, - InitCommand = function(self) - self:xy(capWideScale(get43size(384), 384) + 41, SCREEN_BOTTOM - 100):halign(1):zoom(0.50) - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") end } --- CDtitle, need to figure out a better place for this later. -mina ---Gonna move the cdtitle right next to selected song similar to ultralight. -Misterkister +-- cdtitle t[#t + 1] = Def.Sprite { InitCommand = function(self) self:xy(capWideScale(get43size(344), 364) + 50, capWideScale(get43size(345), 255)):halign(0.5):valign(1) end, - SetCommand = function(self) + MortyFartsCommand = function(self) self:finishtweening() - if GAMESTATE:GetCurrentSong() then - local song = GAMESTATE:GetCurrentSong() if song then if song:HasCDTitle() then self:visible(true) @@ -574,15 +467,6 @@ t[#t + 1] = else self:zoom(1) end - else - self:visible(false) - end - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") end, ChartPreviewOnMessageCommand=function(self) self:addx(capWideScale(34,0)) @@ -592,93 +476,43 @@ t[#t + 1] = end } -t[#t + 1] = - LoadFont("Common Large") .. - { +t[#t + 1] = + Def.Sprite { + Name = "Banner", InitCommand = function(self) - self:xy(frameX, frameY - 120):halign(0):zoom(0.4) - end, - BeginCommand = function(self) - self:queuecommand("Set") + self:x(10):y(61):halign(0):valign(0) end, - SetCommand = function(self) - if song and steps:GetTimingData():HasWarps() then - self:settext("NegBpms!") + MintyFreshCommand=function(self) + if INPUTFILTER:IsBeingPressed("tab") then + self:finishtweening():smooth(0.25):diffusealpha(0):sleep(0.2):queuecommand("ModifyBanner") else - self:settext("") + self:finishtweening():queuecommand("ModifyBanner") end end, - CurrentStepsP1ChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end - } - -t[#t + 1] = - LoadFont("Common Large") .. - { - InitCommand = function(self) - self:xy(frameX + 135, frameY + 45):zoom(0.3):halign(0.5):valign(1) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song and steps then - local goal = profile:GetEasiestGoalForChartAndRate(steps:GetChartKey(), getCurRateValue()) - if goal then - self:settext("Target:") - else - self:settext("") + ModifyBannerCommand = function(self) + self:finishtweening() + if song then + local bnpath = GAMESTATE:GetCurrentSong():GetBannerPath() + if not bnpath then + bnpath = THEME:GetPathG("Common", "fallback banner") end + self:LoadBackground(bnpath) else - self:settext("") - end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - CurrentStepsP1ChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end - } - -t[#t + 1] = - LoadFont("Common Large") .. - { - InitCommand = function(self) - self:xy(frameX + 135, frameY + 60):zoom(0.3):halign(0.5):valign(1) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song and steps then - local goal = profile:GetEasiestGoalForChartAndRate(steps:GetChartKey(), getCurRateValue()) - if goal then - self:settextf("%.2f%%", goal:GetPercent() * 100) - else - self:settext("") + local bnpath = SONGMAN:GetSongGroupBannerPath(SCREENMAN:GetTopScreen():GetMusicWheel():GetSelectedSection()) + if not bnpath or bnpath == "" then + bnpath = THEME:GetPathG("Common", "fallback banner") end - else - self:settext("") + self:LoadBackground(bnpath) end + self:scaletoclipped(capWideScale(get43size(384), 384), capWideScale(get43size(120), 120)):diffusealpha(1) end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - CurrentStepsP1ChangedMessageCommand = function(self) - self:queuecommand("Set") + ChartPreviewOnMessageCommand = function(self) + self:visible(false) end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") + ChartPreviewOffMessageCommand = function(self) + self:visible(true) end - } +} t[#t + 1] = Def.Quad { @@ -690,7 +524,7 @@ t[#t + 1] = local sg = profile:GetEasiestGoalForChartAndRate(steps:GetChartKey(), getCurRateValue()) if sg and isOver(self) and update then sg:SetPercent(sg:GetPercent() + 0.01) - MESSAGEMAN:Broadcast("RefreshChartInfo") + self:GetParent():GetChild("RateDependentStuff"):GetChild("Goalll"):queuecommand("MintyFresh") end end end, @@ -699,40 +533,12 @@ t[#t + 1] = local sg = profile:GetEasiestGoalForChartAndRate(steps:GetChartKey(), getCurRateValue()) if sg and isOver(self) and update then sg:SetPercent(sg:GetPercent() - 0.01) - MESSAGEMAN:Broadcast("RefreshChartInfo") + self:GetParent():GetChild("RateDependentStuff"):GetChild("Goalll"):queuecommand("MintyFresh") end end end } --- perhaps need this perhaps not --- t[#t+1] = LoadFont("Common Large") .. { --- InitCommand=function(self) --- self:xy(frameX+135,frameY+65):zoom(0.3):halign(0.5):valign(1) --- end, --- BeginCommand=function(self) --- self:queuecommand("Set") --- end, --- SetCommand=function(self) --- if steps then --- local goal = profile:GetEasiestGoalForChartAndRate(steps:GetChartKey(), getCurRateValue()) --- if goal then --- self:settextf("%.2f", goal:GetRate()) --- else --- self:settext("") --- end --- else --- self:settext("") --- end --- end, --- CurrentStepsP1ChangedMessageCommand=function(self) --- self:queuecommand("Set") --- end, --- RefreshChartInfoMessageCommand=function(self) --- self:queuecommand("Set") --- end, --- } - -- t[#t+1] = LoadFont("Common Large") .. { -- InitCommand=function(self) -- self:xy((capWideScale(get43size(384),384))+68,SCREEN_BOTTOM-135):halign(1):zoom(0.4,maxwidth,125) @@ -770,214 +576,52 @@ t[#t + 1] = -- end -- } -t[#t + 1] = - LoadFont("Common Large") .. - { - InitCommand = function(self) - self:xy(frameX + 120, frameY - 60):halign(0):zoom(0.4, maxwidth, 125) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song then - self:settext(steps:GetRelevantSkillsetsByMSDRank(getCurRateValue(), 1)) - else - self:settext("") - end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end, - ChartPreviewOnMessageCommand = function(self) - self:visible(false) - end, - ChartPreviewOffMessageCommand = function(self) - self:visible(true) - end, - } - -t[#t + 1] = - LoadFont("Common Large") .. - { - InitCommand = function(self) - self:xy(frameX + 120, frameY - 30):halign(0):zoom(0.4, maxwidth, 125) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song then - self:settext(steps:GetRelevantSkillsetsByMSDRank(getCurRateValue(), 2)) - else - self:settext("") - end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end, - ChartPreviewOnMessageCommand = function(self) - self:visible(false) - end, - ChartPreviewOffMessageCommand = function(self) - self:visible(true) - end, - } - -t[#t + 1] = - LoadFont("Common Large") .. - { - InitCommand = function(self) - self:xy(frameX + 120, frameY):halign(0):zoom(0.4, maxwidth, 125) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - if song then - self:settext(steps:GetRelevantSkillsetsByMSDRank(getCurRateValue(), 3)) - else - self:settext("") - end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end, - ChartPreviewOnMessageCommand = function(self) - self:visible(false) - end, - ChartPreviewOffMessageCommand = function(self) - self:visible(true) - end, - } -- tags? t[#t + 1] = - LoadFont("Common Large") .. - { + LoadFont("Common Normal") .. { InitCommand = function(self) - self:xy(frameX + 300, frameY - 60):halign(0):zoom(0.4):maxwidth(450) - end, - BeginCommand = function(self) - self:queuecommand("Set") + self:xy(frameX + 300, frameY - 60):halign(0):zoom(0.6):maxwidth(450) end, - SetCommand = function(self) + MintyFreshCommand = function(self) if song and ctags[1] then self:settext(ctags[1]) else self:settext("") end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") end } t[#t + 1] = - LoadFont("Common Large") .. - { + LoadFont("Common Normal") .. { InitCommand = function(self) - self:xy(frameX + 300, frameY - 30):halign(0):zoom(0.4):maxwidth(450) - end, - BeginCommand = function(self) - self:queuecommand("Set") + self:xy(frameX + 300, frameY - 30):halign(0):zoom(0.6):maxwidth(450) end, - SetCommand = function(self) + MintyFreshCommand = function(self) if song and ctags[2] then self:settext(ctags[2]) else self:settext("") end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") end } t[#t + 1] = - LoadFont("Common Large") .. - { + LoadFont("Common Normal") .. { InitCommand = function(self) - self:xy(frameX + 300, frameY):halign(0):zoom(0.4):maxwidth(450) + self:xy(frameX + 300, frameY):halign(0):zoom(0.6):maxwidth(450) end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) + MintyFreshCommand = function(self) if song and ctags[3] then self:settext(ctags[3]) else self:settext("") end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") end } - t[#t + 1] = - LoadFont("Common Normal") .. - { - Name = "ClearType", - InitCommand = function(self) - self:xy(frameX + 185, frameY + 35):zoom(0.6):halign(0) - end, - RefreshChartInfoMessageCommand = function(self) - if song and score then - self:visible(true) - self:settext(getClearTypeFromScore(PLAYER_1, score, 0)) - self:diffuse(getClearTypeFromScore(PLAYER_1, score, 2)) - else - self:visible(false) - end - end, - CurrentRateChangedMessageCommand = function(self) - self:queuecommand("RefreshChartInfo") - end, - } - ---test actor -t[#t + 1] = - LoadFont("Common Large") .. - { - InitCommand = function(self) - self:xy(frameX, frameY - 120):halign(0):zoom(0.4, maxwidth, 125) - end, - BeginCommand = function(self) - self:queuecommand("Set") - end, - SetCommand = function(self) - --ms.type(profile:GetGoalByKey(getCurKey())) - self:settext("") - end, - CurrentStepsP1ChangedMessageCommand = function(self) - self:queuecommand("Set") - end, - RefreshChartInfoMessageCommand = function(self) - self:queuecommand("Set") - end - } - - local yesiwantnotefield = false --Chart Preview Button +local yesiwantnotefield = false local function ihatestickinginputcallbackseverywhere(event) if event.type ~= "InputEventType_Release" and getTabIndex() == 0 then @@ -998,13 +642,6 @@ t[#t + 1] = LoadFont("Common Normal") .. { self:halign(0) self:settext("Toggle Preview") end, - RefreshChartInfoMessageCommand = function(self) - if song then - self:visible(true) - else - self:visible(false) - end - end, MouseLeftClickMessageCommand = function(self) if isOver(self) and (song or noteField) then toggleNoteField() @@ -1020,4 +657,4 @@ t[#t + 1] = LoadFont("Common Normal") .. { } t[#t + 1] = LoadActor("../_chartpreview.lua") -return t +return t \ No newline at end of file diff --git a/Themes/Til Death/BGAnimations/ScreenSystemLayer overlay/default.lua b/Themes/Til Death/BGAnimations/ScreenSystemLayer overlay/default.lua index 91ec592405..64ad2112cb 100644 --- a/Themes/Til Death/BGAnimations/ScreenSystemLayer overlay/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenSystemLayer overlay/default.lua @@ -49,13 +49,21 @@ local hhh = SCREEN_HEIGHT * 0.8 local rtzoom = 0.6 local function dooting(self) - self:GetChild("BGQframe"):queuecommand("dooting") + if self:GetVisible() then + self:GetChild("BGQframe"):queuecommand("dooting") + end end local dltzoom = 0.5 -- download queue/progress t[#t + 1] = Def.ActorFrame { + PausingDownloadsMessageCommand=function(self) + self:visible(false) + end, + ResumingDownloadsMessageCommand=function(self) + self:visible(false) + end, AllDownloadsCompletedMessageCommand = function(self) self:visible(false) end, diff --git a/Themes/Til Death/BGAnimations/_PlayerInfo.lua b/Themes/Til Death/BGAnimations/_PlayerInfo.lua index bf4ca7a54c..e7361a3e25 100644 --- a/Themes/Til Death/BGAnimations/_PlayerInfo.lua +++ b/Themes/Til Death/BGAnimations/_PlayerInfo.lua @@ -22,7 +22,7 @@ local setnewdisplayname = function(answer) end local function highlight(self) - self:queuecommand("Highlight") + self:GetChild("refreshbutton"):queuecommand("Highlight") end local function highlightIfOver(self) @@ -242,8 +242,8 @@ t[#t + 1] = self:settext(GAMESTATE:GetEtternaVersion()) end }, - LoadFont("Common Normal") .. - { + LoadFont("Common Normal") .. { + Name = "refreshbutton", InitCommand = function(self) self:xy(SCREEN_WIDTH - 5, AvatarY + 20):halign(1):zoom(0.35):diffuse(getMainColor("positive")) diff --git a/Themes/Til Death/BGAnimations/_chartpreview.lua b/Themes/Til Death/BGAnimations/_chartpreview.lua index a827d576c4..84db559800 100644 --- a/Themes/Til Death/BGAnimations/_chartpreview.lua +++ b/Themes/Til Death/BGAnimations/_chartpreview.lua @@ -40,6 +40,9 @@ local t = Def.ActorFrame { end, CurrentSongChangedMessageCommand=function(self) self:GetChild("pausetext"):settext("") + if GAMESTATE:GetCurrentSong() then + musicratio = GAMESTATE:GetCurrentSong():GetLastSecond() / wodth + end end, MouseRightClickMessageCommand=function(self) SCREENMAN:GetTopScreen():PausePreviewNoteField() @@ -56,11 +59,6 @@ local t = Def.ActorFrame { hELPidontDNOKNOWMessageCommand=function(self) SCREENMAN:GetTopScreen():DeletePreviewNoteField(self) end, - RefreshChartInfoMessageCommand = function(self) - if GAMESTATE:GetCurrentSong() then - musicratio = GAMESTATE:GetCurrentSong():GetLastSecond() / wodth - end - end, NoteFieldVisibleMessageCommand = function(self) self:visible(true) cd:visible(true):y(20) -- need to control this manually -mina diff --git a/Themes/Til Death/BGAnimations/_songbg.lua b/Themes/Til Death/BGAnimations/_songbg.lua index a0100a62e4..eaf12db8d2 100644 --- a/Themes/Til Death/BGAnimations/_songbg.lua +++ b/Themes/Til Death/BGAnimations/_songbg.lua @@ -9,7 +9,6 @@ local t = Def.ActorFrame {} if enabled then t[#t + 1] = - Def.ActorFrame { Def.Sprite { CurrentSongChangedMessageCommand = function(self) self:finishtweening():smooth(0.5):diffusealpha(0):sleep(0.2):queuecommand("ModifySongBackground") @@ -19,6 +18,7 @@ if enabled then end, ModifySongBackgroundCommand = function(self) self:finishtweening() + collectgarbage() if GAMESTATE:GetCurrentSong() and GAMESTATE:GetCurrentSong():GetBackgroundPath() then self:finishtweening() self:visible(true) @@ -44,7 +44,6 @@ if enabled then self:visible(false) end } - } end t[#t + 1] = diff --git a/Themes/Til Death/BGAnimations/goaldisplay.lua b/Themes/Til Death/BGAnimations/goaldisplay.lua index 3845294580..4c79d145f2 100644 --- a/Themes/Til Death/BGAnimations/goaldisplay.lua +++ b/Themes/Til Death/BGAnimations/goaldisplay.lua @@ -40,7 +40,9 @@ local function input(event) end local function highlight(self) - self:queuecommand("Highlight") + if cheese:GetVisible() then + self:queuecommand("Highlight") + end end local function highlightIfOver(self) diff --git a/Themes/Til Death/BGAnimations/superscoreboard.lua b/Themes/Til Death/BGAnimations/superscoreboard.lua index c51ec94d94..bced658842 100644 --- a/Themes/Til Death/BGAnimations/superscoreboard.lua +++ b/Themes/Til Death/BGAnimations/superscoreboard.lua @@ -70,8 +70,10 @@ local function isOver(element) end local function highlight(self) - self:queuecommand("Highlight") - self:queuecommand("WHAZZZAAAA") + if self:GetVisible() then + self:queuecommand("Highlight") + self:queuecommand("WHAZZZAAAA") + end end local function highlightIfOver(self) @@ -103,15 +105,16 @@ local o = BeginCommand = function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end, - OnCommand = function(self) - GetPlayerOrMachineProfile(PLAYER_1):SetFromAll() - self:queuecommand("ChartLeaderboardUpdate") - end, ChartLeaderboardUpdateMessageCommand = function(self) scoretable = DLMAN:RequestChartLeaderBoard(GAMESTATE:GetCurrentSteps(PLAYER_1):GetChartKey(), currentCountry) ind = 0 self:playcommand("Update") end, + BortCommand = function(self) + scoretable = {} + ind = 0 + self:playcommand("Update") + end, UpdateCommand = function(self) if ind == #scoretable then ind = ind - numscores @@ -404,9 +407,8 @@ local function makeScoreDisplay(i) self:addy(-row2yoff) end }, - LoadFont("Common normal") .. - { - --name + LoadFont("Common normal") .. { + Name = "Burt"..i, InitCommand = function(self) self:x(c2x):zoom(tzoom + 0.1):maxwidth((c3x - c2x - capWideScale(10, 40)) / tzoom):halign(0):valign(1) if collapsed then @@ -431,9 +433,8 @@ local function makeScoreDisplay(i) end end }, - LoadFont("Common normal") .. - { - --judgments + LoadFont("Common normal") .. { + Name = "Ernie"..i, InitCommand = function(self) if not collapsed then self:x(c2x):zoom(tzoom - 0.05):halign(0):valign(0):maxwidth(width / 2 / tzoom):addy(row2yoff) diff --git a/Themes/Til Death/Graphics/StepsDisplayListRow frame.lua b/Themes/Til Death/Graphics/StepsDisplayListRow frame.lua index cab6301060..571d2b348f 100644 --- a/Themes/Til Death/Graphics/StepsDisplayListRow frame.lua +++ b/Themes/Til Death/Graphics/StepsDisplayListRow frame.lua @@ -1,5 +1,7 @@ local function highlight(self) - self:queuecommand("Highlight") + if self:GetParent():GetVisible() then + self:queuecommand("Highlight") + end end local function highlightIfOver(self) diff --git a/Themes/_fallback/Graphics/Common splash.png b/Themes/_fallback/Graphics/Common splash.png index ced5e95e5d..768517017e 100644 Binary files a/Themes/_fallback/Graphics/Common splash.png and b/Themes/_fallback/Graphics/Common splash.png differ diff --git a/Themes/_fallback/Scripts/10 Scores.lua b/Themes/_fallback/Scripts/10 Scores.lua index a97fff2d8a..460048bde7 100644 --- a/Themes/_fallback/Scripts/10 Scores.lua +++ b/Themes/_fallback/Scripts/10 Scores.lua @@ -504,3 +504,73 @@ function getRescoredCustomPercentage(offsetVector, customWindows, totalHolds, ho p = p / ((totalNotes * weights.marv) + (totalHolds * weights.holdHit)) return p * 100.0 end + +function GetDisplayScoreByFilter(perc, CurRate) -- moved from wifetwirl, displays the score for the current rate if there is one, + local rtTable = getRateTable() -- if not it looks for what might plausibly be your best by going down each rate + if not rtTable then + return nil + end + + local rates = tableKeys(rtTable) + local scores, score + + if CurRate then + local tmp = getCurRateString() + if tmp == "1x" then + tmp = "1.0x" + end + if tmp == "2x" then + tmp = "2.0x" + end + rates = {tmp} + if not rtTable[rates[1]] then + return nil + end + end + + table.sort( + rates, + function(a, b) + a = a:gsub("x", "") + b = b:gsub("x", "") + return a < b + end + ) + for i = #rates, 1, -1 do + scores = rtTable[rates[i]] + local bestscore = 0 + local index + + for ii = 1, #scores do + score = scores[ii] + if score:ConvertDpToWife() > bestscore then + index = ii + bestscore = score:ConvertDpToWife() + end + end + + if index and scores[index]:GetWifeScore() == 0 and GetPercentDP(scores[index]) > perc * 100 then + return scores[index] + end + + if bestscore > perc then + return scores[index] + end + end +end + +function GetDisplayScore() -- wrapper for above that prioritizes current rate's pb > any rate 90% > any rate 50% > any score any rate + local score + score = GetDisplayScoreByFilter(0, true) + + if not score then + score = GetDisplayScoreByFilter(0.9, false) + end + if not score then + score = GetDisplayScoreByFilter(0.5, false) + end + if not score then + score = GetDisplayScoreByFilter(0, false) + end + return score +end \ No newline at end of file diff --git a/src/DifficultyList.cpp b/src/DifficultyList.cpp index 8491ee2c43..5d6dd05d83 100644 --- a/src/DifficultyList.cpp +++ b/src/DifficultyList.cpp @@ -13,7 +13,7 @@ /** @brief Specifies the max number of charts available for a song. * * This includes autogenned charts. */ -#define MAX_METERS ((NUM_Difficulty * NUM_StepsType) + MAX_EDITS_PER_SONG) +#define MAX_METERS 12 // kinda restrictive but im also as lazy as sm5 devs -mina REGISTER_ACTOR_CLASS(StepsDisplayList); diff --git a/src/DownloadManager.cpp b/src/DownloadManager.cpp index d645afc544..c570009d5f 100644 --- a/src/DownloadManager.cpp +++ b/src/DownloadManager.cpp @@ -428,6 +428,11 @@ void DownloadManager::UpdateDLSpeed(bool gameplay) { this->gameplay = gameplay; + if (gameplay) + MESSAGEMAN->Broadcast("PausingDownloads"); + else + MESSAGEMAN->Broadcast("ResumingDownloads"); + UpdateDLSpeed(); } @@ -492,6 +497,8 @@ DownloadManager::Update(float fDeltaSeconds) { if (!initialized) init(); + if (gameplay) + return; UpdatePacks(fDeltaSeconds); UpdateHTTP(fDeltaSeconds); return; @@ -1444,7 +1451,8 @@ DownloadManager::RequestChartLeaderBoard(string chartkey) FOREACH_ENUM(Skillset, ss) tmp.SSRs[ss] = static_cast( ssrs.value(SkillsetToString(ss).c_str(), 0.0)); - try { + + /*try { auto replay = score["replay"]; if (replay.size() > 1) LOG->Trace(tmp.modifiers.c_str()); @@ -1453,7 +1461,7 @@ DownloadManager::RequestChartLeaderBoard(string chartkey) pair[0].get(), pair[1].get())); } catch (exception e) { // replaydata failed - } + } */ // eo still has some old profiles with various edge issues that // unfortunately need to be handled here screen out old 11111 @@ -2574,7 +2582,7 @@ class LunaDownload : public Luna static int Stop(T* p, lua_State* L) { p->p_RFWrapper.stop = true; - return 1; + return 0; } LunaDownload() { diff --git a/src/GameSoundManager.cpp b/src/GameSoundManager.cpp index 49b0943c50..3a172b1c6d 100644 --- a/src/GameSoundManager.cpp +++ b/src/GameSoundManager.cpp @@ -806,6 +806,7 @@ class LunaGameSoundManager : public Luna pRet->Set(fVol); SOUNDMAN->SetMixVolume(); p->DimMusic(FArg(1), 0.01f); // lazy hack to update volume without changing songs - mina + return 0; } static int PlayOnce(T* p, lua_State* L) { diff --git a/src/GameState.h b/src/GameState.h index 5a1bd55d31..11a1f83d85 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -224,7 +224,7 @@ class GameState bool m_bLoadingNextSong; int GetLoadingCourseSongIndex() const; - RString GetEtternaVersion() { return "0.62.1"; } + RString GetEtternaVersion() { return "0.63.0"; } bool isplaylistcourse = false; bool IsPlaylistCourse() { return isplaylistcourse; } bool CountNotesSeparately(); diff --git a/src/NoteField.cpp b/src/NoteField.cpp index 212b0613f1..6c852ad1c6 100644 --- a/src/NoteField.cpp +++ b/src/NoteField.cpp @@ -359,6 +359,8 @@ NoteField::InitColumnRenderers() void NoteField::Update(float fDeltaTime) { + if (!this->GetVisible()) + return; if (m_bFirstUpdate) { m_pCurDisplay->m_ReceptorArrowRow.PlayCommand("On"); } diff --git a/src/NoteTypes.h b/src/NoteTypes.h index 2243047ecc..698f657d18 100644 --- a/src/NoteTypes.h +++ b/src/NoteTypes.h @@ -253,6 +253,7 @@ struct TapReplayResult int track; // column float offset; // 0 TapNoteType type; // typically mines, holds, rolls, etc + int offsetAdjustedRow; // row assigned later on for full replays }; extern TapNote TAP_EMPTY; // '0' diff --git a/src/Player.cpp b/src/Player.cpp index 8b63646346..66f1ec1415 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -762,6 +762,11 @@ Player::Load() SendComboMessages(m_pPlayerStageStats->m_iCurCombo, m_pPlayerStageStats->m_iCurMissCombo); + // If we are in a replay, attempt to load the real tapper stuff + if (GamePreferences::m_AutoPlay == PC_REPLAY) { + PlayerAI::SetUpExactTapMap(m_Timing); + } + SAFE_DELETE(m_pIterNeedsTapJudging); m_pIterNeedsTapJudging = new NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW)); @@ -929,6 +934,18 @@ Player::Update(float fDeltaTime) if (m_bPaused) return; + // Fake steps in Replay mode, but only if we have column data. + if (m_pPlayerState->m_PlayerController == PC_REPLAY && + PlayerAI::pScoreData->GetReplayType() == 2) { + if (PlayerAI::TapExistsAtOrBeforeThisRow(iSongRow)) { + vector trrVector = + PlayerAI::GetTapsAtOrBeforeRow(iSongRow); + for (TapReplayResult trr : trrVector) { + Step(trr.track, trr.row, now, false, false); + } + } + } + // update pressed flag const int iNumCols = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber) @@ -2216,9 +2233,10 @@ Player::Step(int col, DEBUG_ASSERT(iter != m_NoteData.end(col)); pTN = &iter->second; - // We don't really have to care if we are releasing on a non-lift, right? - // This fixes a weird noteskin bug with tap explosions. - if (PREFSMAN->m_bFullTapExplosions && bRelease && pTN->type != TapNoteType_Lift) + // We don't really have to care if we are releasing on a non-lift, + // right? This fixes a weird noteskin bug with tap explosions. + if (PREFSMAN->m_bFullTapExplosions && bRelease && + pTN->type != TapNoteType_Lift) return; switch (m_pPlayerState->m_PlayerController) { @@ -2377,11 +2395,16 @@ Player::Step(int col, score = TNS_None; fNoteOffset = -1.f; } else { + if (PlayerAI::GetReplayType() == 2) { + iRowOfOverlappingNoteOrRow = row; + } fNoteOffset = PlayerAI::GetTapNoteOffsetForReplay( - pTN, iRowOfOverlappingNoteOrRow, col); + pTN, iRowOfOverlappingNoteOrRow, col); if (fNoteOffset == -2.f) // we hit a mine { score = TNS_HitMine; + PlayerAI::RemoveTapFromVectors( + iRowOfOverlappingNoteOrRow, col); } else if (pTN->type == TapNoteType_Mine) // we are looking // at a mine but // missed it @@ -2804,10 +2827,14 @@ Player::CrossedRows(int iLastRowCrossed, tn.type != TapNoteType_AutoKeysound && tn.result.tns == TNS_None && this->m_Timing->IsJudgableAtRow(iRow)) { - Step(iTrack, iRow, now, false, false); - if (m_pPlayerState->m_PlayerController == PC_AUTOPLAY) { - if (m_pPlayerStageStats) - m_pPlayerStageStats->m_bDisqualified = true; + if ((m_pPlayerState->m_PlayerController == PC_REPLAY && + PlayerAI::GetReplayType() != 2) || + m_pPlayerState->m_PlayerController == PC_AUTOPLAY || m_pPlayerState->m_PlayerController == PC_CPU) { + Step(iTrack, iRow, now, false, false); + if (m_pPlayerState->m_PlayerController == PC_AUTOPLAY || m_pPlayerState->m_PlayerController == PC_CPU) { + if (m_pPlayerStageStats) + m_pPlayerStageStats->m_bDisqualified = true; + } } } } diff --git a/src/PlayerAI.cpp b/src/PlayerAI.cpp index 3a89362e84..acc9a25557 100644 --- a/src/PlayerAI.cpp +++ b/src/PlayerAI.cpp @@ -50,8 +50,10 @@ struct TapScoreDistribution static TapScoreDistribution g_Distributions[NUM_SKILL_LEVELS]; HighScore* PlayerAI::pScoreData = nullptr; +TimingData* PlayerAI::pReplayTiming = nullptr; map> PlayerAI::m_ReplayTapMap; map> PlayerAI::m_ReplayHoldMap; +map> PlayerAI::m_ReplayExactTapMap; void PlayerAI::InitFromDisk() @@ -153,10 +155,16 @@ PlayerAI::GetTapNoteScoreForReplay(const PlayerState* pPlayerState, void PlayerAI::SetScoreData(HighScore* pHighScore) { - pHighScore->LoadReplayData(); + bool successful = pHighScore->LoadReplayData(); pScoreData = pHighScore; m_ReplayTapMap.clear(); m_ReplayHoldMap.clear(); + + if (!successful) + { + return; + } + auto replayNoteRowVector = pHighScore->GetCopyOfNoteRowVector(); auto replayOffsetVector = pHighScore->GetCopyOfOffsetVector(); auto replayTapNoteTypeVector = pHighScore->GetCopyOfTapNoteTypeVector(); @@ -169,11 +177,15 @@ PlayerAI::SetScoreData(HighScore* pHighScore) TapReplayResult trr; trr.row = replayNoteRowVector[i]; trr.offset = replayOffsetVector[i]; + trr.offsetAdjustedRow = replayOffsetVector[i]; if (pScoreData->GetReplayType() == 2) // 2 means that this is a Full Replay { trr.track = replayTrackVector[i]; trr.type = replayTapNoteTypeVector[i]; + + + } else // Anything else (and we got this far without crashing) means // it's not a Full Replay { @@ -204,6 +216,96 @@ PlayerAI::SetScoreData(HighScore* pHighScore) } } +void +PlayerAI::SetUpExactTapMap(TimingData* timing) +{ + m_ReplayExactTapMap.clear(); + + // Don't continue if the replay doesn't have column data. + // We can't be accurate without it. + if (pScoreData->GetReplayType() != 2) + return; + + pReplayTiming = timing; + + // For every row in the replay data... + for (auto& row : m_ReplayTapMap) + { + // Get the current time and go over all taps on this row... + float rowTime = timing->WhereUAtBro(row.first); + for (TapReplayResult& trr : row.second) + { + // Find the time adjusted for offset + // Then the beat according to that time + // Then the noterow according to that beat + float tapTime = rowTime + trr.offset; + float tapBeat = timing->GetBeatFromElapsedTime(tapTime); + int tapRow = BeatToNoteRow(tapBeat); + trr.offsetAdjustedRow = tapRow; + + // And put that into the exacttapmap :) + if (m_ReplayExactTapMap.count(tapRow) != 0) + { + m_ReplayExactTapMap[tapRow].push_back(trr); + } + else + { + vector trrVector = { trr }; + m_ReplayExactTapMap[tapRow] = trrVector; + } + } + + } + +} + +void +PlayerAI::RemoveTapFromVectors(int row, int col) +{ + // if the row is in the replay data + if (m_ReplayTapMap.count(row) != 0) { + for (int i = 0; i < (int)m_ReplayTapMap[row].size(); i++) { + // if the column is in the row data + auto& trr = m_ReplayTapMap[row][i]; + if (trr.track == col) { + // delete + m_ReplayTapMap[row].erase(m_ReplayTapMap[row].begin() + i); + if (m_ReplayTapMap[row].empty()) + m_ReplayTapMap.erase(row); + } + } + } + // if the row is in the replay data + if (m_ReplayExactTapMap.count(row) != 0) { + for (int i = 0; i < (int)m_ReplayExactTapMap[row].size(); i++) { + // if the column is in the row data + auto& trr = m_ReplayExactTapMap[row][i]; + if (trr.track == col) { + // delete + m_ReplayExactTapMap[row].erase(m_ReplayExactTapMap[row].begin() + i); + if (m_ReplayExactTapMap[row].empty()) + m_ReplayExactTapMap.erase(row); + } + } + } +} + +int +PlayerAI::GetAdjustedRowFromUnadjustedCoordinates(int row, int col) +{ + int output = -1; + + if (m_ReplayTapMap.count(row) != 0) + { + for (TapReplayResult& trr : m_ReplayTapMap[row]) + { + if (trr.track == col) + output = trr.offsetAdjustedRow; + } + } + return output; +} + bool PlayerAI::DetermineIfHoldDropped(int noteRow, int col) { @@ -213,7 +315,7 @@ PlayerAI::DetermineIfHoldDropped(int noteRow, int col) // LOG->Trace("Hold row exists in the data"); // It is, so let's go over each column, assuming we may have dropped // more than one hold at once. - for (auto hrr : m_ReplayHoldMap[noteRow]) { + for (auto& hrr : m_ReplayHoldMap[noteRow]) { // We found the column we are looking for if (hrr.track == col) { // LOG->Trace("KILL IT NOW"); @@ -224,6 +326,105 @@ PlayerAI::DetermineIfHoldDropped(int noteRow, int col) return false; } +bool +PlayerAI::TapExistsAtThisRow(int noteRow) +{ + // 2 is a replay with column data + if (pScoreData->GetReplayType() == 2) { + return m_ReplayExactTapMap.count(noteRow) != 0; + } else { + return m_ReplayTapMap.count(noteRow) != 0; + } + +} + +bool +PlayerAI::TapExistsAtOrBeforeThisRow(int noteRow) +{ + // 2 is a replay with column data + if (pScoreData->GetReplayType() == 2) { + return m_ReplayExactTapMap.lower_bound(0)->first <= noteRow; + } else { + return m_ReplayTapMap.lower_bound(0)->first <= noteRow; + } +} + +vector +PlayerAI::GetTapsAtOrBeforeRow(int noteRow) +{ + vector output; + + // 2 is a replay with column data + if (pScoreData->GetReplayType() == 2) { + auto rowIt = m_ReplayExactTapMap.lower_bound(0); + int row = rowIt->first; + for (; row <= noteRow && row != -1;) { + vector toMerge = GetTapsToTapForRow(row); + output.insert(output.end(), toMerge.begin(), toMerge.end()); + row = GetNextRowNoOffsets(row); + } + } else { + auto rowIt = m_ReplayTapMap.lower_bound(0); + int row = rowIt->first; + for (; row <= noteRow && row != -1;) { + vector toMerge = GetTapsToTapForRow(row); + output.insert(output.end(), toMerge.begin(), toMerge.end()); + row = GetNextRowNoOffsets(row); + } + } + return output; +} + +vector +PlayerAI::GetTapsToTapForRow(int noteRow) +{ + vector output; + + // 2 is a replay with column data + if (pScoreData->GetReplayType() == 2) { + if (m_ReplayExactTapMap.count(noteRow) != 0) { + for (auto& trr : m_ReplayExactTapMap[noteRow]) { + output.push_back(trr); + } + } + } else { + if (m_ReplayTapMap.count(noteRow) != 0) { + for (auto& trr : m_ReplayTapMap[noteRow]) { + output.push_back(trr); + } + } + } + return output; +} + +int +PlayerAI::GetReplayType() +{ + return pScoreData->GetReplayType(); +} + +int +PlayerAI::GetNextRowNoOffsets(int currentRow) +{ + if (pScoreData->GetReplayType() == 2) { + auto thing = m_ReplayExactTapMap.lower_bound(currentRow + 1); + + if (thing == m_ReplayExactTapMap.end()) { + return -1; + } else { + return thing->first; + } + } else { + auto thing = m_ReplayTapMap.lower_bound(currentRow + 1); + + if (thing == m_ReplayTapMap.end()) { + return -1; + } else { + return thing->first; + } + } +} + float PlayerAI::GetTapNoteOffsetForReplay(TapNote* pTN, int noteRow, int col) { @@ -237,35 +438,38 @@ PlayerAI::GetTapNoteOffsetForReplay(TapNote* pTN, int noteRow, int col) // tap note type] Current v0.60 Replay Data format (H section): H [noterow] // [track] [optional: tap note subtype] // LOG->Trace("Note row %d", noteRow); - if (m_ReplayTapMap.count(noteRow) != 0) // is the current row recorded? - { - // This replay has no column data or is considered Basic. (Pre-v0.60 - // Replays do this.) - if (pScoreData->GetReplayType() == 1) { - // mines are not preset in the old replay data, we just skip them - // this gets caught by Player after it finds that the offset wasnt - // -2.f (We check for an impossible offset of -2.f in Player to blow - // up a mine) - if (pTN->type == TapNoteType_Mine) - return -1.f; - - float offset = m_ReplayTapMap[noteRow].back().offset; - - // this is done to be able to judge simultaneous taps differently - // due to CC Off this results in possibly incorrect precise per tap - // judges, but the correct judgement ends up being made overall. - m_ReplayTapMap[noteRow].pop_back(); - if (m_ReplayTapMap[noteRow].empty()) { - m_ReplayTapMap.erase(noteRow); - } - return -offset; - } else { + // This replay has no column data or is considered Basic. (Pre-v0.60 + // Replays do this.) + if (pScoreData->GetReplayType() == 1) { + // mines are not preset in the old replay data, we just skip them + // this gets caught by Player after it finds that the offset wasnt + // -2.f (We check for an impossible offset of -2.f in Player to blow + // up a mine) + if (pTN->type == TapNoteType_Mine) + return -1.f; - // This is only reached if we have column data. - for (auto trr : - m_ReplayTapMap[noteRow]) // go over all elements in the row + float offset = m_ReplayTapMap[noteRow].back().offset; + + // this is done to be able to judge simultaneous taps differently + // due to CC Off this results in possibly incorrect precise per tap + // judges, but the correct judgement ends up being made overall. + m_ReplayTapMap[noteRow].pop_back(); + if (m_ReplayTapMap[noteRow].empty()) { + m_ReplayTapMap.erase(noteRow); + } + + return -offset; + } else { + + // This is only reached if we have column data. + noteRow = GetAdjustedRowFromUnadjustedCoordinates(noteRow, col); + if (m_ReplayExactTapMap.count(noteRow) != 0) + { + for (int i = 0; i < (int)m_ReplayExactTapMap[noteRow] + .size(); i++) // go over all elements in the row { + auto trr = m_ReplayExactTapMap[noteRow][i]; if (trr.track == col) // if the column expected is the actual note, use it { @@ -275,6 +479,10 @@ PlayerAI::GetTapNoteOffsetForReplay(TapNote* pTN, int noteRow, int col) if (trr.type != TapNoteType_Lift) continue; } + m_ReplayExactTapMap[noteRow].erase( + m_ReplayExactTapMap[noteRow].begin() + i); + if (m_ReplayExactTapMap[noteRow].empty()) + m_ReplayExactTapMap.erase(noteRow); return -trr.offset; } } diff --git a/src/PlayerAI.h b/src/PlayerAI.h index 2973751c7c..27d3ab384e 100644 --- a/src/PlayerAI.h +++ b/src/PlayerAI.h @@ -14,9 +14,11 @@ class PlayerAI { public: // Pointer to real high score data for a replay - static HighScore* pScoreData; + // Pointer to real timing data for a replay + static TimingData* pReplayTiming; + // Pulled from pScoreData on initialization // A map with indices for each row of the chart, pointing to nothing or a @@ -25,6 +27,11 @@ class PlayerAI // A map with indices for each row of the chart, pointing to nothing or hold // drop results. static map> m_ReplayHoldMap; + // A map with indices for each row of the chart, pointing to nothing or a + // Normal Result. However, note that the rows within are actually calculated + // so that they are adjusted for offsets relative to the actual replay data/notedata. + // This map is only useful for charts with column data. + static map> m_ReplayExactTapMap; static void InitFromDisk(); static TapNoteScore GetTapNoteScore(const PlayerState* pPlayerState); @@ -35,6 +42,27 @@ class PlayerAI const PlayerState* pPlayerState, float fNoteOffset); static bool DetermineIfHoldDropped(int noteRow, int col); + // Returns the column that needs to be tapped. + // Returns -1 if no column needs to be tapped. + static int DetermineNextTapColumn(int noteRow, int searchRowDistance, TimingData* timing); + // Literally get the next row in the replay data. Disregard offset calculations. + static int GetNextRowNoOffsets(int currentRow); + // Reset and populate the ReplayExactTapMap. + // This is meant to be run once Gameplay begins. + static void SetUpExactTapMap(TimingData* timing); + // Check the Tap Replay Data to see if a tap is on this row + static bool TapExistsAtThisRow(int noteRow); + static bool TapExistsAtOrBeforeThisRow(int noteRow); + // Build a list of columns/tracks to tap based on the given noterow. + static vector GetTapsToTapForRow(int noteRow); + static int GetReplayType(); + // Build a list of columns/tracks that happened at or before the given noterow. + // (if we lag and somehow skip rows) + static vector GetTapsAtOrBeforeRow(int noteRow); + // Given a column and row, retrieve the adjusted row. + static int GetAdjustedRowFromUnadjustedCoordinates(int row, int col); + // Remove a given Tap from the fallback and Full replay data vectors + static void RemoveTapFromVectors(int row, int col); }; #endif diff --git a/src/PrefsManager.cpp b/src/PrefsManager.cpp index 66410a4dfd..2bd7d6f200 100644 --- a/src/PrefsManager.cpp +++ b/src/PrefsManager.cpp @@ -150,7 +150,6 @@ PrefsManager::PrefsManager() , m_bAllowedLag("AllowedLag", 0.001f) , m_bShowStats("ShowStats", TRUE_IF_DEBUG) , m_bShowSkips("ShowSkips", true) - , m_bShowBanners("ShowBanners", true) , m_bShowMouseCursor("ShowMouseCursor", true) , m_bVsync("Vsync", false) , m_FastNoteRendering("FastNoteRendering", true) diff --git a/src/PrefsManager.h b/src/PrefsManager.h index e26d8c3863..03dd4df402 100644 --- a/src/PrefsManager.h +++ b/src/PrefsManager.h @@ -151,7 +151,6 @@ class PrefsManager Preference m_bAllowedLag; Preference m_bShowStats; Preference m_bShowSkips; - Preference m_bShowBanners; Preference m_bShowMouseCursor; Preference m_bVsync; Preference m_FastNoteRendering; diff --git a/src/ProductInfo.inc b/src/ProductInfo.inc index dc58167261..c1fa493054 100644 --- a/src/ProductInfo.inc +++ b/src/ProductInfo.inc @@ -6,7 +6,7 @@ !define PRODUCT_ID "Etterna" ; TODO: This needs to be updated with the git rev hash -!define PRODUCT_VER "v0.62.1" +!define PRODUCT_VER "v0.63.0" !define PRODUCT_DISPLAY "${PRODUCT_FAMILY} ${PRODUCT_VER}" !define PRODUCT_BITMAP "ett" diff --git a/src/ScreenEvaluation.cpp b/src/ScreenEvaluation.cpp index 5113b82c05..4553862749 100644 --- a/src/ScreenEvaluation.cpp +++ b/src/ScreenEvaluation.cpp @@ -763,30 +763,48 @@ ScreenEvaluation::Input(const InputEventPlus& input) CodeDetector::EnteredCode(input.GameI.controller, CODE_SAVE_SCREENSHOT2)) { PlayerNumber pn = input.pn; - if (!m_bSavedScreenshot[pn] && // only allow one screenshot - PROFILEMAN->IsPersistentProfile(pn)) { - Profile* pProfile = PROFILEMAN->GetProfile(pn); - RString sDir = - PROFILEMAN->GetProfileDir((ProfileSlot)pn) + "Screenshots/"; - RString sFileName = - StepMania::SaveScreenshot(sDir, true, true, "", ""); - - if (!sFileName.empty()) { - RString sPath = sDir + sFileName; - - const HighScore& hs = - m_pStageStats->m_player[pn].m_HighScore; - Screenshot screenshot; - screenshot.sFileName = sFileName; - screenshot.sMD5 = - BinaryToHex(CRYPTMAN->GetMD5ForFile(sPath)); - screenshot.highScore = hs; - pProfile->AddScreenshot(screenshot); + bool bHoldingShift = + (INPUTFILTER->IsBeingPressed( + DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT)) || + INPUTFILTER->IsBeingPressed( + DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT))); + RString sDir; + RString sFileName; + // To save a screenshot to your own profile you must hold shift + // and press the button it saves compressed so you don't end up + // with an inflated profile size + // Otherwise, you can tap away at the screenshot button without holding shift. + if (bHoldingShift && PROFILEMAN->IsPersistentProfile(pn)) + { + if (!m_bSavedScreenshot[pn]) + { + Profile* pProfile = PROFILEMAN->GetProfile(pn); + sDir = PROFILEMAN->GetProfileDir((ProfileSlot)pn) + + "Screenshots/"; + sFileName = + StepMania::SaveScreenshot(sDir, bHoldingShift, true, "", ""); + if (!sFileName.empty()) { + RString sPath = sDir + sFileName; + + const HighScore& hs = + m_pStageStats->m_player[pn].m_HighScore; + Screenshot screenshot; + screenshot.sFileName = sFileName; + screenshot.sMD5 = + BinaryToHex(CRYPTMAN->GetMD5ForFile(sPath)); + screenshot.highScore = hs; + pProfile->AddScreenshot(screenshot); + } + m_bSavedScreenshot[pn] = true; } - - m_bSavedScreenshot[pn] = true; - return true; // handled } + else + { + sDir = "Screenshots/"; + sFileName = + StepMania::SaveScreenshot(sDir, bHoldingShift, true, "", ""); + } + return true; // handled } } diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index ee61d5a693..4782c45c8d 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -2849,6 +2849,7 @@ ScreenGameplay::ToggleReplayPause() ReloadCurrentSong(); STATSMAN->m_CurStageStats.m_player[PLAYER_1].InternalInit(); PlayerAI::SetScoreData(PlayerAI::pScoreData); + PlayerAI::SetUpExactTapMap(PlayerAI::pReplayTiming); // Reset the wife/judge counter related visible stuff FOREACH_ENUM(TapNoteScore, tns) diff --git a/src/ScreenInstallOverlay.cpp b/src/ScreenInstallOverlay.cpp index 9e21e96383..4b1f8ad761 100644 --- a/src/ScreenInstallOverlay.cpp +++ b/src/ScreenInstallOverlay.cpp @@ -250,34 +250,36 @@ ScreenInstallOverlay::Update(float fDeltaTime) DoInstalls(args); } #if !defined(WITHOUT_NETWORKING) - static float lastDLProgressUpdate = 0; - lastDLProgressUpdate += fDeltaTime; - if (DLMAN->downloads.empty() || lastDLProgressUpdate < 0.5) - return; - lastDLProgressUpdate = 0; - Message msg("DLProgressAndQueueUpdate"); + if (!DLMAN->gameplay) { + static float lastDLProgressUpdate = 0; + lastDLProgressUpdate += fDeltaTime; + if (DLMAN->downloads.empty() || lastDLProgressUpdate < 0.5) + return; + lastDLProgressUpdate = 0; + Message msg("DLProgressAndQueueUpdate"); - vector dls; - for (auto& dl : DLMAN->downloads) { - dls.push_back(dl.second->Status()); - } - msg.SetParam("dlsize", static_cast(DLMAN->downloads.size())); - msg.SetParam("dlprogress", join("\n", dls)); + vector dls; + for (auto& dl : DLMAN->downloads) { + dls.push_back(dl.second->Status()); + } + msg.SetParam("dlsize", static_cast(DLMAN->downloads.size())); + msg.SetParam("dlprogress", join("\n", dls)); - if (!DLMAN->DownloadQueue.empty()) { - vector cue; - for (auto& q : DLMAN->DownloadQueue) { - cue.push_back(q.first->name); + if (!DLMAN->DownloadQueue.empty()) { + vector cue; + for (auto& q : DLMAN->DownloadQueue) { + cue.push_back(q.first->name); + } + msg.SetParam("queuesize", + static_cast(DLMAN->DownloadQueue.size())); + msg.SetParam("queuedpacks", join("\n", cue)); + } else { + msg.SetParam("queuesize", 0); + msg.SetParam("queuedpacks", RString("")); } - msg.SetParam("queuesize", - static_cast(DLMAN->DownloadQueue.size())); - msg.SetParam("queuedpacks", join("\n", cue)); - } else { - msg.SetParam("queuesize", 0); - msg.SetParam("queuedpacks", RString("")); + MESSAGEMAN->Broadcast(msg); } - MESSAGEMAN->Broadcast(msg); - + #endif } diff --git a/src/ScreenOptionsMasterPrefs.cpp b/src/ScreenOptionsMasterPrefs.cpp index cae91e7a8e..3c62ba011f 100644 --- a/src/ScreenOptionsMasterPrefs.cpp +++ b/src/ScreenOptionsMasterPrefs.cpp @@ -1017,8 +1017,6 @@ InitializeConfOptions() g_ConfOptions.back().m_iEffects = OPT_APPLY_GRAPHICS; ADD(ConfOption("FastNoteRendering", MovePref, "Off", "On")); ADD(ConfOption("ShowStats", MovePref, "Off", "On")); - ADD(ConfOption("ShowBanners", MovePref, "Off", "On")); - // Sound options ADD(ConfOption("AttractSoundFrequency", MovePref, diff --git a/src/ScreenProfileSave.cpp b/src/ScreenProfileSave.cpp index aa2e8f5912..b485526dd5 100644 --- a/src/ScreenProfileSave.cpp +++ b/src/ScreenProfileSave.cpp @@ -2,6 +2,7 @@ #include "GameState.h" #include "ScreenManager.h" #include "ScreenProfileSave.h" +#include "DownloadManager.h" REGISTER_SCREEN_CLASS(ScreenProfileSave); @@ -20,6 +21,7 @@ ScreenProfileSave::Input(const InputEventPlus& input) void ScreenProfileSave::Continue() { + DLMAN->chartLeaderboards.clear(); // clear cached leaderboard scores when saving after gameplay -mina GAMESTATE->SavePlayerProfiles(); SCREENMAN->ZeroNextUpdate(); diff --git a/src/ScreenSelectMusic.cpp b/src/ScreenSelectMusic.cpp index 2c6c4417ae..7b843fde2e 100644 --- a/src/ScreenSelectMusic.cpp +++ b/src/ScreenSelectMusic.cpp @@ -66,11 +66,6 @@ AutoScreenMessage(SM_BackFromPlayerOptions); AutoScreenMessage(SM_ConfirmDeleteSong); AutoScreenMessage(SM_BackFromNamePlaylist); -static RString g_sCDTitlePath; -static bool g_bWantFallbackCdTitle; -static bool g_bCDTitleWaiting = false; -static RString g_sBannerPath; -static bool g_bBannerWaiting = false; static bool g_bSampleMusicWaiting = false; static bool delayedchartupdatewaiting = false; static RageTimer g_StartedLoadingAt(RageZeroTimer); @@ -118,9 +113,6 @@ ScreenSelectMusic::Init() SELECT_MENU_NAME.Load(m_sName, "SelectMenuScreenName"); OPTIONS_LIST_TIMEOUT.Load(m_sName, "OptionsListTimeout"); SELECT_MENU_CHANGES_DIFFICULTY.Load(m_sName, "SelectMenuChangesDifficulty"); - TWO_PART_SELECTION.Load(m_sName, "TwoPartSelection"); - TWO_PART_CONFIRMS_ONLY.Load(m_sName, "TwoPartConfirmsOnly"); - TWO_PART_TIMER_SECONDS.Load(m_sName, "TwoPartTimerSeconds"); WRAP_CHANGE_STEPS.Load(m_sName, "WrapChangeSteps"); NULL_SCORE_STRING.Load(m_sName, "NullScoreString"); PLAY_SOUND_ON_ENTERING_OPTIONS_MENU.Load(m_sName, @@ -215,37 +207,6 @@ ScreenSelectMusic::Init() m_OptionsList[PLAYER_2].Link(&m_OptionsList[PLAYER_1]); } - // this is loaded SetSong and TweenToSong - m_Banner.SetName("Banner"); - LOAD_ALL_COMMANDS_AND_SET_XY(m_Banner); - this->AddChild(&m_Banner); - - m_sprCDTitleFront.SetName("CDTitle"); - m_sprCDTitleFront.Load(THEME->GetPathG(m_sName, "fallback cdtitle")); - LOAD_ALL_COMMANDS_AND_SET_XY(m_sprCDTitleFront); - COMMAND(m_sprCDTitleFront, "Front"); - this->AddChild(&m_sprCDTitleFront); - - m_sprCDTitleBack.SetName("CDTitle"); - m_sprCDTitleBack.Load(THEME->GetPathG(m_sName, "fallback cdtitle")); - LOAD_ALL_COMMANDS_AND_SET_XY(m_sprCDTitleBack); - COMMAND(m_sprCDTitleBack, "Back"); - this->AddChild(&m_sprCDTitleBack); - - FOREACH_ENUM(PlayerNumber, p) - { - m_sprHighScoreFrame[p].Load( - THEME->GetPathG(m_sName, ssprintf("ScoreFrame P%d", p + 1))); - m_sprHighScoreFrame[p]->SetName(ssprintf("ScoreFrameP%d", p + 1)); - LOAD_ALL_COMMANDS_AND_SET_XY(m_sprHighScoreFrame[p]); - this->AddChild(m_sprHighScoreFrame[p]); - - m_textHighScore[p].SetName(ssprintf("ScoreP%d", p + 1)); - m_textHighScore[p].LoadFromFont(THEME->GetPathF(m_sName, "score")); - LOAD_ALL_COMMANDS_AND_SET_XY(m_textHighScore[p]); - this->AddChild(&m_textHighScore[p]); - } - RageSoundLoadParams SoundParams; SoundParams.m_bSupportPan = true; @@ -276,7 +237,7 @@ ScreenSelectMusic::BeginScreen() GAMESTATE->SetCompatibleStylesForPlayers(); } - if (GAMESTATE->GetCurrentStyle(PLAYER_INVALID) == NULL) { + if (GAMESTATE->GetCurrentStyle(PLAYER_INVALID) == nullptr) { LOG->Trace("The Style has not been set. A theme must set the Style " "before loading ScreenSelectMusic."); // Instead of crashing, set the first compatible style. @@ -284,7 +245,7 @@ ScreenSelectMusic::BeginScreen() GAMEMAN->GetStepsTypesForGame(GAMESTATE->m_pCurGame, vst); const Style* pStyle = GAMEMAN->GetFirstCompatibleStyle( GAMESTATE->m_pCurGame, GAMESTATE->GetNumSidesJoined(), vst[0]); - if (pStyle == NULL) { + if (pStyle == nullptr) { LOG->Warn(ssprintf("No compatible styles for %s with %d player%s.", GAMESTATE->m_pCurGame->m_szName, GAMESTATE->GetNumSidesJoined(), @@ -300,13 +261,6 @@ ScreenSelectMusic::BeginScreen() GAMESTATE->m_PlayMode.Set(PLAY_MODE_REGULAR); LOG->Trace("PlayMode not set, setting as regular."); } - FOREACH_ENUM(PlayerNumber, pn) - { - if (GAMESTATE->IsHumanPlayer(pn)) - continue; - m_sprHighScoreFrame[pn]->SetVisible(false); - m_textHighScore[pn].SetVisible(false); - } OPTIONS_MENU_AVAILABLE.Load(m_sName, "OptionsMenuAvailable"); PlayCommand("Mods"); @@ -348,31 +302,6 @@ ScreenSelectMusic::~ScreenSelectMusic() void ScreenSelectMusic::CheckBackgroundRequests(bool bForce) { - if (g_bCDTitleWaiting) { - // The CDTitle is normally very small, so we don't bother waiting to - // display it. - RString sPath; - if (!m_BackgroundLoader.IsCacheFileFinished(g_sCDTitlePath, sPath)) - return; - - g_bCDTitleWaiting = false; - - RString sCDTitlePath = sPath; - - if (sCDTitlePath.empty() || !IsAFile(sCDTitlePath)) - sCDTitlePath = - g_bWantFallbackCdTitle ? m_sFallbackCDTitlePath : RString(""); - - if (!sCDTitlePath.empty()) { - TEXTUREMAN->DisableOddDimensionWarning(); - m_sprCDTitleFront.Load(sCDTitlePath); - m_sprCDTitleBack.Load(sCDTitlePath); - TEXTUREMAN->EnableOddDimensionWarning(); - } - - m_BackgroundLoader.FinishedWithCachedFile(g_sCDTitlePath); - } - /* Loading the rest can cause small skips, so don't do it until the wheel * settles. Do load if we're transitioning out, though, so we don't miss * starting the music for the options screen if a song is selected quickly. @@ -382,30 +311,6 @@ ScreenSelectMusic::CheckBackgroundRequests(bool bForce) if (!m_MusicWheel.IsSettled() && !m_MusicWheel.WheelIsLocked() && !bForce) return; - if (g_bBannerWaiting) { - if (m_Banner.GetTweenTimeLeft() > 0) - return; - - RString sPath; - bool bFreeCache = false; - if (TEXTUREMAN->IsTextureRegistered( - Sprite::SongBannerTexture(g_sBannerPath))) { - /* If the file is already loaded into a texture, it's finished, - * and we only do this to honor the HighQualTime value. */ - sPath = g_sBannerPath; - } else { - if (!m_BackgroundLoader.IsCacheFileFinished(g_sBannerPath, sPath)) - return; - bFreeCache = true; - } - - g_bBannerWaiting = false; - m_Banner.Load(sPath, true); - - if (bFreeCache) - m_BackgroundLoader.FinishedWithCachedFile(g_sBannerPath); - } - // we need something similar to the previewmusic delay except for charts, so // heavy duty chart specific operations can be delayed when scrolling (chord // density graph, possibly chart leaderboards, etc) -mina @@ -900,75 +805,30 @@ ScreenSelectMusic::Input(const InputEventPlus& input) } } - // two part confirms only means we can actually change songs here, - // so we need some hackery. -aj - if (TWO_PART_CONFIRMS_ONLY) { - if (m_SelectionState == SelectionState_SelectingSteps) { + if (m_SelectionState == SelectionState_SelectingSteps && + input.type == IET_FIRST_PRESS && !m_bStepsChosen[input.pn]) { + if (input.MenuI == m_GameButtonNextSong || + input.MenuI == m_GameButtonPreviousSong) { if (input.MenuI == m_GameButtonPreviousSong) { - m_SelectionState = SelectionState_SelectingSong; - MESSAGEMAN->Broadcast("TwoPartConfirmCanceled"); - MESSAGEMAN->Broadcast("PreviousSong"); - m_MusicWheel.ChangeMusicUnlessLocked(-1); - } else if (input.MenuI == m_GameButtonNextSong) { - m_SelectionState = SelectionState_SelectingSong; - MESSAGEMAN->Broadcast("TwoPartConfirmCanceled"); - MESSAGEMAN->Broadcast("NextSong"); - m_MusicWheel.ChangeMusicUnlessLocked(+1); - } - // added an entry for difficulty change with gamebuttons - // -DaisuMaster - else if (input.MenuI == m_GameButtonPreviousDifficulty) { - m_SelectionState = SelectionState_SelectingSong; - MESSAGEMAN->Broadcast("TwoPartConfirmCanceled"); ChangeSteps(input.pn, -1); - } else if (input.MenuI == m_GameButtonNextDifficulty) { - m_SelectionState = SelectionState_SelectingSong; - MESSAGEMAN->Broadcast("TwoPartConfirmCanceled"); + } else if (input.MenuI == m_GameButtonNextSong) { ChangeSteps(input.pn, +1); } - // added also for groupchanges - else if (input.MenuI == m_GameButtonPreviousGroup) { - RString sNewGroup = m_MusicWheel.JumpToPrevGroup(); - m_MusicWheel.SelectSection(sNewGroup); - m_MusicWheel.SetOpenSection(sNewGroup); - MESSAGEMAN->Broadcast("TwoPartConfirmCanceled"); - MESSAGEMAN->Broadcast("PreviousGroup"); - AfterMusicChange(); - } else if (input.MenuI == m_GameButtonNextGroup) { - RString sNewGroup = m_MusicWheel.JumpToNextGroup(); - m_MusicWheel.SelectSection(sNewGroup); - m_MusicWheel.SetOpenSection(sNewGroup); - MESSAGEMAN->Broadcast("TwoPartConfirmCanceled"); - MESSAGEMAN->Broadcast("NextGroup"); - AfterMusicChange(); - } - } - } else { - if (m_SelectionState == SelectionState_SelectingSteps && - input.type == IET_FIRST_PRESS && !m_bStepsChosen[input.pn]) { - if (input.MenuI == m_GameButtonNextSong || - input.MenuI == m_GameButtonPreviousSong) { - if (input.MenuI == m_GameButtonPreviousSong) { - ChangeSteps(input.pn, -1); - } else if (input.MenuI == m_GameButtonNextSong) { - ChangeSteps(input.pn, +1); - } - } else if ( - input.MenuI == GAME_BUTTON_MENUUP || - input.MenuI == - GAME_BUTTON_MENUDOWN) // && TWO_PART_DESELECTS_WITH_MENUUPDOWN - { - // XXX: should this be called "TwoPartCancelled"? - float fSeconds = m_MenuTimer->GetSeconds(); - if (fSeconds > 10) { - Message msg("SongUnchosen"); - msg.SetParam("Player", input.pn); - MESSAGEMAN->Broadcast(msg); - // unset all steps - FOREACH_ENUM(PlayerNumber, p) - m_bStepsChosen[p] = false; - m_SelectionState = SelectionState_SelectingSong; - } + } else if (input.MenuI == GAME_BUTTON_MENUUP || + input.MenuI == + GAME_BUTTON_MENUDOWN) // && + // TWO_PART_DESELECTS_WITH_MENUUPDOWN + { + // XXX: should this be called "TwoPartCancelled"? + float fSeconds = m_MenuTimer->GetSeconds(); + if (fSeconds > 10) { + Message msg("SongUnchosen"); + msg.SetParam("Player", input.pn); + MESSAGEMAN->Broadcast(msg); + // unset all steps + FOREACH_ENUM(PlayerNumber, p) + m_bStepsChosen[p] = false; + m_SelectionState = SelectionState_SelectingSong; } } } @@ -1137,7 +997,7 @@ ScreenSelectMusic::HandleMessage(const Message& msg) } m_iSelection[pn] = iSel; - Steps* pSteps = m_vpSteps.empty() ? NULL : m_vpSteps[m_iSelection[pn]]; + Steps* pSteps = m_vpSteps.empty() ? nullptr : m_vpSteps[m_iSelection[pn]]; GAMESTATE->m_pCurSteps[pn].Set(pSteps); } @@ -1156,7 +1016,7 @@ ScreenSelectMusic::HandleScreenMessage(const ScreenMessage SM) m_MenuTimer->SetSeconds(ROULETTE_TIMER_SECONDS); m_MenuTimer->Start(); } else if (DO_ROULETTE_ON_MENU_TIMER && - m_MusicWheel.GetSelectedSong() == NULL) { + m_MusicWheel.GetSelectedSong() == nullptr) { m_MenuTimer->SetSeconds(ROULETTE_TIMER_SECONDS); m_MenuTimer->Start(); } else { @@ -1252,9 +1112,8 @@ ScreenSelectMusic::SelectCurrent(PlayerNumber pn) return false; // a song was selected - if (m_MusicWheel.GetSelectedSong() != NULL) { - if (TWO_PART_CONFIRMS_ONLY && - SAMPLE_MUSIC_PREVIEW_MODE == + if (m_MusicWheel.GetSelectedSong() != nullptr) { + if (SAMPLE_MUSIC_PREVIEW_MODE == SampleMusicPreviewMode_StartToPreview) { // start playing the preview music. g_bSampleMusicWaiting = true; @@ -1316,8 +1175,6 @@ ScreenSelectMusic::SelectCurrent(PlayerNumber pn) bool bAllPlayersDoneSelectingSteps = bInitiatedByMenuTimer || bAllOtherHumanPlayersDone; - if (TWO_PART_CONFIRMS_ONLY) - bAllPlayersDoneSelectingSteps = true; if (!bAllPlayersDoneSelectingSteps) { m_bStepsChosen[pn] = true; @@ -1334,8 +1191,7 @@ ScreenSelectMusic::SelectCurrent(PlayerNumber pn) FOREACH_ENUM(PlayerNumber, p) { - if (!TWO_PART_SELECTION || - m_SelectionState == SelectionState_SelectingSteps) { + if (m_SelectionState == SelectionState_SelectingSteps) { if (m_OptionsList[p].IsOpened()) m_OptionsList[p].Close(); } @@ -1348,14 +1204,6 @@ ScreenSelectMusic::SelectCurrent(PlayerNumber pn) m_soundStart.Play(true); - // If the MenuTimer has forced us to move on && TWO_PART_CONFIRMS_ONLY, - // set Selection State to finalized and move on. - if (TWO_PART_CONFIRMS_ONLY) { - if (m_MenuTimer->GetSeconds() < 1) { - m_SelectionState = SelectionState_Finalized; - } - } - if (m_SelectionState == SelectionState_Finalized) { #if !defined(WITHOUT_NETWORKING) DLMAN->UpdateDLSpeed(true); @@ -1387,7 +1235,6 @@ ScreenSelectMusic::SelectCurrent(PlayerNumber pn) /* If we're currently waiting on song assets, abort all except the music * and start the music, so if we make a choice quickly before background * requests come through, the music will still start. */ - g_bCDTitleWaiting = g_bBannerWaiting = false; m_BackgroundLoader.Abort(); CheckBackgroundRequests(true); @@ -1412,13 +1259,6 @@ ScreenSelectMusic::SelectCurrent(PlayerNumber pn) } else { StartTransitioningScreen(SM_BeginFadingOut); } - } else // !finalized. Set the timer for selecting difficulty and mods. - { - float fSeconds = m_MenuTimer->GetSeconds(); - if (fSeconds < 10) { - m_MenuTimer->SetSeconds(TWO_PART_TIMER_SECONDS); // was 13 -aj - m_MenuTimer->Start(); - } } return false; } @@ -1426,28 +1266,7 @@ ScreenSelectMusic::SelectCurrent(PlayerNumber pn) bool ScreenSelectMusic::MenuBack(const InputEventPlus& /* input */) { - // Handle unselect song (ffff) - // todo: this isn't right at all. -aj - /* - if( m_SelectionState == SelectionState_SelectingSteps && - !m_bStepsChosen[input.pn] && input.MenuI == GAME_BUTTON_BACK && - input.type == IET_FIRST_PRESS ) - { - // if a player has chosen their steps already, don't unchoose song. - FOREACH_HumanPlayer( p ) - if( m_bStepsChosen[p] ) return; - - // and if we get here... - Message msg("SongUnchosen"); - msg.SetParam( "Player", input.pn ); - MESSAGEMAN->Broadcast( msg ); - m_SelectionState = SelectionState_SelectingSong; - return true; - } - */ - m_BackgroundLoader.Abort(); - Cancel(SM_GoToPrevScreen); return true; } @@ -1455,16 +1274,6 @@ ScreenSelectMusic::MenuBack(const InputEventPlus& /* input */) void ScreenSelectMusic::AfterStepsOrTrailChange(const vector& vpns) { - if (TWO_PART_CONFIRMS_ONLY && - m_SelectionState == SelectionState_SelectingSteps) { - // if TWO_PART_CONFIRMS_ONLY, changing difficulties unsets the song. -aj - m_SelectionState = SelectionState_SelectingSong; - MESSAGEMAN->Broadcast("TwoPartConfirmCanceled"); - } - - // FOREACH_CONST(PlayerNumber, vpns, p) - //{ - // PlayerNumber pn = *p; PlayerNumber pn = PLAYER_1; ASSERT(GAMESTATE->IsHumanPlayer(pn)); @@ -1472,10 +1281,11 @@ ScreenSelectMusic::AfterStepsOrTrailChange(const vector& vpns) CLAMP(m_iSelection[pn], 0, m_vpSteps.size() - 1); Song* pSong = GAMESTATE->m_pCurSong; - Steps* pSteps = m_vpSteps.empty() ? NULL : m_vpSteps[m_iSelection[pn]]; + Steps* pSteps = m_vpSteps.empty() ? nullptr : m_vpSteps[m_iSelection[pn]]; GAMESTATE->m_pCurSteps[pn].Set(pSteps); - GAMESTATE->SetCompatibleStyle(pSteps->m_StepsType, pn); + if (pSteps != nullptr) + GAMESTATE->SetCompatibleStyle(pSteps->m_StepsType, pn); int iScore = 0; if (pSteps) { @@ -1489,13 +1299,7 @@ ScreenSelectMusic::AfterStepsOrTrailChange(const vector& vpns) } delayedchartupdatewaiting = true; } - - m_textHighScore[pn].SetText(ssprintf("%*i", NUM_SCORE_DIGITS, iScore)); - } else { - // The numbers shouldn't stay if the current selection is NULL. - m_textHighScore[pn].SetText(NULL_SCORE_STRING); } - //} } void @@ -1554,23 +1358,22 @@ ScreenSelectMusic::AfterMusicChange() GAMESTATE->m_pCurSong.Set(pSong); if (pSong != nullptr) GAMESTATE->m_pPreferredSong = pSong; + else { + GAMESTATE->m_pCurSteps[PLAYER_1].Set(nullptr); + if (m_pPreviewNoteField) + m_pPreviewNoteField->SetVisible(false); + } + GAMESTATE->SetPaused(false); // hacky can see this being problematic // if we forget about it -mina m_vpSteps.clear(); - - m_Banner.SetMovingFast(!!m_MusicWheel.IsMoving()); - vector m_Artists, m_AltArtists; if (SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong) { m_sSampleMusicToPlay = ""; } - m_pSampleMusicTimingData = NULL; - g_sCDTitlePath = ""; - g_sBannerPath = ""; - g_bWantFallbackCdTitle = false; - bool bWantBanner = true; + m_pSampleMusicTimingData = nullptr; static SortOrder s_lastSortOrder = SortOrder_Invalid; if (GAMESTATE->m_SortOrder != s_lastSortOrder) { @@ -1587,9 +1390,6 @@ ScreenSelectMusic::AfterMusicChange() case WheelItemDataType_Random: case WheelItemDataType_Custom: FOREACH_PlayerNumber(p) m_iSelection[p] = -1; - - g_sCDTitlePath = ""; // none - if (SAMPLE_MUSIC_PREVIEW_MODE == SampleMusicPreviewMode_LastSong) { // HACK: Make random music work in LastSong mode. -aj if (m_sSampleMusicToPlay == m_sRandomMusicPath) { @@ -1605,49 +1405,27 @@ ScreenSelectMusic::AfterMusicChange() case WheelItemDataType_Section: // reduce scope { - SortOrder curSort = GAMESTATE->m_SortOrder; - if (curSort == SORT_GROUP) { - g_sBannerPath = SONGMAN->GetSongGroupBannerPath( - m_MusicWheel.GetSelectedSection()); - } else { - bWantBanner = false; // we load it ourself - m_Banner.LoadFromSortOrder(curSort); - } - if (SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong) m_sSampleMusicToPlay = m_sSectionMusicPath; } break; case WheelItemDataType_Sort: - bWantBanner = false; // we load it ourself - m_Banner.LoadMode(); if (SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong) m_sSampleMusicToPlay = m_sSortMusicPath; break; case WheelItemDataType_Roulette: - bWantBanner = false; // we load it ourself - m_Banner.LoadRoulette(); if (SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong) m_sSampleMusicToPlay = m_sRouletteMusicPath; break; case WheelItemDataType_Random: - bWantBanner = false; // we load it ourself - m_Banner.LoadRandom(); // if( SAMPLE_MUSIC_PREVIEW_MODE != // SampleMusicPreviewMode_LastSong ) m_sSampleMusicToPlay = m_sRandomMusicPath; break; case WheelItemDataType_Custom: { - bWantBanner = false; // we load it ourself - RString sBannerName = - GetMusicWheel() - ->GetCurWheelItemData( - GetMusicWheel()->GetCurrentIndex()) - ->m_pAction->m_sName.c_str(); - m_Banner.LoadCustom(sBannerName); if (SAMPLE_MUSIC_PREVIEW_MODE != SampleMusicPreviewMode_LastSong) m_sSampleMusicToPlay = m_sSectionMusicPath; @@ -1707,48 +1485,16 @@ ScreenSelectMusic::AfterMusicChange() // nothing."); } - if (PREFSMAN->m_bShowBanners) - g_sBannerPath = pSong->GetBannerPath(); - - g_sCDTitlePath = pSong->GetCDTitlePath(); - g_bWantFallbackCdTitle = true; - SwitchToPreferredDifficulty(); break; default: FAIL_M(ssprintf("Invalid WheelItemDataType: %i", wtype)); } - m_sprCDTitleFront.UnloadTexture(); - m_sprCDTitleBack.UnloadTexture(); - // Cancel any previous, incomplete requests for song assets, // since we need new ones. m_BackgroundLoader.Abort(); - g_bCDTitleWaiting = false; - if (!g_sCDTitlePath.empty() || g_bWantFallbackCdTitle) { - if (PREFSMAN->m_verbose_log > 1) - LOG->Trace("cache \"%s\"", g_sCDTitlePath.c_str()); - m_BackgroundLoader.CacheFile(g_sCDTitlePath); // empty OK - g_bCDTitleWaiting = true; - } - - g_bBannerWaiting = false; - if (bWantBanner) { - if (PREFSMAN->m_verbose_log > 1) - LOG->Trace("LoadFromCachedBanner(%s)", g_sBannerPath.c_str()); - if (m_Banner.LoadFromCachedBanner(g_sBannerPath)) { - /* If the high-res banner is already loaded, just delay before - * loading it, so the low-res one has time to fade in. */ - if (!TEXTUREMAN->IsTextureRegistered( - Sprite::SongBannerTexture(g_sBannerPath))) - m_BackgroundLoader.CacheFile(g_sBannerPath); - - g_bBannerWaiting = true; - } - } - // Don't stop music if it's already playing the right file. g_bSampleMusicWaiting = false; if (!m_MusicWheel.IsRouletting() && @@ -1804,7 +1550,7 @@ ScreenSelectMusic::OnConfirmSongDeletion() // delete the song directory from disk FILEMAN->DeleteRecursive(deleteDir); - m_pSongAwaitingDeletionConfirmation = NULL; + m_pSongAwaitingDeletionConfirmation = nullptr; } bool diff --git a/src/ScreenSelectMusic.h b/src/ScreenSelectMusic.h index 806d00c1ca..52e1baa1b1 100644 --- a/src/ScreenSelectMusic.h +++ b/src/ScreenSelectMusic.h @@ -119,9 +119,6 @@ class ScreenSelectMusic : public ScreenWithMenuElements ThemeMetric USE_PLAYER_SELECT_MENU; ThemeMetric SELECT_MENU_NAME; ThemeMetric SELECT_MENU_CHANGES_DIFFICULTY; - ThemeMetric TWO_PART_SELECTION; - ThemeMetric TWO_PART_CONFIRMS_ONLY; - ThemeMetric TWO_PART_TIMER_SECONDS; ThemeMetric WRAP_CHANGE_STEPS; ThemeMetric CHANGE_STEPS_WITH_GAME_BUTTONS; ThemeMetric CHANGE_GROUPS_WITH_GAME_BUTTONS; @@ -132,18 +129,11 @@ class ScreenSelectMusic : public ScreenWithMenuElements { return m_SelectionState == SelectionState_SelectingSong; } - bool CanChangeSteps() const - { - return TWO_PART_SELECTION - ? m_SelectionState == SelectionState_SelectingSteps - : m_SelectionState == SelectionState_SelectingSong; - } SelectionState GetNextSelectionState() const { switch (m_SelectionState) { case SelectionState_SelectingSong: - return TWO_PART_SELECTION ? SelectionState_SelectingSteps - : SelectionState_Finalized; + return SelectionState_Finalized; default: return SelectionState_Finalized; } @@ -164,10 +154,6 @@ class ScreenSelectMusic : public ScreenWithMenuElements RString m_sLoopMusicPath; RString m_sFallbackCDTitlePath; - FadingBanner m_Banner; - Sprite m_sprCDTitleFront, m_sprCDTitleBack; - AutoActor m_sprHighScoreFrame[NUM_PLAYERS]; - BitmapText m_textHighScore[NUM_PLAYERS]; MusicWheel m_MusicWheel; OptionsList m_OptionsList[NUM_PLAYERS]; diff --git a/stepmania.nsi b/stepmania.nsi index 2cc46af75b..a29cd3aef6 100644 --- a/stepmania.nsi +++ b/stepmania.nsi @@ -43,7 +43,7 @@ ; don't forget to change this before releasing a new version. ; wish this could be automated, but it requires "X.Y.Z.a" format. -aj - VIProductVersion "0.62.1.0" + VIProductVersion "0.63.0.0" VIAddVersionKey "ProductName" "${PRODUCT_ID}" VIAddVersionKey "FileVersion" "${PRODUCT_VER}" VIAddVersionKey "FileDescription" "${PRODUCT_ID} Installer"