diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua index 452a50d95a..2015eb8b5f 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua @@ -91,7 +91,7 @@ local f = Def.ActorFrame{ LoadFont("Common Large")..{ InitCommand=cmd(xy,frameX+frameWidth/2,175;zoom,textzoom;halign,0), SetCommand=function(self) - self:settext("Max Rate: "..1) + self:settext("Max Rate: 1.5x") end, }, LoadFont("Common Large")..{ @@ -103,7 +103,7 @@ local f = Def.ActorFrame{ LoadFont("Common Large")..{ InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY*2;zoom,textzoom;halign,0), SetCommand=function(self) - self:settext("Highest SS: ".."False") + self:settext("Highest SS Only : ".."Off") end, }, } diff --git a/src/GameState.cpp b/src/GameState.cpp index c978fbf3c5..43536cd5c0 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -176,7 +176,11 @@ GameState::GameState() : // Don't reset yet; let the first screen do it, so we can use PREFSMAN and THEME. //Reset(); + + // filter stuff - mina ZERO( SkillsetFilters ); + MaxFilterRate = 1.5; + // Register with Lua. { @@ -3238,6 +3242,10 @@ class LunaGameState: public Luna p->m_autogen_fargs[si]= v; COMMON_RETURN_SELF; } + static int SetMaxFilterRate(T* p, lua_State* L) { + p->MaxFilterRate = FArg(1); + return 1; + } LunaGameState() { @@ -3366,6 +3374,7 @@ class LunaGameState: public Luna ADD_METHOD( SetStepsForEditMode ); ADD_METHOD( GetAutoGenFarg ); ADD_METHOD( SetAutoGenFarg ); + ADD_METHOD( SetMaxFilterRate ); } }; diff --git a/src/GameState.h b/src/GameState.h index 8eac216a07..ae153f973a 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -243,8 +243,10 @@ class GameState int GetLoadingCourseSongIndex() const; - // mina was here - mina + // mina was here to drop in some temporary(?) filter things that need to persist - mina float SkillsetFilters[NUM_Skillset]; + float MaxFilterRate; + void SetMaxFilterRate(float v) { MaxFilterRate; } // State Info used during gameplay diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index 7dcd3bb63c..fd255a679f 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -533,13 +533,11 @@ void MusicWheel::FilterBySearch(vector& inv, RString findme) { size_t fart = findme.find("artist="); size_t faux = findme.find("author="); size_t fitty = findme.find("title="); - size_t jack = findme.find("jack="); RString findfart = ""; RString findfaux = ""; RString findfitty = ""; - int findjack = -1.f; - if (fart != findme.npos || faux != findme.npos || fitty != findme.npos || jack != findme.npos) { + if (fart != findme.npos || faux != findme.npos || fitty != findme.npos) { super_search = true; if (fart != findme.npos) findfart = findme.substr(fart + 7, findme.find(fart, ';') - fart); @@ -547,8 +545,6 @@ void MusicWheel::FilterBySearch(vector& inv, RString findme) { findfaux = findme.substr(faux + 7, findme.find(faux, ';') - faux); if (fitty != findme.npos) findfitty = findme.substr(fitty + 6, findme.find(fitty, ';') - fitty); - if (jack != findme.npos) - findjack = StringToInt(findme.substr(jack + 5, findme.find(jack, ';') - jack)); } vector tmp; @@ -585,11 +581,6 @@ void MusicWheel::FilterBySearch(vector& inv, RString findme) { if (gimmie != fittyS.npos) tmp.emplace_back(inv[i]); } - if (findjack != -1.f) { - float jackR = inv[i]->GetHighestSkillsetAllSteps(3); - if(jackR > findjack) - tmp.emplace_back(inv[i]); - } } } @@ -607,7 +598,7 @@ void MusicWheel::FilterBySkillsets(vector& inv) { bool addsong = false; FOREACH_ENUM(Skillset, ss) { if (SkillsetFilters[ss] > 0.f) { - float val = inv[i]->GetHighestSkillsetAllSteps(static_cast(ss)); + float val = inv[i]->GetHighestOfSkillsetAllSteps(static_cast(ss), GAMESTATE->MaxFilterRate); if (val > SkillsetFilters[ss]) addsong = addsong || true; } diff --git a/src/Song.cpp b/src/Song.cpp index d5824ec626..b59502f7ea 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -1732,12 +1732,12 @@ float Song::GetPreviewStartSeconds() const return 0.0f; } -float Song::GetHighestSkillsetAllSteps(int x) { +float Song::GetHighestOfSkillsetAllSteps(int x, float rate) { float o = 0.f; vector vsteps = GetAllSteps(); FOREACH(Steps*, vsteps, steps) - if ((*steps)->GetMSD(1, x) > o) - o = (*steps)->GetMSD(1, x); + if ((*steps)->GetMSD(rate, x) > o) + o = (*steps)->GetMSD(rate, x); return o; } diff --git a/src/Song.h b/src/Song.h index 034a0a0f58..73a7a1e74e 100644 --- a/src/Song.h +++ b/src/Song.h @@ -273,7 +273,9 @@ class Song float GetPreviewStartSeconds() const; // how have i not jammed anything here yet - mina - float GetHighestSkillsetAllSteps(int x); + + // Get the highest value for a specific skillset across all the steps objects for the song at a given rate + float GetHighestOfSkillsetAllSteps(int x, float rate); // For loading only: bool m_bHasMusic, m_bHasBanner, m_bHasBackground;