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
+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;