it's a shame I have to use this, but its for the better really
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#COURSE:Jupiter;
|
||||
#SCRIPTER:Midiman;
|
||||
|
||||
#GAINSECONDS:120;
|
||||
#SONG:*:Hard;
|
||||
|
||||
#GAINSECONDS:25;
|
||||
#SONG:*:Hard;
|
||||
@@ -0,0 +1,284 @@
|
||||
function MakeScoreList(StagesAgo)
|
||||
local c;
|
||||
local Stats;
|
||||
local PlayerStats = { }
|
||||
local children = {
|
||||
LoadActor( "difficulty cap 9x1" ) .. {
|
||||
Name="DifficultyP1";
|
||||
InitCommand = cmd(x,-66;pause;halign,1);
|
||||
OnCommand=cmd(zoomx,0;sleep,0.3;bounceend,0.3;zoomx,1);
|
||||
OffCommand=cmd(bouncebegin,0.1;zoomx,0);
|
||||
};
|
||||
LoadActor( "difficulty cap 9x1" ) .. {
|
||||
Name="DifficultyP2";
|
||||
InitCommand = cmd(x,66;pause;halign,1;zoomx,0);
|
||||
OnCommand=cmd(zoomx,0;sleep,0.3;bounceend,0.3;zoomx,-1);
|
||||
OffCommand=cmd(bouncebegin,0.1;zoomx,0);
|
||||
};
|
||||
LoadActor( "banner mask" ) .. {
|
||||
Name="BannerMask";
|
||||
InitCommand=cmd(clearzbuffer,true;zwrite,true;blend,"BlendMode_NoEffect");
|
||||
OnCommand=cmd(zoom,0;bounceend,0.3;zoom,1);
|
||||
OffCommand=cmd(bouncebegin,0.3;zoom,0);
|
||||
};
|
||||
Def.Sprite {
|
||||
Name = "Banner";
|
||||
InitCommand = cmd(setsize,300,100;zoom,0.5;ztest,true);
|
||||
OnCommand=cmd(zoom,0;bounceend,0.3;zoom,0.5);
|
||||
OffCommand=cmd(bouncebegin,0.3;zoom,0);
|
||||
};
|
||||
LoadActor( "banner frame" ) .. {
|
||||
Name="BannerFrame";
|
||||
OnCommand=cmd(zoom,0;bounceend,0.3;zoom,1);
|
||||
OffCommand=cmd(bouncebegin,0.3;zoom,0);
|
||||
};
|
||||
|
||||
LoadActor( "side score frame" ) .. {
|
||||
Name="ScoreFrameP1";
|
||||
InitCommand=cmd();
|
||||
OnCommand=cmd(x,-266;addx,-250;diffusealpha,1;decelerate,0.3;addx,250);
|
||||
OffCommand=cmd(linear,0.3;addx,-150;diffusealpha,0);
|
||||
};
|
||||
LoadActor( "side score frame" ) .. {
|
||||
Name="ScoreFrameP2";
|
||||
InitCommand=cmd(zoomx,-1);
|
||||
OnCommand=cmd(x,266;addx,250;diffusealpha,1;decelerate,0.3;addx,-250);
|
||||
OffCommand=cmd(linear,0.3;addx,150;diffusealpha,0);
|
||||
};
|
||||
|
||||
LoadFont( "_regra bold 30px" ) .. {
|
||||
Name="PlayerScoreP1";
|
||||
InitCommand=cmd(x,-135;diffuse,color("#fdf991");shadowlength,0;zoom,0.6);
|
||||
OnCommand=cmd(x,-135;addx,50;zoom,0;diffusealpha,0;sleep,0.1;accelerate,0.3;addx,-50;diffusealpha,1;zoom,0.6);
|
||||
OffCommand=cmd(linear,0.3;diffusealpha,0);
|
||||
};
|
||||
LoadFont( "_regra bold 30px" ) .. {
|
||||
Name="PlayerScoreP2";
|
||||
InitCommand=cmd(x,135;diffuse,color("#abfe8e");shadowlength,0;zoom,0.6);
|
||||
OnCommand=cmd(x,135;addx,-50;zoom,0;diffusealpha,0;sleep,0.1;accelerate,0.3;addx,50;diffusealpha,1;zoom,0.6);
|
||||
OffCommand=cmd(linear,0.3;diffusealpha,0);
|
||||
};
|
||||
|
||||
LoadFont( "_regra bold 30px" ) .. {
|
||||
Name="MachineBestP1";
|
||||
InitCommand=cmd(diffuse,color("#ffffff");shadowlength,0;zoom,0.5);
|
||||
OnCommand=cmd(x,-250;addx,-250;diffusealpha,1;decelerate,0.3;addx,250);
|
||||
OffCommand=cmd(linear,0.3;addx,-150;diffusealpha,0);
|
||||
};
|
||||
LoadFont( "_regra bold 30px" ) .. {
|
||||
Name="MachineBestP2";
|
||||
InitCommand=cmd(diffuse,color("#ffffff");shadowlength,0;zoom,0.5);
|
||||
OnCommand=cmd(x,250;addx,250;diffusealpha,1;decelerate,0.3;addx,-250);
|
||||
OffCommand=cmd(linear,0.3;addx,150;diffusealpha,0);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
return Def.ActorFrame {
|
||||
children = children;
|
||||
InitCommand = function(self)
|
||||
c = self:GetChildren();
|
||||
c.PlayerScore = {};
|
||||
c.PlayerScore[PLAYER_1] = c.PlayerScoreP1;
|
||||
c.PlayerScore[PLAYER_2] = c.PlayerScoreP2;
|
||||
c.MachineBest = {};
|
||||
c.MachineBest[PLAYER_1] = c.MachineBestP1;
|
||||
c.MachineBest[PLAYER_2] = c.MachineBestP2;
|
||||
c.ScoreFrame = {};
|
||||
c.ScoreFrame[PLAYER_1] = c.ScoreFrameP1;
|
||||
c.ScoreFrame[PLAYER_2] = c.ScoreFrameP2;
|
||||
c.Difficulty = {};
|
||||
c.Difficulty[PLAYER_1] = c.DifficultyP1;
|
||||
c.Difficulty[PLAYER_2] = c.DifficultyP2;
|
||||
end;
|
||||
|
||||
BeginCommand = function(self)
|
||||
Stats = STATSMAN:GetPlayedStageStats(StagesAgo);
|
||||
if not Stats then
|
||||
self:visible(false);
|
||||
return;
|
||||
end;
|
||||
self:visible(true);
|
||||
|
||||
PlayerStats[PLAYER_1] = Stats:GetPlayerStageStats(PLAYER_1);
|
||||
PlayerStats[PLAYER_2] = Stats:GetPlayerStageStats(PLAYER_2);
|
||||
|
||||
local Current;
|
||||
local CurrentPart = {}
|
||||
if GAMESTATE:IsCourseMode() then
|
||||
Current = GAMESTATE:GetCurrentCourse();
|
||||
CurrentPart[PLAYER_1] = GAMESTATE:GetCurrentTrail( PLAYER_1 );
|
||||
CurrentPart[PLAYER_2] = GAMESTATE:GetCurrentTrail( PLAYER_2 );
|
||||
else
|
||||
Current = Stats:GetPlayedSongs()[1];
|
||||
CurrentPart[PLAYER_1] = PlayerStats[PLAYER_1]:GetPlayedSteps()[1];
|
||||
CurrentPart[PLAYER_2] = PlayerStats[PLAYER_2]:GetPlayedSteps()[1];
|
||||
end
|
||||
assert(Current);
|
||||
|
||||
local sBannerPath = Current:GetBannerPath() or THEME:GetPathG("Common","fallback banner");
|
||||
c.Banner:LoadBanner( sBannerPath );
|
||||
|
||||
for pn in ivalues(PlayerNumber) do
|
||||
local visible = GAMESTATE:IsHumanPlayer(pn) and CurrentPart[pn] ~= nil; -- was present for this song
|
||||
c.MachineBest[pn]:visible( visible );
|
||||
c.PlayerScore[pn]:visible( visible );
|
||||
c.ScoreFrame[pn]:visible( visible );
|
||||
c.Difficulty[pn]:visible( visible );
|
||||
|
||||
local MachineProfile = PROFILEMAN:GetMachineProfile();
|
||||
if visible then
|
||||
assert(CurrentPart[pn]);
|
||||
|
||||
c.Difficulty[pn]:SetDifficultyAndStepsTypeFrame( CurrentPart[pn] );
|
||||
|
||||
local hsl = MachineProfile:GetHighScoreList( Current, CurrentPart[pn] );
|
||||
assert( hsl );
|
||||
|
||||
-- Find the first high score that isn't one that we're entering now.
|
||||
local HighScores = hsl:GetHighScores();
|
||||
local hs;
|
||||
for h in ivalues(HighScores) do
|
||||
if not hs and not h:IsFillInMarker() then
|
||||
hs = h;
|
||||
end
|
||||
end
|
||||
|
||||
if hs then
|
||||
local fMachineScore = hs:GetPercentDP() or 0;
|
||||
local sName = hs:GetName() or "";
|
||||
local sText = sName .. " " .. FormatPercentScore( fMachineScore );
|
||||
c.MachineBest[pn]:settext( sText );
|
||||
else
|
||||
c.ScoreFrame[pn]:visible( false );
|
||||
end
|
||||
|
||||
local fPlayerScore = PlayerStats[pn]:GetPercentDancePoints();
|
||||
local sText = FormatPercentScore( fPlayerScore );
|
||||
c.PlayerScore[pn]:settext( sText );
|
||||
local colors = {
|
||||
[PLAYER_1] = color("#fdf991"),
|
||||
[PLAYER_2] = color("#abfe8e"),
|
||||
};
|
||||
if Stats:PlayerHasHighScore(pn) then
|
||||
colors = {
|
||||
[PLAYER_1] = color("#feef01"),
|
||||
[PLAYER_2] = color("#0ffc03"),
|
||||
};
|
||||
end
|
||||
c.PlayerScore[pn]:diffuse(colors[pn]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
};
|
||||
end
|
||||
|
||||
local children = {
|
||||
LoadActor( "center frame" ) .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y+9);
|
||||
OnCommand=cmd(fadetop,0.3; croptop,1; linear,0.5; croptop,-0.3);
|
||||
OffCommand=cmd(linear,0.5; croptop,1);
|
||||
};
|
||||
LoadActor( "line" ) .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;SetWidth,336;y,SCREEN_CENTER_Y+65;fadeleft,0.3; faderight,0.3);
|
||||
OnCommand=cmd(cropleft,.5;cropright,.5;
|
||||
sleep,0.2;
|
||||
linear,0.3;
|
||||
cropleft,-.2;cropright,-.2);
|
||||
|
||||
OffCommand=cmd(linear,0.3;cropleft,.5;cropright,.5);
|
||||
};
|
||||
};
|
||||
|
||||
for i = 1,5 do
|
||||
children[#children+1] =
|
||||
MakeScoreList(i) .. {
|
||||
Name="Row" .. tostring(i);
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X);
|
||||
};
|
||||
end
|
||||
|
||||
children[#children+1] =
|
||||
LoadActor( THEME:GetPathB("","_shared underlay") ) .. { OnCommand=cmd(); };
|
||||
|
||||
children[#children+1] = LoadActor( "keyboard" ) .. {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y+80);
|
||||
BeginCommand = cmd(visible,SCREENMAN:GetTopScreen():GetAnyEntering());
|
||||
};
|
||||
|
||||
for pn in ivalues(PlayerNumber) do
|
||||
local FrameX = pn == PLAYER_1 and (SCREEN_CENTER_X-265) or (SCREEN_CENTER_X+267);
|
||||
local P1 = pn == PLAYER_1 and 1 or -1;
|
||||
children[#children+1] = LoadActor( "name frame" ) .. {
|
||||
InitCommand=cmd(y,SCREEN_CENTER_Y+119;
|
||||
zoomx,pn == PLAYER_1 and 1.0 or -1.0);
|
||||
BeginCommand=cmd(visible,SCREENMAN:GetTopScreen():GetEnteringName(pn));
|
||||
OnCommand=cmd(finishtweening;x,FrameX;addx,-200*P1;zoom,0;bounceend,0.3;zoom,1;addx,200*P1);
|
||||
OffCommand=cmd(stoptweening;bouncebegin,0.3;zoom,0;addx,-200*P1);
|
||||
};
|
||||
|
||||
children[#children+1] = LoadFont( "_regra bold 30px" ) .. {
|
||||
Name="PlayerText";
|
||||
InitCommand=cmd(x,pn == PLAYER_1 and (SCREEN_CENTER_X-WideScale(310,330)) or (SCREEN_CENTER_X+WideScale(198,204));
|
||||
halign,0;
|
||||
y,SCREEN_CENTER_Y+115;shadowlength,0;zoom,1);
|
||||
BeginCommand=cmd(visible,SCREENMAN:GetTopScreen():GetEnteringName(pn));
|
||||
OnCommand=cmd(finishtweening;diffusealpha,0;sleep,0.1;linear,0.3;diffusealpha,1);
|
||||
OffCommand=cmd(stoptweening;bouncebegin,0.3;zoom,0;addx,-200*P1);
|
||||
EntryChangedMessageCommand=function(self,params)
|
||||
if params.PlayerNumber ~= pn then
|
||||
return;
|
||||
end;
|
||||
self:settext( params.Text );
|
||||
end;
|
||||
};
|
||||
end;
|
||||
|
||||
return Def.ActorFrame {
|
||||
children = children;
|
||||
|
||||
BeginCommand = function(self)
|
||||
local StagesPlayed = STATSMAN:GetStagesPlayed();
|
||||
local c = self:GetChildren();
|
||||
|
||||
local fYCenter = SCREEN_CENTER_Y-60;
|
||||
local fYMinSpacing = 44;
|
||||
local fYMaxSpacing = 70;
|
||||
local fYSpacing = scale(StagesPlayed, 4, 5, fYMaxSpacing, fYMinSpacing);
|
||||
fYSpacing = clamp(fYSpacing, fYMinSpacing, fYMaxSpacing);
|
||||
fYSpacing = fYSpacing + math.mod(fYSpacing, 2); -- even
|
||||
fYSpacing = -fYSpacing;
|
||||
|
||||
local fYStart = fYSpacing*(StagesPlayed-1)/2;
|
||||
local fYEnd = -fYSpacing*(StagesPlayed-1)/2;
|
||||
for i = 1,StagesPlayed do
|
||||
local Name = "Row" .. tostring(i);
|
||||
local row = c[Name];
|
||||
assert(row);
|
||||
local fY = fYCenter + fYEnd + (i-1)*fYSpacing;
|
||||
row:y( fY );
|
||||
end
|
||||
|
||||
local Timer = SCREENMAN:GetTopScreen():GetChild("Timer");
|
||||
if not SCREENMAN:GetTopScreen():GetAnyEntering() then
|
||||
Timer:setseconds(5);
|
||||
Timer:silent(true);
|
||||
else
|
||||
Timer:setseconds(25);
|
||||
Timer:silent(false);
|
||||
end
|
||||
end;
|
||||
|
||||
OnCommand = function(self)
|
||||
local StagesPlayed = STATSMAN:GetStagesPlayed();
|
||||
local c = self:GetChildren();
|
||||
for i = 1,StagesPlayed do
|
||||
local Name = "Row" .. tostring(i);
|
||||
local row = c[Name];
|
||||
assert(row);
|
||||
|
||||
row:hibernate(0.3+(i/StagesPlayed)*0.3);
|
||||
end
|
||||
end;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,279 @@
|
||||
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( "_regra bold 30px" ) .. {
|
||||
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("", "_venacti 26px normal");
|
||||
end;
|
||||
end;
|
||||
children[#children+1] = LoadActor( THEME:GetPathS(Var "LoadingScreen", "type key") ) .. { Name = "Type"; SupportPan = true; }
|
||||
children[#children+1] = LoadActor( THEME:GetPathS(Var "LoadingScreen", "back") ) .. { Name = "Back"; SupportPan = true; }
|
||||
children[#children+1] = LoadActor( THEME:GetPathS(Var "LoadingScreen", "enter") ) .. { Name = "Enter"; SupportPan = true; }
|
||||
children[#children+1] = LoadActor( THEME:GetPathS(Var "LoadingScreen", "move cursor") ) .. { 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
|
||||
|
||||
-- SCREENMAN:GetTopScreen():EnterKey(PLAYER_2,"x");
|
||||
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;
|
||||
};
|
||||
@@ -193,4 +193,7 @@ Branch = {
|
||||
Network = function()
|
||||
return IsNetConnected() and "ScreenTitleMenu" or "ScreenTitleMenu"
|
||||
end,
|
||||
AfterSaveSummary = function()
|
||||
return GAMESTATE:AnyPlayerHasRankingFeats() and "ScreenNameEntryTraditional" or "ScreenGameOver"
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -966,8 +966,8 @@ StopOffsetX=50
|
||||
DelayOffsetX=120
|
||||
WarpOffsetX=90
|
||||
TimeSignatureOffsetX=30
|
||||
TickcountOffsetX=50
|
||||
ComboOffsetX=70
|
||||
TickcountOffsetX=70
|
||||
ComboOffsetX=50
|
||||
LabelOffsetX=130
|
||||
SpeedOffsetX=30
|
||||
ScrollOffsetX=100
|
||||
@@ -3220,6 +3220,9 @@ PlayerType="PlayerShared"
|
||||
Class="ScreenEvaluation"
|
||||
Fallback="ScreenWithMenuElements"
|
||||
#
|
||||
NextScreen=Branch.AfterEvaluation()
|
||||
PrevScreen=Branch.AfterEvaluation()
|
||||
#
|
||||
LightsMode="LightsMode_MenuStartOnly"
|
||||
#
|
||||
Summary=false
|
||||
@@ -3305,30 +3308,34 @@ DetailLineFormat="%3d/%3d"
|
||||
[ScreenEvaluationNormal]
|
||||
Fallback="ScreenEvaluation"
|
||||
#
|
||||
NextScreen="ScreenProfileSave"
|
||||
NextScreen=Branch.AfterEvaluation()
|
||||
PrevScreen=Branch.AfterEvaluation()
|
||||
|
||||
[ScreenEvaluationSummary]
|
||||
Fallback="ScreenEvaluation"
|
||||
#
|
||||
NextScreen="ScreenSelectMusic"
|
||||
NextScreen=Branch.AfterSummary()
|
||||
#
|
||||
Summary=true
|
||||
#
|
||||
|
||||
[ScreenNameEntry]
|
||||
# !!! #
|
||||
Class="ScreenNameEntry"
|
||||
Fallback="ScreenWithMenuElementsBlank"
|
||||
#
|
||||
TimerX=SCREEN_CENTER_X+0
|
||||
TimerY=SCREEN_CENTER_Y-210
|
||||
#
|
||||
CategoryY=SCREEN_CENTER_Y+190
|
||||
CategoryZoom=0.7
|
||||
#
|
||||
CharsZoomSmall=1.0
|
||||
CharsZoomLarge=1.5
|
||||
CharsSpacingY=40
|
||||
CharsChoices=" ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
ScrollingCharsCommand=diffuse,0.6,0.8,0.8,1
|
||||
SelectedCharsCommand=diffuse,0.8,1,1,1
|
||||
#
|
||||
ReceptorArrowsY=SCREEN_CENTER_Y-140
|
||||
NumCharsToDrawBehind=2
|
||||
NumCharsToDrawTotal=10
|
||||
@@ -3338,7 +3345,9 @@ TimerSeconds=24
|
||||
TimerStealth=false
|
||||
ShowStyleIcon=false
|
||||
MaxRankingNameLength=4
|
||||
#
|
||||
NextScreen="ScreenProfileSave"
|
||||
#
|
||||
PlayerP1OnePlayerOneSideX=SCREEN_CENTER_X-160
|
||||
PlayerP2OnePlayerOneSideX=SCREEN_CENTER_X+160
|
||||
PlayerP1TwoPlayersTwoSidesX=SCREEN_CENTER_X-160
|
||||
@@ -3346,6 +3355,31 @@ PlayerP2TwoPlayersTwoSidesX=SCREEN_CENTER_X+160
|
||||
PlayerP1OnePlayerTwoSidesX=SCREEN_CENTER_X
|
||||
PlayerP2OnePlayerTwoSidesX=SCREEN_CENTER_X
|
||||
|
||||
[ScreenNameEntryTraditional]
|
||||
Class="ScreenNameEntryTraditional"
|
||||
Fallback="ScreenWithMenuElements"
|
||||
#
|
||||
TimerSeconds=30
|
||||
#
|
||||
RepeatRate=15
|
||||
RepeatDelay=1/4
|
||||
#
|
||||
NextScreen="ScreenProfileSaveSummary"
|
||||
#
|
||||
HelpText="Enter your name!"
|
||||
#
|
||||
CancelTransitionsOut=true
|
||||
MaxRankingNameLength=4
|
||||
CodeNames="Backspace,Left,Right,NextRow1=NextRow,NextRow2=NextRow,PrevRow,JumpToEnter,Enter"
|
||||
CodeLeft="+MenuLeft"
|
||||
CodeRight="+MenuRight"
|
||||
CodePrevRow="+MenuUp"
|
||||
CodeNextRow1="+MenuDown"
|
||||
CodeNextRow2="Select,~Select"
|
||||
CodeBackspace="@Select-MenuLeft"
|
||||
CodeJumpToEnter="@Select-Start"
|
||||
CodeEnter="Start"
|
||||
|
||||
[ScreenProfileSave]
|
||||
Class="ScreenProfileSave"
|
||||
Fallback="ScreenWithMenuElementsBlank"
|
||||
@@ -3358,8 +3392,8 @@ TimerSeconds=-1
|
||||
[ScreenProfileSaveSummary]
|
||||
Fallback="ScreenProfileSave"
|
||||
#
|
||||
NextScreen="ScreenGameOver"
|
||||
PrevScreen="ScreenGameOver"
|
||||
NextScreen=Branch.AfterSaveSummary()
|
||||
PrevScreen=Branch.AfterSaveSummary()
|
||||
|
||||
[ScreenGameOver]
|
||||
Class="ScreenEnding"
|
||||
@@ -3592,7 +3626,6 @@ DifficultyFormat="%s:\n %s\n"
|
||||
RoutinePlayerFormat="%s: %d\n"
|
||||
DescriptionFormat="%s:\n %s\n"
|
||||
StepAuthorFormat="%s:\n %s\n"
|
||||
ChartNameFormat="%s:\n %s\n"
|
||||
ChartStyleFormat="%s:\n %s\n"
|
||||
MainTitleFormat="%s:\n %s\n"
|
||||
SubtitleFormat="%s:\n %s\n"
|
||||
|
||||
Reference in New Issue
Block a user