Fallback handled. Yes, I tested this.

This commit is contained in:
Jason Felds
2013-07-03 20:08:34 -04:00
parent a5ef44a838
commit 986d510a88
29 changed files with 1314 additions and 793 deletions
@@ -1,14 +1,21 @@
local t = Def.ActorFrame {
Def.ActorFrame {
InitCommand=cmd(Center);
--[[ ToggleConsoleDisplayMessageCommand=function(self)
InitCommand=function(self)
self:Center();
end;
--[[
ToggleConsoleDisplayMessageCommand=function(self)
bVisible = 1 - bVisible;
bShow = (bVisible >= 1) and true or false;
self:visible(bShow);
end; --]]
end;
--]]
Def.Quad {
InitCommand(zoomto,64,64;spin;);
ToggleConsoleDisplayMessageCommand=cmd(zoomto,345,345;visible,true);
ToggleConsoleDisplayMessageCommand=function(self)
self:zoomto(345, 345);
self:visible(true);
end;
};
};
};
@@ -117,8 +117,18 @@ local sections = {
-- To add people or sections modify the above.
local lineOn = cmd(zoom,0.875;strokecolor,color("#444444");shadowcolor,color("#444444");shadowlength,3)
local sectionOn = cmd(diffuse,color("#88DDFF");strokecolor,color("#446688");shadowcolor,color("#446688");shadowlength,3)
local lineOn = function(self)
self:zoom(0.875);
self:strokecolor(color("#444444"));
self:shadowcolor(color("#444444"));
self:shadowlength(3);
end;
local sectionOn = function(self)
self:diffuse(color("#88DDFF"));
self:strokecolor(color("#446688"));
self:shadowcolor(color("#446688"));
self:shadowlength(3);
end;
local item_padding_start = 4;
local creditScroller = Def.ActorScroller {
@@ -127,7 +137,9 @@ local creditScroller = Def.ActorScroller {
TransformFunction = function( self, offset, itemIndex, numItems)
self:y(30*offset)
end;
OnCommand = cmd(scrollwithpadding,item_padding_start,15);
OnCommand = function(self)
self:scrollwithpadding(item_padding_start, 15);
end;
}
local function AddLine( text, command )
@@ -156,6 +168,9 @@ end;
return Def.ActorFrame{
creditScroller..{
InitCommand=cmd(CenterX;y,SCREEN_BOTTOM-64),
InitCommand=function(self)
self:CenterX();
self:y(SCREEN_BOTTOM - 64);
end;
}
};
@@ -1,39 +1,83 @@
local t = Def.ActorFrame {};
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(Center);
InitCommand=function(self)
self:Center();
end;
Def.Quad {
InitCommand=cmd(scaletoclipped,SCREEN_WIDTH,SCREEN_HEIGHT);
OnCommand=cmd(diffuse,color("0,0,0,1");diffusetopedge,color("0.1,0.1,0.1,1"));
InitCommand=function(self)
self:scaletoclipped(SCREEN_WIDTH, SCREEN_HEIGHT);
end;
OnCommand=function(self)
self:diffuse(color("0,0,0,1"));
self:diffusetopedge(color("0.1,0.1,0.1,1"));
end;
};
};
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(Center);
InitCommand=function(self)
self:Center();
end;
Def.ActorFrame {
Def.Quad {
InitCommand=cmd(zoomto,SCREEN_WIDTH,128);
OnCommand=cmd(diffusealpha,1;sleep,1.5;linear,0.25);
InitCommand=function(self)
self:zoomto(SCREEN_WIDTH, 128);
end;
OnCommand=function(self)
self:diffusealpha(1);
self:sleep(1.5);
self:linear(0.25);
end;
};
LoadActor("ssc") .. {
OnCommand=cmd(diffusealpha,0;linear,1;diffusealpha,1;sleep,0.75;linear,0.25;diffusealpha,0);
OnCommand=function(self)
self:diffusealpha(0);
self:linear(1);
self:diffusealpha(1);
self:sleep(0.75);
self:linear(0.25);
self:diffusealpha(0);
end;
};
};
Def.ActorFrame {
OnCommand=cmd(playcommandonchildren,"ChildrenOn");
ChildrenOnCommand=cmd(diffusealpha,0;sleep,2;linear,0.25;diffusealpha,1);
OnCommand=function(self)
self:playcommandonchildren("ChildrenOn");
end;
ChildrenOnCommand=function(self)
self:diffusealpha(0);
self:sleep(2);
self:linear(0.25);
self:diffusealpha(1);
end;
LoadFont("Common Normal") .. {
Text=ProductID();
InitCommand=cmd(y,-20;zoom,0.75);
OnCommand=cmd(diffuse,color("0,0,0,1");strokecolor,color("#f7941d"));
InitCommand=function(self)
self:y(-20);
self:zoom(0.75);
end;
OnCommand=function(self)
self:diffuse(color("0,0,0,1"));
self:strokecolor(color("#f7941d"));
end;
};
LoadFont("Common Normal") .. {
Text=THEME:GetThemeDisplayName();
OnCommand=cmd(diffuse,color("0,0,0,1");strokecolor,color("#f7941d"));
OnCommand=function(self)
self:diffuse(color("0,0,0,1"));
self:strokecolor(color("#f7941d"));
end;
};
LoadFont("Common Normal") .. {
Text="Created by " .. THEME:GetThemeAuthor();
InitCommand=cmd(y,24;zoom,0.75);
OnCommand=cmd(diffuse,color("0,0,0,1");strokecolor,color("#f7941d"));
InitCommand=function(self)
self:y(24);
self:zoom(0.75);
end;
OnCommand=function(self)
self:diffuse(color("0,0,0,1"));
self:strokecolor(color("#f7941d"));
end;
};
};
};
@@ -1,27 +1,69 @@
local waitTime = 7.5
local t = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
OnCommand=cmd(queuecommand,"TweenOn";sleep,waitTime;queuecommand,"TweenOff");
}
t[#t+1] = Def.Quad {
InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color.Black);
TweenOnCommand=cmd(diffusealpha,1;linear,0.5;diffusealpha,0.8);
TweenOffCommand=cmd(linear,0.5;diffusealpha,0);
};
t[#t+1] = Def.ActorFrame {
LoadFont("Common Normal") .. {
Text=ScreenString("WarningHeader");
InitCommand=cmd(y,-70;diffuse,Color.Red);
TweenOnCommand=cmd(diffusealpha,0;zoomx,2;zoomy,0;sleep,0.5;smooth,0.25;zoom,1;diffusealpha,1);
TweenOffCommand=cmd(linear,0.5;diffusealpha,0);
};
LoadFont("Common Normal") .. {
Text=ScreenString("WarningText");
InitCommand=cmd(y,10;wrapwidthpixels,SCREEN_WIDTH-48);
TweenOnCommand=cmd(diffusealpha,0;sleep,0.5125;linear,0.125;diffusealpha,1);
TweenOffCommand=cmd(linear,0.5;diffusealpha,0);
};
};
local waitTime = 7.5
local t = Def.ActorFrame {
InitCommand=function(self)
self:x(SCREEN_CENTER_X);
self:y(SCREEN_CENTER_Y);
end;
OnCommand=function(self)
self:queuecommand("TweenOn");
self:sleep(waitTime);
self:queuecommand("TweenOff");
end;
}
t[#t+1] = Def.Quad {
InitCommand=function(self)
self:zoomto(SCREEN_WIDTH, SCREEN_HEIGHT);
self:diffuse(Color.Black);
end;
TweenOnCommand=function(self)
self:diffusealpha(1);
self:linear(0.5);
self:diffusealpha(0.8);
end;
TweenOffCommand=function(self)
self:linear(0.5);
self:diffusealpha(0);
end;
};
t[#t+1] = Def.ActorFrame {
LoadFont("Common Normal") .. {
Text=ScreenString("WarningHeader");
InitCommand=function(self)
self:y(-70);
self:diffuse(Color.Red);
end;
TweenOnCommand=function(self)
self:diffusealpha(0);
self:zoomx(2);
self:zoomy(0);
self:sleep(0.5);
self:smooth(0.25);
self:zoom(1);
self:diffusealpha(1);
end;
TweenOffCommand=function(self)
self:linear(0.5);
self:diffusealpha(0);
end;
};
LoadFont("Common Normal") .. {
Text=ScreenString("WarningText");
InitCommand=function(self)
self:y(10);
self:wrapwidthpixels(SCREEN_WIDTH - 48);
end;
TweenOnCommand=function(self)
self:diffusealpha(0);
self:sleep(0.5125);
self:linear(0.125);
self:diffusealpha(1);
end;
TweenOffCommand=function(self)
self:linear(0.5);
self:diffusealpha(0);
end;
};
};
return t
@@ -1,40 +1,52 @@
local Players = GAMESTATE:GetHumanPlayers();
--[[ local tMath = {
PLAYER_1 = -1,
PLAYER_2 = 1
}; --]]
--
local t = Def.ActorFrame {};
-- Is Anyone Enabled To Join
t[#t+1] = Def.ActorFrame {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
LoadFont("Common Normal") .. {
Text="A player has a high score";
BeginCommand=cmd(visible,SCREENMAN:GetTopScreen():GetAnyEntering());
};
LoadFont("Common Normal") .. {
Text="No players has a high score";
BeginCommand=cmd(visible,not SCREENMAN:GetTopScreen():GetAnyEntering());
};
--[[ for pn in ivalues(Players) do
LoadFont("Common Normal") .. {
Text=ToEnumShortString(pn);
InitCommand=cmd(x,128 * tMath[pn];y,32);
};
end --]]
};
--
t[#t+1] = Def.Actor {
MenuTimerExpiredMessageCommand = function(self, param)
for pn in ivalues(Players) do
SCREENMAN:GetTopScreen():Finish(pn);
end
end;
CodeMessageCommand=function(self,param)
if param.Name == "Enter" then
SCREENMAN:GetTopScreen():Finish(pn);
end
end
};
--
local Players = GAMESTATE:GetHumanPlayers();
--[[ local tMath = {
PLAYER_1 = -1,
PLAYER_2 = 1
}; --]]
--
local t = Def.ActorFrame {};
-- Is Anyone Enabled To Join
t[#t+1] = Def.ActorFrame {
InitCommand=function(self)
self:x(SCREEN_CENTER_X);
self:y(SCREEN_CENTER_Y);
end;
LoadFont("Common Normal") .. {
Text="A player has a high score";
BeginCommand=function(self)
self:visible(SCREENMAN:GetTopScreen():GetAnyEntering());
end;
};
LoadFont("Common Normal") .. {
Text="No players has a high score";
BeginCommand=function(self)
self:visible(not SCREENMAN:GetTopScreen():GetAnyEntering());
end;
};
--[[
for pn in ivalues(Players) do
LoadFont("Common Normal") .. {
Text=ToEnumShortString(pn);
InitCommand=function(self)
self:x(128 * tMath[pn]);
self:y(32);
end
};
end
--]]
};
--
t[#t+1] = Def.Actor {
MenuTimerExpiredMessageCommand = function(self, param)
for pn in ivalues(Players) do
SCREENMAN:GetTopScreen():Finish(pn);
end
end;
CodeMessageCommand=function(self,param)
if param.Name == "Enter" then
SCREENMAN:GetTopScreen():Finish(pn);
end
end
};
--
return t
@@ -1,271 +1,293 @@
local function distance( x1, y1, x2, y2 )
return math.pow( math.pow(x1-x2, 2) + math.pow(y1-y2, 2), 0.5 );
end
local children = {
};
local Letters = {
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
"O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "?", "!",
"BACK", "ENTER"
};
local LetterIndexes = { };
for i, l in ipairs(Letters) do
LetterIndexes[l] = i;
end
local MapNameToLetter = {};
local MapLetterToName = {};
local letter = LoadFont("Common Normal")..{
InitCommand=cmd(zoom,0.8;shadowlength,0);
PulseCommand = function(self)
self:finishtweening();
local z = self:GetZoomX();
(cmd(accelerate,0.15;zoom,1.2;decelerate,0.15;zoom,z))(self);
end;
};
for l in ivalues(Letters) do
local Name = "letter " .. l;
MapNameToLetter[Name] = l;
MapLetterToName[l] = Name;
children[#children+1] = letter..{
Name = Name;
Text = l;
};
if l == "BACK" or l == "ENTER" then
children[#children].File = THEME:GetPathF("Common", "Normal");
end;
end;
children[#children+1] = LoadActor( THEME:GetPathS("Common", "value") ) .. { Name = "Type"; SupportPan = true; }
children[#children+1] = LoadActor( THEME:GetPathS("Common", "cancel") ) .. { Name = "Back"; SupportPan = true; }
children[#children+1] = LoadActor( THEME:GetPathS("Common", "start") ).. { Name = "Enter"; SupportPan = true; }
children[#children+1] = LoadActor( THEME:GetPathS("MusicWheel", "change") ) .. { Name = "Move"; SupportPan = true; }
local CursorFiles = {
[PLAYER_1] = "Cursor P1",
[PLAYER_2] = "Cursor P2"
};
for pn in ivalues(PlayerNumber) do
children[#children+1] = LoadActor( THEME:GetPathG("_frame", "1D"),
{ 4/10, 2/10, 4/10 },
LoadActor(CursorFiles[pn])
)..{
Name = CursorFiles[pn];
BeginCommand = cmd(visible,SCREENMAN:GetTopScreen():GetEnteringName(pn));
OnCommand = cmd(
zoom,0;
rotationz,-360*2;
sleep,0.55;
decelerate,0.5;
zoom,1;
rotationz,0;
);
OffCommand = cmd(sleep,0.3;queuecommand,"TweenOff");
PlayerFinishedMessageCommand = function(self,param)
if param.PlayerNumber ~= pn then return end
self:playcommand("TweenOff" );
end;
TweenOffCommand = function(self,param)
(cmd(accelerate,0.25;zoomx,0;))(self);
end;
};
end
local c;
local Keys = {};
local Selection = {};
local PlayerX = {};
local PlayerY = {};
return Def.ActorFrame {
children = children;
BeginCommand = function(self)
c = self:GetChildren();
c.Cursors = {};
c.Cursors[PLAYER_1] = c["Cursor P1"];
c.Cursors[PLAYER_2] = c["Cursor P2"];
for l in ivalues(Letters) do
local Name = MapLetterToName[l];
assert(Name);
Keys[l] = {
Text = c[Name];
Width = c[Name]:GetWidth();
Height = c[Name]:GetHeight();
};
assert(c[Name], Name);
end;
-- Position letters.
local RowWidths = {};
local fX = 0;
local fXPadding = 4;
local fY = 0;
local iRow = 1;
for l in ivalues(Letters) do
if l == "O" or l == "0" or l == "BACK" then
fX = 0;
fY = fY + 30;
iRow = iRow + 1;
end;
Keys[l].Row = iRow;
Keys[l].Text:x(fX + Keys[l].Width/2);
Keys[l].Text:y(fY + Keys[l].Height/2);
fX = fX + Keys[l].Width;
RowWidths[iRow] = fX;
fX = fX + fXPadding;
end;
for l in ivalues(Letters) do
local iRow = Keys[l].Row;
Keys[l].Text:addx(-RowWidths[iRow]/2);
end;
Keys["BACK"].Text:x(-140);
Keys["ENTER"].Text:x(140);
for pn in ivalues(PlayerNumber) do
local sName = SCREENMAN:GetTopScreen():GetSelection(pn);
local DefaultKey = "A"
if #sName > 0 then
DefaultKey = "ENTER"
end
self:playcommand("SelectKey", { Key = DefaultKey, PlayerNumber = pn });
c.Cursors[pn]:finishtweening();
end
end;
CodeMessageCommand = function(self, param)
local pn = param.PlayerNumber;
if not SCREENMAN:GetTopScreen():GetAnyStillEntering() and param.Name == "Enter" then
if SCREENMAN:GetTopScreen():Finish(pn) then
c.Enter:play();
end
return;
end
if SCREENMAN:GetTopScreen():GetFinalized( pn ) then
return;
end
if param.Name == "Left" or param.Name == "Right" then
local iDir = param.Name == "Left" and -1 or 1;
local idx = LetterIndexes[Selection[pn]];
idx = idx + iDir;
idx = math.mod(idx+#Letters-1, #Letters)+1;
self:playcommand("SelectKey", { Key = Letters[idx], PlayerNumber = pn });
c.Move:playforplayer(pn);
return;
end
if param.Name == "JumpToEnter" then
self:playcommand("SelectKey", { Key = "ENTER", PlayerNumber = pn });
c.Move:playforplayer(pn);
return;
end
if param.Name == "Backspace" then
if SCREENMAN:GetTopScreen():Backspace(pn) then
c.Back:playforplayer(pn);
end
return;
end
if param.Name == "NextRow" or param.Name == "PrevRow" then
local iDir = param.Name == "PrevRow" and -1 or 1;
local idx = LetterIndexes[Selection[pn]];
local iRow = Keys[Selection[pn]].Row;
iRow = iRow + iDir;
iRow = math.mod(iRow+4-1, 4)+1;
local NearestLetter
local NearestLetterDistance
for l in ivalues(Letters) do
if iRow == Keys[l].Row then
local Text = Keys[l].Text;
local fDist = distance( PlayerX[pn], PlayerY[pn],
Text:GetX(), Text:GetY() );
if not NearestLetterDistance or fDist < NearestLetterDistance then
NearestLetterDistance = fDist;
NearestLetter = l;
end
end
end
assert( NearestLetter );
self:playcommand("SelectKey", { Key = NearestLetter, PlayerNumber = pn, NoStore = true });
c.Move:playforplayer(pn);
return;
end
if param.Name == "Enter" then
if Selection[pn] == "BACK" then
if SCREENMAN:GetTopScreen():Backspace(pn) then
Keys[Selection[pn]].Text:playcommand( "Pulse" );
c.Back:playforplayer(pn);
end
elseif Selection[pn] == "ENTER" then
if SCREENMAN:GetTopScreen():Finish(pn) then
Keys[Selection[pn]].Text:playcommand( "Pulse" );
c.Enter:playforplayer(pn);
end
else
local key = Selection[pn]; -- EnterKey may change this
if SCREENMAN:GetTopScreen():EnterKey(pn, key) then
Keys[key].Text:playcommand( "Pulse" );
c.Type:playforplayer(pn);
end
end
end
end;
SelectKeyMessageCommand = function(self, param)
local key = param.Key;
local pn = param.PlayerNumber;
if not Keys[key] then return end
Selection[pn] = key;
c.Cursors[pn]:stoptweening();
c.Cursors[pn]:playcommand( "SetSize", { Width=Keys[key].Width+6; tween=cmd(stoptweening;linear,0.10); } );
c.Cursors[pn]:x( Keys[key].Text:GetX() );
c.Cursors[pn]:y( Keys[key].Text:GetY() );
if not param.NoStore then
PlayerX[pn] = Keys[key].Text:GetX();
PlayerY[pn] = Keys[key].Text:GetY();
end
end;
MenuTimerExpiredMessageCommand = function(self, param)
for pn in ivalues(PlayerNumber) do
SCREENMAN:GetTopScreen():Finish(pn);
end
c.Enter:play();
end;
OnCommand = function(self, param)
for key in ivalues(Letters) do
local fDist = distance( Keys[key].Text:GetX(), Keys[key].Text:GetY(), 0, 100 );
local f = cmd(
diffusealpha,0;zoom,0;
sleep,0.25 + (fDist / 400);
decelerate,0.5;
diffusealpha,1;zoom,0.8);
f(Keys[key].Text);
end
end;
OffCommand = function(self, param)
for key in ivalues(Letters) do
local fDist = distance( Keys[key].Text:GetX(), Keys[key].Text:GetY(), 0, 100 );
local f = cmd(
sleep,0.0 + (fDist / 400);
decelerate,0.5;
diffusealpha,0;zoom,0);
f(Keys[key].Text);
end
end;
};
local function distance( x1, y1, x2, y2 )
return math.pow( math.pow(x1-x2, 2) + math.pow(y1-y2, 2), 0.5 );
end
local children = {
};
local Letters = {
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
"O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "?", "!",
"BACK", "ENTER"
};
local LetterIndexes = { };
for i, l in ipairs(Letters) do
LetterIndexes[l] = i;
end
local MapNameToLetter = {};
local MapLetterToName = {};
local letter = LoadFont("Common Normal")..{
InitCommand=function(self)
self:zoom(0.8);
self:shadowlength(0);
end;
PulseCommand = function(self)
self:finishtweening();
local z = self:GetZoomX();
self:accelerate(0.15);
self:zoom(1.2);
self:decelerate(0.15);
self:zoom(z);
end;
};
for l in ivalues(Letters) do
local Name = "letter " .. l;
MapNameToLetter[Name] = l;
MapLetterToName[l] = Name;
children[#children+1] = letter..{
Name = Name;
Text = l;
};
if l == "BACK" or l == "ENTER" then
children[#children].File = THEME:GetPathF("Common", "Normal");
end;
end;
children[#children+1] = LoadActor( THEME:GetPathS("Common", "value") ) .. { Name = "Type"; SupportPan = true; }
children[#children+1] = LoadActor( THEME:GetPathS("Common", "cancel") ) .. { Name = "Back"; SupportPan = true; }
children[#children+1] = LoadActor( THEME:GetPathS("Common", "start") ).. { Name = "Enter"; SupportPan = true; }
children[#children+1] = LoadActor( THEME:GetPathS("MusicWheel", "change") ) .. { Name = "Move"; SupportPan = true; }
local CursorFiles = {
[PLAYER_1] = "Cursor P1",
[PLAYER_2] = "Cursor P2"
};
for pn in ivalues(PlayerNumber) do
children[#children+1] = LoadActor( THEME:GetPathG("_frame", "1D"),
{ 4/10, 2/10, 4/10 },
LoadActor(CursorFiles[pn])
)..{
Name = CursorFiles[pn];
BeginCommand = function(self)
self:visible(SCREENMAN:GetTopScreen():GetEnteringName(pn));
end;
OnCommand = function(self)
self:zoom(0);
self:rotationz(-360 * 2);
self:sleep(0.55);
self:decelerate(0.5);
self:zoom(1);
self:rotationz(0);
end;
OffCommand = function(self)
self:sleep(0.3);
self:queuecommand("TweenOff");
end;
PlayerFinishedMessageCommand = function(self,param)
if param.PlayerNumber ~= pn then return end
self:playcommand("TweenOff" );
end;
TweenOffCommand = function(self,param)
self:accelerate(0.25);
self:zoomx(0);
end;
};
end
local c;
local Keys = {};
local Selection = {};
local PlayerX = {};
local PlayerY = {};
return Def.ActorFrame {
children = children;
BeginCommand = function(self)
c = self:GetChildren();
c.Cursors = {};
c.Cursors[PLAYER_1] = c["Cursor P1"];
c.Cursors[PLAYER_2] = c["Cursor P2"];
for l in ivalues(Letters) do
local Name = MapLetterToName[l];
assert(Name);
Keys[l] = {
Text = c[Name];
Width = c[Name]:GetWidth();
Height = c[Name]:GetHeight();
};
assert(c[Name], Name);
end;
-- Position letters.
local RowWidths = {};
local fX = 0;
local fXPadding = 4;
local fY = 0;
local iRow = 1;
for l in ivalues(Letters) do
if l == "O" or l == "0" or l == "BACK" then
fX = 0;
fY = fY + 30;
iRow = iRow + 1;
end;
Keys[l].Row = iRow;
Keys[l].Text:x(fX + Keys[l].Width/2);
Keys[l].Text:y(fY + Keys[l].Height/2);
fX = fX + Keys[l].Width;
RowWidths[iRow] = fX;
fX = fX + fXPadding;
end;
for l in ivalues(Letters) do
local iRow = Keys[l].Row;
Keys[l].Text:addx(-RowWidths[iRow]/2);
end;
Keys["BACK"].Text:x(-140);
Keys["ENTER"].Text:x(140);
for pn in ivalues(PlayerNumber) do
local sName = SCREENMAN:GetTopScreen():GetSelection(pn);
local DefaultKey = "A"
if #sName > 0 then
DefaultKey = "ENTER"
end
self:playcommand("SelectKey", { Key = DefaultKey, PlayerNumber = pn });
c.Cursors[pn]:finishtweening();
end
end;
CodeMessageCommand = function(self, param)
local pn = param.PlayerNumber;
if not SCREENMAN:GetTopScreen():GetAnyStillEntering() and param.Name == "Enter" then
if SCREENMAN:GetTopScreen():Finish(pn) then
c.Enter:play();
end
return;
end
if SCREENMAN:GetTopScreen():GetFinalized( pn ) then
return;
end
if param.Name == "Left" or param.Name == "Right" then
local iDir = param.Name == "Left" and -1 or 1;
local idx = LetterIndexes[Selection[pn]];
idx = idx + iDir;
idx = math.mod(idx+#Letters-1, #Letters)+1;
self:playcommand("SelectKey", { Key = Letters[idx], PlayerNumber = pn });
c.Move:playforplayer(pn);
return;
end
if param.Name == "JumpToEnter" then
self:playcommand("SelectKey", { Key = "ENTER", PlayerNumber = pn });
c.Move:playforplayer(pn);
return;
end
if param.Name == "Backspace" then
if SCREENMAN:GetTopScreen():Backspace(pn) then
c.Back:playforplayer(pn);
end
return;
end
if param.Name == "NextRow" or param.Name == "PrevRow" then
local iDir = param.Name == "PrevRow" and -1 or 1;
local idx = LetterIndexes[Selection[pn]];
local iRow = Keys[Selection[pn]].Row;
iRow = iRow + iDir;
iRow = math.mod(iRow+4-1, 4)+1;
local NearestLetter
local NearestLetterDistance
for l in ivalues(Letters) do
if iRow == Keys[l].Row then
local Text = Keys[l].Text;
local fDist = distance( PlayerX[pn], PlayerY[pn],
Text:GetX(), Text:GetY() );
if not NearestLetterDistance or fDist < NearestLetterDistance then
NearestLetterDistance = fDist;
NearestLetter = l;
end
end
end
assert( NearestLetter );
self:playcommand("SelectKey", { Key = NearestLetter, PlayerNumber = pn, NoStore = true });
c.Move:playforplayer(pn);
return;
end
if param.Name == "Enter" then
if Selection[pn] == "BACK" then
if SCREENMAN:GetTopScreen():Backspace(pn) then
Keys[Selection[pn]].Text:playcommand( "Pulse" );
c.Back:playforplayer(pn);
end
elseif Selection[pn] == "ENTER" then
if SCREENMAN:GetTopScreen():Finish(pn) then
Keys[Selection[pn]].Text:playcommand( "Pulse" );
c.Enter:playforplayer(pn);
end
else
local key = Selection[pn]; -- EnterKey may change this
if SCREENMAN:GetTopScreen():EnterKey(pn, key) then
Keys[key].Text:playcommand( "Pulse" );
c.Type:playforplayer(pn);
end
end
end
end;
SelectKeyMessageCommand = function(self, param)
local key = param.Key;
local pn = param.PlayerNumber;
if not Keys[key] then return end
Selection[pn] = key;
c.Cursors[pn]:stoptweening();
c.Cursors[pn]:playcommand( "SetSize", {
Width=Keys[key].Width+6; tween=function(self)
self:stoptweening();
self:linear(0.10);
end;
} );
c.Cursors[pn]:x( Keys[key].Text:GetX() );
c.Cursors[pn]:y( Keys[key].Text:GetY() );
if not param.NoStore then
PlayerX[pn] = Keys[key].Text:GetX();
PlayerY[pn] = Keys[key].Text:GetY();
end
end;
MenuTimerExpiredMessageCommand = function(self, param)
for pn in ivalues(PlayerNumber) do
SCREENMAN:GetTopScreen():Finish(pn);
end
c.Enter:play();
end;
OnCommand = function(self, param)
for key in ivalues(Letters) do
local fDist = distance( Keys[key].Text:GetX(), Keys[key].Text:GetY(), 0, 100 );
local f = function(self)
self:diffusealpha(0);
self:zoom(0);
self:sleep(0.25 + (fDist / 400));
self:decelerate(0.5);
self:diffusealpha(1);
self:zoom(0.8);
end;
f(Keys[key].Text);
end
end;
OffCommand = function(self, param)
for key in ivalues(Letters) do
local fDist = distance( Keys[key].Text:GetX(), Keys[key].Text:GetY(), 0, 100 );
local f = function(self)
self:sleep(0.0 + (fDist / 400));
self:decelerate(0.5);
self:diffusealpha(0);
self:zoom(0);
end;
f(Keys[key].Text);
end
end;
};
@@ -1,17 +1,28 @@
local t = Def.ActorFrame{
LoadActor("noise")..{
Name="Noise";
InitCommand=cmd(Center;texturewrapping,true;SetTextureFiltering,false;zoom,2;diffusealpha,0;);
OnCommand=cmd(linear,1;diffusealpha,1);
};
};
local function Update(self)
local c = self:GetChild("Noise");
local x = math.random();
local y = math.random();
c:customtexturerect(0+x,0+y,2+x,2+y);
end;
t.InitCommand = cmd(SetUpdateFunction,Update);
return t;
local t = Def.ActorFrame{
LoadActor("noise")..{
Name="Noise";
InitCommand=function(self)
self:Center();
self:texturewrapping(true);
self:SetTextureFiltering(false);
self:zoom(2);
self:diffusealpha(0);
end;
OnCommand=function(self)
self:linear(1);
self:diffusealpha(1);
end;
};
};
local function Update(self)
local c = self:GetChild("Noise");
local x = math.random();
local y = math.random();
c:customtexturerect(0+x,0+y,2+x,2+y);
end;
t.InitCommand = function(self)
self:SetUpdateFunction(Update);
end;
return t;
@@ -1,22 +1,33 @@
local x = Def.ActorFrame{
Def.Quad{
InitCommand=cmd(Center;zoomto,SCREEN_WIDTH,80;diffuse,color("0,0,0,0.5"));
OnCommand=cmd();
OffCommand=cmd();
};
LoadFont("Common Normal")..{
Text=ScreenString("Loading Profiles");
InitCommand=cmd(Center;diffuse,color("1,1,1,1");shadowlength,1);
OffCommand=cmd(linear,0.15;diffusealpha,0);
};
};
x[#x+1] = Def.Actor {
BeginCommand=function(self)
if SCREENMAN:GetTopScreen():HaveProfileToLoad() then self:sleep(1); end;
self:queuecommand("Load");
end;
LoadCommand=function() SCREENMAN:GetTopScreen():Continue(); end;
};
local x = Def.ActorFrame{
Def.Quad{
InitCommand=function(self)
self:Center();
self:zoomto(SCREEN_WIDTH, 80);
self:diffuse(color("0,0,0,0.5"));
end;
OnCommand=function(self) end;
OffCommand=function(self) end;
};
LoadFont("Common Normal")..{
Text=ScreenString("Loading Profiles");
InitCommand=function(self)
self:Center();
self:diffuse(color("1,1,1,1"));
self:shadowlength(1);
end;
OffCommand=function(self)
self:linear(0.15);
self:diffusealpha(0);
end;
};
};
x[#x+1] = Def.Actor {
BeginCommand=function(self)
if SCREENMAN:GetTopScreen():HaveProfileToLoad() then self:sleep(1); end;
self:queuecommand("Load");
end;
LoadCommand=function() SCREENMAN:GetTopScreen():Continue(); end;
};
return x;
@@ -1,22 +1,33 @@
local x = Def.ActorFrame{
Def.Quad{
InitCommand=cmd(Center;zoomto,SCREEN_WIDTH,80;diffuse,color("0,0,0,0.5"));
OnCommand=cmd();
OffCommand=cmd();
};
LoadFont("Common Normal")..{
Text=ScreenString("Saving Profiles");
InitCommand=cmd(Center;diffuse,color("1,1,1,1");shadowlength,1);
OffCommand=cmd(linear,0.15;diffusealpha,0);
};
};
x[#x+1] = Def.Actor {
BeginCommand=function(self)
if SCREENMAN:GetTopScreen():HaveProfileToSave() then self:sleep(1); end;
self:queuecommand("Load");
end;
LoadCommand=function() SCREENMAN:GetTopScreen():Continue(); end;
};
local x = Def.ActorFrame{
Def.Quad{
InitCommand=function(self)
self:Center();
self:zoomto(SCREEN_WIDTH, 80);
self:diffuse(color("0,0,0,0.5"));
end;
OnCommand=function(self) end;
OffCommand=function(self) end;
};
LoadFont("Common Normal")..{
Text=ScreenString("Saving Profiles");
InitCommand=function(self)
self:Center();
self:diffuse(color("1,1,1,1"));
self:shadowlength(1);
end;
OffCommand=function(self)
self:linear(0.15);
self:diffusealpha(0);
end;
};
};
x[#x+1] = Def.Actor {
BeginCommand=function(self)
if SCREENMAN:GetTopScreen():HaveProfileToSave() then self:sleep(1); end;
self:queuecommand("Load");
end;
LoadCommand=function() SCREENMAN:GetTopScreen():Continue(); end;
};
return x;
@@ -4,16 +4,24 @@ function GetLocalProfiles()
for p = 0,PROFILEMAN:GetNumLocalProfiles()-1 do
local profile=PROFILEMAN:GetLocalProfileFromIndex(p);
local ProfileCard = Def.ActorFrame {
--[[ Def.Quad {
InitCommand=cmd(zoomto,200,1;y,40/2);
OnCommand=cmd(diffuse,Color('Outline'););
}; --]]
LoadFont("Common Normal") .. {
Text=profile:GetDisplayName();
InitCommand=cmd(shadowlength,1;y,-10;zoom,1;ztest,true);
InitCommand=function(self)
self:shadowlength(1);
self:y(-10);
self:zoom(1);
self:ztest(true);
end;
};
LoadFont("Common Normal") .. {
InitCommand=cmd(shadowlength,1;y,8;zoom,0.5;vertspacing,-8;ztest,true);
InitCommand=function(self)
self:shadowlength(1);
self:y(8);
self:zoom(0.5);
self:vertspacing(-8);
self:ztest(true);
end;
BeginCommand=function(self)
local numSongsPlayed = profile:GetNumTotalSongsPlayed();
local s = numSongsPlayed == 1 and "Song" or "Songs";
@@ -31,7 +39,9 @@ end;
function LoadCard(cColor)
local t = Def.ActorFrame {
LoadActor( THEME:GetPathG("ScreenSelectProfile","CardBackground") ) .. {
InitCommand=cmd(diffuse,cColor);
InitCommand=function(self)
self:diffuse(cColor);
end;
};
LoadActor( THEME:GetPathG("ScreenSelectProfile","CardFrame") );
};
@@ -48,18 +58,17 @@ function LoadPlayerStuff(Player)
t[#t+1] = Def.ActorFrame {
Name = 'JoinFrame';
LoadCard(Color('Orange'));
--[[ Def.Quad {
InitCommand=cmd(zoomto,200+4,230+4);
OnCommand=cmd(shadowlength,1;diffuse,color("0,0,0,0.5"));
};
Def.Quad {
InitCommand=cmd(zoomto,200,230);
OnCommand=cmd(diffuse,Color('Orange');diffusealpha,0.5);
}; --]]
LoadFont("Common Normal") .. {
Text="Press &START; to join.";
InitCommand=cmd(shadowlength,1);
OnCommand=cmd(diffuseshift;effectcolor1,Color('White');effectcolor2,color("0.5,0.5,0.5"));
InitCommand=function(self)
self:shadowlength(1);
end;
OnCommand=function(self)
self:diffuseshift();
self:effectcolor1(Color('White'));
self:effectcolor2(color("0.5,0.5,0.5"));
end;
};
};
@@ -69,37 +78,65 @@ function LoadPlayerStuff(Player)
};
t[#t+1] = Def.ActorFrame {
Name = 'SmallFrame';
InitCommand=cmd(y,-2);
InitCommand=function(self)
self:y(-2);
end;
Def.Quad {
InitCommand=cmd(zoomto,200-10,40+2);
OnCommand=cmd(diffuse,Color('Black');diffusealpha,0.5);
InitCommand=function(self)
self:zoomto(200 - 10, 40 + 2);
end;
OnCommand=function(self)
self:diffuse(Color('Black'));
self:diffusealpha(0.5);
end;
};
Def.Quad {
InitCommand=cmd(zoomto,200-10,40);
OnCommand=cmd(diffuse,PlayerColor(Player);fadeleft,0.25;faderight,0.25;glow,color("1,1,1,0.25"));
InitCommand=function(self)
self:zoomto(200 - 10, 40);
end;
OnCommand=function(self)
self:diffuse(PlayerColor(Player));
self:fadeleft(0.25);
self:faderight(0.25);
self:glow(color("1,1,1,0.25"));
end;
};
Def.Quad {
InitCommand=cmd(zoomto,200-10,40;y,-40/2+20);
OnCommand=cmd(diffuse,Color("Black");fadebottom,1;diffusealpha,0.35);
InitCommand=function(self)
self:zoomto(200 - 10, 40);
self:y(-40 / 2 + 20);
end;
OnCommand=function(self)
self:diffuse(Color("Black"));
self:fadebottom(1);
self:diffusealpha(0.35);
end;
};
Def.Quad {
InitCommand=cmd(zoomto,200-10,1;y,-40/2+1);
OnCommand=cmd(diffuse,PlayerColor(Player);glow,color("1,1,1,0.25"));
InitCommand=function(self)
self:zoomto(200 - 10, 1);
self:y(-40 / 2 + 1);
end;
OnCommand=function(self)
self:diffuse(PlayerColor(Player));
self:glow(color("1,1,1,0.25"));
end;
};
};
t[#t+1] = Def.ActorScroller{
Name = 'Scroller';
NumItemsToDraw=6;
-- InitCommand=cmd(y,-230/2+20;);
OnCommand=cmd(y,1;SetFastCatchup,true;SetMask,200,58;SetSecondsPerItem,0.15);
OnCommand=function(self)
self:y(1);
self:SetFastCatchup(true);
self:SetMask(200, 58);
self:SetSecondsPerItem(0.15);
end;
TransformFunction=function(self, offset, itemIndex, numItems)
local focus = scale(math.abs(offset),0,2,1,0);
self:visible(false);
self:y(math.floor( offset*40 ));
-- self:zoomy( focus );
-- self:z(-math.abs(offset));
-- self:zoom(focus);
end;
children = GetLocalProfiles();
};
@@ -109,8 +146,10 @@ function LoadPlayerStuff(Player)
};
t[#t+1] = LoadFont("Common Normal") .. {
Name = 'SelectedProfileText';
--InitCommand=cmd(y,160;shadowlength,1;diffuse,PlayerColor(Player));
InitCommand=cmd(y,160;shadowlength,1;);
InitCommand=function(self)
self:y(160);
self:shadowlength(1);
end;
};
return t;
@@ -233,37 +272,67 @@ local t = Def.ActorFrame {
children = {
Def.ActorFrame {
Name = 'P1Frame';
InitCommand=cmd(x,SCREEN_CENTER_X-160;y,SCREEN_CENTER_Y);
OnCommand=cmd(zoom,0;bounceend,0.35;zoom,1);
OffCommand=cmd(bouncebegin,0.35;zoom,0);
InitCommand=function(self)
self:x(SCREEN_CENTER_X - 160);
self:y(SCREEN_CENTER_Y);
end;
OnCommand=function(self)
self:zoom(0);
self:bounceend(0.35);
self:zoom(1);
end;
OffCommand=function(self)
self:bouncebegin(0.35);
self:zoom(0);
end;
PlayerJoinedMessageCommand=function(self,param)
if param.Player == PLAYER_1 then
(cmd(;zoom,1.15;bounceend,0.175;zoom,1.0;))(self);
self:zoom(1.15);
self:bounceend(0.175);
self:zoom(1.0);
end;
end;
children = LoadPlayerStuff(PLAYER_1);
};
Def.ActorFrame {
Name = 'P2Frame';
InitCommand=cmd(x,SCREEN_CENTER_X+160;y,SCREEN_CENTER_Y);
OnCommand=cmd(zoom,0;bounceend,0.35;zoom,1);
OffCommand=cmd(bouncebegin,0.35;zoom,0);
InitCommand=function(self)
self:x(SCREEN_CENTER_X + 160);
self:y(SCREEN_CENTER_Y);
end;
OnCommand=function(self)
self:zoom(0);
self:bounceend(0.35);
self:zoom(1);
end;
OffCommand=function(self)
self:bouncebegin(0.35);
self:zoom(0);
end;
PlayerJoinedMessageCommand=function(self,param)
if param.Player == PLAYER_2 then
(cmd(zoom,1.15;bounceend,0.175;zoom,1.0;))(self);
self:zoom(1.15);
self:bounceend(0.175);
self:zoom(1.0);
end;
end;
children = LoadPlayerStuff(PLAYER_2);
};
-- sounds
LoadActor( THEME:GetPathS("Common","start") )..{
StartButtonMessageCommand=cmd(play);
StartButtonMessageCommand=function(self)
self:play();
end;
};
LoadActor( THEME:GetPathS("Common","cancel") )..{
BackButtonMessageCommand=cmd(play);
BackButtonMessageCommand=function(self)
self:play();
end;
};
LoadActor( THEME:GetPathS("Common","value") )..{
DirectionButtonMessageCommand=cmd(play);
DirectionButtonMessageCommand=function(self)
self:play();
end;
};
};
};
@@ -1,90 +1,89 @@
local function CreditsText( pn )
local text = LoadFont(Var "LoadingScreen","credits") .. {
InitCommand=function(self)
self:name("Credits" .. PlayerNumberToString(pn))
ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen");
end;
UpdateTextCommand=function(self)
local str = ScreenSystemLayerHelpers.GetCreditsMessage(pn);
self:settext(str);
end;
UpdateVisibleCommand=function(self)
local screen = SCREENMAN:GetTopScreen();
local bShow = true;
if screen then
local sClass = screen:GetName();
bShow = THEME:GetMetric( sClass, "ShowCreditDisplay" );
end
self:visible( bShow );
end
};
return text;
end;
--[[ local function PlayerPane( PlayerNumber )
local t = Def.ActorFrame {
InitCommand=function(self)
self:name("PlayerPane" .. PlayerNumberToString(PlayerNumber));
-- ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen");
end
};
t[#t+1] = Def.ActorFrame {
Name = "Background";
Def.Quad {
InitCommand=cmd(zoomto,160,28;queuecommand,"On");
OnCommand=cmd(diffuse,PlayerColor(PlayerNumber);fadebottom,1);
};
};
t[#t+1] = LoadFont("Common","Normal") .. {
Name = "PlayerText";
InitCommand=cmd(x,-60;maxwidth,80/0.5;zoom,0.5;queuecommand,"On");
OnCommand=cmd(playcommand,"Set");
SetCommand=function(self)
local profile = PROFILEMAN:GetProfile( PlayerNumber) or PROFILEMAN:GetMachineProfile()
if profile then
self:settext( profile:GetDisplayName() );
else
self:settext( "NoProf" );
end
end;
};
return t
end --]]
--
local t = Def.ActorFrame {}
-- Aux
t[#t+1] = LoadActor(THEME:GetPathB("ScreenSystemLayer","aux"));
-- Credits
t[#t+1] = Def.ActorFrame {
--[[ PlayerPane( PLAYER_1 ) .. {
InitCommand=cmd(x,scale(0.125,0,1,SCREEN_LEFT,SCREEN_WIDTH);y,SCREEN_BOTTOM-16)
}; --]]
CreditsText( PLAYER_1 );
CreditsText( PLAYER_2 );
};
-- Text
t[#t+1] = Def.ActorFrame {
Def.Quad {
InitCommand=cmd(zoomtowidth,SCREEN_WIDTH;zoomtoheight,30;horizalign,left;vertalign,top;y,SCREEN_TOP;diffuse,color("0,0,0,0"));
OnCommand=cmd(finishtweening;diffusealpha,0.85;);
OffCommand=cmd(sleep,3;linear,0.5;diffusealpha,0;);
};
LoadFont("Common","Normal") .. {
Name="Text";
InitCommand=cmd(maxwidth,750;horizalign,left;vertalign,top;y,SCREEN_TOP+10;x,SCREEN_LEFT+10;shadowlength,1;diffusealpha,0;);
OnCommand=cmd(finishtweening;diffusealpha,1;zoom,0.5);
OffCommand=cmd(sleep,3;linear,0.5;diffusealpha,0;);
};
SystemMessageMessageCommand = function(self, params)
self:GetChild("Text"):settext( params.Message );
self:playcommand( "On" );
if params.NoAnimate then
self:finishtweening();
end
self:playcommand( "Off" );
end;
HideSystemMessageMessageCommand = cmd(finishtweening);
};
return t;
local function CreditsText( pn )
local text = LoadFont(Var "LoadingScreen","credits") .. {
InitCommand=function(self)
self:name("Credits" .. PlayerNumberToString(pn))
ActorUtil.LoadAllCommandsAndSetXY(self,Var "LoadingScreen");
end;
UpdateTextCommand=function(self)
local str = ScreenSystemLayerHelpers.GetCreditsMessage(pn);
self:settext(str);
end;
UpdateVisibleCommand=function(self)
local screen = SCREENMAN:GetTopScreen();
local bShow = true;
if screen then
local sClass = screen:GetName();
bShow = THEME:GetMetric( sClass, "ShowCreditDisplay" );
end
self:visible( bShow );
end
};
return text;
end;
--
local t = Def.ActorFrame {}
-- Aux
t[#t+1] = LoadActor(THEME:GetPathB("ScreenSystemLayer","aux"));
-- Credits
t[#t+1] = Def.ActorFrame {
CreditsText( PLAYER_1 );
CreditsText( PLAYER_2 );
};
-- Text
t[#t+1] = Def.ActorFrame {
Def.Quad {
InitCommand=function(self)
self:zoomtowidth(SCREEN_WIDTH);
self:zoomtoheight(30);
self:horizalign(left);
self:vertalign(top);
self:y(SCREEN_TOP);
self:diffuse(color("0,0,0,0"));
end;
OnCommand=function(self)
self:finishtweening();
self:diffusealpha(0.85);
end;
OffCommand=function(self)
self:sleep(3);
self:linear(0.5);
self:diffusealpha(0);
end;
};
LoadFont("Common","Normal") .. {
Name="Text";
InitCommand=function(self)
self:maxwidth(750);
self:horizalign(left);
self:vertalign(top);
self:y(SCREEN_TOP + 10);
self:x(SCREEN_LEFT + 10);
self:shadowlength(1);
self:diffusealpha(0);
end;
OnCommand=function(self)
self:finishtweening();
self:diffusealpha(1);
self:zoom(0.5);
end;
OffCommand=function(self)
self:sleep(3);
self:linear(0.5);
self:diffusealpha(0);
end;
};
SystemMessageMessageCommand = function(self, params)
self:GetChild("Text"):settext( params.Message );
self:playcommand( "On" );
if params.NoAnimate then
self:finishtweening();
end
self:playcommand( "Off" );
end;
HideSystemMessageMessageCommand = function(self)
self:finishtweening();
end;
};
return t;
@@ -1,14 +1,22 @@
return Def.ActorFrame {
--Def.ControllerStateDisplay {
-- InitCommand=cmd(LoadGameController,
--};
Def.DeviceList {
Font="Common normal";
InitCommand=cmd(x,SCREEN_LEFT+20;y,SCREEN_TOP+80;zoom,0.8;halign,0);
InitCommand=function(self)
self:x(SCREEN_LEFT + 20);
self:y(SCREEN_TOP + 80);
self:zoom(0.8);
self:halign(0);
end;
};
Def.InputList {
Font="Common normal";
InitCommand=cmd(x,SCREEN_CENTER_X-250;y,SCREEN_CENTER_Y;zoom,1;halign,0;vertspacing,8);
InitCommand=function(self)
self:x(SCREEN_CENTER_X - 250);
self:y(SCREEN_CENTER_Y);
self:zoom(1);
self:halign(0);
self:vertspacing(8);
end;
};
};
@@ -1,12 +1,32 @@
local File, Width = ...
assert( File );
assert( Width );
local FullFile = THEME:GetPathB('','_frame files 3x1/'..File )
local Frame = LoadActor( FullFile )
return Def.ActorFrame {
Frame .. { InitCommand=cmd(setstate,0;pause;horizalign,right;x,-Width/2) };
Frame .. { InitCommand=cmd(setstate,1;pause;zoomtowidth,Width) };
Frame .. { InitCommand=cmd(setstate,2;pause;horizalign,left;x,Width/2) };
};
local File, Width = ...
assert( File );
assert( Width );
local FullFile = THEME:GetPathB('','_frame files 3x1/'..File )
local Frame = LoadActor( FullFile )
return Def.ActorFrame {
Frame .. {
InitCommand=function(self)
self:setstate(0);
self:pause();
self:horizalign(right);
self:x(-Width / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(1);
self:pause();
self:zoomtowidth(Width);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(2);
self:pause();
self:horizalign(left);
self:x(Width / 2);
end;
};
};
@@ -1,18 +1,95 @@
local File, Width, Height = ...
assert( File );
assert( Width );
assert( Height );
local FullFile = THEME:GetPathB('','_frame files 3x3/'..File )
local Frame = LoadActor( FullFile )
return Def.ActorFrame {
Frame .. { InitCommand=cmd(setstate,0;pause;horizalign,right;vertalign,bottom;x,-Width/2;y,-Height/2) };
Frame .. { InitCommand=cmd(setstate,1;pause;zoomtowidth,Width;vertalign,bottom;zoomtowidth,Width;y,-Height/2) };
Frame .. { InitCommand=cmd(setstate,2;pause;horizalign,left;vertalign,bottom;x,Width/2;y,-Height/2) };
Frame .. { InitCommand=cmd(setstate,3;pause;horizalign,right;x,-Width/2;zoomtoheight,Height) };
Frame .. { InitCommand=cmd(setstate,4;pause;zoomtowidth,Width;zoomtoheight,Height) };
Frame .. { InitCommand=cmd(setstate,5;pause;horizalign,left;x,Width/2;zoomtoheight,Height) };
Frame .. { InitCommand=cmd(setstate,6;pause;horizalign,right;vertalign,top;x,-Width/2;y,Height/2) };
Frame .. { InitCommand=cmd(setstate,7;pause;zoomtowidth,Width;vertalign,top;zoomtowidth,Width;y,Height/2) };
Frame .. { InitCommand=cmd(setstate,8;pause;horizalign,left;vertalign,top;x,Width/2;y,Height/2) };
};
local File, Width, Height = ...
assert( File );
assert( Width );
assert( Height );
local FullFile = THEME:GetPathB('','_frame files 3x3/'..File )
local Frame = LoadActor( FullFile )
return Def.ActorFrame {
Frame .. {
InitCommand=function(self)
self:setstate(0);
self:pause();
self:horizalign(right);
self:vertalign(bottom);
self:x(-Width / 2);
self:y(-Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(1);
self:pause();
self:zoomtowidth(Width);
self:vertalign(bottom);
self:zoomtowidth(Width);
self:y(-Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(2);
self:pause();
self:horizalign(left);
self:vertalign(bottom);
self:x(Width / 2);
self:y(-Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(3);
self:pause();
self:horizalign(right);
self:x(-Width / 2);
self:zoomtoheight(Height);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(4);
self:pause();
self:zoomtowidth(Width);
self:zoomtoheight(Height);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(5);
self:pause();
self:horizalign(left);
self:x(Width / 2);
self:zoomtoheight(Height);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(6);
self:pause();
self:horizalign(right);
self:vertalign(top);
self:x(-Width / 2);
self:y(Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(7);
self:pause();
self:zoomtowidth(Width);
self:vertalign(top);
self:zoomtowidth(Width);
self:y(Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(8);
self:pause();
self:horizalign(left);
self:vertalign(top);
self:x(Width / 2);
self:y(Height / 2);
end;
};
};
+6 -6
View File
@@ -1,6 +1,6 @@
local waitTime = ...
-- default to 1 second if parameter is missing
if not waitTime then waitTime = 1 end
return Def.Actor{ OnCommand=cmd(sleep,waitTime); };
local waitTime = ...
-- default to 1 second if parameter is missing
if not waitTime then waitTime = 1 end
return Def.Actor{ OnCommand=function(self) self:sleep(waitTime); end; };
@@ -1,3 +1,6 @@
return Def.Quad{
InitCommand=cmd(zoomto,4,22;diffuse,color("#AABBDD"));
InitCommand=function(self)
self:zoomto(4, 22);
self:diffuse(color("#AABBDD"));
end;
};
+10 -2
View File
@@ -1,8 +1,16 @@
return Def.ActorFrame {
Def.Quad {
InitCommand=cmd(zoomto,10,10;y,-5;skewx,-1);
InitCommand=function(self)
self:zoomto(10, 10);
self:y(-5);
self:skewx(-1);
end;
};
Def.Quad {
InitCommand=cmd(zoomto,10,10;y,5;skewx,1);
InitCommand=function(self)
self:zoomto(10, 10);
self:y(5);
self:skewx(1);
end;
};
}
+10 -2
View File
@@ -1,8 +1,16 @@
return Def.ActorFrame {
Def.Quad {
InitCommand=cmd(zoomto,10,10;y,-5;skewx,1);
InitCommand=function(self)
self:zoomto(10, 10);
self:y(-5);
self:skewx(1);
end;
};
Def.Quad {
InitCommand=cmd(zoomto,10,10;y,5;skewx,-1);
InitCommand=function(self)
self:zoomto(10, 10);
self:y(5);
self:skewx(-1);
end;
};
}
@@ -12,7 +12,9 @@ local LabelMinZoom = THEME:GetMetric("Combo", "LabelMinZoom");
local LabelMaxZoom = THEME:GetMetric("Combo", "LabelMaxZoom");
local t = Def.ActorFrame {
InitCommand=cmd(vertalign,bottom);
InitCommand=function(self)
self:vertalign(bottom);
end;
LoadFont( "Combo", "numbers" ) .. {
Name="Number";
OnCommand = THEME:GetMetric("Combo", "NumberOnCommand");
@@ -39,11 +41,14 @@ local t = Def.ActorFrame {
return
end; --]]
TwentyFiveMilestoneCommand=function(self,parent)
(cmd(skewy,-0.125;decelerate,0.325;skewy,0))(self);
self:skewy(-0.125);
self:decelerate(0.325);
self:skewy(0);
end;
ToastyAchievedMessageCommand=function(self,params)
if params.PlayerNumber == player then
(cmd(thump,2;effectclock,'beat'))(self);
self:thump(2);
self:effectclock('beat');
end;
end;
ComboCommand=function(self, param)
@@ -88,26 +93,19 @@ local t = Def.ActorFrame {
c.Number:diffuse(Color("White"));
-- c.Number:diffuse(PlayerColor(player));
c.Number:stopeffect();
(cmd(diffuse,Color("White");diffusebottomedge,color("0.5,0.5,0.5,1")))(c.Label);
c.Label.diffuse(Color("White"));
c.Label.diffusebottomedge(color("0.5,0.5,0.5,1"));
else
c.Number:diffuse(color("#ff0000"));
c.Number:stopeffect();
(cmd(diffuse,Color("Red");diffusebottomedge,color("0.5,0,0,1")))(c.Label);
c.Label.diffuse(Color("Red"));
c.Label.diffusebottomedge(color("0.5,0,0,1"));
end
-- Pulse
Pulse( c.Number, param );
PulseLabel( c.Label, param );
-- Milestone Logic
end;
--[[ ScoreChangedMessageCommand=function(self,param)
local iToastyCombo = param.ToastyCombo;
if iToastyCombo and (iToastyCombo > 0) then
-- (cmd(thump;effectmagnitude,1,1.2,1;effectclock,'beat'))(c.Number)
-- (cmd(thump;effectmagnitude,1,1.2,1;effectclock,'beat'))(c.Number)
else
-- c.Number:stopeffect();
end;
end; --]]
};
return t;
@@ -31,16 +31,29 @@ local t = Def.ActorFrame {};
t[#t+1] = Def.ActorFrame {
LoadActor(THEME:GetPathG("Judgment","Normal")) .. {
Name="Judgment";
InitCommand=cmd(pause;visible,false);
InitCommand=function(self)
self:pause();
self:visible(false);
end;
OnCommand=THEME:GetMetric("Judgment","JudgmentOnCommand");
ResetCommand=cmd(finishtweening;stopeffect;visible,false);
ResetCommand=function(self)
self:finishtweening();
self:stopeffect();
self:visible(false);
end;
};
LoadFont("Common Normal") .. {
Name="ProtimingDisplay";
Text="";
InitCommand=cmd(visible,false);
InitCommand=function(self)
self:visible(false);
end;
OnCommand=THEME:GetMetric("Protiming","ProtimingOnCommand");
ResetCommand=cmd(finishtweening;stopeffect;visible,false);
ResetCommand=function(self)
self:finishtweening();
self:stopeffect();
self:visible(false);
end;
};
InitCommand = function(self)
@@ -1,10 +1,32 @@
return LoadFont("Common Normal") .. {
Text="Exit";
InitCommand=cmd(x,SCREEN_CENTER_X;zoom,0.75;shadowlength,0;diffuse,color("#808080"));
OnCommand=cmd(diffusealpha,0;decelerate,0.5;diffusealpha,1);
OffCommand=cmd(stoptweening;accelerate,0.3;diffusealpha,0;queuecommand,"Hide");
HideCommand=cmd(visible,false);
GainFocusCommand=cmd(diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF"));
LoseFocusCommand=cmd(stopeffect);
};
return LoadFont("Common Normal") .. {
Text="Exit";
InitCommand=function(self)
self:x(SCREEN_CENTER_X);
self:zoom(0.75);
self:shadowlength(0);
self:diffuse(color("#808080"));
end;
OnCommand=function(self)
self:diffusealpha(0);
self:decelerate(0.5);
self:diffusealpha(1);
end;
OffCommand=function(self)
self:stoptweening();
self:accelerate(0.3);
self:diffusealpha(0);
self:queuecommand("Hide");
end;
HideCommand=function(self)
self:visible(false);
end;
GainFocusCommand=function(self)
self:diffuseshift();
self:effectcolor2(color("#808080"));
self:effectcolor1(color("#FFFFFF"));
end;
LoseFocusCommand=function(self)
self:stopeffect();
end;
};
@@ -1,3 +1,6 @@
return Def.Quad{
InitCommand=cmd(setsize,96,28;diffuse,color("#44CCFFCC"););
InitCommand=function(self)
self:setsize(96, 28);
self:diffuse(color("#44CCFFCC"));
end;
};
@@ -6,6 +6,10 @@ t[#t+1] = LoadFont("Common Normal") .. {
Text=gc:GetName();
};
t.GainFocusCommand=cmd(visible,true);
t.LoseFocusCommand=cmd(visible,false);
t.GainFocusCommand=function(self)
self:visible(true);
end;
t.LoseFocusCommand=function(self)
self:visible(false);
end;
return t;
@@ -2,7 +2,9 @@ local t = Def.ActorFrame {};
t[#t+1] = Def.ActorFrame {
Def.Quad {
InitCommand=cmd(zoomto,32,32);
InitCommand=function(self)
self:zoomto(32, 32);
end;
};
};
@@ -6,7 +6,27 @@ local FullFile = THEME:GetPathG('','_frame files 3x1/'..File )
local Frame = LoadActor( FullFile )
return Def.ActorFrame {
Frame .. { InitCommand=cmd(setstate,0;pause;horizalign,right;x,-Width/2) };
Frame .. { InitCommand=cmd(setstate,1;pause;zoomtowidth,Width) };
Frame .. { InitCommand=cmd(setstate,2;pause;horizalign,left;x,Width/2) };
Frame .. {
InitCommand=function(self)
self:setstate(0);
self:pause();
self:horizalign(right);
self:x(-Width / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(1);
self:pause();
self:zoomtowidth(Width);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(2);
self:pause();
self:horizalign(left);
self:x(Width / 2);
end;
};
};
@@ -6,13 +6,90 @@ assert( Height );
local FullFile = THEME:GetPathG('','_frame files 3x3/'..File )
local Frame = LoadActor( FullFile )
return Def.ActorFrame {
Frame .. { InitCommand=cmd(setstate,0;pause;horizalign,right;vertalign,bottom;x,-Width/2;y,-Height/2) };
Frame .. { InitCommand=cmd(setstate,1;pause;zoomtowidth,Width;vertalign,bottom;zoomtowidth,Width;y,-Height/2) };
Frame .. { InitCommand=cmd(setstate,2;pause;horizalign,left;vertalign,bottom;x,Width/2;y,-Height/2) };
Frame .. { InitCommand=cmd(setstate,3;pause;horizalign,right;x,-Width/2;zoomtoheight,Height) };
Frame .. { InitCommand=cmd(setstate,4;pause;zoomtowidth,Width;zoomtoheight,Height) };
Frame .. { InitCommand=cmd(setstate,5;pause;horizalign,left;x,Width/2;zoomtoheight,Height) };
Frame .. { InitCommand=cmd(setstate,6;pause;horizalign,right;vertalign,top;x,-Width/2;y,Height/2) };
Frame .. { InitCommand=cmd(setstate,7;pause;zoomtowidth,Width;vertalign,top;zoomtowidth,Width;y,Height/2) };
Frame .. { InitCommand=cmd(setstate,8;pause;horizalign,left;vertalign,top;x,Width/2;y,Height/2) };
Frame .. {
InitCommand=function(self)
self:setstate(0);
self:pause();
self:horizalign(right);
self:vertalign(bottom);
self:x(-Width / 2);
self:y(-Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(1);
self:pause();
self:zoomtowidth(Width);
self:vertalign(bottom);
self:zoomtowidth(Width);
self:y(-Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(2);
self:pause();
self:horizalign(left);
self:vertalign(bottom);
self:x(Width / 2);
self:y(-Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(3);
self:pause();
self:horizalign(right);
self:x(-Width / 2);
self:zoomtoheight(Height);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(4);
self:pause();
self:zoomtowidth(Width);
self:zoomtoheight(Height);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(5);
self:pause();
self:horizalign(left);
self:x(Width / 2);
self:zoomtoheight(Height);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(6);
self:pause();
self:horizalign(right);
self:vertalign(top);
self:x(-Width / 2);
self:y(Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(7);
self:pause();
self:zoomtowidth(Width);
self:vertalign(top);
self:zoomtowidth(Width);
self:y(Height / 2);
end;
};
Frame .. {
InitCommand=function(self)
self:setstate(8);
self:pause();
self:horizalign(left);
self:vertalign(top);
self:x(Width / 2);
self:y(Height / 2);
end;
};
};
+58 -58
View File
@@ -1,58 +1,58 @@
-- This file is always executed first.
-- Override Lua's upper and lower functions with our own, which is always UTF-8.
if Uppercase then
string.upper = Uppercase
string.lower = Lowercase
Uppercase = nil -- don't use directly
Lowercase = nil -- don't use directly
end
Trace = lua.Trace
Warn = lua.Warn
print = Trace
-- Use MersenneTwister in place of math.random and math.randomseed.
if MersenneTwister then
math.random = MersenneTwister.Random
math.randomseed = MersenneTwister.Seed
end
PLAYER_1 = "PlayerNumber_P1"
PLAYER_2 = "PlayerNumber_P2"
NUM_PLAYERS = #PlayerNumber
OtherPlayer = { [PLAYER_1] = PLAYER_2, [PLAYER_2] = PLAYER_1 }
function string:find_last(text)
local LastPos = 0
while true do
local p = string.find(self, text, LastPos+1, true)
if not p then
return LastPos
end
LastPos = p
end
end
-- (c) 2006 Glenn Maynard
-- All rights reserved.
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
-- without limitation the rights to use, copy, modify, merge, publish,
-- distribute, and/or sell copies of the Software, and to permit persons to
-- whom the Software is furnished to do so, provided that the above
-- copyright notice(s) and this permission notice appear in all copies of
-- the Software and that both the above copyright notice(s) and this
-- permission notice appear in supporting documentation.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
-- THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
-- INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
-- OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
-- This file is always executed first.
-- Override Lua's upper and lower functions with our own, which is always UTF-8.
if Uppercase then
string.upper = Uppercase
string.lower = Lowercase
Uppercase = nil -- don't use directly
Lowercase = nil -- don't use directly
end
Trace = lua.Trace
Warn = lua.Warn
print = Trace
-- Use MersenneTwister in place of math.random and math.randomseed.
if MersenneTwister then
math.random = MersenneTwister.Random
math.randomseed = MersenneTwister.Seed
end
PLAYER_1 = "PlayerNumber_P1"
PLAYER_2 = "PlayerNumber_P2"
NUM_PLAYERS = #PlayerNumber
OtherPlayer = { [PLAYER_1] = PLAYER_2, [PLAYER_2] = PLAYER_1 }
function string:find_last(text)
local LastPos = 0
while true do
local p = string.find(self, text, LastPos+1, true)
if not p then
return LastPos
end
LastPos = p
end
end
-- (c) 2006 Glenn Maynard
-- All rights reserved.
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
-- without limitation the rights to use, copy, modify, merge, publish,
-- distribute, and/or sell copies of the Software, and to permit persons to
-- whom the Software is furnished to do so, provided that the above
-- copyright notice(s) and this permission notice appear in all copies of
-- the Software and that both the above copyright notice(s) and this
-- permission notice appear in supporting documentation.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
-- THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
-- INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
-- OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
+98 -92
View File
@@ -1,92 +1,98 @@
function Sprite:LoadFromSongBanner(song)
if song then
local Path = song:GetBannerPath()
if not Path then
Path = THEME:GetPathG("Common","fallback banner")
end
self:LoadBanner( Path )
else
self:LoadBanner( THEME:GetPathG("Common","fallback banner") )
end
end
function Sprite:LoadFromSongBackground(song)
local Path = song:GetBackgroundPath()
if not Path then
Path = THEME:GetPathG("Common","fallback background")
end
self:LoadBackground( Path )
end
function LoadSongBackground()
return Def.Sprite {
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y),
BeginCommand=cmd(LoadFromSongBackground,GAMESTATE:GetCurrentSong();scale_or_crop_background)
}
end
function Sprite:LoadFromCurrentSongBackground()
local song = GAMESTATE:GetCurrentSong()
if not song then
local trail = GAMESTATE:GetCurrentTrail(GAMESTATE:GetMasterPlayerNumber())
local e = trail:GetTrailEntries()
if #e > 0 then
song = e[1]:GetSong()
end
end
if not song then return end
self:LoadFromSongBackground(song)
end
function Sprite:position( f )
self:GetTexture():position( f )
end
function Sprite:loop( f )
self:GetTexture():loop( f )
end
function Sprite:rate( f )
self:GetTexture():rate( f )
end
function Sprite.LinearFrames(NumFrames, Seconds)
local Frames = {}
for i = 0,NumFrames-1 do
Frames[#Frames+1] = {
Frame = i,
Delay = (1/NumFrames)*Seconds
}
end
return Frames
end
-- command aliases:
function Sprite:cropto(w,h) self:CropTo(w,h) end
-- (c) 2005 Glenn Maynard
-- All rights reserved.
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
-- without limitation the rights to use, copy, modify, merge, publish,
-- distribute, and/or sell copies of the Software, and to permit persons to
-- whom the Software is furnished to do so, provided that the above
-- copyright notice(s) and this permission notice appear in all copies of
-- the Software and that both the above copyright notice(s) and this
-- permission notice appear in supporting documentation.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
-- THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
-- INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
-- OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
function Sprite:LoadFromSongBanner(song)
if song then
local Path = song:GetBannerPath()
if not Path then
Path = THEME:GetPathG("Common","fallback banner")
end
self:LoadBanner( Path )
else
self:LoadBanner( THEME:GetPathG("Common","fallback banner") )
end
end
function Sprite:LoadFromSongBackground(song)
local Path = song:GetBackgroundPath()
if not Path then
Path = THEME:GetPathG("Common","fallback background")
end
self:LoadBackground( Path )
end
function LoadSongBackground()
return Def.Sprite {
InitCommand=function(self)
self:x(SCREEN_CENTER_X);
self:y(SCREEN_CENTER_Y);
end;
BeginCommand=function(self)
self:LoadFromSongBackground(GAMESTATE:GetCurrentSong());
self:scale_or_crop_background();
end;
}
end
function Sprite:LoadFromCurrentSongBackground()
local song = GAMESTATE:GetCurrentSong()
if not song then
local trail = GAMESTATE:GetCurrentTrail(GAMESTATE:GetMasterPlayerNumber())
local e = trail:GetTrailEntries()
if #e > 0 then
song = e[1]:GetSong()
end
end
if not song then return end
self:LoadFromSongBackground(song)
end
function Sprite:position( f )
self:GetTexture():position( f )
end
function Sprite:loop( f )
self:GetTexture():loop( f )
end
function Sprite:rate( f )
self:GetTexture():rate( f )
end
function Sprite.LinearFrames(NumFrames, Seconds)
local Frames = {}
for i = 0,NumFrames-1 do
Frames[#Frames+1] = {
Frame = i,
Delay = (1/NumFrames)*Seconds
}
end
return Frames
end
-- command aliases:
function Sprite:cropto(w,h) self:CropTo(w,h) end
-- (c) 2005 Glenn Maynard
-- All rights reserved.
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
-- without limitation the rights to use, copy, modify, merge, publish,
-- distribute, and/or sell copies of the Software, and to permit persons to
-- whom the Software is furnished to do so, provided that the above
-- copyright notice(s) and this permission notice appear in all copies of
-- the Software and that both the above copyright notice(s) and this
-- permission notice appear in supporting documentation.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
-- THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
-- INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
-- OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
+11 -2
View File
@@ -23,8 +23,17 @@ Library = {
local t = Def.ActorFrame {
Name="Radar";
Def.GrooveRadar {
OnCommand=cmd(zoom,0;sleep,0.583;decelerate,0.150;zoom,1);
OffCommand=cmd(sleep,0.183;decelerate,0.167;zoom,0);
OnCommand=function(self)
self:zoom(0);
self:sleep(0.583);
self:decelerate(0.150);
self:zoom(1);
end;
OffCommand=function(self)
self:sleep(0.183);
self:decelerate(0.167);
self:zoom(0);
end;
CurrentSongChangedMessageCommand=function(self)
for pn in ivalues(GAMESTATE:GetHumanPlayers()) do
radarSet(self, pn);