Skip to content

Commit

Permalink
clean up theme errors produced as a result of the purge
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 5, 2017
1 parent 0258e9d commit e7e550f
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ local t = Def.ActorFrame{
self:finishtweening()

if getTabIndex() == 4 then

self:queuecommand("On")
self:visible(true)
update = true
Expand All @@ -31,7 +30,7 @@ local scorestodisplay = 25
local distY = 15
local offsetX = 10
local offsetY = 20
local rankingSkillset=0
local rankingSkillset=1
local rankingPage=1
local rankingWidth = frameWidth-capWideScale(15,50)
local rankingX = capWideScale(30,50)
Expand All @@ -40,7 +39,6 @@ local rankingTitleWidth = (rankingWidth/(#ms.SkillSets + 1))

if GAMESTATE:IsPlayerEnabled(PLAYER_1) then
profile = GetPlayerOrMachineProfile(PLAYER_1)
profile:SortAllSSRs() -- should be fine this way now - mina
end


Expand All @@ -61,7 +59,7 @@ local function rankingLabel(i)
local t = Def.ActorFrame{
InitCommand=cmd(visible, false),
UpdateRankingMessageCommand=function(self)
if rankingSkillset > 0 then
if rankingSkillset > 1 then
self:visible(true)
else
self:visible(false)
Expand All @@ -73,12 +71,11 @@ local function rankingLabel(i)
if update then
self:diffuse(getMainColor("positive"))
self:settext(((rankingPage-1)*25)+i..".")
ths = profile:GetTopSSRHighScore(i+(scorestodisplay*(rankingPage-1)), rankingSkillset)
ths = SCOREMAN:GetTopSSRHighScore(i+(scorestodisplay*(rankingPage-1)), ms.SkillSets[rankingSkillset])
if ths then
ck = ths:GetChartKey()
thssong = SONGMAN:GetSongByChartKey(ck)
thssteps = SONGMAN:GetStepsByChartKey(ck)
if not thssong or not thssteps then ths = nil end
end

end
Expand All @@ -88,10 +85,10 @@ local function rankingLabel(i)
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
if update and rankingSkillset > 1 then
if ths then
local a=profile:GetTopSSRValue(i+(scorestodisplay*(rankingPage-1)), rankingSkillset)
self:settextf("%5.2f", a)
local val = ths:GetSkillsetSSR(ms.SkillSets[rankingSkillset])
self:settextf("%5.2f", val)
if not ths:GetEtternaValid() then
self:diffuse(byJudgment("TapNoteScore_Miss"))
else
Expand Down Expand Up @@ -161,11 +158,9 @@ local function rankingLabel(i)
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
if (thssteps ~= nil) then
local diff = thssteps:GetDifficulty()
self:diffuse(byDifficulty(diff))
self:settext(getShortDifficulty(diff))
end
local diff = thssteps:GetDifficulty()
self:diffuse(byDifficulty(diff))
self:settext(getShortDifficulty(diff))
else
self:settext( ' - ' )
self:diffuse(getMainColor('positive'))
Expand Down Expand Up @@ -206,16 +201,18 @@ local function rankingButton(i)
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
if i == rankingSkillset then
self:diffusealpha(1)
else
self:diffusealpha(0.35)
end
end,
MouseLeftClickMessageCommand=function(self)
if isOver(self) then
rankingSkillset = i-1
rankingSkillset = i
rankingPage = 1
SCOREMAN:SortSSRs(ms.SkillSets[rankingSkillset])
ms.ok(ms.SkillSets[rankingSkillset])
MESSAGEMAN:Broadcast("UpdateRanking")
end
end,
Expand All @@ -237,7 +234,7 @@ 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
if rankingSkillset > 1 then
self:visible(true)
else
self:visible(false)
Expand All @@ -259,7 +256,7 @@ r[#r+1] = Def.Quad{
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
if rankingSkillset > 1 then
self:visible(true)
else
self:visible(false)
Expand All @@ -271,7 +268,7 @@ r[#r+1] = LoadFont("Common Large") .. {
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
if rankingSkillset > 1 then
self:visible(true)
else
self:visible(false)
Expand All @@ -294,7 +291,7 @@ r[#r+1] = Def.Quad{
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)
if rankingSkillset > 0 then
if rankingSkillset > 1 then
self:visible(true)
else
self:visible(false)
Expand All @@ -306,7 +303,7 @@ r[#r+1] = LoadFont("Common Large") .. {
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
if rankingSkillset > 1 then
self:visible(true)
self:settextf("%i-%i", ((rankingPage-1)*25)+1, rankingPage*25)
else
Expand All @@ -332,7 +329,7 @@ t[#t+1] = r
local function littlebits(i)
local t = Def.ActorFrame{
UpdateRankingMessageCommand=function(self)
if rankingSkillset == 0 then
if rankingSkillset == 1 then
self:visible(true)
else
self:visible(false)
Expand Down Expand Up @@ -362,14 +359,14 @@ local function littlebits(i)
return t
end

for i=2,#ms.SkillSets do
for i=1,#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)
if rankingSkillset == 0 then
if rankingSkillset == 1 then
self:visible(true)
else
self:visible(false)
Expand All @@ -391,7 +388,7 @@ t[#t+1] = Def.Quad{
t[#t+1] = Def.Quad{
InitCommand=cmd(xy,frameX+320,frameY+rankingY+265;zoomto,100,20;halign,0.5;valign,0;diffuse,getMainColor('frames');diffusealpha,0.35),
SetCommand=function(self)
if rankingSkillset == 0 then
if rankingSkillset == 1 then
self:visible(true)
else
self:visible(false)
Expand All @@ -413,7 +410,7 @@ t[#t+1] = Def.Quad{
t[#t+1] = LoadFont("Common Large") .. {
InitCommand=cmd(xy,frameX+80,frameY+rankingY+275;halign,0.5;zoom,0.3;diffuse,getMainColor('positive');settext,"Save Profile"),
SetCommand=function(self)
if rankingSkillset == 0 then
if rankingSkillset == 1 then
self:visible(true)
else
self:visible(false)
Expand All @@ -425,7 +422,7 @@ t[#t+1] = LoadFont("Common Large") .. {
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
if rankingSkillset == 1 then
self:visible(true)
else
self:visible(false)
Expand All @@ -442,7 +439,7 @@ t[#t+1] = Def.Quad{
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
if rankingSkillset == 1 then
self:visible(true)
else
self:visible(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ 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
if score and update then
self:settext(THEME:GetString("Grade",ToEnumShortString(score:GetGrade())))
self:diffuse(getGradeColor(score:GetGrade()))
else
Expand All @@ -126,7 +126,7 @@ 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 and update then
if score:GetWifeScore() == 0 then
self:settextf("NA (%s)", "Wife")
else
Expand All @@ -144,7 +144,7 @@ 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 and update then
-- if score:GetWifeScore() == 0 then
-- self:settextf("NA (%s)", "Wife")
-- else
Expand All @@ -161,7 +161,7 @@ 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 and update then
-- if score:GetWifeScore() == 0 then
-- self:settext("")
-- else
Expand All @@ -178,7 +178,7 @@ 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
if score and update then
self:settext(getClearTypeFromScore(pn,score,0))
self:diffuse(getClearTypeFromScore(pn,score,2))
end
Expand All @@ -190,7 +190,7 @@ 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
if score and update then
local maxCombo = getScoreMaxCombo(score)
self:settextf("Max Combo: %d",maxCombo)
else
Expand All @@ -204,7 +204,7 @@ 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
if score and update then
local missCount = getScoreMissCount(score)
if missCount ~= nil then
self:settext("Miss Count: "..missCount)
Expand All @@ -222,7 +222,7 @@ 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
if score and update then
self:settext("Date Achieved: "..getScoreDate(score))
else
self:settext("Date Achieved: ")
Expand All @@ -235,7 +235,7 @@ 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
if score and update then
self:settext("Mods: " ..score:GetModifiers())
else
self:settext("Mods:")
Expand All @@ -249,7 +249,7 @@ t[#t+1] = LoadFont("Common Normal")..{
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
if score and update then
local diff = getDifficulty(steps:GetDifficulty())
local stype = ToEnumShortString(steps:GetStepsType()):gsub("%_"," ")
local meter = steps:GetMeter()
Expand Down Expand Up @@ -278,7 +278,7 @@ t[#t+1] = LoadFont("Common Normal")..{
Name="ChordCohesion",
InitCommand=cmd(xy,frameX+frameWidth/40,frameY+frameHeight-10;zoom,0.4;halign,0),
SetCommand=function(self)
if score ~= nil then
if score and update then
if score:GetChordCohesion() == true then
self:settext("Chord Cohesion: Yes")
else
Expand Down Expand Up @@ -352,7 +352,7 @@ local function makeJudge(index,judge)
t[#t+1] = LoadFont("Common Normal")..{
InitCommand=cmd(x,120;zoom,0.5;halign,1),
SetCommand=function(self)
if score ~= nil then
if score and update then
if judge ~= 'HoldNoteScore_Held' and judge ~= 'HoldNoteScore_LetGo' then
self:settext(getScoreTapNoteScore(score,judge))
else
Expand Down
6 changes: 1 addition & 5 deletions Themes/Til Death/BGAnimations/_PlayerInfo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ t[#t+1] = Def.Actor{
if GAMESTATE:IsPlayerEnabled(PLAYER_1) then
profile = GetPlayerOrMachineProfile(PLAYER_1)
if profile ~= nil then
if profile == PROFILEMAN:GetMachineProfile() then
profileName = "Player 1"
else
profileName = profile:GetDisplayName()
end
profileName = profile:GetDisplayName()
playCount = profile:GetTotalNumSongsPlayed()
playTime = profile:GetTotalSessionSeconds()
noteCount = profile:GetTotalTapsAndHolds()
Expand Down
2 changes: 1 addition & 1 deletion Themes/Til Death/Scripts/Scores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function getScoresByKey(pn)
profile = GetPlayerOrMachineProfile(pn)
steps = GAMESTATE:GetCurrentSteps(pn)
if profile ~= nil and steps ~= nil and song ~= nil then
return profile:GetScoresByKey(steps:GetChartKey())
return SCOREMAN:GetScoresByKey(steps:GetChartKey())
end
end
return nil
Expand Down
3 changes: 1 addition & 2 deletions src/HighScore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1085,8 +1085,7 @@ class LunaHighScore: public Luna<HighScore>
}

static int GetSkillsetSSR(T* p, lua_State *L) {
Skillset lel = static_cast<Skillset>(IArg(1)-1);
lua_pushnumber(L, p->GetSkillsetSSR(lel));
lua_pushnumber(L, p->GetSkillsetSSR(Enum::Check<Skillset>(L, 1)));
return 1;
}
static int ToggleEtternaValidation(T* p, lua_State *L) {
Expand Down
Loading

0 comments on commit e7e550f

Please sign in to comment.