From 43f9411625f874334d6dcc6bd4a7d5119787d192 Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Sat, 14 Jan 2017 14:21:28 -0500 Subject: [PATCH] add match results counter message --- .../ScreenSelectMusic decorations/filters.lua | 6 ++++++ src/MusicWheel.cpp | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua index 7546a1bb12..c0259002af 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/filters.lua @@ -172,6 +172,12 @@ local f = Def.ActorFrame{ end end, }, + LoadFont("Common Large")..{ + InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 3;zoom,textzoom;halign,0;settext,""), + FilterResultsMessageCommand=function(self, msg) + self:settext("Matches: "..msg.Matches.."/"..msg.Total) + end + }, } local function CreateFilterInputBox(i) diff --git a/src/MusicWheel.cpp b/src/MusicWheel.cpp index fd3ecdeb29..35f0153553 100644 --- a/src/MusicWheel.cpp +++ b/src/MusicWheel.cpp @@ -609,11 +609,12 @@ void MusicWheel::FilterBySkillsets(vector& inv) { if (val > lb && val < ub) // if dealing with an explicit range evaluate as such addsong = addsong || true; } - else + else { if (lb > 0.f && val > lb) // must be a nicer way to handle this but im tired addsong = addsong || true; if (ub > 0.f && val < ub) addsong = addsong || true; + } } } @@ -637,11 +638,12 @@ void MusicWheel::FilterBySkillsets(vector& inv) { if (val < lb || val > ub) addsong = false; } - else + else { if (lb > 0.f && val < lb) addsong = false; if (ub > 0.f && val > ub) addsong = false; + } } } if (addsong) @@ -702,12 +704,18 @@ void MusicWheel::BuildWheelItemDatas( vector &arrayWheelIt vector arraySongs; GetSongList( arraySongs, so ); + Message msg("FilterResults"); + msg.SetParam("Total", arraySongs.size()); + if (searching) FilterBySearch(arraySongs, findme); if (GAMESTATE->AnyActiveFilter()) FilterBySkillsets(arraySongs); + msg.SetParam("Matches", arraySongs.size()); + MESSAGEMAN->Broadcast(msg); + bool bUseSections = true; // sort the songs