diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua index 44936cfb64..9c5add2de8 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua @@ -46,7 +46,7 @@ local function FilterInput(event) if SSQuery[activebound][ActiveSS] == "" then SSQuery[activebound][ActiveSS] = "0" end - GAMESTATE:SetSSFilter(tonumber(SSQuery[activebound][ActiveSS]), ActiveSS, activebound) + FILTERMAN:SetSSFilter(tonumber(SSQuery[activebound][ActiveSS]), ActiveSS, activebound) whee:SongSearch("") -- stupid workaround? MESSAGEMAN:Broadcast("UpdateFilter") end @@ -113,7 +113,7 @@ local f = Def.ActorFrame{ LoadFont("Common Large")..{ InitCommand=cmd(xy,frameX+frameWidth/2,175;zoom,textzoom;halign,0), SetCommand=function(self) - self:settextf("Max Rate:%5.1fx",GAMESTATE:GetMaxFilterRate()) + self:settextf("Max Rate:%5.1fx",FILTERMAN:GetMaxFilterRate()) end, MaxFilterRateChangedMessageCommand=cmd(queuecommand,"Set"), }, @@ -121,14 +121,14 @@ local f = Def.ActorFrame{ InitCommand=cmd(xy,frameX+frameWidth/2,175;zoomto,130,18;halign,0;diffusealpha,0), MouseLeftClickMessageCommand=function(self) if isOver(self) and active then - GAMESTATE:SetMaxFilterRate(GAMESTATE:GetMaxFilterRate()+0.1) + FILTERMAN:SetMaxFilterRate(FILTERMAN:GetMaxFilterRate()+0.1) MESSAGEMAN:Broadcast("MaxFilterRateChanged") whee:SongSearch("") end end, MouseRightClickMessageCommand=function(self) if isOver(self) and active then - GAMESTATE:SetMaxFilterRate(GAMESTATE:GetMaxFilterRate()-0.1) + FILTERMAN:SetMaxFilterRate(FILTERMAN:GetMaxFilterRate()-0.1) MESSAGEMAN:Broadcast("MaxFilterRateChanged") whee:SongSearch("") end @@ -137,7 +137,7 @@ local f = Def.ActorFrame{ LoadFont("Common Large")..{ InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY;zoom,textzoom;halign,0), SetCommand=function(self) - self:settextf("Min Rate:%5.1fx",GAMESTATE:GetMinFilterRate()) + self:settextf("Min Rate:%5.1fx",FILTERMAN:GetMinFilterRate()) end, MaxFilterRateChangedMessageCommand=cmd(queuecommand,"Set"), }, @@ -145,14 +145,14 @@ local f = Def.ActorFrame{ InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY;zoomto,130,18;halign,0;diffusealpha,0), MouseLeftClickMessageCommand=function(self) if isOver(self) and active then - GAMESTATE:SetMinFilterRate(GAMESTATE:GetMinFilterRate()+0.1) + FILTERMAN:SetMinFilterRate(FILTERMAN:GetMinFilterRate()+0.1) MESSAGEMAN:Broadcast("MaxFilterRateChanged") whee:SongSearch("") end end, MouseRightClickMessageCommand=function(self) if isOver(self) and active then - GAMESTATE:SetMinFilterRate(GAMESTATE:GetMinFilterRate()-0.1) + FILTERMAN:SetMinFilterRate(FILTERMAN:GetMinFilterRate()-0.1) MESSAGEMAN:Broadcast("MaxFilterRateChanged") whee:SongSearch("") end @@ -161,7 +161,7 @@ local f = Def.ActorFrame{ LoadFont("Common Large")..{ InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 2;zoom,textzoom;halign,0), SetCommand=function(self) - if GAMESTATE:GetFilterMode() then + if FILTERMAN:GetFilterMode() then self:settext("Mode: ".."AND") else self:settext("Mode: ".."OR") @@ -173,7 +173,7 @@ local f = Def.ActorFrame{ InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 2;zoomto,120,18;halign,0;diffusealpha,0), MouseLeftClickMessageCommand=function(self) if isOver(self) and active then - GAMESTATE:ToggleFilterMode() + FILTERMAN:ToggleFilterMode() MESSAGEMAN:Broadcast("FilterModeChanged") whee:SongSearch("") end @@ -182,12 +182,12 @@ local f = Def.ActorFrame{ LoadFont("Common Large")..{ InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 3;zoom,textzoom;halign,0), SetCommand=function(self) - if GAMESTATE:GetHighestSkillsetsOnly() then + if FILTERMAN:GetHighestSkillsetsOnly() then self:settext("Highest Only: ".."ON") else self:settext("Highest Only: ".."OFF") end - if GAMESTATE:GetFilterMode() then + if FILTERMAN:GetFilterMode() then self:diffuse(color("#666666")) else self:diffuse(color("#FFFFFF")) @@ -199,7 +199,7 @@ local f = Def.ActorFrame{ InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 3;zoomto,160,18;halign,0;diffusealpha,0), MouseLeftClickMessageCommand=function(self) if isOver(self) and active then - GAMESTATE:ToggleHighestSkillsetsOnly() + FILTERMAN:ToggleHighestSkillsetsOnly() MESSAGEMAN:Broadcast("FilterModeChanged") whee:SongSearch("") end @@ -244,7 +244,7 @@ local function CreateFilterInputBox(i) LoadFont("Common Large")..{ InitCommand=cmd(addx,150;addy,175 + (i-1)*spacingY;halign,1;maxwidth,40;zoom,textzoom), SetCommand=function(self) - local fval = GAMESTATE:GetSSFilter(i,0) -- lower bounds + local fval = FILTERMAN:GetSSFilter(i,0) -- lower bounds self:settext(fval) if fval <= 0 and ActiveSS ~= i then self:diffuse(color("#666666")) @@ -280,7 +280,7 @@ local function CreateFilterInputBox(i) LoadFont("Common Large")..{ InitCommand=cmd(addx,175;addy,175 + (i-1)*spacingY;halign,1;maxwidth,40;zoom,textzoom), SetCommand=function(self) - local fval = GAMESTATE:GetSSFilter(i,1) -- upper bounds + local fval = FILTERMAN:GetSSFilter(i,1) -- upper bounds self:settext(fval) if fval <= 0 and ActiveSS ~= i then self:diffuse(color("#666666")) @@ -300,7 +300,7 @@ f[#f+1] = Def.Quad{ InitCommand=cmd(xy,frameX+frameWidth-150,frameY+250;zoomto,60,20;halign,0.5;diffuse,getMainColor('frames');diffusealpha,0), MouseLeftClickMessageCommand=function(self) if isOver(self) and active then - GAMESTATE:ResetSSFilters() + FILTERMAN:ResetSSFilters() for i=1,#ms.SkillSets do SSQuery[0][i] = "0" SSQuery[1][i] = "0" diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tabs.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tabs.lua index 247ef1738d..6a4fbc3bfc 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tabs.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/tabs.lua @@ -91,7 +91,7 @@ function tabs(index) SetCommand=function(self) self:settext(tabNames[index]) if isTabEnabled(index) then - if index == 6 and GAMESTATE:AnyActiveFilter() then + if index == 6 and FILTERMAN:AnyActiveFilter() then self:diffuse(color("#cc2929")) else self:diffuse(getMainColor('positive')) diff --git a/src/FilterManager.cpp b/src/FilterManager.cpp new file mode 100644 index 0000000000..435a5df29c --- /dev/null +++ b/src/FilterManager.cpp @@ -0,0 +1,147 @@ +#include "global.h" +#include "FilterManager.h" +#include "PlayerState.h" + +FilterManager* FILTERMAN = NULL; + +FilterManager::FilterManager() { + // filter stuff - mina + ZERO(SSFilterLowerBounds); + ZERO(SSFilterUpperBounds); + + FOREACH_PlayerNumber(p) + { + m_pPlayerState[p] = new PlayerState; + m_pPlayerState[p]->SetPlayerNumber(p); + } + + // Register with Lua. + { + Lua *L = LUA->Get(); + lua_pushstring(L, "FILTERMAN"); + this->PushSelf(L); + lua_settable(L, LUA_GLOBALSINDEX); + LUA->Release(L); + } +} + +FilterManager::~FilterManager() { + FOREACH_PlayerNumber(p) + SAFE_DELETE(m_pPlayerState[p]); + + // Unregister with Lua. + LUA->UnsetGlobal("FILTERMAN"); +} + +float FilterManager::GetSSFilter(Skillset ss, int bound) { + if (bound == 0) + return SSFilterLowerBounds[ss]; + else + return SSFilterUpperBounds[ss]; +} + +void FilterManager::SetSSFilter(float v, Skillset ss, int bound) { + if (bound == 0) + SSFilterLowerBounds[ss] = v; + else + SSFilterUpperBounds[ss] = v; +} + +// reset button for filters +void FilterManager::ResetSSFilters() { + FOREACH_ENUM(Skillset, ss) { + SSFilterLowerBounds[ss] = 0; + SSFilterUpperBounds[ss] = 0; + } +} + +// tmp filter stuff - mina +bool FilterManager::AnyActiveFilter() { + FOREACH_ENUM(Skillset, ss) { + if (SSFilterLowerBounds[ss] > 0) + return true; + if (SSFilterUpperBounds[ss] > 0) + return true; + } + return false; +} + +// lua start +#include "LuaBinding.h" + +class LunaFilterManager : public Luna +{ +public: + DEFINE_METHOD(AnyActiveFilter, AnyActiveFilter()) + static int SetSSFilter(T* p, lua_State *L) { + p->SetSSFilter(FArg(1), static_cast(IArg(2) - 1), IArg(3)); + return 1; + } + static int GetSSFilter(T* p, lua_State *L) { + float f = p->GetSSFilter(static_cast(IArg(1) - 1), IArg(2)); + lua_pushnumber(L, f); + return 1; + } + static int ResetSSFilters(T* p, lua_State *L) { + p->ResetSSFilters(); + return 1; + } + static int SetMaxFilterRate(T* p, lua_State* L) { + float mfr = FArg(1); + auto loot = p->m_pPlayerState[0]; + CLAMP(mfr, loot->wtFFF, 2.f); + p->MaxFilterRate = mfr; + return 1; + } + static int GetMaxFilterRate(T* p, lua_State* L) { + lua_pushnumber(L, p->MaxFilterRate); + return 1; + } + static int SetMinFilterRate(T* p, lua_State* L) { + float mfr = FArg(1); + CLAMP(mfr, 0.7f, p->MaxFilterRate); + auto loot = p->m_pPlayerState[0]; + loot->wtFFF = mfr; + return 1; + } + static int GetMinFilterRate(T* p, lua_State* L) { + auto loot = p->m_pPlayerState[0]; + lua_pushnumber(L, loot->wtFFF); + return 1; + } + static int ToggleFilterMode(T* p, lua_State* L) { + p->ExclusiveFilter = !p->ExclusiveFilter; + return 1; + + } + static int GetFilterMode(T* p, lua_State* L) { + lua_pushboolean(L, p->ExclusiveFilter); + return 1; + } + static int ToggleHighestSkillsetsOnly(T* p, lua_State* L) { + p->HighestSkillsetsOnly = !p->HighestSkillsetsOnly; + return 1; + + } + static int GetHighestSkillsetsOnly(T* p, lua_State* L) { + lua_pushboolean(L, p->HighestSkillsetsOnly); + return 1; + } + LunaFilterManager() { + ADD_METHOD(SetSSFilter); + ADD_METHOD(GetSSFilter); + ADD_METHOD(ResetSSFilters); + ADD_METHOD(AnyActiveFilter); + ADD_METHOD(SetMaxFilterRate); + ADD_METHOD(GetMaxFilterRate); + ADD_METHOD(SetMinFilterRate); + ADD_METHOD(GetMinFilterRate); + ADD_METHOD(ToggleFilterMode); + ADD_METHOD(GetFilterMode); + ADD_METHOD(ToggleHighestSkillsetsOnly); + ADD_METHOD(GetHighestSkillsetsOnly); + } +}; + +LUA_REGISTER_CLASS(FilterManager) +// lua end \ No newline at end of file diff --git a/src/FilterManager.h b/src/FilterManager.h new file mode 100644 index 0000000000..894fc61d6d --- /dev/null +++ b/src/FilterManager.h @@ -0,0 +1,31 @@ +#ifndef FilterManager_H +#define FilterManager_H +#include "PlayerNumber.h" +#include "GameConstantsAndTypes.h" + +class PlayerState; +class FilterManager { +public: + FilterManager(); + ~FilterManager(); + + PlayerState* m_pPlayerState[NUM_PLAYERS]; + + float SSFilterLowerBounds[NUM_Skillset]; + float SSFilterUpperBounds[NUM_Skillset]; + float MaxFilterRate = 1.f; + bool ExclusiveFilter = false; // if true the filter system will only match songs that meet all criteria rather than all that meet any - mina + float GetSSFilter(Skillset ss, int bound); + void SetSSFilter(float v, Skillset ss, int bound); + void ResetSSFilters(); // reset button for filters + bool HighestSkillsetsOnly = false; + bool SkillsetFiltersActive = false; // appears to be unused + bool AnyActiveFilter(); + + //Lua + void PushSelf(lua_State *L); +}; + +extern FilterManager* FILTERMAN; + +#endif \ No newline at end of file diff --git a/src/GameState.cpp b/src/GameState.cpp index 22e90e2ba2..e89da1b127 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -176,11 +176,6 @@ GameState::GameState() : // Don't reset yet; let the first screen do it, so we can use PREFSMAN and THEME. //Reset(); - - // filter stuff - mina - ZERO( SSFilterLowerBounds ); - ZERO( SSFilterUpperBounds ); - // Register with Lua. { Lua *L = LUA->Get(); @@ -206,39 +201,6 @@ GameState::~GameState() SAFE_DELETE( processedTiming ); } -// tmp filter stuff - mina -bool GameState::AnyActiveFilter() { - FOREACH_ENUM(Skillset, ss) { - if (SSFilterLowerBounds[ss] > 0) - return true; - if (SSFilterUpperBounds[ss] > 0) - return true; - } - return false; -} - -void GameState::SetSSFilter(float v, Skillset ss, int bound) { - if (bound == 0) - SSFilterLowerBounds[ss] = v; - else - SSFilterUpperBounds[ss] = v; -} - -float GameState::GetSSFilter(Skillset ss, int bound) { - if (bound == 0) - return SSFilterLowerBounds[ss]; - else - return SSFilterUpperBounds[ss]; -} - -// reset button for filters -void GameState::ResetSSFilters() { - FOREACH_ENUM(Skillset, ss) { - SSFilterLowerBounds[ss] = 0; - SSFilterUpperBounds[ss] = 0; - } -} - PlayerNumber GameState::GetMasterPlayerNumber() const { return this->masterPlayerNumber; @@ -2847,7 +2809,6 @@ class LunaGameState: public Luna DEFINE_METHOD( GetCoinMode, GetCoinMode() ) DEFINE_METHOD( GetPremium, GetPremium() ) DEFINE_METHOD( GetSongOptionsString, m_SongOptions.GetCurrent().GetString() ) - DEFINE_METHOD( AnyActiveFilter, AnyActiveFilter()) static int GetSessionTime(T* p, lua_State *L) { lua_pushnumber(L, p->m_timeGameStarted.GetTimeSinceStart()); return 1; } static int GetSongOptions( T* p, lua_State *L ) { @@ -3275,60 +3236,6 @@ class LunaGameState: public Luna p->m_autogen_fargs[si]= v; COMMON_RETURN_SELF; } - static int SetSSFilter(T* p, lua_State *L) { - p->SetSSFilter(FArg(1), static_cast(IArg(2) - 1), IArg(3)); - return 1; - } - static int GetSSFilter(T* p, lua_State *L) { - float f = p->GetSSFilter(static_cast(IArg(1) - 1), IArg(2)); - lua_pushnumber(L, f); - return 1; - } - static int ResetSSFilters(T* p, lua_State *L) { - p->ResetSSFilters(); - return 1; - } - static int SetMaxFilterRate(T* p, lua_State* L) { - float mfr = FArg(1); - auto loot = p->m_pPlayerState[0]; - CLAMP(mfr, loot->wtFFF, 2.f); - p->MaxFilterRate = mfr; - return 1; - } - static int GetMaxFilterRate(T* p, lua_State* L) { - lua_pushnumber(L, p->MaxFilterRate); - return 1; - } - static int SetMinFilterRate(T* p, lua_State* L) { - float mfr = FArg(1); - CLAMP(mfr, 0.7f, p->MaxFilterRate); - auto loot = p->m_pPlayerState[0]; - loot->wtFFF = mfr; - return 1; - } - static int GetMinFilterRate(T* p, lua_State* L) { - auto loot = p->m_pPlayerState[0]; - lua_pushnumber(L, loot->wtFFF); - return 1; - } - static int ToggleFilterMode(T* p, lua_State* L) { - p->ExclusiveFilter = !p->ExclusiveFilter; - return 1; - - } - static int GetFilterMode(T* p, lua_State* L) { - lua_pushboolean(L, p->ExclusiveFilter); - return 1; - } - static int ToggleHighestSkillsetsOnly(T* p, lua_State* L) { - p->HighestSkillsetsOnly = !p->HighestSkillsetsOnly; - return 1; - - } - static int GetHighestSkillsetsOnly(T* p, lua_State* L) { - lua_pushboolean(L, p->HighestSkillsetsOnly); - return 1; - } DEFINE_METHOD(GetEtternaVersion, GetEtternaVersion()) LunaGameState() { @@ -3457,18 +3364,6 @@ class LunaGameState: public Luna ADD_METHOD( SetStepsForEditMode ); ADD_METHOD( GetAutoGenFarg ); ADD_METHOD( SetAutoGenFarg ); - ADD_METHOD( SetSSFilter ); - ADD_METHOD( GetSSFilter ); - ADD_METHOD( ResetSSFilters ); - ADD_METHOD( AnyActiveFilter ); - ADD_METHOD( SetMaxFilterRate ); - ADD_METHOD( GetMaxFilterRate ); - ADD_METHOD( SetMinFilterRate ); - ADD_METHOD( GetMinFilterRate ); - ADD_METHOD( ToggleFilterMode ); - ADD_METHOD( GetFilterMode ); - ADD_METHOD( ToggleHighestSkillsetsOnly ); - ADD_METHOD( GetHighestSkillsetsOnly ); ADD_METHOD( GetEtternaVersion ); } }; diff --git a/src/GameState.h b/src/GameState.h index 230d408cb0..0b1214456f 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -242,18 +242,6 @@ class GameState bool m_bLoadingNextSong; int GetLoadingCourseSongIndex() const; - - // todo: make a filterman or something - mina - float SSFilterLowerBounds[NUM_Skillset]; - float SSFilterUpperBounds[NUM_Skillset]; - float MaxFilterRate = 1.f; - bool ExclusiveFilter = false; // if true the filter system will only match songs that meet all criteria rather than all that meet any - mina - float GetSSFilter(Skillset ss, int bound); - void SetSSFilter(float v, Skillset ss, int bound); - void ResetSSFilters(); // reset button for filters - bool HighestSkillsetsOnly = false; - bool SkillsetFiltersActive = false; - bool AnyActiveFilter(); RString GetEtternaVersion() { return "0.54.1"; } diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index b3e831c2d7..8e347ed11b 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -23,6 +23,7 @@ #include "CommonMetrics.h" #include "MessageManager.h" #include "LocalizedString.h" +#include "FilterManager.h" static Preference g_bMoveRandomToEnd( "MoveRandomToEnd", false ); static Preference g_bPrecacheAllSorts( "PreCacheAllWheelSorts", false); @@ -591,18 +592,18 @@ void MusicWheel::FilterBySearch(vector& inv, RString findme) { // should definitely house these in lower level functions so return can be called the iteration an outcome is determined on instead of clumsily using continue - mina void MusicWheel::FilterBySkillsets(vector& inv) { vector tmp; - if (!GAMESTATE->ExclusiveFilter) { + if (!FILTERMAN->ExclusiveFilter) { for (size_t i = 0; i < inv.size(); i++) { bool addsong = false; FOREACH_ENUM(Skillset, ss) { - float lb = GAMESTATE->SSFilterLowerBounds[ss]; - float ub = GAMESTATE->SSFilterUpperBounds[ss]; + float lb = FILTERMAN->SSFilterLowerBounds[ss]; + float ub = FILTERMAN->SSFilterUpperBounds[ss]; if (lb > 0.f || ub > 0.f) { // if either bound is active, continue to evaluation - float currate = GAMESTATE->MaxFilterRate + 0.1f; - float minrate = GAMESTATE->m_pPlayerState[0]->wtFFF; + float currate = FILTERMAN->MaxFilterRate + 0.1f; + float minrate = FILTERMAN->m_pPlayerState[0]->wtFFF; do { currate = currate - 0.1f; - if (GAMESTATE->HighestSkillsetsOnly) + if (FILTERMAN->HighestSkillsetsOnly) if (!inv[i]->IsSkillsetHighestOfAnySteps(ss, currate)) continue; @@ -633,12 +634,12 @@ void MusicWheel::FilterBySkillsets(vector& inv) { bool addsong = true; FOREACH_ENUM(Skillset, ss) { bool pineapple = true; - float lb = GAMESTATE->SSFilterLowerBounds[ss]; - float ub = GAMESTATE->SSFilterUpperBounds[ss]; + float lb = FILTERMAN->SSFilterLowerBounds[ss]; + float ub = FILTERMAN->SSFilterUpperBounds[ss]; if (lb > 0.f || ub > 0.f) { bool localaddsong; - float currate = GAMESTATE->MaxFilterRate + 0.1f; - float minrate = GAMESTATE->m_pPlayerState[0]->wtFFF; + float currate = FILTERMAN->MaxFilterRate + 0.1f; + float minrate = FILTERMAN->m_pPlayerState[0]->wtFFF; bool toiletpaper = false; do { localaddsong = true; @@ -726,7 +727,7 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelIt if (searching) FilterBySearch(arraySongs, findme); - if (GAMESTATE->AnyActiveFilter()) + if (FILTERMAN->AnyActiveFilter()) FilterBySkillsets(arraySongs); msg.SetParam("Matches", static_cast(arraySongs.size())); diff --git a/src/ScreenNetSelectMusic.cpp b/src/ScreenNetSelectMusic.cpp index 0bdbc2da33..d141b34924 100644 --- a/src/ScreenNetSelectMusic.cpp +++ b/src/ScreenNetSelectMusic.cpp @@ -26,6 +26,7 @@ #include "SongManager.h" #include "CodeDetector.h" #include "ProfileManager.h" +#include "FilterManager.h" AutoScreenMessage( SM_NoSongs ); AutoScreenMessage( SM_ChangeSong ); @@ -230,15 +231,15 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM ) } else { FOREACH_ENUM(Skillset, i) { - GAMESTATE->SSFilterLowerBounds[i] = 0; - GAMESTATE->SSFilterUpperBounds[i] = 0; + FILTERMAN->SSFilterLowerBounds[i] = 0; + FILTERMAN->SSFilterUpperBounds[i] = 0; } m_MusicWheel.ReloadSongList(false, ""); } else { FOREACH_ENUM(Skillset, i) { - GAMESTATE->SSFilterLowerBounds[i] = 0; - GAMESTATE->SSFilterUpperBounds[i] = 0; + FILTERMAN->SSFilterLowerBounds[i] = 0; + FILTERMAN->SSFilterUpperBounds[i] = 0; } m_MusicWheel.ReloadSongList(false, ""); } diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 735e82e18e..d669c77b32 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -55,6 +55,7 @@ #include "InputQueue.h" #include "SongCacheIndex.h" #include "BannerCache.h" +#include "FilterManager.h" //#include "BackgroundCache.h" #include "UnlockManager.h" #include "RageFileManager.h" @@ -1182,6 +1183,8 @@ int sm_main(int argc, char* argv[]) MESSAGEMAN = new MessageManager; STATSMAN = new StatsManager; + FILTERMAN = new FilterManager; + // Initialize which courses are ranking courses here. SONGMAN->UpdateRankingCourses();