From d4b028a963097367409e088ffc79775e66806afd Mon Sep 17 00:00:00 2001 From: Misterkister Date: Tue, 17 Jan 2017 14:54:04 -0600 Subject: [PATCH 1/6] updating default.lua to fix the tabs redirecting to offline tabs. --- .../ScreenNetSelectMusic decorations/default.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/default.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/default.lua index 0f7ebed712..1d57e0c559 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/default.lua @@ -7,13 +7,13 @@ t[#t+1] = LoadActor("../_chatbox") --t[#t+1] = LoadActor("kappa") --t[#t+1] = LoadActor("msd stuff") --t[#t+1] = LoadActor("matra") -t[#t+1] = LoadActor("profile") -t[#t+1] = LoadActor("msd") -t[#t+1] = LoadActor("songsearch") +t[#t+1] = LoadActor("../ScreenSelectMusic decorations/profile") +t[#t+1] = LoadActor("../ScreenSelectMusic decorations/msd") +t[#t+1] = LoadActor("../ScreenSelectMusic decorations/songsearch") t[#t+1] = LoadActor("tabs") -t[#t+1] = LoadActor("score") +t[#t+1] = LoadActor("../ScreenSelectMusic decorations/score") t[#t+1] = LoadActor("dumbrate") -t[#t+1] = LoadActor("filters") +t[#t+1] = LoadActor("../ScreenSelectMusic decorations/filters") local g = Def.ActorFrame{ TabChangedMessageCommand=function(self) From 3aff2c5a7a1c8477e14cc988fb01763a9a7ded35 Mon Sep 17 00:00:00 2001 From: Misterkister Date: Tue, 17 Jan 2017 14:55:52 -0600 Subject: [PATCH 2/6] Delete profile.lua --- .../profile.lua | 289 ------------------ 1 file changed, 289 deletions(-) delete mode 100644 Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/profile.lua diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/profile.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/profile.lua deleted file mode 100644 index 9692c63095..0000000000 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/profile.lua +++ /dev/null @@ -1,289 +0,0 @@ -local update = false -local t = Def.ActorFrame{ - BeginCommand=cmd(queuecommand,"Set";visible,false), - OffCommand=cmd(bouncebegin,0.2;xy,-500,0;diffusealpha,0), - OnCommand=cmd(bouncebegin,0.2;xy,0,0;diffusealpha,1), - SetCommand=function(self) - self:finishtweening() - - if getTabIndex() == 4 then - - self:queuecommand("On") - self:visible(true) - update = true - else - self:queuecommand("Off") - update = false - end - end, - TabChangedMessageCommand=cmd(queuecommand,"Set"), - PlayerJoinedMessageCommand=cmd(queuecommand,"Set"), -} - -local frameX = 10 -local frameY = 45 -local frameWidth = capWideScale(360,400) -local frameHeight = 350 -local fontScale = 0.4 -local scorestodisplay = 25 -local distY = 15 -local offsetX = 10 -local offsetY = 20 -local rankingSkillset=0 -local rankingPage=1 -local rankingWidth = frameWidth-capWideScale(15,50) -local rankingX = capWideScale(25,45) -local rankingY = capWideScale(60,60) -local rankingTitleWidth = (rankingWidth/(#ms.SkillSets + 1)) - -if GAMESTATE:IsPlayerEnabled(PLAYER_1) then - profile = GetPlayerOrMachineProfile(PLAYER_1) -end - - -t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY;zoomto,frameWidth,frameHeight;halign,0;valign,0;diffuse,color("#333333CC"))} -t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY;zoomto,frameWidth,offsetY;halign,0;valign,0;diffuse,getMainColor('frames');diffusealpha,0.5)} - -t[#t+1] = LoadFont("Common Normal")..{InitCommand=cmd(xy,frameX+5,frameY+offsetY-9;zoom,0.6;halign,0;diffuse,getMainColor('positive');settext,"Profile Info (WIP)")} - --- The input callback for mouse clicks already exists within the tabmanager and redefining it within the local scope does nothing but create confusion - mina -local r = Def.ActorFrame{ - -- Cache the ranking - BeginCommand=function(self) - profile:GetTopSSRValue(250, rankingSkillset) - end, -} - -local function rankingLabel(i) - local ths -- the top highscore object - mina - local t = Def.ActorFrame{ - InitCommand=cmd(visible, false), - UpdateRankingMessageCommand=function(self) - if rankingSkillset > 0 then - self:visible(true) - else - self:visible(false) - end - end, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+rankingX,frameY+rankingY+110-(11-i)*10;halign,0;zoom,0.25;diffuse,getMainColor('positive');maxwidth,160), - SetCommand=function(self) - if update and rankingSkillset > 0 then - ths = profile:GetTopSSRHighScore(i+(20*(rankingPage-1)), rankingSkillset) - if ths then - local a=profile:GetTopSSRValue(i+(20*(rankingPage-1)), rankingSkillset) - self:settextf("%5.2f", a) - if not ths:GetEtternaValid() then - self:diffuse(byJudgment("TapNoteScore_Miss")) - else - self:diffuse(getMainColor('positive')) - end - else - self:settext( ' - ' ) - end - end - end, - UpdateRankingMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+rankingX+40,frameY+rankingY+110-(11-i)*10;halign,0;zoom,0.25;diffuse,getMainColor('positive');maxwidth,rankingWidth*2.5-160), - SetCommand=function(self) - if ths then - local a=profile:GetTopSSRValue(i+(20*(rankingPage-1)), rankingSkillset) - self:settext(profile:GetTopSSRSongName(i+(20*(rankingPage-1)), rankingSkillset) ) - if not ths:GetEtternaValid() then - self:diffuse(byJudgment("TapNoteScore_Miss")) - else - self:diffuse(getMainColor('positive')) - end - else - self:settext( ' ' ) - end - end, - UpdateRankingMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+rankingX+240,frameY+rankingY+110-(11-i)*10;halign,0.5;zoom,0.25;diffuse,getMainColor('positive');maxwidth,rankingWidth*4-160), - SetCommand=function(self) - if ths then - local ratestring = string.format("%.2f", ths:GetMusicRate()):gsub("%.?0+$", "").."x" - self:settext(ratestring) - if not ths:GetEtternaValid() then - self:diffuse(byJudgment("TapNoteScore_Miss")) - else - self:diffuse(getMainColor('positive')) - end - else - self:settext( ' - ' ) - end - end, - UpdateRankingMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+rankingX+290,frameY+rankingY+110-(11-i)*10;halign,0.5;zoom,0.25;diffuse,getMainColor('positive');maxwidth,rankingWidth*4-160), - SetCommand=function(self) - if ths then - self:settextf("%5.2f%%", ths:GetWifeScore()*100) - if not ths:GetEtternaValid() then - self:diffuse(byJudgment("TapNoteScore_Miss")) - else - self:diffuse(getGradeColor(ths:GetWifeGrade())) - end - else - self:settext( ' - ' ) - end - end, - UpdateRankingMessageCommand=cmd(queuecommand,"Set"), - }, - Def.Quad{ - InitCommand=cmd(xy,rankingX+rankingWidth/2,frameY+rankingY+105-(11-i)*10;zoomto,rankingWidth,10;halign,0.5;valign,0;diffuse,getMainColor('frames');diffusealpha,0), - MouseRightClickMessageCommand=function(self) - if ths then - if isOver(self) then - ths:ToggleEtternaValidation() - MESSAGEMAN:Broadcast("UpdateRanking") - if ths:GetEtternaValid() then - ms.ok("Score Revalidated") - else - ms.ok("Score Invalidated") - end - end - end - end, - MouseLeftClickMessageCommand=function(self) - if ths then - if isOver(self) then - local whee = SCREENMAN:GetTopScreen():GetMusicWheel() - local ssrsong = profile:GetSongFromSSR(i+(20*(rankingPage-1)), rankingSkillset) - whee:SelectSong(ssrsong) - end - end - end - } - } - return t -end - -local function rankingButton(i) - local t = Def.ActorFrame{ - Def.Quad{ - InitCommand=cmd(xy,frameX+rankingX+(i-1+i*(1/(1+#ms.SkillSets)))*rankingTitleWidth,frameY+rankingY-30;zoomto,rankingTitleWidth,30;halign,0.5;valign,0;diffuse,getMainColor('frames');diffusealpha,0.35), - SetCommand=function(self) - if i-1 == rankingSkillset then - self:diffusealpha(0.7) - else - self:diffusealpha(0.35) - end; - end, - MouseLeftClickMessageCommand=function(self) - if isOver(self) then - rankingSkillset = i-1 - MESSAGEMAN:Broadcast("UpdateRanking") - end; - end, - UpdateRankingMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+rankingX+(i-1+i*(1/(1+#ms.SkillSets)))*rankingTitleWidth,frameY+rankingY-15;halign,0.5;diffuse,getMainColor('positive');maxwidth,rankingTitleWidth;maxheight,25), - BeginCommand=function(self) - self:settext(ms.SkillSets[i]) - end, - } - } - return t -end - - -r[#r+1] = Def.Quad{ - InitCommand=cmd(xy,frameX+frameWidth-30,frameY+rankingY+265;zoomto,40,20;halign,0.5;valign,0;diffuse,getMainColor('frames');diffusealpha,0.35), - MouseLeftClickMessageCommand=function(self) - if isOver(self) then - --Move right - if rankingPage == 10 then - rankingPage=1 - else - rankingPage=rankingPage+1 - end - MESSAGEMAN:Broadcast("UpdateRanking") - end; - end; - } -r[#r+1] = LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+frameWidth-30,frameY+rankingY+275;halign,0.5;zoom,0.3;diffuse,getMainColor('positive')), - BeginCommand=function(self) - self:settext( 'Next' ) - end, - } - -r[#r+1] = Def.Quad{ - InitCommand=cmd(xy,frameX+40,frameY+rankingY+265;zoomto,65,20;halign,0.5;valign,0;diffuse,getMainColor('frames');diffusealpha,0.35), - MouseLeftClickMessageCommand=function(self) - if isOver(self) then - --Move left - if rankingPage == 1 then - rankingPage=10 - else - rankingPage=rankingPage-1 - end - MESSAGEMAN:Broadcast("UpdateRanking") - end; - end; - } -r[#r+1] = LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+40,frameY+rankingY+275;halign,0.5;zoom,0.3;diffuse,getMainColor('positive')), - BeginCommand=function(self) - self:settext( 'Previous' ) - end, - } -for i=1,scorestodisplay do - r[#r+1] = rankingLabel(i) -end - --- Technically the "overall" skillset is used for single value display during music select/eval and isn't factored in to the profile rating --- Only the specific skillsets are, and so overall should be used to display the specific skillset breakdowns separately - mina -for i=1,#ms.SkillSets do - r[#r+1] = rankingButton(i) -end - -t[#t+1] = r - --- should make a highlight or something to indicate the greatest value at a quick glance -local function littlebits(i) - local t = Def.ActorFrame{ - UpdateRankingMessageCommand=function(self) - if rankingSkillset == 0 then - self:visible(true) - else - self:visible(false) - end - end, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+30,frameY+120 + 22*i;halign,0;zoom,0.5;diffuse,getMainColor('positive')), - BeginCommand=cmd(queuecommand,"Set"), - SetCommand=function(self) - self:settext(ms.SkillSets[i]..":") - end, - PlayerJoinedMessageCommand=cmd(queuecommand,"Set"), - PlayerUnjoinedMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+270,frameY+120 + 22*i;halign,1;zoom,0.5), - BeginCommand=cmd(queuecommand,"Set"), - SetCommand=function(self) - local rating = profile:GetPlayerSkillsetRating(i) - self:settextf("%5.2f",rating) - self:diffuse(ByMSD(rating)) - end, - PlayerJoinedMessageCommand=cmd(queuecommand,"Set"), - PlayerUnjoinedMessageCommand=cmd(queuecommand,"Set"), - } - } - return t -end - -for i=2,#ms.SkillSets do - t[#t+1] = littlebits(i) -end - - -return t From 096bcd66f539920e98022bad68f24f2e268eb854 Mon Sep 17 00:00:00 2001 From: Misterkister Date: Tue, 17 Jan 2017 14:56:08 -0600 Subject: [PATCH 3/6] Delete msd.lua --- .../ScreenNetSelectMusic decorations/msd.lua | 173 ------------------ 1 file changed, 173 deletions(-) delete mode 100644 Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/msd.lua diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/msd.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/msd.lua deleted file mode 100644 index 16431afa4a..0000000000 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/msd.lua +++ /dev/null @@ -1,173 +0,0 @@ ---Local vars -local update = false -local steps -local song -local frameX = 10 -local frameY = 45 -local frameWidth = capWideScale(320,400) -local frameHeight = 350 -local fontScale = 0.4 -local distY = 15 -local offsetX = 10 -local offsetY = 20 -local pn = GAMESTATE:GetEnabledPlayers()[1] -local greatest = 0 -local steps -local meter = {} -meter[1] = 0.00 - ---Actor Frame -local t = Def.ActorFrame{ - BeginCommand=cmd(queuecommand,"Set";visible,false), - OffCommand=cmd(bouncebegin,0.2;xy,-500,0;diffusealpha,0), - OnCommand=cmd(bouncebegin,0.2;xy,0,0;diffusealpha,1), - SetCommand=function(self) - self:finishtweening() - if getTabIndex() == 1 then - self:queuecommand("On") - self:visible(true) - song = GAMESTATE:GetCurrentSong() - steps = GAMESTATE:GetCurrentSteps(PLAYER_1) - - --Find max MSD value, store MSD values in meter[] - greatest=0 - if song and steps then - for i=1,#ms.SkillSets do - meter[i+1] = steps:GetMSD(getCurRateValue(), i) - if meter[i+1] > meter[greatest+1] then - greatest = i - end - end - end - - MESSAGEMAN:Broadcast("UpdateMSDInfo") - update = true - else - self:queuecommand("Off") - update = false - end - end, - CurrentRateChangedMessageCommand=cmd(queuecommand,"Set"), - RefreshChartInfoMessageCommand=cmd(queuecommand,"Set"), - TabChangedMessageCommand=cmd(queuecommand,"Set"), - PlayerJoinedMessageCommand=cmd(queuecommand,"Set"), -} - ---BG quad -t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY;zoomto,frameWidth,frameHeight;halign,0;valign,0;diffuse,color("#333333CC"))} - ---Skillset label function -local function littlebits(i) - local t = Def.ActorFrame{ - LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+35,frameY+120 + 22*i;halign,0;valign,0;zoom,0.5;maxwidth,110/0.6), - BeginCommand=cmd(queuecommand,"Set"), - SetCommand=function(self) - --skillset name - if song and steps then - self:settext(ms.SkillSets[i]..":") - else - self:settext("") - end - --highlight - if greatest == i then - self:diffuse(getMainColor('positive')) - else - self:diffuse(getMainColor('negative')) - end - end, - UpdateMSDInfoCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+225,frameY+120 + 22*i;halign,1;valign,0;zoom,0.5;maxwidth,110/0.6), - BeginCommand=cmd(queuecommand,"Set"), - SetCommand=function(self) - if song and steps then - self:settextf("%05.2f",meter[i+1]) - self:diffuse(ByMSD(meter[i+1])) - else - self:settext("") - end - end, - CurrentRateChangedMessageCommand=cmd(queuecommand,"Set"), - UpdateMSDInfoCommand=cmd(queuecommand,"Set"), - } - } - return t -end - ---Song Title -t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY;zoomto,frameWidth,offsetY;halign,0;valign,0;diffuse,getMainColor('frames');diffusealpha,0.5)} -t[#t+1] = LoadFont("Common Normal")..{InitCommand=cmd(xy,frameX+5,frameY+offsetY-9;zoom,0.6;halign,0;diffuse,getMainColor('positive');settext,"MSD Breakdown (Wip)")} -t[#t+1] = LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX+5,frameY+35;zoom,0.6;halign,0;diffuse,getMainColor('positive');maxwidth,SCREEN_CENTER_X/0.7), - SetCommand=function(self) - if song then - self:settext(song:GetDisplayMainTitle()) - else - self:settext("") - end - end, - UpdateMSDInfoCommand=cmd(queuecommand,"Set"), -} - - --- Music Rate Display -t[#t+1] = LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+frameWidth-100,frameY+offsetY+65;visible,true;halign,0;zoom,0.4;maxwidth,capWideScale(get43size(360),360)/capWideScale(get43size(0.45),0.45)), - SetCommand=function(self) - self:settext(getCurRateDisplayString()) - end, - CurrentRateChangedCommand=cmd(queuecommand,"set") -} - ---Difficulty -t[#t+1] = LoadFont("Common Normal")..{ - Name="StepsAndMeter", - InitCommand=cmd(xy,frameX+frameWidth-offsetX,frameY+offsetY+50;zoom,0.5;halign,1), - SetCommand=function(self) - steps = GAMESTATE:GetCurrentSteps(pn) - if steps ~= nil then - local diff = getDifficulty(steps:GetDifficulty()) - local stype = ToEnumShortString(steps:GetStepsType()):gsub("%_"," ") - local meter = steps:GetMeter() - if update then - self:settext(stype.." "..diff.." "..meter) - self:diffuse(getDifficultyColor(GetCustomDifficulty(steps:GetStepsType(),steps:GetDifficulty()))) - end - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - - ---NPS -t[#t+1] = LoadFont("Common Normal")..{ - Name="NPS"; - InitCommand=cmd(xy,frameX+frameWidth-15,frameY+60;zoom,0.4;halign,1;); - SetCommand=function(self) - steps = GAMESTATE:GetCurrentSteps(pn) - --local song = GAMESTATE:GetCurrentSong() - local notecount = 0 - local length = 1 - if steps ~= nil and song ~= nil and update then - length = song:GetStepsSeconds() - notecount = steps:GetRadarValues(pn):GetValue("RadarCategory_Notes") - self:settext(string.format("%0.2f Average NPS",notecount/length)) - self:diffuse(Saturation(getDifficultyColor(GetCustomDifficulty(steps:GetStepsType(),steps:GetDifficulty())),0.3)) - else - self:settext("0.00 Average NPS") - end - end; - CurrentSongChangedMessageCommand=cmd(queuecommand,"Set"); - CurrentStepsP1ChangedMessageCommand=cmd(queuecommand,"Set"); - CurrentStepsP2ChangedMessageCommand=cmd(queuecommand,"Set"); -}; - - ---Skillset labels -for i=1,#ms.SkillSets do - t[#t+1] = littlebits(i) -end - -return t From 3ca2ffe9d755e6c1e78260520507bcb786da4261 Mon Sep 17 00:00:00 2001 From: Misterkister Date: Tue, 17 Jan 2017 14:56:32 -0600 Subject: [PATCH 4/6] Delete songsearch.lua --- .../songsearch.lua | 119 ------------------ 1 file changed, 119 deletions(-) delete mode 100644 Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/songsearch.lua diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/songsearch.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/songsearch.lua deleted file mode 100644 index 17dbc9913c..0000000000 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/songsearch.lua +++ /dev/null @@ -1,119 +0,0 @@ -local searchstring = "" -- GetPersistentSearch() -local englishes = {"a", "b", "c", "d", "e","f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",";"} -local frameX = 10 -local frameY = 180+capWideScale(get43size(120),120) -local active = false -local whee -local lastsearchstring = "" -- GetPersistentSearch() - -local function searchInput(event) - if event.type ~= "InputEventType_Release" and active == true then - if event.button == "Back" then - searchstring = "" - whee:SongSearch(searchstring) - resetTabIndex(0) - MESSAGEMAN:Broadcast("TabChanged") - MESSAGEMAN:Broadcast("EndingSearch", {ActiveFilter = ""}) - elseif event.button == "Start" then - resetTabIndex(0) - --SetPersistentSearch(searchstring) - MESSAGEMAN:Broadcast("EndingSearch", {ActiveFilter = searchstring}) - MESSAGEMAN:Broadcast("TabChanged") - elseif event.DeviceInput.button == "DeviceButton_space" then -- add space to the string - searchstring = searchstring.." " - elseif event.DeviceInput.button == "DeviceButton_backspace"then - searchstring = searchstring:sub(1, -2) -- remove the last element of the string - elseif event.DeviceInput.button == "DeviceButton_delete" then - searchstring = "" - elseif event.DeviceInput.button == "DeviceButton_=" then - searchstring = searchstring.."=" - else - for i=1,#englishes do -- add standard characters to string - if event.DeviceInput.button == "DeviceButton_"..englishes[i] then - searchstring = searchstring..englishes[i] - end - end - end - if lastsearchstring ~= searchstring then - MESSAGEMAN:Broadcast("UpdateString") - whee:SongSearch(searchstring) - lastsearchstring = searchstring - end - end -end - -local t = Def.ActorFrame{ - OnCommand=function(self) - whee = SCREENMAN:GetTopScreen():GetMusicWheel() - SCREENMAN:GetTopScreen():AddInputCallback(searchInput) - self:visible(false) - end, - SetCommand=function(self) - self:finishtweening() - if getTabIndex() == 3 then - ms.ok("Song search activated") - MESSAGEMAN:Broadcast("BeginningSearch") - self:visible(true) - active = true - SCREENMAN:set_input_redirected(PLAYER_1, true) - MESSAGEMAN:Broadcast("RefreshSearchResults") - else - self:visible(false) - self:queuecommand("Off") - active = false - SCREENMAN:set_input_redirected(PLAYER_1, false) - end - end, - TabChangedMessageCommand=cmd(queuecommand,"Set"), - - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX+250-capWideScale(get43size(120),30),frameY-90;zoom,0.7;halign,0.5;maxwidth,470), - SetCommand=function(self) - if active then - self:settext("Search Active:") - self:diffuse(getGradeColor("Grade_Tier03")) - else - self:settext("Search Complete:") - self:diffuse(byJudgment("TapNoteScore_Miss")) - end - end, - UpdateStringMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX+250-capWideScale(get43size(120),30),frameY-50;zoom,0.7;halign,0.5;maxwidth,470), - SetCommand=function(self) - self:settext(searchstring) - end, - UpdateStringMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX+20,frameY-200;zoom,0.4;halign,0), - SetCommand=function(self) - self:settext("Start to lock search results.") - end, - UpdateStringMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX+20,frameY-175;zoom,0.4;halign,0), - SetCommand=function(self) - self:settext("Back to cancel search.") - end, - UpdateStringMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX+20,frameY-150;zoom,0.4;halign,0), - SetCommand=function(self) - self:settext("Delete resets search query.") - end, - UpdateStringMessageCommand=cmd(queuecommand,"Set"), - }, - LoadFont("Common Normal")..{ - InitCommand=cmd(xy,frameX+20,frameY+70;zoom,0.5;halign,0), - SetCommand=function(self) - self:settext("Currently supports standard english alphabet only.") - end, - UpdateStringMessageCommand=cmd(queuecommand,"Set"), - }, -} - -return t \ No newline at end of file From 9e14d4f852ceb82b6e2500b149a18e15c71c9486 Mon Sep 17 00:00:00 2001 From: Misterkister Date: Tue, 17 Jan 2017 14:56:48 -0600 Subject: [PATCH 5/6] Delete score.lua --- .../score.lua | 464 ------------------ 1 file changed, 464 deletions(-) delete mode 100644 Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/score.lua diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/score.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/score.lua deleted file mode 100644 index 97ed10a6dc..0000000000 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/score.lua +++ /dev/null @@ -1,464 +0,0 @@ -local update = false - -local hsTable -local rtTable -local rates -local rateIndex = 1 -local scoreIndex = 1 -local score -local pn = GAMESTATE:GetEnabledPlayers()[1] - -local defaultRateText = "" -if themeConfig:get_data().global.RateSort then - defaultRateText = "1.0x" -else - defaultRateText = "All" -end - -local t = Def.ActorFrame{ - BeginCommand=cmd(queuecommand,"Set";visible,false), - OffCommand=cmd(bouncebegin,0.2;xy,-500,0;diffusealpha,0), -- visible(false) doesn't seem to work with sleep - OnCommand=cmd(bouncebegin,0.2;xy,0,0;diffusealpha,1), - SetCommand=function(self) - self:finishtweening() - if getTabIndex() == 2 then - self:queuecommand("On") - self:visible(true) - update = true - self:playcommand("InitScore") - else - self:queuecommand("Off") - update = false - end - end, - TabChangedMessageCommand=cmd(queuecommand,"Set"), - CodeMessageCommand=function(self,params) - if update then - if params.Name == "NextRate" then - rateIndex = ((rateIndex)%(#rates))+1 - scoreIndex = 1 - elseif params.Name == "PrevRate" then - rateIndex = ((rateIndex-2)%(#rates))+1 - scoreIndex = 1 - elseif params.Name == "NextScore" then - if rtTable[rates[rateIndex]] ~= nil then - scoreIndex = ((scoreIndex)%(#rtTable[rates[rateIndex]]))+1 - end - elseif params.Name == "PrevScore" then - if rtTable[rates[rateIndex]] ~= nil then - scoreIndex = ((scoreIndex-2)%(#rtTable[rates[rateIndex]]))+1 - end - end - if rtTable[rates[rateIndex]] ~= nil then - score = rtTable[rates[rateIndex]][scoreIndex] - MESSAGEMAN:Broadcast("ScoreUpdate") - end - end - end, - PlayerJoinedMessageCommand=cmd(queuecommand,"Set"), - CurrentSongChangedMessageCommand=cmd(queuecommand,"Set"), - CurrentStepsP1ChangedMessageCommand=cmd(queuecommand,"Set"), - CurrentStepsP2ChangedMessageCommand=cmd(queuecommand,"Set"), - InitScoreCommand=function(self) - if GAMESTATE:GetCurrentSong() ~= nil then - hsTable = getScoresByKey(pn) - if hsTable ~= nil and hsTable[1] ~= nil then - rtTable = getRateTable(hsTable) - rates,rateIndex = getUsedRates(rtTable) - scoreIndex = 1 - score = rtTable[rates[rateIndex]][scoreIndex] - else - rtTable = {} - rates,rateIndex = {defaultRateText},1 - scoreIndex = 1 - score = nil - end; - else - hsTable = {} - rtTable = {} - rates,rateIndex = {defaultRateText},1 - scoreIndex = 1 - score = nil - end - MESSAGEMAN:Broadcast("ScoreUpdate") - end -} - -local frameX = 10 -local frameY = 45 -local frameWidth = capWideScale(320,400) -local frameHeight = 350 -local fontScale = 0.4 -local offsetX = 10 -local offsetY = 20 - -local judges = {'TapNoteScore_W1','TapNoteScore_W2','TapNoteScore_W3','TapNoteScore_W4','TapNoteScore_W5','TapNoteScore_Miss','HoldNoteScore_Held','HoldNoteScore_LetGo'} - -t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY;zoomto,frameWidth,frameHeight;halign,0;valign,0;diffuse,color("#333333CC"))} -t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY;zoomto,frameWidth,offsetY;halign,0;valign,0;diffuse,getMainColor('frames');diffusealpha,0.5)} - -t[#t+1] = LoadFont("Common Normal")..{ - InitCommand=cmd(xy,frameX+5,frameY+offsetY-9;zoom,0.6;halign,0;diffuse,getMainColor('positive')), - BeginCommand=cmd(settext,"Score Info") -} - -t[#t+1] = LoadFont("Common Large")..{ - Name="Grades", - InitCommand=cmd(xy,frameX+offsetX,frameY+offsetY+20;zoom,0.6;halign,0;maxwidth,50/0.6), - SetCommand=function(self) - if score ~= nil then - self:settext(THEME:GetString("Grade",ToEnumShortString(score:GetGrade()))) - self:diffuse(getGradeColor(score:GetGrade())) - else - self:settext("") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - --- DP display -t[#t+1] = LoadFont("Common Normal")..{ - Name="Score", - InitCommand=cmd(xy,frameX+offsetX+55,frameY+offsetY+14;zoom,0.5;halign,0), - SetCommand=function(self) - if score ~= nil then - local curscore = getScore(score,0) - local maxscore = getMaxScore(pn,0) - if maxscore == 0 or maxscore == nil then - maxscore = 1 - end - local pscore = (curscore/maxscore) - - self:settextf("%05.2f%% (%s)",math.floor((pscore)*10000)/100, scoringToText(1)) - else - self:settextf("00.00%% (%s)", scoringToText(1)) - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - --- Wife display -t[#t+1] = LoadFont("Common Normal")..{ - Name="Score", - InitCommand=cmd(xy,frameX+offsetX+55,frameY+offsetY+28;zoom,0.5;halign,0), - SetCommand=function(self) - if score ~= nil then - if score:GetWifeScore() == 0 then - self:settextf("NA (%s)", "Wife") - else - self:settextf("%05.2f%% (%s)", notShit.floor(score:GetWifeScore()*10000)/100, "Wife") - end - else - self:settextf("00.00%% (%s)", "Wife") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - --- Rescoring stuff --- t[#t+1] = LoadFont("Common Normal")..{ - -- Name="Score", - -- InitCommand=cmd(xy,frameX+offsetX+155,frameY+offsetY+14;zoom,0.5;halign,0), - -- SetCommand=function(self) - -- if score ~= nil then - -- if score:GetWifeScore() == 0 then - -- self:settextf("NA (%s)", "Wife") - -- else - -- self:settextf("%05.2f%% (%s)", notShit.floor(score:RescoreToWifeJudge(4)*10000)/100, "Wife J4") - -- end - -- else - -- self:settextf("00.00%% (%s)", "Wife") - -- end - -- end, - -- ScoreUpdateMessageCommand=cmd(queuecommand,"Set") --- } - --- t[#t+1] = LoadFont("Common Normal")..{ - -- Name="Score", - -- InitCommand=cmd(xy,frameX+offsetX+155,frameY+offsetY+28;zoom,0.5;halign,0), - -- SetCommand=function(self) - -- if score ~= nil then - -- if score:GetWifeScore() == 0 then - -- self:settextf("NA (%s)", "Wife") - -- else - -- self:settextf("%05.2f%% (%s)", notShit.floor(score:RescoreToDPJudge(4)*10000)/100, "DP J4") - -- end - -- else - -- self:settextf("00.00%% (%s)", "Wife") - -- end - -- end, - -- ScoreUpdateMessageCommand=cmd(queuecommand,"Set") --- } - --- SSR displays -t[#t+1] = LoadFont("Common Normal")..{ - Name="Score", - InitCommand=cmd(xy,frameX+offsetX+155,frameY+offsetY+28;zoom,0.5;halign,0), - SetCommand=function(self) - if score ~= nil then - if score:GetWifeScore() == 0 then - self:settext("") - else - self:settextf("%5.2f", score:GetSkillsetSSR(2)) - end - else - self:settext("") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - Name="Score", - InitCommand=cmd(xy,frameX+offsetX+155,frameY+offsetY+38;zoom,0.5;halign,0), - SetCommand=function(self) - if score ~= nil then - if score:GetWifeScore() == 0 then - self:settext("") - else - self:settextf("%5.2f", score:GetSkillsetSSR(3)) - end - else - self:settext("") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - Name="Score", - InitCommand=cmd(xy,frameX+offsetX+155,frameY+offsetY+48;zoom,0.5;halign,0), - SetCommand=function(self) - if score ~= nil then - if score:GetWifeScore() == 0 then - self:settext("") - else - self:settextf("%5.2f", score:GetSkillsetSSR(4)) - end - else - self:settext("") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - Name="Score", - InitCommand=cmd(xy,frameX+offsetX+155,frameY+offsetY+58;zoom,0.5;halign,0), - SetCommand=function(self) - if score ~= nil then - if score:GetWifeScore() == 0 then - self:settext("") - else - self:settextf("%5.2f", score:GetSkillsetSSR(5)) - end - else - self:settext("") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - Name="ClearType", - InitCommand=cmd(xy,frameX+offsetX,frameY+offsetY+41;zoom,0.5;halign,0); - SetCommand=function(self) - if score ~= nil then - self:settext(getClearTypeFromScore(pn,score,0)) - self:diffuse(getClearTypeFromScore(pn,score,2)) - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - Name="Combo", - InitCommand=cmd(xy,frameX+offsetX,frameY+offsetY+58;zoom,0.4;halign,0); - SetCommand=function(self) - if score ~= nil then - local maxCombo = getScoreMaxCombo(score) - self:settextf("Max Combo: %d",maxCombo) - else - self:settext("Max Combo: 0") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - Name="MissCount", - InitCommand=cmd(xy,frameX+offsetX,frameY+offsetY+73;zoom,0.4;halign,0); - SetCommand=function(self) - if score ~= nil then - local missCount = getScoreMissCount(score) - if missCount ~= nil then - self:settext("Miss Count: "..missCount) - else - self:settext("Miss Count: -") - end - else - self:settext("Miss Count: -") - end; - end; - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - Name="Date", - InitCommand=cmd(xy,frameX+offsetX,frameY+offsetY+88;zoom,0.4;halign,0); - SetCommand=function(self) - if score ~= nil then - self:settext("Date Achieved: "..getScoreDate(score)) - else - self:settext("Date Achieved: ") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - Name="Mods", - InitCommand=cmd(xy,frameX+offsetX,frameY+offsetY+103;zoom,0.4;halign,0); - SetCommand=function(self) - if score ~= nil then - self:settext("Mods: " ..score:GetModifiers()) - else - self:settext("Mods:") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - Name="StepsAndMeter", - InitCommand=cmd(xy,frameX+frameWidth-offsetX,frameY+offsetY+10;zoom,0.5;halign,1), - SetCommand=function(self) - local steps = GAMESTATE:GetCurrentSteps(pn) - if steps ~= nil then - local diff = getDifficulty(steps:GetDifficulty()) - local stype = ToEnumShortString(steps:GetStepsType()):gsub("%_"," ") - local meter = steps:GetMeter() - if update then - self:settext(stype.." "..diff.." "..meter) - self:diffuse(getDifficultyColor(GetCustomDifficulty(steps:GetStepsType(),steps:GetDifficulty()))) - end - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = LoadFont("Common Normal")..{ - InitCommand=cmd(xy,frameX+frameWidth-offsetX,frameY+frameHeight-10;zoom,0.4;halign,1), - SetCommand=function(self) - if hsTable ~= nil and rates ~= nil and rtTable[rates[rateIndex]] ~= nil then - self:settextf("Rate %s - Showing %d/%d",rates[rateIndex],scoreIndex,#rtTable[rates[rateIndex]]) - else - self:settext("No Scores Saved") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") -} - -t[#t+1] = Def.Quad{ - Name="ScrollBar", - InitCommand=cmd(xy,frameX+frameWidth,frameY+frameHeight;zoomto,4,0;halign,1;valign,1;diffuse,getMainColor('highlight');diffusealpha,0.5), - ScoreUpdateMessageCommand=cmd(queuecommand,"Set"), - SetCommand=function(self,params) - self:finishtweening() - self:smooth(0.2) - if hsTable ~= nil and rates ~= nil and rtTable[rates[rateIndex]] ~= nil then - self:zoomy(((frameHeight-offsetY)/#rtTable[rates[rateIndex]])) - self:y(frameY+offsetY+(((frameHeight-offsetY)/#rtTable[rates[rateIndex]])*scoreIndex)) - else - self:zoomy(frameHeight-offsetY) - self:y(frameY+frameHeight) - end - end -} - -local function makeText(index) - return LoadFont("Common Normal")..{ - InitCommand=cmd(xy,frameX+frameWidth-offsetX,frameY+offsetY+15+(index*15);zoom,fontScale;halign,1), - SetCommand=function(self) - local count = 0 - if update then - if rtTable[rates[index]] ~= nil then - count = #rtTable[rates[index]] - end - if index <= #rates then - self:settextf("%s (%d)",rates[index],count) - if index == rateIndex then - self:diffuse(color("#FFFFFF")) - else - self:diffuse(getMainColor('positive')) - end - else - self:settext("") - end - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") - } -end - -for i=1,10 do - t[#t+1] =makeText(i) -end - -local function makeJudge(index,judge) - local t = Def.ActorFrame{InitCommand=cmd(xy,frameX+offsetX,frameY+offsetY+125+((index-1)*18))} - - --labels - t[#t+1] = LoadFont("Common Normal")..{ - InitCommand=cmd(zoom,0.5;halign,0), - BeginCommand=function(self) - self:settext(getJudgeStrings(judge)) - self:diffuse(byJudgment(judge)) - end - }; - - t[#t+1] = LoadFont("Common Normal")..{ - InitCommand=cmd(x,120;zoom,0.5;halign,1), - SetCommand=function(self) - if score ~= nil then - if judge ~= 'HoldNoteScore_Held' and judge ~= 'HoldNoteScore_LetGo' then - self:settext(getScoreTapNoteScore(score,judge)) - else - self:settext(getScoreHoldNoteScore(score,judge)) - end - else - self:settext("0") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set"), - }; - - t[#t+1] = LoadFont("Common Normal")..{ - InitCommand=cmd(x,122;zoom,0.3;halign,0), - SetCommand=function(self) - if score ~= nil then - if judge ~= 'HoldNoteScore_Held' and judge ~= 'HoldNoteScore_LetGo' then - local taps = math.max(1,getMaxNotes(pn)) - local count = getScoreTapNoteScore(score,judge) - self:settextf("(%03.2f%%)",(count/taps)*100) - else - local holds = math.max(1,getMaxHolds(pn)) - local count = getScoreHoldNoteScore(score,judge) - - self:settextf("(%03.2f%%)",(count/holds)*100) - end - else - self:settext("(0.00%)") - end - end, - ScoreUpdateMessageCommand=cmd(queuecommand,"Set") - }; - - return t -end - -for i=1,#judges do - t[#t+1] =makeJudge(i,judges[i]) -end - -return t \ No newline at end of file From 4bf1504b60224b8c258c51d3ebff58b2cc5d8ddd Mon Sep 17 00:00:00 2001 From: Misterkister Date: Tue, 17 Jan 2017 14:57:04 -0600 Subject: [PATCH 6/6] Delete filters.lua --- .../filters.lua | 299 ------------------ 1 file changed, 299 deletions(-) delete mode 100644 Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/filters.lua diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/filters.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/filters.lua deleted file mode 100644 index 1e00aaea86..0000000000 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/filters.lua +++ /dev/null @@ -1,299 +0,0 @@ -local numbershers = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"} -local frameX = 10 -local frameY = 45 -local active = false -local whee -local spacingY = 20 -local textzoom = 0.35 -local ActiveSS = 0 -local SSQuery = {} -SSQuery[0] = {} -SSQuery[1] = {} -local frameWidth = capWideScale(360,400) -local frameHeight = 350 -local offsetX = 10 -local offsetY = 20 -local activebound = 0 -for i=1,#ms.SkillSets do - SSQuery[0][i] = "0" - SSQuery[1][i] = "0" -end - -local function FilterInput(event) - if event.type ~= "InputEventType_Release" and ActiveSS > 0 and active then - if event.button == "Start" or event.button == "Back" then - ActiveSS = 0 - MESSAGEMAN:Broadcast("NumericInputEnded") - SCREENMAN:set_input_redirected(PLAYER_1, false) - return true - elseif event.DeviceInput.button == "DeviceButton_backspace" then - SSQuery[activebound][ActiveSS] = SSQuery[activebound][ActiveSS]:sub(1, -2) - elseif event.DeviceInput.button == "DeviceButton_delete" then - SSQuery[activebound][ActiveSS] = "" - else - for i=1,#numbershers do - if event.DeviceInput.button == "DeviceButton_"..numbershers[i] then - if SSQuery[activebound][ActiveSS] == "0" then - SSQuery[activebound][ActiveSS] = "" - end - SSQuery[activebound][ActiveSS] = SSQuery[activebound][ActiveSS]..numbershers[i] - if #SSQuery[activebound][ActiveSS] > 2 then - SSQuery[activebound][ActiveSS] = numbershers[i] - end - end - end - end - if SSQuery[activebound][ActiveSS] == "" then - SSQuery[activebound][ActiveSS] = "0" - end - GAMESTATE:SetSSFilter(tonumber(SSQuery[activebound][ActiveSS]), ActiveSS, activebound) - whee:SongSearch("") -- stupid workaround? - MESSAGEMAN:Broadcast("UpdateFilter") - end -end - -local f = Def.ActorFrame{ - InitCommand=cmd(xy,frameX,frameY;halign,0), - Def.Quad{InitCommand=cmd(zoomto,frameWidth,frameHeight;halign,0;valign,0;diffuse,color("#333333CC"))}, - Def.Quad{InitCommand=cmd(zoomto,frameWidth,offsetY;halign,0;valign,0;diffuse,getMainColor('frames');diffusealpha,0.5)}, - LoadFont("Common Normal")..{InitCommand=cmd(xy,5,offsetY-9;zoom,0.6;halign,0;diffuse,getMainColor('positive');settext,"Filters (WIP)")}, - OnCommand=function(self) - whee = SCREENMAN:GetTopScreen():GetMusicWheel() - SCREENMAN:GetTopScreen():AddInputCallback(FilterInput) - self:visible(false) - end, - SetCommand=function(self) - self:finishtweening() - if getTabIndex() == 5 then - self:visible(true) - active = true - else - MESSAGEMAN:Broadcast("NumericInputEnded") - self:visible(false) - self:queuecommand("Off") - end - end, - TabChangedMessageCommand=cmd(queuecommand,"Set"), - MouseRightClickMessageCommand=function(self) - ActiveSS = 0 - MESSAGEMAN:Broadcast("NumericInputEnded") - MESSAGEMAN:Broadcast("UpdateFilter") - SCREENMAN:set_input_redirected(PLAYER_1, false) - end, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX,frameY;zoom,0.3;halign,0), - SetCommand=function(self) - self:settext("Left click on the filter value to set it.") - end, - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX,frameY+20;zoom,0.3;halign,0), - SetCommand=function(self) - self:settext("Right click/Start/Back to cancel input.") - end, - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX,frameY+40;zoom,0.3;halign,0), - SetCommand=function(self) - self:settext("Greyed out values are inactive.") - end, - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX,frameY+60;zoom,0.3;halign,0), - SetCommand=function(self) - self:settext("Using both bounds creates a range.") - end, - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX,frameY+80;zoom,0.3;halign,0), - SetCommand=function(self) - self:settext("'Highest Only' applies only to Mode: Or") - end, - }, - 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()) - end, - MaxFilterRateChangedMessageCommand=cmd(queuecommand,"Set"), - }, - Def.Quad{ - InitCommand=cmd(xy,frameX+frameWidth/2,175;zoomto,130,18;halign,0;diffusealpha,0), - MouseLeftClickMessageCommand=function(self) - if isOver(self) then - GAMESTATE:SetMaxFilterRate(GAMESTATE:GetMaxFilterRate()+0.1) - MESSAGEMAN:Broadcast("MaxFilterRateChanged") - whee:SongSearch("") - end - end, - MouseRightClickMessageCommand=function(self) - if isOver(self) then - GAMESTATE:SetMaxFilterRate(GAMESTATE:GetMaxFilterRate()-0.1) - MESSAGEMAN:Broadcast("MaxFilterRateChanged") - whee:SongSearch("") - end - end, - }, - 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()) - end, - MaxFilterRateChangedMessageCommand=cmd(queuecommand,"Set"), - }, - Def.Quad{ - InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY;zoomto,130,18;halign,0;diffusealpha,0), - MouseLeftClickMessageCommand=function(self) - if isOver(self) then - GAMESTATE:SetMinFilterRate(GAMESTATE:GetMinFilterRate()+0.1) - MESSAGEMAN:Broadcast("MaxFilterRateChanged") - whee:SongSearch("") - end - end, - MouseRightClickMessageCommand=function(self) - if isOver(self) then - GAMESTATE:SetMinFilterRate(GAMESTATE:GetMinFilterRate()-0.1) - MESSAGEMAN:Broadcast("MaxFilterRateChanged") - whee:SongSearch("") - end - end, - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 2;zoom,textzoom;halign,0), - SetCommand=function(self) - local mode = GAMESTATE:GetFilterMode() - if mode then - self:settext("Mode: ".."AND") - else - self:settext("Mode: ".."OR") - end - end, - FilterModeChangedMessageCommand=cmd(queuecommand,"Set"), - }, - Def.Quad{ - InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 2;zoomto,120,18;halign,0;diffusealpha,0), - MouseLeftClickMessageCommand=function(self) - if isOver(self) then - GAMESTATE:ToggleFilterMode() - MESSAGEMAN:Broadcast("FilterModeChanged") - whee:SongSearch("") - end - end, - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 3;zoom,textzoom;halign,0), - SetCommand=function(self) - local yes = GAMESTATE:GetHighestSkillsetsOnly() - if yes then - self:settext("Highest Only: ".."ON") - else - self:settext("Highest Only: ".."OFF") - end - end, - FilterModeChangedMessageCommand=cmd(queuecommand,"Set"), - }, - Def.Quad{ - InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 3;zoomto,160,18;halign,0;diffusealpha,0), - MouseLeftClickMessageCommand=function(self) - if isOver(self) then - GAMESTATE:ToggleHighestSkillsetsOnly() - MESSAGEMAN:Broadcast("FilterModeChanged") - whee:SongSearch("") - end - end, - }, - LoadFont("Common Large")..{ - InitCommand=cmd(xy,frameX+frameWidth/2,175 + spacingY * 4;zoom,textzoom;halign,0;settext,""), - FilterResultsMessageCommand=function(self, msg) - self:settext("Matches: "..msg.Matches.."/"..msg.Total) - end - }, -} - -local function CreateFilterInputBox(i) - local t = Def.ActorFrame{ - LoadFont("Common Large")..{ - InitCommand=cmd(addx,10;addy,175 + (i-1)*spacingY;halign,0;zoom,textzoom), - SetCommand=cmd(settext, ms.SkillSets[i]) - }, - Def.Quad{ - InitCommand=cmd(addx,150;addy,175 + (i-1)*spacingY;zoomto,18,18;halign,1), - MouseLeftClickMessageCommand=function(self) - if isOver(self) then - ActiveSS = i - activebound = 0 - MESSAGEMAN:Broadcast("NumericInputActive") - self:diffusealpha(0.1) - SCREENMAN:set_input_redirected(PLAYER_1, true) - end - end, - SetCommand=function(self) - if ActiveSS == i and activebound == 0 then - self:diffuse(color("#666666")) - else - self:diffuse(color("#000000")) - end - end, - UpdateFilterMessageCommand=cmd(queuecommand,"Set"), - NumericInputEndedMessageCommand=cmd(queuecommand,"Set"), - NumericInputActiveMessageCommand=cmd(queuecommand,"Set"), - }, - 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 - self:settext(fval) - if fval <= 0 and ActiveSS ~= i then - self:diffuse(color("#666666")) - elseif activebound == 0 then - self:diffuse(color("#FFFFFF")) - end - end, - UpdateFilterMessageCommand=cmd(queuecommand,"Set"), - NumericInputActiveMessageCommand=cmd(queuecommand,"Set"), - }, - Def.Quad{ - InitCommand=cmd(addx,175;addy,175 + (i-1)*spacingY;zoomto,18,18;halign,1), - MouseLeftClickMessageCommand=function(self) - if isOver(self) then - ActiveSS = i - activebound = 1 - MESSAGEMAN:Broadcast("NumericInputActive") - self:diffusealpha(0.1) - SCREENMAN:set_input_redirected(PLAYER_1, true) - end - end, - SetCommand=function(self) - if ActiveSS == i and activebound == 1 then - self:diffuse(color("#666666")) - else - self:diffuse(color("#000000")) - end - end, - UpdateFilterMessageCommand=cmd(queuecommand,"Set"), - NumericInputEndedMessageCommand=cmd(queuecommand,"Set"), - NumericInputActiveMessageCommand=cmd(queuecommand,"Set"), - }, - 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 - self:settext(fval) - if fval <= 0 and ActiveSS ~= i then - self:diffuse(color("#666666")) - elseif activebound == 1 then - self:diffuse(color("#FFFFFF")) - end - end, - UpdateFilterMessageCommand=cmd(queuecommand,"Set"), - NumericInputActiveMessageCommand=cmd(queuecommand,"Set"), - }, - } - return t -end - -for i=1,#ms.SkillSets do - f[#f+1] = CreateFilterInputBox(i) -end - -return f \ No newline at end of file