Skip to content

Commit

Permalink
look who's purging now
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Dec 19, 2016
1 parent 845afd7 commit 705612a
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 1,280 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ end
--ScoreBoard
local judges = {'TapNoteScore_W1','TapNoteScore_W2','TapNoteScore_W3','TapNoteScore_W4','TapNoteScore_W5','TapNoteScore_Miss'}

local score = getCurScore()
local pssP1 = STATSMAN:GetCurStageStats():GetPlayerStageStats(PLAYER_1)

local frameX = 20
Expand All @@ -77,12 +76,58 @@ function scoreBoard(pn,position)
BeginCommand=function(self)
if position == 1 then
self:x(SCREEN_WIDTH-(frameX*2)-frameWidth)
end;
end;
end
end
}

local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(pn)

t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX-5,frameY;zoomto,frameWidth+10,220;halign,0;valign,0;diffuse,color("#333333CC"))};
t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY+30;zoomto,frameWidth,2;halign,0;diffuse,getMainColor('highlight');diffusealpha,0.5)};
t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY+55;zoomto,frameWidth,2;halign,0;diffuse,getMainColor('highlight');diffusealpha,0.5)};

t[#t+1] = LoadFont("Common Large")..{
InitCommand=cmd(xy,frameWidth+frameX,frameY+32;zoom,0.5;halign,1;valign,0;maxwidth,200),
BeginCommand=cmd(queuecommand,"Set"),
SetCommand=function(self)
local meter = pss:GetSSR()
self:settextf("%5.2f", meter)
self:diffuse(byDifficultyMeter(meter))
end,
};

t[#t+1] = LoadFont("Common Large") .. {
InitCommand=cmd(xy,frameWidth+frameX,frameY+7;zoom,0.5;halign,1;valign,0;maxwidth,200),
BeginCommand=cmd(queuecommand,"Set"),
SetCommand=function(self)
local steps = GAMESTATE:GetCurrentSteps(PLAYER_1)
local diff = getDifficulty(steps:GetDifficulty())
self:settext(getShortDifficulty(diff))
self:diffuse(getDifficultyColor(GetCustomDifficulty(steps:GetStepsType(),steps:GetDifficulty())))
end
};

-- Wife percent
t[#t+1] = LoadFont("Common Large")..{
InitCommand=cmd(xy,frameX+5,frameY+9;zoom,0.45;halign,0;valign,0),
BeginCommand=cmd(queuecommand,"Set"),
SetCommand=function(self)
self:diffuse(getGradeColor(pss:GetWifeGrade()))
self:settextf("%05.2f%% (%s)",notShit.floor(pss:GetWifeScore()*10000)/100, "Wife")
end,
};

-- DP percent
t[#t+1] = LoadFont("Common Large")..{
InitCommand=cmd(xy,frameX+5,frameY+34;zoom,0.45;halign,0;valign,0),
BeginCommand=cmd(queuecommand,"Set"),
SetCommand=function(self)
local score = getScoreFromTable(getScoreList(PLAYER_1),pss:GetPersonalHighScoreIndex()+1)
self:diffuse(getGradeColor(pss:GetGrade()))
self:settextf("%05.2f%% (%s)",GetPercentDP(score), "DP")
end,
}

