various theme changes from midi

This commit is contained in:
AJ Kelly
2010-08-05 18:13:34 -05:00
parent 0af92261bc
commit 8a0919872a
8 changed files with 62 additions and 14 deletions
@@ -1,6 +1,17 @@
local c;
local player = Var "Player";
local bShowProtiming = GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(player) );
local function MakeAverage( t )
local sum = 0;
for i=1,#t do
sum = sum + t[i];
end
return sum / #t
end
local tTotalJudgments = {};
local JudgeCmds = {
TapNoteScore_W1 = THEME:GetMetric( "Judgment", "JudgmentW1Command" );
TapNoteScore_W2 = THEME:GetMetric( "Judgment", "JudgmentW2Command" );
@@ -19,6 +30,10 @@ local ProtimingCmds = {
TapNoteScore_Miss = THEME:GetMetric( "Protiming", "ProtimingMissCommand" );
};
local AverageCmds = {
Pulse = THEME:GetMetric( "Protiming", "AveragePulseCommand" );
};
local TNSFrames = {
TapNoteScore_W1 = 0;
TapNoteScore_W2 = 1;
@@ -42,12 +57,18 @@ t[#t+1] = Def.ActorFrame {
OnCommand=THEME:GetMetric("Protiming","ProtimingOnCommand");
ResetCommand=cmd(finishtweening;stopeffect;visible,false);
};
LoadFont("Common Normal") .. {
Name="ProtimingAverage";
Text="";
InitCommand=cmd(visible,false);
OnCommand=THEME:GetMetric("Protiming","AverageOnCommand");
ResetCommand=cmd(finishtweening;stopeffect;visible,false);
};
InitCommand = function(self)
c = self:GetChildren();
end;
JudgmentMessageCommand=function(self, param)
local t
if param.Player ~= player then return end;
if param.HoldNoteScore then return end;
@@ -62,6 +83,9 @@ t[#t+1] = Def.ActorFrame {
end
end
-- we're safe, you can push the values
tTotalJudgments[#tTotalJudgments+1] = math.abs( param.TapNoteOffset );
local iTapNoteOffset = param.TapNoteOffset;
if param.HoldNoteScore then
iTapNoteOffset = 1;
@@ -79,6 +103,9 @@ t[#t+1] = Def.ActorFrame {
c.ProtimingDisplay:settextf("%i%%",100 - math.floor(math.abs(param.TapNoteOffset * 1000)) );
ProtimingCmds[param.TapNoteScore](c.ProtimingDisplay);
c.ProtimingAverage:visible( bShowProtiming );
c.ProtimingAverage:settextf("%i%%",100 - MakeAverage( tTotalJudgments ) * 1000 );
AverageCmds['Pulse'](c.ProtimingAverage);
end;
};