Skip to content

Commit

Permalink
Merge pull request #17 from Misterkister/patch-1
Browse files Browse the repository at this point in the history
one quick small patch
  • Loading branch information
MinaciousGrace authored Jan 12, 2017
2 parents a2e5646 + 30e1ec7 commit 753b2bd
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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)
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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]..":")
Expand All @@ -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"),
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Themes/Til Death/metrics.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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()"
Expand Down

0 comments on commit 753b2bd

Please sign in to comment.