From a555195b09cab4d0a4f297129f6817db715cf478 Mon Sep 17 00:00:00 2001 From: Misterkister Date: Wed, 11 Jan 2017 10:47:15 -0600 Subject: [PATCH 1/2] might as well keep up with updating profile in screen net select music until mina add anything further to the profile tab. This is just more a clean up for now. --- .../profile.lua | 150 +++++++++++++----- 1 file changed, 109 insertions(+), 41 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/profile.lua b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/profile.lua index 51ef18c621..a5d13dfce0 100644 --- a/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/profile.lua +++ b/Themes/Til Death/BGAnimations/ScreenNetSelectMusic decorations/profile.lua @@ -25,34 +25,19 @@ local frameY = 45 local frameWidth = capWideScale(320,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 = 250 -local rankingX = capWideScale(75,90) -local rankingY = capWideScale(200,180) +local rankingWidth = frameWidth-50 +local rankingX = capWideScale(25,45) +local rankingY = capWideScale(80,60) local rankingTitleWidth = (rankingWidth/(#ms.SkillSets + 1)) -local skillsets = { - Overall = 0, - Speed = 0, - Stam = 0, - Jack = 0, - Technical = 0 -} - - if GAMESTATE:IsPlayerEnabled(PLAYER_1) then profile = GetPlayerOrMachineProfile(PLAYER_1) - if profile ~= nil then - skillsets.Overall = profile:GetPlayerRating() - skillsets.Speed = profile:GetPlayerSkillsetRating(2) - skillsets.Stam = profile:GetPlayerSkillsetRating(3) - skillsets.Jack = profile:GetPlayerSkillsetRating(4) - skillsets.Technical = profile:GetPlayerSkillsetRating(5) - end end @@ -77,38 +62,110 @@ local r = Def.ActorFrame{ } 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) - local a=profile:GetTopSSRValue(i+(10*(rankingPage-1)), rankingSkillset) - if a==0 then - self:settext( ' - ' ) - else - self:settextf("%5.2f", a) + 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*4-160), + 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) - local a=profile:GetTopSSRValue(i+(10*(rankingPage-1)), rankingSkillset) - if a==0 then + 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(profile:GetTopSSRSongName(i+(10*(rankingPage-1)), rankingSkillset) ) + 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), + MouseLeftClickMessageCommand=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 + } } 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;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-1 == rankingSkillset then self:diffusealpha(0.7) @@ -125,7 +182,7 @@ local function rankingButton(i) 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;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(ms.SkillSets[i]) end, @@ -136,7 +193,7 @@ end r[#r+1] = Def.Quad{ - InitCommand=cmd(xy,frameX+rankingX+rankingWidth,frameY+rankingY+40;zoomto,40,20;halign,0;valign,0;diffuse,getMainColor('frames');diffusealpha,0.35), + 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 @@ -150,14 +207,14 @@ r[#r+1] = Def.Quad{ end; } r[#r+1] = LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+rankingX+rankingWidth,frameY+rankingY+50;halign,0;zoom,0.3;diffuse,getMainColor('positive')), + 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+rankingX-75,frameY+rankingY+40;zoomto,65,20;halign,0;valign,0;diffuse,getMainColor('frames');diffusealpha,0.35), + 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 @@ -171,15 +228,18 @@ r[#r+1] = Def.Quad{ end; } r[#r+1] = LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+rankingX-75,frameY+rankingY+50;halign,0;zoom,0.3;diffuse,getMainColor('positive')), + 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,10 do +for i=1,scorestodisplay do r[#r+1] = rankingLabel(i) end -for i=1,#ms.SkillSets do + +-- 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 @@ -188,8 +248,15 @@ 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+(frameWidth/2)-100,frameY+20 + 22*i;halign,0;zoom,0.5;diffuse,getMainColor('positive')), + 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]..":") @@ -198,11 +265,12 @@ local function littlebits(i) PlayerUnjoinedMessageCommand=cmd(queuecommand,"Set"), }, LoadFont("Common Large") .. { - InitCommand=cmd(xy,frameX+(frameWidth/2)+90,frameY+20 + 22*i;halign,1;zoom,0.5), + InitCommand=cmd(xy,frameX+270,frameY+120 + 22*i;halign,1;zoom,0.5), BeginCommand=cmd(queuecommand,"Set"), SetCommand=function(self) - self:settextf("%5.2f",skillsets[ms.SkillSets[i]]) - self:diffuse(ByMSD(skillsets[ms.SkillSets[i]])) + local rating = profile:GetPlayerSkillsetRating(i) + self:settextf("%5.2f",rating) + self:diffuse(ByMSD(rating)) end, PlayerJoinedMessageCommand=cmd(queuecommand,"Set"), PlayerUnjoinedMessageCommand=cmd(queuecommand,"Set"), @@ -211,7 +279,7 @@ local function littlebits(i) return t end -for i=1,#ms.SkillSets do +for i=2,#ms.SkillSets do t[#t+1] = littlebits(i) end From 30e1ec79443ca58a3d3b94b81a26f3333e2d620d Mon Sep 17 00:00:00 2001 From: Misterkister Date: Wed, 11 Jan 2017 10:51:33 -0600 Subject: [PATCH 2/2] rearrange some of the options in screen player options because I forgot to do that earlier. --- Themes/Til Death/metrics.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Themes/Til Death/metrics.ini b/Themes/Til Death/metrics.ini index ae25374bab..38dfb162a3 100644 --- a/Themes/Til Death/metrics.ini +++ b/Themes/Til Death/metrics.ini @@ -378,7 +378,7 @@ StepsTypeSetCommand=%function(self,param) \ end; \ [ScreenPlayerOptions] -LineNames="1,Rate,8,4,RS,14,5,7,10,13,JT,TT,TG,TTM,JC,EB,PI,FB,MB,SF,LC,NPS,16,BG,Fail,Center,Score,Life,Judge,Background," +LineNames="1,Rate,8,4,RS,14,5,7,10,13,JT,TT,TG,TTM,JC,EB,PI,FB,MB,SF,LC,NPS,16,BG,Life,Judge,Background,Fail,Center,Score" LineCenter="conf,Center1Player" LineRS="lua,ReceptorSize()" LineJT="lua,JudgmentText()"