From 5cbde033b835d11af65ddb5bb7f93725a06cd98d Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Sat, 29 Apr 2017 17:48:21 -0400 Subject: [PATCH] go back to old profile lua --- .../ScreenSelectMusic decorations/profile.lua | 597 +++++++++--------- 1 file changed, 292 insertions(+), 305 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/profile.lua b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/profile.lua index 94faada7e4..65c45fd7da 100644 --- a/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/profile.lua +++ b/Themes/Til Death/BGAnimations/ScreenSelectMusic decorations/profile.lua @@ -1,3 +1,5 @@ +-- refactor this using the goaltracker code framework after i finish making it not shit -mina + local update = false local t = Def.ActorFrame{ BeginCommand=cmd(queuecommand,"Set";visible,false), @@ -7,10 +9,10 @@ local t = Def.ActorFrame{ self:finishtweening() if getTabIndex() == 4 then + self:queuecommand("On") self:visible(true) update = true - MESSAGEMAN:Broadcast("UpdateGoals") else self:queuecommand("Off") update = false @@ -25,323 +27,197 @@ local frameY = 45 local frameWidth = capWideScale(360,400) local frameHeight = 350 local fontScale = 0.4 -local goalsperpage = 9 +local scorestodisplay = 25 local distY = 15 local offsetX = 10 local offsetY = 20 local rankingSkillset=0 -local goalFilter=1 +local rankingPage=1 local rankingWidth = frameWidth-capWideScale(15,50) -local rankingX = capWideScale(20,30) -local rankingY = capWideScale(80,80) -local rankingTitleWidth = (rankingWidth/(3 + 1)) -local buttondiffuse = 0 -local buttonheight = 10 -local goalYspacing = 30 -local goalrow2Y = 12 -local currentgoalpage = 1 -local numgoalpages = 1 +local rankingX = capWideScale(30,50) +local rankingY = capWideScale(60,60) +local rankingTitleWidth = (rankingWidth/(#ms.SkillSets + 1)) if GAMESTATE:IsPlayerEnabled(PLAYER_1) then profile = GetPlayerOrMachineProfile(PLAYER_1) end -local playergoals = profile:GetAllGoals() -local displayindex = {} 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,"Goal Tracker (WIP)")} --- prolly a clever way to cut this down to like 5 lines - mina -local function filterDisplay (playergoals) - local index = {} - if goalFilter == 2 then - for i=1,#playergoals do - if playergoals[i]:IsAchieved() then - index[#index+1] = i - end - end - return index - elseif goalFilter == 3 then - for i=1,#playergoals do - if not playergoals[i]:IsAchieved() then - index[#index+1] = i - end - end - return index - end - for i=1,#playergoals do - index[#index+1] = i - end - return index -end - -local function byAchieved(scoregoal) - if not scoregoal or scoregoal:IsAchieved() then - return getMainColor('positive') - end - return byDifficulty("Difficulty_Edit") -end - -local function datetimetodate(datetime) - local i = datetime:find(" ") - return datetime:sub(1,i) -end +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)")} -local r = Def.ActorFrame{ - UpdateGoalsMessageCommand=function(self) - playergoals = profile:GetAllGoals() - displayindex = filterDisplay(playergoals) - numgoalpages = notShit.ceil(#displayindex/goalsperpage) - end -} - - --- need to handle visibility toggle better... cba now -mina -local function makescoregoal(i) - local sg -- scoregoal object -mina - local ck -- multiple things need this so just have the first actor update it - local goalsong -- screw it do all the things -mina - local goalsteps +-- 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{} +local function rankingLabel(i) + local ths -- the top highscore object - mina local t = Def.ActorFrame{ - InitCommand=cmd(xy,frameX+rankingX,frameY+rankingY+220), - -- Nest actor frames for each goal so we can control spacing from a single point -mina - Def.ActorFrame{ - InitCommand=function(self) - self:y((goalsperpage-i)*-goalYspacing) + 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+12.5,frameY+rankingY+110-(11-i)*10;halign,0.5;zoom,0.25;diffuse,getMainColor('positive');maxwidth,100), + SetCommand=function(self) + self:diffuse(getMainColor("positive")) + self:settext(((rankingPage-1)*25)+i..".") end, - Def.Quad{InitCommand=cmd(xy,-16,20;zoomto,frameWidth-10,goalYspacing-2;halign,0;valign,1;diffuse,getMainColor('frames');diffusealpha,0.35)}, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,-14,goalrow2Y;halign,0;zoom,0.25;diffuse,getMainColor('positive');maxwidth,56), - SetCommand=function(self) - if update then - sg = playergoals[displayindex[i+( (currentgoalpage - 1) *goalsperpage)]] - if sg then - -- should do this initialization better -mina - ck = sg:GetChartKey() - goalsong = SONGMAN:GetSongByChartKey(ck) - goalsteps = SONGMAN:GetStepsByChartKey(ck) - - local diff = goalsteps:GetDifficulty() - self:settext(getShortDifficulty(diff)) - self:diffuse(byDifficulty(diff)) - self:visible(true) - else - self:visible(false) - end - end - end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set") - }, - LoadFont("Common Large") .. { - InitCommand=cmd(x,30;halign,0;zoom,0.25;diffuse,getMainColor('positive');maxwidth,600), - SetCommand=function(self) - if update then - if sg then - self:settextf(goalsong:GetDisplayMainTitle()) - self:visible(true) + UpdateRankingMessageCommand=cmd(queuecommand,"Set"), + }, + 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 + profile:GetTopSSRHighScore(i+(scorestodisplay*(9)), rankingSkillset) -- hacky way to initialzie vectors out to 250 (way faster) + ths = profile:GetTopSSRHighScore(i+(scorestodisplay*(rankingPage-1)), rankingSkillset) + if ths then + profile:GetTopSSRValue(i+(scorestodisplay*(9)), rankingSkillset) + local a=profile:GetTopSSRValue(i+(scorestodisplay*(rankingPage-1)), rankingSkillset) + self:settextf("%5.2f", a) + if not ths:GetEtternaValid() then + self:diffuse(byJudgment("TapNoteScore_Miss")) else - self:visible(false) - end - self:diffuse(byAchieved(sg)) - end - end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set") - }, - Def.Quad{ - InitCommand=cmd(x,30;zoomto,150,buttonheight;halign,0;diffuse,getMainColor('frames');diffusealpha,buttondiffuse), - MouseLeftClickMessageCommand=function(self) - if update and sg then - if isOver(self) then - local whee = SCREENMAN:GetTopScreen():GetMusicWheel() - whee:SelectSong(goalsong) - GAMESTATE:GetSongOptionsObject('ModsLevel_Preferred'):MusicRate(sg:GetRate()) - GAMESTATE:GetSongOptionsObject('ModsLevel_Song'):MusicRate(sg:GetRate()) - GAMESTATE:GetSongOptionsObject('ModsLevel_Current'):MusicRate(sg:GetRate()) - MESSAGEMAN:Broadcast("GoalSelected") - end + self:diffuse(getMainColor('positive')) + end + else + self:settext( ' - ' ) + self:diffuse(getMainColor('positive')) end end - }, - LoadFont("Common Large") .. { - InitCommand=cmd(halign,0;zoom,0.25;diffuse,getMainColor('positive');maxwidth,80), - SetCommand=function(self) - if update then - if sg then - local ratestring = string.format("%.2f", sg:GetRate()):gsub("%.?0+$", "").."x" - self:settextf(ratestring) - self:visible(true) - else - self:visible(false) - end - self:diffuse(byAchieved(sg)) - end - end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set") - }, - Def.Quad{ - InitCommand=cmd(halign,0;zoomto,28,buttonheight;diffuse,getMainColor('positive');diffusealpha,buttondiffuse), - MouseLeftClickMessageCommand=function(self) - if isOver(self) and update then - sg:SetRate(sg:GetRate()+0.1) - MESSAGEMAN:Broadcast("UpdateGoals") - end - end, - MouseRightClickMessageCommand=function(self) - if isOver(self) and update then - sg:SetRate(sg:GetRate()-0.1) - MESSAGEMAN:Broadcast("UpdateGoals") - end + end, + UpdateRankingMessageCommand=cmd(queuecommand,"Set"), + }, + LoadFont("Common Large") .. { + InitCommand=cmd(xy,frameX+rankingX+35,frameY+rankingY+110-(11-i)*10;halign,0;zoom,0.25;diffuse,getMainColor('positive');maxwidth,rankingWidth*2.5-160), + SetCommand=function(self) + if update and ths then + profile:GetTopSSRValue(i+(scorestodisplay*(9)), rankingSkillset) + local a=profile:GetTopSSRValue(i+(scorestodisplay*(rankingPage-1)), rankingSkillset) + self:settext(profile:GetTopSSRSongName(i+(scorestodisplay*(rankingPage-1)), rankingSkillset) ) + if not ths:GetEtternaValid() then + self:diffuse(byJudgment("TapNoteScore_Miss")) + else + self:diffuse(getMainColor('positive')) + end + else + self:settext( ' ' ) + self:diffuse(getMainColor('positive')) end - }, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,-6,goalrow2Y;halign,0;zoom,0.2;diffuse,getMainColor('positive')), - SetCommand=function(self) - if update then - if sg then - self:settextf("%5.f%% (Best: -)", sg:GetPercent()) - self:visible(true) - else - self:visible(false) - end - self:diffuse(byAchieved(sg)) - end - end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set") - }, - Def.Quad{ - InitCommand=cmd(y,goalrow2Y;halign,0;zoomto,25,buttonheight;diffuse,getMainColor('positive');diffusealpha,buttondiffuse), - MouseLeftClickMessageCommand=function(self) - if isOver(self) and update then - sg:SetPercent(sg:GetPercent()+1) - MESSAGEMAN:Broadcast("UpdateGoals") - end - end, - MouseRightClickMessageCommand=function(self) - if isOver(self) and update then - sg:SetPercent(sg:GetPercent()-1) - MESSAGEMAN:Broadcast("UpdateGoals") - end + end, + UpdateRankingMessageCommand=cmd(queuecommand,"Set"), + }, + LoadFont("Common Large") .. { + InitCommand=cmd(xy,frameX+rankingX+230,frameY+rankingY+110-(11-i)*10;halign,0.5;zoom,0.25;diffuse,getMainColor('positive');maxwidth,rankingWidth*4-160), + SetCommand=function(self) + if update and 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( ' - ' ) + self:diffuse(getMainColor('positive')) end - }, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,300,goalrow2Y;halign,0;zoom,0.2;diffuse,getMainColor('positive');maxwidth,80), - SetCommand=function(self) - if update then - if sg then - local msd = goalsteps:GetMSD(sg:GetRate(), 1) - self:settextf("%5.1f", msd) - self:diffuse(ByMSD(msd)) - self:visible(true) - else - self:visible(false) - end - end - end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set") - }, - LoadFont("Common Large") .. { - InitCommand=cmd(x,200;halign,0;zoom,0.2;diffuse,getMainColor('positive');maxwidth,800), - SetCommand=function(self) - if update then - if sg then - self:settext("Assigned: "..datetimetodate(sg:WhenAssigned())) - self:visible(true) - else - self:visible(false) - end - self:diffuse(byAchieved(sg)) - end - end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set") - }, - LoadFont("Common Large") .. { - InitCommand=cmd(xy,200,goalrow2Y;halign,0;zoom,0.2;diffuse,getMainColor('positive');maxwidth,800), - SetCommand=function(self) - if update then - if sg and sg:IsAchieved() then - self:settext("Achieved: "..sg:WhenAchieved()) - self:visible(true) - else - self:visible(false) - end - self:diffuse(byAchieved(sg)) + end, + UpdateRankingMessageCommand=cmd(queuecommand,"Set"), + }, + LoadFont("Common Large") .. { + InitCommand=cmd(xy,frameX+rankingX+270,frameY+rankingY+110-(11-i)*10;halign,0.5;zoom,0.25;diffuse,getMainColor('positive');maxwidth,rankingWidth*4-160), + SetCommand=function(self) + if update and 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( ' - ' ) + self:diffuse(getMainColor('positive')) + end + end, + UpdateRankingMessageCommand=cmd(queuecommand,"Set"), + }, + LoadFont("Common Large") .. { + InitCommand=cmd(xy,frameX+rankingX+310,frameY+rankingY+110-(11-i)*10;halign,0.5;zoom,0.25;diffuse,getMainColor('positive');maxwidth,rankingWidth*4-160), + SetCommand=function(self) + if update and ths then + profile:GetStepsFromSSR(i+(scorestodisplay*(9)), rankingSkillset) + local thsteps = profile:GetStepsFromSSR(i+(scorestodisplay*(rankingPage-1)), rankingSkillset) + if (thsteps ~= nil) then + local diff = thsteps:GetDifficulty() + self:diffuse(byDifficulty(diff)) + self:settext(getShortDifficulty(diff)) end - end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set") - }, - LoadFont("Common Large") .. { - InitCommand=cmd(x,-12;halign,0;zoom,0.25;diffuse,getMainColor('positive');maxwidth,160), - SetCommand=function(self) - if update then - if sg then - self:settextf(sg:GetPriority()) - self:visible(true) + else + self:settext( ' - ' ) + self:diffuse(getMainColor('positive')) + 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 update and ths then + if isOver(self) then + ths:ToggleEtternaValidation() + MESSAGEMAN:Broadcast("UpdateRanking") + if ths:GetEtternaValid() then + ms.ok("Score Revalidated") else - self:visible(false) + ms.ok("Score Invalidated") end - self:diffuse(byAchieved(sg)) - end - end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set") - }, - Def.Quad{ - InitCommand=cmd(x,-16;halign,0;zoomto,16,buttonheight;diffuse,getMainColor('positive');diffusealpha,buttondiffuse), - MouseLeftClickMessageCommand=function(self) - if isOver(self) and update then - sg:SetPriority(sg:GetPriority()+1) - MESSAGEMAN:Broadcast("UpdateGoals") - end - end, - MouseRightClickMessageCommand=function(self) - if isOver(self) and update then - sg:SetPriority(sg:GetPriority()-1) - MESSAGEMAN:Broadcast("UpdateGoals") end end - }, - Def.Quad{ - InitCommand=cmd(x,325;halign,0;zoomto,4,4;diffuse,byJudgment('TapNoteScore_Miss');diffusealpha,1), - MouseLeftClickMessageCommand=function(self) - if isOver(self) and update and sg then - profile:RemoveGoalsByKey(ck) - MESSAGEMAN:Broadcast("UpdateGoals") + end, + MouseLeftClickMessageCommand=function(self) + if update and ths then + if isOver(self) then + local whee = SCREENMAN:GetTopScreen():GetMusicWheel() + local ssrsong = profile:GetSongFromSSR(i+(scorestodisplay*(rankingPage-1)), rankingSkillset) + whee:SelectSong(ssrsong) end - end, - } + end + end } } return t end - - -local fawa = {"All Goals","Completed","Incomplete"} local function rankingButton(i) local t = Def.ActorFrame{ Def.Quad{ - InitCommand=cmd(xy,20+frameX+rankingX+(i-1+i*(1/(1+3)))*rankingTitleWidth,frameY+rankingY-60;zoomto,rankingTitleWidth,30;halign,0.5;valign,0;diffuse,getMainColor('frames');diffusealpha,0.35), + 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 == goalFilter then + if i-1 == rankingSkillset then self:diffusealpha(1) else self:diffusealpha(0.35) - end + end; end, MouseLeftClickMessageCommand=function(self) if isOver(self) then - goalFilter = i - MESSAGEMAN:Broadcast("UpdateGoals") - end + rankingSkillset = i-1 + rankingPage = 1 + MESSAGEMAN:Broadcast("UpdateRanking") + end; end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set"), + UpdateRankingMessageCommand=cmd(queuecommand,"Set"), }, LoadFont("Common Large") .. { - InitCommand=cmd(xy,20+frameX+rankingX+(i-1+i*(1/(1+3)))*rankingTitleWidth,frameY+rankingY-45;halign,0.5;diffuse,getMainColor('positive');maxwidth,rankingTitleWidth;maxheight,25), + 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(fawa[i]) + self:settext(ms.SkillSets[i]) end, } } @@ -349,58 +225,140 @@ local function rankingButton(i) end ---[ + -- should actor frame prev/next/page displays to prevent redundancy - mina -r[#r+1] = Def.ActorFrame{ - InitCommand=cmd(xy,frameX+10,frameY+rankingY+250), - Def.Quad{ - InitCommand=cmd(xy,300,-8;zoomto,40,20;halign,0;valign,0;diffuse,getMainColor('frames');diffusealpha,buttondiffuse), - MouseLeftClickMessageCommand=function(self) - if isOver(self) and currentgoalpage < numgoalpages then - currentgoalpage = currentgoalpage + 1 - MESSAGEMAN:Broadcast("UpdateGoals") - 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), + SetCommand=function(self) + if rankingSkillset > 0 then + self:visible(true) + else + self:visible(false) end - }, - LoadFont("Common Large") .. { - InitCommand=cmd(x,300;halign,0;zoom,0.3;diffuse,getMainColor('positive');settext,"Next"), - }, - Def.Quad{ - InitCommand=cmd(y,-8;zoomto,65,20;halign,0;valign,0;diffuse,getMainColor('frames');diffusealpha,buttondiffuse), - MouseLeftClickMessageCommand=function(self) - if isOver(self) and currentgoalpage > 1 then - currentgoalpage = currentgoalpage - 1 - MESSAGEMAN:Broadcast("UpdateGoals") + end, + MouseLeftClickMessageCommand=function(self) + if isOver(self) and rankingSkillset > 0 then + --Move right + if rankingPage == 10 then + rankingPage=1 + else + rankingPage=rankingPage+1 end + MESSAGEMAN:Broadcast("UpdateRanking") + end; + end; + UpdateRankingMessageCommand=cmd(queuecommand,"Set"), + } +r[#r+1] = LoadFont("Common Large") .. { + InitCommand=cmd(xy,frameX+frameWidth-30,frameY+rankingY+275;halign,0.5;zoom,0.3;diffuse,getMainColor('positive');settext,"Next"), + SetCommand=function(self) + if rankingSkillset > 0 then + self:visible(true) + else + self:visible(false) + end + end, + UpdateRankingMessageCommand=cmd(queuecommand,"Set") + } + +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), + SetCommand=function(self) + if rankingSkillset > 0 then + self:visible(true) + else + self:visible(false) end - }, - LoadFont("Common Large") .. { - InitCommand=cmd(halign,0;zoom,0.3;diffuse,getMainColor('positive');settext,"Previous"), - }, - LoadFont("Common Large") .. { - InitCommand=cmd(x,175;halign,0.5;zoom,0.3;diffuse,getMainColor('positive')), + end, + MouseLeftClickMessageCommand=function(self) + if isOver(self) and rankingSkillset > 0 then + --Move left + if rankingPage == 1 then + rankingPage=10 + else + rankingPage=rankingPage-1 + end + MESSAGEMAN:Broadcast("UpdateRanking") + end; + end; + UpdateRankingMessageCommand=cmd(queuecommand,"Set"), + } + +r[#r+1] = LoadFont("Common Large") .. { + InitCommand=cmd(xy,frameX+40,frameY+rankingY+275;halign,0.5;zoom,0.3;diffuse,getMainColor('positive');settext,"Previous"), SetCommand=function(self) - self:settextf("Showing %i-%i of %i", math.min(((currentgoalpage-1)*goalsperpage)+1, #displayindex), math.min(currentgoalpage*goalsperpage, #displayindex), #displayindex) + if rankingSkillset > 0 then + self:visible(true) + else + self:visible(false) + end end, - UpdateGoalsMessageCommand=cmd(queuecommand,"Set"), + UpdateRankingMessageCommand=cmd(queuecommand,"Set") } -} - - +r[#r+1] = LoadFont("Common Large") .. { + InitCommand=cmd(xy,frameX+frameWidth/2,frameY+rankingY+275;halign,0.5;zoom,0.3;diffuse,getMainColor('positive')), + SetCommand=function(self) + if rankingSkillset > 0 then + self:visible(true) + self:settextf("%i-%i", ((rankingPage-1)*25)+1, rankingPage*25) + else + self:visible(false) + end + end, + UpdateRankingMessageCommand=cmd(queuecommand,"Set"), +} - -for i=1,goalsperpage do - r[#r+1] = makescoregoal(i) +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,3 do +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 + t[#t+1] = Def.Quad{ InitCommand=cmd(xy,frameX+80,frameY+rankingY+265;zoomto,100,20;halign,0.5;valign,0;diffuse,getMainColor('frames');diffusealpha,0.35), SetCommand=function(self) @@ -434,5 +392,34 @@ t[#t+1] = LoadFont("Common Large") .. { end, UpdateRankingMessageCommand=cmd(queuecommand,"Set") } + +t[#t+1] = Def.Quad{ + InitCommand=cmd(xy,frameX+210,frameY+rankingY+265;zoomto,100,20;halign,0.5;valign,0;diffuse,getMainColor('frames');diffusealpha,0.35), + SetCommand=function(self) + if rankingSkillset == 0 then + self:visible(true) + else + self:visible(false) + end + end, + MouseLeftClickMessageCommand=function(self) + if isOver(self) and rankingSkillset == 0 then + profile:ValidateAllScores() + end + end, + UpdateRankingMessageCommand=cmd(queuecommand,"Set") +} + +t[#t+1] = LoadFont("Common Large") .. { + InitCommand=cmd(xy,frameX+210,frameY+rankingY+275;halign,0.5;zoom,0.3;diffuse,getMainColor('positive');settext,"Validate All"), + SetCommand=function(self) + if rankingSkillset == 0 then + self:visible(true) + else + self:visible(false) + end + end, + UpdateRankingMessageCommand=cmd(queuecommand,"Set") + } return t \ No newline at end of file