t[#t+1] = LoadFont("Common Normal")..{
InitCommand=cmd(xy,frameX+5,frameY+63;zoom,0.40;halign,0;maxwidth,frameWidth/0.4),
BeginCommand=cmd(queuecommand,"Set"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


function gradestring(tier) --to be moved
if tier == "Grade_Tier01" then
return 'AAAA'
Expand All @@ -19,8 +17,8 @@ function gradestring(tier) --to be moved
return 'F'
else
return tier
end;
end;
end
end

local lines = 5 -- number of scores to display
local framex = SCREEN_WIDTH-capWideScale(get43size(230),230)
Expand All @@ -45,7 +43,7 @@ if GAMESTATE:IsPlayerEnabled(player) then
profile = GetPlayerOrMachineProfile(player)
steps = STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetPlayedSteps()[1]
origTable = getScoresByKey(player)
score = STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetHighScore()--origTable[STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetPersonalHighScoreIndex()+1]
score = STATSMAN:GetCurStageStats():GetPlayerStageStats(player):GetHighScore()
rtTable = getRateTable(origTable)
if themeConfig:get_data().global.RateSort then
hsTable = sortScore(rtTable[getRate(score)] or {},0)
Expand All @@ -66,18 +64,18 @@ local function input(event)
scoreBoard:GetChild("scoreItem"..tostring(i)):GetChild("judge"):visible(not scoreBoard:GetChild("scoreItem"..tostring(i)):GetChild("judge"):GetVisible())
scoreBoard:GetChild("scoreItem"..tostring(i)):GetChild("date"):visible(not scoreBoard:GetChild("scoreItem"..tostring(i)):GetChild("date"):GetVisible())
scoreBoard:GetChild("scoreItem"..tostring(i)):GetChild("option"):visible(not scoreBoard:GetChild("scoreItem"..tostring(i)):GetChild("option"):GetVisible())
end;
end;
end;
end
end
end
end
return false;
return false
end


local t = Def.ActorFrame{
Name="scoreBoard";
Name="scoreBoard",
OnCommand=function(self) SCREENMAN:GetTopScreen():AddInputCallback(input) end
};
}

local function scoreitem(pn,index,scoreIndex,drawindex)

Expand All @@ -91,23 +89,23 @@ local function scoreitem(pn,index,scoreIndex,drawindex)

--
local t = Def.ActorFrame {
Name="scoreItem"..tostring(drawindex);
Name="scoreItem"..tostring(drawindex),

--The main quad
Def.Quad{
InitCommand=cmd(xy,framex,framey+(drawindex*spacing)-4;zoomto,frameWidth,30;halign,0;valign,0;diffuse,color("#333333");diffusealpha,1;diffuserightedge,color("#33333333"));
InitCommand=cmd(xy,framex,framey+(drawindex*spacing)-4;zoomto,frameWidth,30;halign,0;valign,0;diffuse,color("#333333");diffusealpha,1;diffuserightedge,color("#33333333")),
BeginCommand=function(self)
self:visible(GAMESTATE:IsHumanPlayer(pn));
end;
};
self:visible(GAMESTATE:IsHumanPlayer(pn))
end
},

--Highlight quad for the current score
Def.Quad{
InitCommand=cmd(xy,framex,framey+(drawindex*spacing)-4;zoomto,frameWidth,30;halign,0;valign,0;diffuse,color("#ffffff");diffusealpha,0.3;diffuserightedge,color("#33333300"));
InitCommand=cmd(xy,framex,framey+(drawindex*spacing)-4;zoomto,frameWidth,30;halign,0;valign,0;diffuse,color("#ffffff");diffusealpha,0.3;diffuserightedge,color("#33333300")),
BeginCommand=function(self)
self:visible(GAMESTATE:IsHumanPlayer(pn) and equals);
end;
};
self:visible(GAMESTATE:IsHumanPlayer(pn) and equals)
end
},

--Quad that will act as the bounding box for mouse rollover/click stuff.
Def.Quad{
Expand Down Expand Up @@ -143,18 +141,18 @@ local function scoreitem(pn,index,scoreIndex,drawindex)

-- DP grade and %score
LoadFont("Common normal")..{
Name="grade";
InitCommand=cmd(xy,framex+10,framey+(drawindex*spacing)+2;zoom,0.35;halign,0;maxwidth,(frameWidth-15)/0.3);
Name="grade",
InitCommand=cmd(xy,framex+10,framey+(drawindex*spacing)+2;zoom,0.35;halign,0;maxwidth,(frameWidth-15)/0.3),
BeginCommand=function(self)
local curscore = getScore(hsTable[index])
local maxscore = getMaxScore(pn,0)
if maxscore == 0 or maxscore == nil then
maxscore = 1
end;
local pscore = (curscore/maxscore)
self:settextf("%.2f%% (%s)",math.floor((pscore)*10000)/100,"DP");
end;
};
self:settextf("%.2f%% (%s)",math.floor((pscore)*10000)/100,"DP")
end
},

-- Wife grade and %score
LoadFont("Common normal")..{
Expand All @@ -169,16 +167,15 @@ local function scoreitem(pn,index,scoreIndex,drawindex)
end
},


--mods
LoadFont("Common normal")..{
Name="option";
InitCommand=cmd(xy,framex+10,framey+11+(drawindex*spacing);zoom,0.35;halign,0;maxwidth,(frameWidth-15)/0.35);
Name="option",
InitCommand=cmd(xy,framex+10,framey+11+(drawindex*spacing);zoom,0.35;halign,0;maxwidth,(frameWidth-15)/0.35),
BeginCommand=function(self)
self:settext(hsTable[index]:GetModifiers());
self:settext(hsTable[index]:GetModifiers())
self:visible(false)
end;
};
end
},

