Revert "Some more of default. Not yet done."

This reverts commit 162b626e3e.
This commit is contained in:
Jason Felds
2013-07-18 17:57:14 -04:00
parent dc5d6a932d
commit ea45a6947c
11 changed files with 1024 additions and 1447 deletions
@@ -1,49 +1,43 @@
local player = Var "Player"
local blinkTime = 1.2
local barWidth = 256;
local barHeight = 32;
local c;
local LifeMeter, MaxLives, CurLives;
local LifeRatio;
local t = Def.ActorFrame {
LoadActor("_lives")..{
InitCommand=function(self)
self:pause();
self:horizalign(left);
self:x(barWidth / -2);
end;
BeginCommand=function(self,param)
local screen = SCREENMAN:GetTopScreen();
local glifemeter = screen:GetLifeMeter(player);
self:setstate(glifemeter:GetTotalLives()-1);
if glifemeter:GetTotalLives() <= 4 then
self:zoomx(barWidth/(4*64));
else
self:zoomx(barWidth/((glifemeter:GetTotalLives())*64));
end
self:cropright((640-(((glifemeter:GetTotalLives())*64)))/640);
end;
LifeChangedMessageCommand=function(self,param)
if param.Player == player then
if param.LivesLeft == 0 then
self:visible(false)
else
self:setstate( math.max(param.LivesLeft-1,0) )
self:visible(true)
end
end
end;
StartCommand=function(self,param)
if param.Player == player then
self:setstate( math.max(param.LivesLeft-1,0) );
end
end;
FinishCommand=function(self)
self:playcommand("Start");
end;
};
};
local player = Var "Player"
local blinkTime = 1.2
local barWidth = 256;
local barHeight = 32;
local c;
local LifeMeter, MaxLives, CurLives;
local LifeRatio;
local t = Def.ActorFrame {
LoadActor("_lives")..{
InitCommand=cmd(pause;horizalign,left;x,-(barWidth/2));
BeginCommand=function(self,param)
local screen = SCREENMAN:GetTopScreen();
local glifemeter = screen:GetLifeMeter(player);
self:setstate(glifemeter:GetTotalLives()-1);
if glifemeter:GetTotalLives() <= 4 then
self:zoomx(barWidth/(4*64));
else
self:zoomx(barWidth/((glifemeter:GetTotalLives())*64));
end
self:cropright((640-(((glifemeter:GetTotalLives())*64)))/640);
end;
LifeChangedMessageCommand=function(self,param)
if param.Player == player then
if param.LivesLeft == 0 then
self:visible(false)
else
self:setstate( math.max(param.LivesLeft-1,0) )
self:visible(true)
end
end
end;
StartCommand=function(self,param)
if param.Player == player then
self:setstate( math.max(param.LivesLeft-1,0) );
end
end;
FinishCommand=cmd(playcommand,"Start");
};
};
return t;
+160 -235
View File
@@ -1,236 +1,161 @@
local iPN = ...;
assert(iPN,"[Graphics/PaneDisplay text.lua] No PlayerNumber Provided.");
local t = Def.ActorFrame {};
local function GetRadarData( pnPlayer, rcRadarCategory )
local tRadarValues;
local StepsOrTrail;
local fDesiredValue = 0;
if GAMESTATE:GetCurrentSteps( pnPlayer ) then
StepsOrTrail = GAMESTATE:GetCurrentSteps( pnPlayer );
fDesiredValue = StepsOrTrail:GetRadarValues( pnPlayer ):GetValue( rcRadarCategory );
elseif GAMESTATE:GetCurrentTrail( pnPlayer ) then
StepsOrTrail = GAMESTATE:GetCurrentTrail( pnPlayer );
fDesiredValue = StepsOrTrail:GetRadarValues( pnPlayer ):GetValue( rcRadarCategory );
else
StepsOrTrail = nil;
end;
return fDesiredValue;
end;
local function CreatePaneDisplayItem( _pnPlayer, _sLabel, _rcRadarCategory )
return Def.ActorFrame {
LoadFont("Common SemiBold") .. {
Text=string.upper( THEME:GetString("PaneDisplay",_sLabel) );
InitCommand=function(self)
self:horizalign(left);
end;
OnCommand=function(self)
self:zoom(0.5875);
self:diffuse(color("0.9,0.9,0.9"));
self:shadowlength(1);
end;
};
LoadFont("Common Normal") .. {
Text=string.format("%04i", 0);
InitCommand=function(self)
self:x(96);
self:horizalign(right);
end;
OnCommand=function(self)
self:zoom(0.5875);
self:shadowlength(1);
end;
CurrentSongChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentStepsP1ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentStepsP2ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentTrailP1ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentTrailP2ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentCourseChangedMessageCommand=function(self)
self:playcommand("Set");
end;
SetCommand=function(self)
local song = GAMESTATE:GetCurrentSong()
local course = GAMESTATE:GetCurrentCourse()
if not song and not course then
self:settextf("%04i", 0);
else
self:settextf("%04i", GetRadarData( _pnPlayer, _rcRadarCategory ) );
end
end;
};
};
end;
local function CreatePaneDisplayGraph( _pnPlayer, _sLabel, _rcRadarCategory )
return Def.ActorFrame {
LoadFont("Common Normal") .. {
Text=_sLabel;
InitCommand=function(self)
self:horizalign(left);
end;
OnCommand=function(self)
self:zoom(0.5);
self:shadowlength(1);
end;
};
Def.Quad {
InitCommand=function(self)
self:x(12);
self:zoomto(50, 10);
self:horizalign(left);
end;
OnCommand=function(self)
self:diffuse(Color("Black"));
self:shadowlength(1);
self:diffusealpha(0.5);
end;
};
Def.Quad {
InitCommand=function(self)
self:x(12);
self:zoomto(50, 10);
self:horizalign(left);
end;
OnCommand=function(self)
self:shadowlength(0);
self:diffuse(Color("Green"));
self:diffusebottomedge(ColorLightTone(Color("Green")));
end;
CurrentSongChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentStepsP1ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentStepsP2ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentTrailP1ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentTrailP2ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentCourseChangedMessageCommand=function(self)
self:playcommand("Set");
end;
SetCommand=function(self)
local song = GAMESTATE:GetCurrentSong()
local course = GAMESTATE:GetCurrentCourse()
if not song and not course then
self:stoptweening();
self:decelerate(0.2);
self:zoomtowidth(0);
else
self:stoptweening();
self:decelerate(0.2);
self:zoomtowidth( clamp(GetRadarData( _pnPlayer, _rcRadarCategory ) * 50,0,50) );
end
end;
};
LoadFont("Common Normal") .. {
InitCommand=function(self)
self:x(14);
self:zoom(0.5);
self:halign(0);
end;
OnCommand=function(self)
self:shadowlength(1);
self:strokecolor(color("0.15,0.15,0.15,0.625"));
end;
CurrentSongChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentStepsP1ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentStepsP2ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentTrailP1ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentTrailP2ChangedMessageCommand=function(self)
self:playcommand("Set");
end;
CurrentCourseChangedMessageCommand=function(self)
self:playcommand("Set");
end;
SetCommand=function(self)
local song = GAMESTATE:GetCurrentSong()
local course = GAMESTATE:GetCurrentCourse()
if not song and not course then
self:settext("")
else
self:settextf("%i%%", GetRadarData( _pnPlayer, _rcRadarCategory ) * 100 );
end
end;
};
};
end;
--[[ Numbers ]]
t[#t+1] = Def.ActorFrame {
-- Left
CreatePaneDisplayItem( iPN, "Taps", 'RadarCategory_TapsAndHolds' ) .. {
InitCommand=function(self)
self:x(-128 + 16 + 8);
self:y(-14 + 16 * 0);
end;
};
CreatePaneDisplayItem( iPN, "Jumps", 'RadarCategory_Jumps' ) .. {
InitCommand=function(self)
self:x(-128 + 16 + 8);
self:y(-14 + 16 * 1);
end;
};
CreatePaneDisplayItem( iPN, "Holds", 'RadarCategory_Holds' ) .. {
InitCommand=function(self)
self:x(-128 + 16 + 8);
self:y(-14 + 16 * 2);
end;
};
CreatePaneDisplayItem( iPN, "Mines", 'RadarCategory_Mines' ) .. {
InitCommand=function(self)
self:x(-128 + 16 + 8);
self:y(-14 + 16 * 3);
end;
};
-- Center
CreatePaneDisplayItem( iPN, "Hands", 'RadarCategory_Hands' ) .. {
InitCommand=function(self)
self:x(8);
self:y(-14 + 16 * 0);
end;
};
CreatePaneDisplayItem( iPN, "Rolls", 'RadarCategory_Rolls' ) .. {
InitCommand=function(self)
self:x(8);
self:y(-14 + 16 * 1);
end;
};
CreatePaneDisplayItem( iPN, "Lifts", 'RadarCategory_Lifts' ) .. {
InitCommand=function(self)
self:x(8);
self:y(-14 + 16 * 2);
end;
};
CreatePaneDisplayItem( iPN, "Fakes", 'RadarCategory_Fakes' ) .. {
InitCommand=function(self)
self:x(8);
self:y(-14 + 16 * 3);
end;
};
};
local iPN = ...;
assert(iPN,"[Graphics/PaneDisplay text.lua] No PlayerNumber Provided.");
local t = Def.ActorFrame {};
local function GetRadarData( pnPlayer, rcRadarCategory )
local tRadarValues;
local StepsOrTrail;
local fDesiredValue = 0;
if GAMESTATE:GetCurrentSteps( pnPlayer ) then
StepsOrTrail = GAMESTATE:GetCurrentSteps( pnPlayer );
fDesiredValue = StepsOrTrail:GetRadarValues( pnPlayer ):GetValue( rcRadarCategory );
elseif GAMESTATE:GetCurrentTrail( pnPlayer ) then
StepsOrTrail = GAMESTATE:GetCurrentTrail( pnPlayer );
fDesiredValue = StepsOrTrail:GetRadarValues( pnPlayer ):GetValue( rcRadarCategory );
else
StepsOrTrail = nil;
end;
return fDesiredValue;
end;
local function CreatePaneDisplayItem( _pnPlayer, _sLabel, _rcRadarCategory )
return Def.ActorFrame {
LoadFont("Common SemiBold") .. {
Text=string.upper( THEME:GetString("PaneDisplay",_sLabel) );
InitCommand=function(self)
self:horizalign(left);
end;
OnCommand=function(self)
self:zoom(0.5875);
self:diffuse(color("0.9,0.9,0.9"));
self:shadowlength(1);
end;
};
LoadFont("Common Normal") .. {
Text=string.format("%04i", 0);
InitCommand=function(self)
self:x(96);
InitCommand=cmd(x,96;horizalign,right);
OnCommand=cmd(zoom,0.5875;shadowlength,1);
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Set");
CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set");
CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set");
CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set");
CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
SetCommand=function(self)
local song = GAMESTATE:GetCurrentSong()
local course = GAMESTATE:GetCurrentCourse()
if not song and not course then
self:settextf("%04i", 0);
else
self:settextf("%04i", GetRadarData( _pnPlayer, _rcRadarCategory ) );
end
end;
};
};
end;
local function CreatePaneDisplayGraph( _pnPlayer, _sLabel, _rcRadarCategory )
return Def.ActorFrame {
LoadFont("Common Normal") .. {
Text=_sLabel;
InitCommand=function(self)
self:horizalign(left);
end;
OnCommand=function(self)
self:zoom(0.5);
self:shadowlength(1);
end;
};
Def.Quad {
InitCommand=function(self)
self:x(12);
self:zoomto(50, 10);
self:horizalign(left);
end;
OnCommand=function(self)
self:diffuse(Color("Black"));
self:shadowlength(1);
self:diffusealpha(0.5);
end;
};
Def.Quad {
InitCommand=function(self)
self:x(12);
InitCommand=cmd(x,12;zoomto,50,10;horizalign,left);
OnCommand=cmd(shadowlength,0;diffuse,Color("Green");diffusebottomedge,ColorLightTone(Color("Green")));
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Set");
CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set");
CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set");
CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set");
CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
SetCommand=function(self)
local song = GAMESTATE:GetCurrentSong()
local course = GAMESTATE:GetCurrentCourse()
if not song and not course then
self:stoptweening();
self:decelerate(0.2);
self:zoomtowidth(0);
else
self:stoptweening();
self:decelerate(0.2);
self:zoomtowidth( clamp(GetRadarData( _pnPlayer, _rcRadarCategory ) * 50,0,50) );
end
end;
};
LoadFont("Common Normal") .. {
InitCommand=function(self)
self:x(14);
InitCommand=cmd(x,14;zoom,0.5;halign,0;);
OnCommand=cmd(shadowlength,1;strokecolor,color("0.15,0.15,0.15,0.625"));
CurrentSongChangedMessageCommand=cmd(playcommand,"Set");
CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Set");
CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Set");
CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Set");
CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Set");
CurrentCourseChangedMessageCommand=cmd(playcommand,"Set");
SetCommand=function(self)
local song = GAMESTATE:GetCurrentSong()
local course = GAMESTATE:GetCurrentCourse()
if not song and not course then
self:settext("")
else
self:settextf("%i%%", GetRadarData( _pnPlayer, _rcRadarCategory ) * 100 );
end
end;
};
};
end;
--[[ Numbers ]]
t[#t+1] = Def.ActorFrame {
-- Left
CreatePaneDisplayItem( iPN, "Taps", 'RadarCategory_TapsAndHolds' ) .. {
InitCommand=cmd(x,-128+16+8;y,-14);
};
CreatePaneDisplayItem( iPN, "Jumps", 'RadarCategory_Jumps' ) .. {
InitCommand=cmd(x,-128+16+8;y,-14+16);
};
CreatePaneDisplayItem( iPN, "Holds", 'RadarCategory_Holds' ) .. {
InitCommand=cmd(x,-128+16+8;y,-14+16*2);
};
CreatePaneDisplayItem( iPN, "Mines", 'RadarCategory_Mines' ) .. {
InitCommand=cmd(x,-128+16+8;y,-14+16*3);
};
-- Center
CreatePaneDisplayItem( iPN, "Hands", 'RadarCategory_Hands' ) .. {
InitCommand=cmd(x,8;y,-14);
};
CreatePaneDisplayItem( iPN, "Rolls", 'RadarCategory_Rolls' ) .. {
InitCommand=cmd(x,8;y,-14+16);
};
CreatePaneDisplayItem( iPN, "Lifts", 'RadarCategory_Lifts' ) .. {
InitCommand=cmd(x,8;y,-14+16*2);
};
CreatePaneDisplayItem( iPN, "Fakes", 'RadarCategory_Fakes' ) .. {
InitCommand=cmd(x,8;y,-14+16*3);
};
};
return t;
@@ -1,370 +1,255 @@
local c;
local player = Var "Player";
local function ShowProtiming()
if GAMESTATE:IsDemonstration() then
return false
else
return GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(player));
end
end;
local bShowProtiming = ShowProtiming();
local ProtimingWidth = 240;
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" );
TapNoteScore_W3 = THEME:GetMetric( "Judgment", "JudgmentW3Command" );
TapNoteScore_W4 = THEME:GetMetric( "Judgment", "JudgmentW4Command" );
TapNoteScore_W5 = THEME:GetMetric( "Judgment", "JudgmentW5Command" );
TapNoteScore_Miss = THEME:GetMetric( "Judgment", "JudgmentMissCommand" );
};
local ProtimingCmds = {
TapNoteScore_W1 = THEME:GetMetric( "Protiming", "ProtimingW1Command" );
TapNoteScore_W2 = THEME:GetMetric( "Protiming", "ProtimingW2Command" );
TapNoteScore_W3 = THEME:GetMetric( "Protiming", "ProtimingW3Command" );
TapNoteScore_W4 = THEME:GetMetric( "Protiming", "ProtimingW4Command" );
TapNoteScore_W5 = THEME:GetMetric( "Protiming", "ProtimingW5Command" );
TapNoteScore_Miss = THEME:GetMetric( "Protiming", "ProtimingMissCommand" );
};
local AverageCmds = {
Pulse = THEME:GetMetric( "Protiming", "AveragePulseCommand" );
};
local TextCmds = {
Pulse = THEME:GetMetric( "Protiming", "TextPulseCommand" );
};
local TNSFrames = {
TapNoteScore_W1 = 0;
TapNoteScore_W2 = 1;
TapNoteScore_W3 = 2;
TapNoteScore_W4 = 3;
TapNoteScore_W5 = 4;
TapNoteScore_Miss = 5;
};
local t = Def.ActorFrame {};
t[#t+1] = Def.ActorFrame {
LoadActor(THEME:GetPathG("Judgment","Normal")) .. {
Name="Judgment";
InitCommand=function(self)
self:pause();
self:visible(false);
end;
OnCommand=THEME:GetMetric("Judgment","JudgmentOnCommand");
ResetCommand=function(self)
self:finishtweening();
self:stopeffect();
self:visible(false);
end;
};
LoadFont("Combo Numbers") .. {
Name="ProtimingDisplay";
Text="";
InitCommand=function(self)
self:visible(false);
end;
OnCommand=THEME:GetMetric("Protiming","ProtimingOnCommand");
ResetCommand=function(self)
self:finishtweening();
self:stopeffect();
self:visible(false);
end;
};
LoadFont("Common Normal") .. {
Name="ProtimingAverage";
Text="";
InitCommand=function(self)
self:visible(false);
end;
OnCommand=THEME:GetMetric("Protiming","AverageOnCommand");
ResetCommand=function(self)
self:finishtweening();
self:stopeffect();
self:visible(false);
end;
};
LoadFont("Common Normal") .. {
Name="TextDisplay";
Text=THEME:GetString("Protiming","MS");
InitCommand=function(self)
self:visible(false);
end;
OnCommand=THEME:GetMetric("Protiming","TextOnCommand");
ResetCommand=function(self)
self:finishtweening();
self:stopeffect();
self:visible(false);
end;
};
Def.Quad {
Name="ProtimingGraphBG";
InitCommand=function(self)
self:visible(false);
self:y(32);
self:zoomto(ProtimingWidth, 16);
end;
ResetCommand=function(self)
self:finishtweening();
self:diffusealpha(0.8);
self:visible(false);
end;
OnCommand=function(self)
self:diffuse(Color("Black"));
self:diffusetopedge(color("0.1,0.1,0.1,1"));
self:diffusealpha(0.8);
self:shadowlength(2);
end;
};
Def.Quad {
Name="ProtimingGraphWindowW3";
InitCommand=function(self)
self:visible(false);
self:y(32);
self:zoomto(ProtimingWidth - 4, 16 - 4);
end;
ResetCommand=function(self)
self:finishtweening();
self:diffusealpha(1);
self:visible(false);
end;
OnCommand=function(self)
self:diffuse(GameColor.Judgment["JudgmentLine_W3"]);
end;
};
Def.Quad {
Name="ProtimingGraphWindowW2";
InitCommand=function(self)
self:visible(false);
self:y(32);
self:zoomto(scale(
PREFSMAN:GetPreference("TimingWindowSecondsW2"),
0,
PREFSMAN:GetPreference("TimingWindowSecondsW3"),
0,
ProtimingWidth-4),16-4);
end;
ResetCommand=function(self)
self:finishtweening();
self:diffusealpha(1);
self:visible(false);
end;
OnCommand=function(self)
self:diffuse(GameColor.Judgment["JudgmentLine_W2"]);
end;
};
Def.Quad {
Name="ProtimingGraphWindowW1";
InitCommand=function(self)
self:visible(false);
self:y(32);
self:zoomto(scale(
PREFSMAN:GetPreference("TimingWindowSecondsW1"),
0,
PREFSMAN:GetPreference("TimingWindowSecondsW3"),
0,
ProtimingWidth-4),16-4);
end;
ResetCommand=function(self)
self:finishtweening();
self:diffusealpha(1);
self:visible(false);
end;
OnCommand=function(self)
self:diffuse(GameColor.Judgment["JudgmentLine_W1"]);
end;
};
Def.Quad {
Name="ProtimingGraphUnderlay";
InitCommand=function(self)
self:visible(false);
self:y(32);
self:zoomto(ProtimingWidth-4,16-4);
end;
ResetCommand=function(self)
self:finishtweening();
self:diffusealpha(0.25);
self:visible(false);
end;
OnCommand=function(self)
self:diffuse(Color("Black"));
self:diffusealpha(0.25);
end;
};
Def.Quad {
Name="ProtimingGraphFill";
InitCommand=function(self)
self:visible(false);
self:y(32);
self:zoomto(0,16-4);
self:horizalign(left);
end;
ResetCommand=function(self)
self:finishtweening();
self:diffusealpha(1);
self:visible(false);
end;
OnCommand=function(self)
self:diffuse(Color("Red"));
end;
};
Def.Quad {
Name="ProtimingGraphAverage";
InitCommand=function(self)
self:visible(false);
self:y(32);
self:zoomto(2,7);
end;
ResetCommand=function(self)
self:finishtweening();
self:diffusealpha(0.85);
self:visible(false);
end;
OnCommand=function(self)
self:diffuse(Color("Orange"));
self:diffusealpha(0.85);
end;
};
Def.Quad {
Name="ProtimingGraphCenter";
InitCommand=function(self)
self:visible(false);
self:y(32);
self:zoomto(2,16-4);
end;
ResetCommand=function(self)
self:finishtweening();
self:diffusealpha(1);
self:visible(false);
end;
OnCommand=function(self)
self:diffuse(Color("White"));
self:diffusealpha(1);
end;
};
InitCommand = function(self)
c = self:GetChildren();
end;
JudgmentMessageCommand=function(self, param)
-- Fix Player Combo animating when player successfully avoids a mine.
local msgParam = param;
MESSAGEMAN:Broadcast("TestJudgment",msgParam);
--
if param.Player ~= player then return end;
if param.HoldNoteScore then return end;
local iNumStates = c.Judgment:GetNumStates();
local iFrame = TNSFrames[param.TapNoteScore];
if not iFrame then return end
if iNumStates == 12 then
iFrame = iFrame * 2;
if not param.Early then
iFrame = iFrame + 1;
end
end
local fTapNoteOffset = param.TapNoteOffset;
if param.HoldNoteScore then
fTapNoteOffset = 1;
else
fTapNoteOffset = param.TapNoteOffset;
end
if param.TapNoteScore == 'TapNoteScore_Miss' then
fTapNoteOffset = 1;
bUseNegative = true;
else
-- fTapNoteOffset = fTapNoteOffset;
bUseNegative = false;
end;
if fTapNoteOffset ~= 1 then
-- we're safe, you can push the values
tTotalJudgments[#tTotalJudgments+1] = math.abs(fTapNoteOffset);
--~ tTotalJudgments[#tTotalJudgments+1] = bUseNegative and fTapNoteOffset or math.abs( fTapNoteOffset );
end
self:playcommand("Reset");
c.Judgment:visible( not bShowProtiming );
c.Judgment:setstate( iFrame );
JudgeCmds[param.TapNoteScore](c.Judgment);
c.ProtimingDisplay:visible( bShowProtiming );
c.ProtimingDisplay:settextf("%i",fTapNoteOffset * 1000);
ProtimingCmds[param.TapNoteScore](c.ProtimingDisplay);
c.ProtimingAverage:visible( bShowProtiming );
c.ProtimingAverage:settextf("%.2f%%",clamp(100 - MakeAverage( tTotalJudgments ) * 1000 ,0,100));
AverageCmds['Pulse'](c.ProtimingAverage);
c.TextDisplay:visible( bShowProtiming );
TextCmds['Pulse'](c.TextDisplay);
c.ProtimingGraphBG:visible( bShowProtiming );
c.ProtimingGraphUnderlay:visible( bShowProtiming );
c.ProtimingGraphWindowW3:visible( bShowProtiming );
c.ProtimingGraphWindowW2:visible( bShowProtiming );
c.ProtimingGraphWindowW1:visible( bShowProtiming );
c.ProtimingGraphFill:visible( bShowProtiming );
c.ProtimingGraphFill:finishtweening();
c.ProtimingGraphFill:decelerate(1/60);
c.ProtimingGraphFill:zoomtowidth( clamp(
scale(
fTapNoteOffset,
0,PREFSMAN:GetPreference("TimingWindowSecondsW3"),
0,(ProtimingWidth-4)/2),
-(ProtimingWidth-4)/2,(ProtimingWidth-4)/2)
);
c.ProtimingGraphAverage:visible( bShowProtiming );
c.ProtimingGraphAverage:zoomtowidth( clamp(
scale(
MakeAverage( tTotalJudgments ),
0,PREFSMAN:GetPreference("TimingWindowSecondsW3"),
0,ProtimingWidth-4),
0,ProtimingWidth-4)
);
-- c.ProtimingGraphAverage:zoomtowidth( clamp(MakeAverage( tTotalJudgments ) * 1880,0,188) );
c.ProtimingGraphCenter:visible( bShowProtiming );
c.ProtimingGraphBG.sleep(2);
c.ProtimingGraphBG.linear(0.5);
c.ProtimingGraphBG.diffusealpha(0);
c.ProtimingGraphUnderlay.sleep(2);
c.ProtimingGraphUnderlay.linear(0.5);
c.ProtimingGraphUnderlay.diffusealpha(0);
c.ProtimingGraphWindowW3.sleep(2);
c.ProtimingGraphWindowW3.linear(0.5);
c.ProtimingGraphWindowW3.diffusealpha(0);
c.ProtimingGraphWindowW2.sleep(2);
c.ProtimingGraphWindowW2.linear(0.5);
c.ProtimingGraphWindowW2.diffusealpha(0);
c.ProtimingGraphWindowW1.sleep(2);
c.ProtimingGraphWindowW1.linear(0.5);
c.ProtimingGraphWindowW1.diffusealpha(0);
c.ProtimingGraphFill.sleep(2);
c.ProtimingGraphFill.linear(0.5);
c.ProtimingGraphFill.diffusealpha(0);
c.ProtimingGraphAverage.sleep(2);
c.ProtimingGraphAverage.linear(0.5);
c.ProtimingGraphAverage.diffusealpha(0);
c.ProtimingGraphCenter.sleep(2);
c.ProtimingGraphCenter.linear(0.5);
c.ProtimingGraphCenter.diffusealpha(0);
end;
};
return t;
local c;
local player = Var "Player";
local function ShowProtiming()
if GAMESTATE:IsDemonstration() then
return false
else
return GetUserPrefB("UserPrefProtiming" .. ToEnumShortString(player));
end
end;
local bShowProtiming = ShowProtiming();
local ProtimingWidth = 240;
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" );
TapNoteScore_W3 = THEME:GetMetric( "Judgment", "JudgmentW3Command" );
TapNoteScore_W4 = THEME:GetMetric( "Judgment", "JudgmentW4Command" );
TapNoteScore_W5 = THEME:GetMetric( "Judgment", "JudgmentW5Command" );
TapNoteScore_Miss = THEME:GetMetric( "Judgment", "JudgmentMissCommand" );
};
local ProtimingCmds = {
TapNoteScore_W1 = THEME:GetMetric( "Protiming", "ProtimingW1Command" );
TapNoteScore_W2 = THEME:GetMetric( "Protiming", "ProtimingW2Command" );
TapNoteScore_W3 = THEME:GetMetric( "Protiming", "ProtimingW3Command" );
TapNoteScore_W4 = THEME:GetMetric( "Protiming", "ProtimingW4Command" );
TapNoteScore_W5 = THEME:GetMetric( "Protiming", "ProtimingW5Command" );
TapNoteScore_Miss = THEME:GetMetric( "Protiming", "ProtimingMissCommand" );
};
local AverageCmds = {
Pulse = THEME:GetMetric( "Protiming", "AveragePulseCommand" );
};
local TextCmds = {
Pulse = THEME:GetMetric( "Protiming", "TextPulseCommand" );
};
local TNSFrames = {
TapNoteScore_W1 = 0;
TapNoteScore_W2 = 1;
TapNoteScore_W3 = 2;
TapNoteScore_W4 = 3;
TapNoteScore_W5 = 4;
TapNoteScore_Miss = 5;
};
local t = Def.ActorFrame {};
t[#t+1] = Def.ActorFrame {
LoadActor(THEME:GetPathG("Judgment","Normal")) .. {
Name="Judgment";
InitCommand=function(self)
self:pause();
self:visible(false);
end;
OnCommand=THEME:GetMetric("Judgment","JudgmentOnCommand");
ResetCommand=cmd(finishtweening;stopeffect;visible,false);
};
LoadFont("Combo Numbers") .. {
Name="ProtimingDisplay";
Text="";
InitCommand=function(self)
self:visible(false);
end;
OnCommand=THEME:GetMetric("Protiming","ProtimingOnCommand");
ResetCommand=cmd(finishtweening;stopeffect;visible,false);
};
LoadFont("Common Normal") .. {
Name="ProtimingAverage";
Text="";
InitCommand=function(self)
self:visible(false);
end;
OnCommand=THEME:GetMetric("Protiming","AverageOnCommand");
ResetCommand=cmd(finishtweening;stopeffect;visible,false);
};
LoadFont("Common Normal") .. {
Name="TextDisplay";
Text=THEME:GetString("Protiming","MS");
InitCommand=function(self)
self:visible(false);
end;
OnCommand=THEME:GetMetric("Protiming","TextOnCommand");
ResetCommand=cmd(finishtweening;stopeffect;visible,false);
};
Def.Quad {
Name="ProtimingGraphBG";
InitCommand=function(self)
self:visible(false);
self:y(32);
self:zoomto(ProtimingWidth, 16);
end;
ResetCommand=function(self)
self:finishtweening();
self:diffusealpha(0.8);
self:visible(false);
end;
OnCommand=function(self)
self:diffuse(Color("Black"));
self:diffusetopedge(color("0.1,0.1,0.1,1"));
self:diffusealpha(0.8);
self:shadowlength(2);
end;
};
Def.Quad {
Name="ProtimingGraphWindowW3";
InitCommand=cmd(visible,false;y,32;zoomto,ProtimingWidth-4,16-4);
ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false);
OnCommand=cmd(diffuse,GameColor.Judgment["JudgmentLine_W3"];);
};
Def.Quad {
Name="ProtimingGraphWindowW2";
InitCommand=cmd(visible,false;y,32;zoomto,scale(PREFSMAN:GetPreference("TimingWindowSecondsW2"),0,PREFSMAN:GetPreference("TimingWindowSecondsW3"),0,ProtimingWidth-4),16-4);
ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false);
OnCommand=cmd(diffuse,GameColor.Judgment["JudgmentLine_W2"];);
};
Def.Quad {
Name="ProtimingGraphWindowW1";
InitCommand=cmd(visible,false;y,32;zoomto,scale(PREFSMAN:GetPreference("TimingWindowSecondsW1"),0,PREFSMAN:GetPreference("TimingWindowSecondsW3"),0,ProtimingWidth-4),16-4);
ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false);
OnCommand=cmd(diffuse,GameColor.Judgment["JudgmentLine_W1"];);
};
Def.Quad {
Name="ProtimingGraphUnderlay";
InitCommand=cmd(visible,false;y,32;zoomto,ProtimingWidth-4,16-4);
ResetCommand=cmd(finishtweening;diffusealpha,0.25;visible,false);
OnCommand=cmd(diffuse,Color("Black");diffusealpha,0.25);
};
Def.Quad {
Name="ProtimingGraphFill";
InitCommand=cmd(visible,false;y,32;zoomto,0,16-4;horizalign,left;);
ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false);
OnCommand=cmd(diffuse,Color("Red"););
};
Def.Quad {
Name="ProtimingGraphAverage";
InitCommand=cmd(visible,false;y,32;zoomto,2,7;);
ResetCommand=cmd(finishtweening;diffusealpha,0.85;visible,false);
OnCommand=cmd(diffuse,Color("Orange");diffusealpha,0.85);
};
Def.Quad {
Name="ProtimingGraphCenter";
InitCommand=cmd(visible,false;y,32;zoomto,2,16-4;);
ResetCommand=cmd(finishtweening;diffusealpha,1;visible,false);
OnCommand=cmd(diffuse,Color("White");diffusealpha,1);
};
InitCommand = function(self)
c = self:GetChildren();
end;
JudgmentMessageCommand=function(self, param)
-- Fix Player Combo animating when player successfully avoids a mine.
local msgParam = param;
MESSAGEMAN:Broadcast("TestJudgment",msgParam);
--
if param.Player ~= player then return end;
if param.HoldNoteScore then return end;
local iNumStates = c.Judgment:GetNumStates();
local iFrame = TNSFrames[param.TapNoteScore];
if not iFrame then return end
if iNumStates == 12 then
iFrame = iFrame * 2;
if not param.Early then
iFrame = iFrame + 1;
end
end
local fTapNoteOffset = param.TapNoteOffset;
if param.HoldNoteScore then
fTapNoteOffset = 1;
else
fTapNoteOffset = param.TapNoteOffset;
end
if param.TapNoteScore == 'TapNoteScore_Miss' then
fTapNoteOffset = 1;
bUseNegative = true;
else
-- fTapNoteOffset = fTapNoteOffset;
bUseNegative = false;
end;
if fTapNoteOffset ~= 1 then
-- we're safe, you can push the values
tTotalJudgments[#tTotalJudgments+1] = math.abs(fTapNoteOffset);
--~ tTotalJudgments[#tTotalJudgments+1] = bUseNegative and fTapNoteOffset or math.abs( fTapNoteOffset );
end
self:playcommand("Reset");
c.Judgment:visible( not bShowProtiming );
c.Judgment:setstate( iFrame );
JudgeCmds[param.TapNoteScore](c.Judgment);
c.ProtimingDisplay:visible( bShowProtiming );
c.ProtimingDisplay:settextf("%i",fTapNoteOffset * 1000);
ProtimingCmds[param.TapNoteScore](c.ProtimingDisplay);
c.ProtimingAverage:visible( bShowProtiming );
c.ProtimingAverage:settextf("%.2f%%",clamp(100 - MakeAverage( tTotalJudgments ) * 1000 ,0,100));
AverageCmds['Pulse'](c.ProtimingAverage);
c.TextDisplay:visible( bShowProtiming );
TextCmds['Pulse'](c.TextDisplay);
c.ProtimingGraphBG:visible( bShowProtiming );
c.ProtimingGraphUnderlay:visible( bShowProtiming );
c.ProtimingGraphWindowW3:visible( bShowProtiming );
c.ProtimingGraphWindowW2:visible( bShowProtiming );
c.ProtimingGraphWindowW1:visible( bShowProtiming );
c.ProtimingGraphFill:visible( bShowProtiming );
c.ProtimingGraphFill:finishtweening();
c.ProtimingGraphFill:decelerate(1/60);
-- c.ProtimingGraphFill:zoomtowidth( clamp(fTapNoteOffset * 188,-188/2,188/2) );
c.ProtimingGraphFill:zoomtowidth( clamp(
scale(
fTapNoteOffset,
0,PREFSMAN:GetPreference("TimingWindowSecondsW3"),
0,(ProtimingWidth-4)/2),
-(ProtimingWidth-4)/2,(ProtimingWidth-4)/2)
);
c.ProtimingGraphAverage:visible( bShowProtiming );
c.ProtimingGraphAverage:zoomtowidth( clamp(
scale(
MakeAverage( tTotalJudgments ),
0,PREFSMAN:GetPreference("TimingWindowSecondsW3"),
0,ProtimingWidth-4),
0,ProtimingWidth-4)
);
-- c.ProtimingGraphAverage:zoomtowidth( clamp(MakeAverage( tTotalJudgments ) * 1880,0,188) );
c.ProtimingGraphCenter:visible( bShowProtiming );
(cmd(sleep,2;linear,0.5;diffusealpha,0))(c.ProtimingGraphBG);
(cmd(sleep,2;linear,0.5;diffusealpha,0))(c.ProtimingGraphUnderlay);
(cmd(sleep,2;linear,0.5;diffusealpha,0))(c.ProtimingGraphWindowW3);
(cmd(sleep,2;linear,0.5;diffusealpha,0))(c.ProtimingGraphWindowW2);
(cmd(sleep,2;linear,0.5;diffusealpha,0))(c.ProtimingGraphWindowW1);
(cmd(sleep,2;linear,0.5;diffusealpha,0))(c.ProtimingGraphFill);
(cmd(sleep,2;linear,0.5;diffusealpha,0))(c.ProtimingGraphAverage);
(cmd(sleep,2;linear,0.5;diffusealpha,0))(c.ProtimingGraphCenter);
end;
};
return t;
@@ -7,14 +7,8 @@ local previewHeight = SCREEN_CENTER_Y;
local t = Def.ActorFrame{
Name="PreviewFrame";
InitCommand=function(self)
self:x(SCREEN_CENTER_X * 1.5);
self:y(SCREEN_CENTER_Y * 0.85);
end;
OffCommand=function(self)
self:bouncebegin(0.25);
self:addx(SCREEN_CENTER_X);
end;
InitCommand=cmd(x,SCREEN_CENTER_X*1.5;y,SCREEN_CENTER_Y*0.85);
OffCommand=cmd(bouncebegin,0.25;addx,SCREEN_CENTER_X);
};
local function TitleMenuItem(text,focused)
@@ -22,231 +16,92 @@ local function TitleMenuItem(text,focused)
local textColor = focused and color("#FFFFFF") or color("#888888");
return LoadFont("Common Normal")..{
Text=text;
InitCommand=function(self)
self:zoom(0.45);
self:strokecolor(Color("Outline"));
self:diffuse(textColor);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(zoom,0.45;strokecolor,Color("Outline");diffuse,textColor);
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
end;
local previews = {
WhereToFind = Def.ActorFrame{
LoadActor(THEME:GetPathG("_howto","find"))..{
InitCommand=function(self)
self:zoomto(previewWidth, previewHeight);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(zoomto,previewWidth,previewHeight);
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
};
HowToInstall = Def.ActorFrame{
LoadActor(THEME:GetPathG("_howto","install"))..{
InitCommand=function(self)
self:zoomto(previewWidth, previewHeight);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(zoomto,previewWidth,previewHeight);
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
};
AdditionalFolders = Def.ActorFrame{
Def.Quad{
InitCommand=function(self)
self:zoomto(previewWidth, previewHeight);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(zoomto,previewWidth,previewHeight);
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
Def.Quad{
InitCommand=function(self)
self:y(-previewHeight * 0.45);
self:diffuse(color("#E0F0F0"));
self:zoomto(previewWidth, previewHeight * 0.1);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(y,-previewHeight*0.45;diffuse,color("#E0F0F0");zoomto,previewWidth,previewHeight*0.1;);
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
LoadFont("Common normal")..{
InitCommand=function(self)
self:x(SCREEN_CENTER_X * -0.4);
self:y(SCREEN_CENTER_Y * -0.475);
self:zoom(0.625);
self:halign(0);
self:valign(0);
self:diffuse(color("#000000"));
end;
InitCommand=cmd(x,-(SCREEN_CENTER_X*0.4);y,-(SCREEN_CENTER_Y*0.475);zoom,0.625;halign,0;valign,0;diffuse,color("#000000"));
BeginCommand=function(self)
local text = "Preferences.ini";
self:settext(text);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
LoadFont("Common normal")..{
Text="[Options]\nAdditionalCourseFolders=\nAdditionalFolders=\nAdditionalSongFolders=";
InitCommand=function(self)
self:x(SCREEN_CENTER_X * -0.4);
self:y(SCREEN_CENTER_Y * -0.35);
self:zoom(0.75);
self:halign(0);
self:valign(0);
self:diffuse(color("#000000"));
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(x,-(SCREEN_CENTER_X*0.4);y,-(SCREEN_CENTER_Y*0.35);zoom,0.75;halign,0;valign,0;diffuse,color("#000000"));
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
};
ReloadSongs = Def.ActorFrame{
LoadActor(THEME:GetPathB("ScreenTitleMenu","background/_bg"))..{
InitCommand=function(self)
self:zoomto(previewWidth, previewHeight);
self:halign(0.5);
self:valign(0.5);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(zoomto,previewWidth,previewHeight;halign,0.5;valign,0.5);
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
LoadFont("Common normal")..{
InitCommand=function(self)
self:zoom(0.4);
self:maxwidth((previewWidth * 1.6) - 8);
end;
InitCommand=cmd(zoom,0.4;maxwidth,(previewWidth*1.6)-8);
BeginCommand=function(self)
local song = SONGMAN:GetRandomSong();
self:settext("Loading songs...\n"..song:GetGroupName().."\n"..song:GetDisplayFullTitle());
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
};
Exit = Def.ActorFrame{
LoadActor(THEME:GetPathB("ScreenTitleMenu","background/_bg"))..{
InitCommand=function(self)
self:zoomto(previewWidth, previewHeight);
self:halign(0.5);
self:valign(0.5);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(zoomto,previewWidth,previewHeight;halign,0.5;valign,0.5);
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
LoadActor(THEME:GetPathG("ScreenTitleMenu","logo"))..{
InitCommand=function(self)
self:y(-28);
self:zoom(0.35);
self:propagate(true);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(y,-28;zoom,0.35;propagate,true);
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
TitleMenuItem("Game Start",true)..{
InitCommand=function(self)
self:y(20);
end;
InitCommand=cmd(y,20);
};
TitleMenuItem("Options")..{
InitCommand=function(self)
self:y(32);
end;
InitCommand=cmd(y,32);
};
TitleMenuItem("Edit/Share")..{
InitCommand=function(self)
self:y(44);
end;
InitCommand=cmd(y,44);
};
TitleMenuItem("Exit")..{
InitCommand=function(self)
self:y(56);
end;
InitCommand=cmd(y,56);
};
};
};
@@ -258,26 +113,9 @@ t[#t+1] = LoadFont("Common normal")..{
--Text="The quick brown fox jumps over the lazy dog ".. Index .." times.";
Text=Screen.String("Explanation-"..Name);
-- was x,-(SCREEN_CENTER_X*0.4);y,SCREEN_CENTER_Y*0.525;
InitCommand=function(self)
self:x(SCREEN_CENTER_X * -0.8);
self:y(SCREEN_CENTER_Y * 0.8);
self:halign(0);
self:valign(0);
self:zoom(0.65);
self:wrapwidthpixels((SCREEN_WIDTH * 0.55) * 1.75);
self:NoStroke();
self:shadowlength(1);
end;
GainFocusCommand=function(self)
self:stoptweening();
self:decelerate(0.5);
self:diffusealpha(1);
end;
LoseFocusCommand=function(self)
self:stoptweening();
self:accelerate(0.5);
self:diffusealpha(0);
end;
InitCommand=cmd(x,-(SCREEN_CENTER_X*0.8);y,SCREEN_CENTER_Y*0.8;halign,0;valign,0;zoom,0.65;wrapwidthpixels,(SCREEN_WIDTH*0.55)*1.75;NoStroke;shadowlength,1);
GainFocusCommand=cmd(stoptweening;decelerate,0.5;diffusealpha,1);
LoseFocusCommand=cmd(stoptweening;accelerate,0.5;diffusealpha,0);
};
return t;
@@ -8,3 +8,26 @@ return Def.HelpDisplay {
self:SetTipsColonSeparated( params.Text );
end;
};
--[[ local sString = THEME:GetString(Var "LoadingScreen","AlternateHelpText");
local tItems = split(sString,"&");
local t = Def.ActorScroller {
NumItemsToDraw=#tItems;
SecondsPerItem=1.25;
TransformFunction=function( self, offset, itemIndex, numItems )
self:x( offset*74 );
end;
InitCommand=cmd(SetLoop,true);
-- OnCommand=cmd(scrollwithpadding,10,0);
};
for i=1,#tItems do
t[#t+1] = Def.ActorFrame {
LoadFont("HelpDisplay", "text") .. {
Text=tostring(tItems[i]);
OnCommand=THEME:GetMetric( Var "LoadingScreen","HelpOnCommand");
};
};
end
return t; --]]
@@ -11,6 +11,8 @@ local colors = {
local t = Def.ActorFrame {};
-- Background!
t[#t+1] = Def.ActorFrame {
-- GainFocusCommand=cmd(visible,true);
-- LoseFocusCommand=cmd(visible,false);
LoadActor(THEME:GetPathG("ScreenSelectPlayMode","BackgroundFrame")) .. {
InitCommand=function(self)
self:diffuse(Color("Black"));
@@ -53,38 +53,21 @@ local function MakeIcon( sTarget )
Def.ActorFrame {
-- Life goes up to 1-5
Def.ActorFrame {
InitCommand=function(self)
self:y(12);
end;
InitCommand=cmd(y,12);
MakeDisplayBar( 6, 5 ) .. {
InitCommand=function(self)
self:x(-16);
self:visible( GetLifeDifficulty() >= 1 );
end;
InitCommand=cmd(x,-16;visible,( GetLifeDifficulty() >= 1 ));
};
MakeDisplayBar( 6, 9 ) .. {
InitCommand=function(self)
self:x(-8);
self:visible( GetLifeDifficulty() >= 2 );
end;
InitCommand=cmd(x,-8;visible,( GetLifeDifficulty() >= 2 ));
};
MakeDisplayBar( 6, 13 ) .. {
InitCommand=function(self)
self:x(0);
self:visible( GetLifeDifficulty() >= 3 );
end;
InitCommand=cmd(x,0;visible,( GetLifeDifficulty() >= 3 ));
};
MakeDisplayBar( 6, 16 ) .. {
InitCommand=function(self)
self:x(8);
self:visible( GetLifeDifficulty() >= 4 );
end;
InitCommand=cmd(x,8;visible,( GetLifeDifficulty() >= 4 ));
};
MakeDisplayBar( 6, 20 ) .. {
InitCommand=function(self)
self:x(16);
self:visible( GetLifeDifficulty() >= 5 );
end;
InitCommand=cmd(x,16;visible,( GetLifeDifficulty() >= 5 ));
};
};
Condition=sTarget[1] == "LifeDifficulty";
@@ -92,69 +75,47 @@ local function MakeIcon( sTarget )
Def.ActorFrame {
-- Timing goes up to 1-8
Def.ActorFrame {
InitCommand=function(self)
self:y(12);
end;
InitCommand=cmd(y,12);
MakeDisplayBar( 4, 5 ) .. {
InitCommand=function(self)
self:x(-20);
self:visible( GetTimingDifficulty() >= 1 );
end;
InitCommand=cmd(x,-20;visible,( GetTimingDifficulty() >= 1 ));
};
MakeDisplayBar( 4, 9 ) .. {
InitCommand=function(self)
self:x(-215);
self:visible( GetTimingDifficulty() >= 2 );
end;
InitCommand=cmd(x,-15;visible,( GetTimingDifficulty() >= 2 ));
};
MakeDisplayBar( 4, 13 ) .. {
InitCommand=function(self)
self:x(-10);
self:visible( GetTimingDifficulty() >= 3 );
end;
InitCommand=cmd(x,-10;visible,( GetTimingDifficulty() >= 3 ));
};
MakeDisplayBar( 4, 16 ) .. {
InitCommand=function(self)
self:x(-5);
self:visible( GetTimingDifficulty() >= 4 );
end;
InitCommand=cmd(x,-5;visible,( GetTimingDifficulty() >= 4 ));
};
MakeDisplayBar( 4, 20 ) .. {
InitCommand=function(self)
self:x(5);
self:visible( GetTimingDifficulty() >= 5 );
end;
InitCommand=cmd(x,5;visible,( GetTimingDifficulty() >= 5 ));
};
MakeDisplayBar( 4, 20 ) .. {
function(self)
self:x(10);
self:visible( GetTimingDifficulty() >= 6 );
end;
InitCommand=cmd(x,10;visible,( GetTimingDifficulty() >= 6 ));
};
MakeDisplayBar( 4, 20 ) .. {
function(self)
self:x(15);
self:visible( GetTimingDifficulty() >= 7 );
end;
InitCommand=cmd(x,15;visible,( GetTimingDifficulty() >= 7 ));
};
MakeDisplayBar( 4, 20 ) .. {
function(self)
self:x(20);
self:visible( GetTimingDifficulty() >= 8 );
end;
InitCommand=cmd(x,20;visible,( GetTimingDifficulty() >= 8 ));
};
};
Condition=sTarget[1] == "TimingDifficulty";
};
--
--[[ for i=1,8 do
t[#t+1] = Def.Quad {
InitCommand=cmd(vertalign,bottom;zoomto,4,10+(i*4));
};
end --]]
};
return t
end;
for i=1,#tInfo do
t[#t+1] = MakeIcon( tInfo[i] ) .. {
InitCommand=function(self)
self:x((i - 1) * fSpacingX);
end;
InitCommand=cmd(x,(i-1)*fSpacingX);
};
end