--grade text
LoadFont("Common normal")..{
Expand Down Expand Up @@ -241,8 +238,8 @@ local function scoreitem(pn,index,scoreIndex,drawindex)
end
},

};
return t;
}
return t
end

--can't have more lines than the # of scores huehuehu
Expand All @@ -264,28 +261,14 @@ elseif scoreIndex>math.floor(lines/2) then
startind = scoreIndex - math.floor(lines/2)
else
startind = scoreIndex - math.floor(lines/2)+1
end;
end;
end
end

while drawindex<#hsTable and startind<=finishind do
t[#t+1] = scoreitem(player,startind,scoreIndex,drawindex)
startind = startind+1
drawindex = drawindex+1
end;

--Text that sits above the scoreboard with some info
t[#t+1] = LoadFont("Common normal")..{
InitCommand=cmd(xy,SCREEN_CENTER_X,framey+95;zoom,0.5;halign,0.5;);
BeginCommand=function(self)
local text = ""
text = getRate(score)
self:settext(text)
if text == "1.0x" then
self:diffusealpha(0)
end
end;
};

end

if tonumber(PREFSMAN:GetPreference("MaxHighScoresPerListForPlayer")) ~= 3 then
themeConfig:get_data().global.ScoreBoardNag = false
Expand All @@ -295,7 +278,7 @@ end

if themeConfig:get_data().global.ScoreBoardNag and #origTable == tonumber(PREFSMAN:GetPreference("MaxHighScoresPerListForPlayer")) then
t[#t+1] = LoadFont("Common normal")..{
InitCommand=cmd(xy,framex+frameWidth/2,framey+4*spacing;zoom,0.30;valign,0;diffusealpha,0.8;maxwidth,frameWidth/0.30);
InitCommand=cmd(xy,framex+frameWidth/2,framey+4*spacing;zoom,0.30;valign,0;diffusealpha,0.8;maxwidth,frameWidth/0.30),
BeginCommand=function(self)
local text = string.format("You have reached the maximum number of saved scores for this chart."..
" \n Lower ranked scores will be removed as you save more scores.\n\n"..
Expand All @@ -304,7 +287,7 @@ if themeConfig:get_data().global.ScoreBoardNag and #origTable == tonumber(PREFSM
"This will no longer appear once the limit is set to any non-default value.\n(You may change back afterwards if you want)\n\n"..
"The current limit is %s. (Default is 3)",PREFSMAN:GetPreference("MaxHighScoresPerListForPlayer") or 0)
self:settext(text)
end;
end
}
end

Expand All @@ -325,14 +308,4 @@ local function Update(self)
end
t.InitCommand=cmd(SetUpdateFunction,Update)


--[[
t[#t+1] = LoadFont("Common normal")..{
InitCommand=cmd(xy,framex,framey+10+(spacing);zoom,1;halign,0);
BeginCommand=function(self)
self:settext(scoreIndex)
end;
};
--]]

return t;
return t
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
-- should be merged with other stuff later and need to test to make sure it //actually// does nothing if scores aren't 4k

storeSongSearchResult(nil)

local score
local Scores
local RateScores
local newScore

if not getCurKey() then -- these are probably fairly redundant checks but oh well for now
ms.ok("No chart key detected (probably never generated)... skipping wife calculations...")
else
if STATSMAN:GetCurStageStats():GetPlayerStageStats(PLAYER_1):GetPlayedSteps()[1]:GetStepsType() == "StepsType_Dance_Single" then
score = STATSMAN:GetCurStageStats():GetPlayerStageStats(PLAYER_1):GetHighScore()
Scores = getCurChart().Scores
RateScores = formLink(Scores, getRate(score))
newScore = formLink(RateScores, fashionScoreKey(score))
newScore = buildPlayerScore(newScore, score, devianceTable, NoteRowTable)
setCurScore(newScore)
saveCurChart()
SCREENMAN:SystemMessage("Wife: Score Saved")
else
SCREENMAN:SystemMessage("Wife: Not 4k singles, Stop wasting my time")
end
end
return
-- gone
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ local jdgT = { -- Table of judgments for the judgecounter
"HoldNoteScore_LetGo",
}

local sT = scoringTypes[themeConfig:get_data().global.DefaultScoreType]
local dvCur
local jdgCur -- Note: only for judgments with OFFSETS, might reorganize a bit later
local positive = getMainColor("positive")
Expand Down
Loading

0 comments on commit 705612a

Please sign in to comment.