Merge branch 'StageDispFixes' of https://github.com/kyzentun/stepmania
This commit is contained in:
@@ -7,26 +7,6 @@ if playMode ~= 'PlayMode_Regular' and playMode ~= 'PlayMode_Rave' and playMode ~
|
||||
sStage = playMode;
|
||||
end;
|
||||
|
||||
if not (GAMESTATE:IsCourseMode() or GAMESTATE:IsExtraStage() or GAMESTATE:IsExtraStage2()) then
|
||||
local tRemap = {
|
||||
Stage_Event = 0,
|
||||
Stage_1st = 1,
|
||||
Stage_2nd = 2,
|
||||
Stage_3rd = 3,
|
||||
Stage_4th = 4,
|
||||
Stage_5th = 5,
|
||||
Stage_6th = 6,
|
||||
};
|
||||
|
||||
local nSongCount = tRemap[sStage] + (GAMESTATE:GetCurrentSong():GetStageCost()-1);
|
||||
|
||||
if nSongCount >= PREFSMAN:GetPreference("SongsPerPlay") then
|
||||
sStage = "Stage_Final";
|
||||
else
|
||||
sStage = sStage;
|
||||
end;
|
||||
end;
|
||||
|
||||
local t = Def.ActorFrame {};
|
||||
t[#t+1] = Def.Quad {
|
||||
InitCommand=cmd(Center;zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color("Black"));
|
||||
@@ -47,11 +27,28 @@ else
|
||||
};
|
||||
end
|
||||
|
||||
local stage_num_actor= THEME:GetPathG("ScreenStageInformation", "Stage " .. ToEnumShortString(sStage), true)
|
||||
if stage_num_actor ~= "" and FILEMAN:DoesFileExist(stage_num_actor) then
|
||||
stage_num_actor= LoadActor(stage_num_actor)
|
||||
else
|
||||
-- Midiman: We need a "Stage Next" actor or something for stages after
|
||||
-- the 6th. -Kyz
|
||||
local curStage = GAMESTATE:GetCurrentStage();
|
||||
stage_num_actor= Def.BitmapText{
|
||||
Font= "Common Normal", Text= thified_curstage_index(false) .. " Stage",
|
||||
InitCommand= function(self)
|
||||
self:zoom(1.5)
|
||||
self:strokecolor(Color.Black)
|
||||
self:diffuse(StageToColor(curStage));
|
||||
self:diffusetopedge(ColorLightTone(StageToColor(curStage)));
|
||||
end
|
||||
}
|
||||
end
|
||||
|
||||
t[#t+1] = Def.ActorFrame {
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y);
|
||||
OnCommand=cmd(stoptweening;zoom,1.25;decelerate,3;zoom,1);
|
||||
|
||||
LoadActor( THEME:GetPathG("ScreenStageInformation", "Stage " .. ToEnumShortString(sStage) ) ) .. {
|
||||
stage_num_actor .. {
|
||||
OnCommand=cmd(diffusealpha,0;linear,0.25;diffusealpha,1;sleep,1.75;linear,0.5;zoomy,0;zoomx,2;diffusealpha,0);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ for i=1,#statList do
|
||||
as[#as+1] = Def.ActorFrame {
|
||||
Def.Sprite {
|
||||
InitCommand=cmd(scaletoclipped,256,80);
|
||||
BeginCommand=function(self)
|
||||
OnCommand=function(self)
|
||||
local path = statList[j]:GetPlayedSongs()[1]:GetBannerPath() or THEME:GetPathG("Common","fallback banner");
|
||||
self:LoadBanner(path);
|
||||
end;
|
||||
@@ -43,7 +43,7 @@ for i=1,#statList do
|
||||
OnCommand=cmd(zoomto,80,18;diffuse,Color.Black;diffusealpha,0.5;fadeleft,0.5);
|
||||
};
|
||||
LoadFont("Common Normal") .. {
|
||||
Text=StageToLocalizedString( statList[j]:GetStage() );
|
||||
Text=thify_number(statList[j]:GetStageIndex()+1);
|
||||
InitCommand=cmd(x,128-4;y,40-4;horizalign,right;vertalign,bottom);
|
||||
OnCommand=cmd(diffuse,StageToColor(statList[j]:GetStage());zoom,0.675;shadowlength,1);
|
||||
};
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
local curScreen = Var "LoadingScreen";
|
||||
local curStage = GAMESTATE:GetCurrentStage();
|
||||
local curStageIndex = GAMESTATE:GetCurrentStageIndex();
|
||||
local curStageIndex = GAMESTATE:GetCurrentStageIndex() + 1;
|
||||
local playMode = GAMESTATE:GetPlayMode();
|
||||
|
||||
local tRemap = {
|
||||
Stage_1st = 1,
|
||||
Stage_2nd = 2,
|
||||
Stage_3rd = 3,
|
||||
Stage_4th = 4,
|
||||
Stage_5th = 5,
|
||||
Stage_6th = 6,
|
||||
};
|
||||
if tRemap[curStage] == PREFSMAN:GetPreference("SongsPerPlay") then
|
||||
curStage = "Stage_Final";
|
||||
end
|
||||
|
||||
local t = Def.ActorFrame {
|
||||
LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",64,16);
|
||||
LoadFont("Common Normal") .. {
|
||||
@@ -36,12 +24,13 @@ local t = Def.ActorFrame {
|
||||
self:settextf("%i / %i", songsPlayed, GAMESTATE:GetCurrentCourse():GetEstimatedNumStages());
|
||||
else
|
||||
if GAMESTATE:IsEventMode() then
|
||||
self:settextf("Stage %s", curStageIndex+1);
|
||||
self:settextf("Stage %s", curStageIndex);
|
||||
else
|
||||
local thed_stage= thified_curstage_index(false)
|
||||
if THEME:GetMetric(curScreen,"StageDisplayUseShortString") then
|
||||
self:settextf("%s", ToEnumShortString(curStage));
|
||||
self:settextf(thed_stage)
|
||||
else
|
||||
self:settextf("%s Stage", ToEnumShortString(curStage));
|
||||
self:settextf("%s Stage", thed_stage)
|
||||
end
|
||||
end
|
||||
end;
|
||||
|
||||
@@ -21,18 +21,12 @@ t[#t+1] = Def.ActorFrame {
|
||||
elseif GAMESTATE:IsEventMode() then
|
||||
self:settextf("Stage %s", curStageIndex);
|
||||
else
|
||||
-- hack: ScreenEvaluation shows the current stage, but it needs to
|
||||
-- show the last stage instead. PlayedStageStats has the right one.
|
||||
if string.find(curScreen,"Evaluation") then
|
||||
local stageStats = STATSMAN:GetPlayedStageStats(1)
|
||||
curStage = stageStats:GetStage()
|
||||
end
|
||||
|
||||
local thed_stage= thified_curstage_index(curScreen:find("Evaluation"))
|
||||
if THEME:GetMetric(curScreen,"StageDisplayUseShortString") then
|
||||
self:settextf("%s", ToEnumShortString(curStage));
|
||||
self:settext(thed_stage)
|
||||
self:zoom(0.75);
|
||||
else
|
||||
self:settextf("%s Stage", ToEnumShortString(curStage));
|
||||
self:settextf("%s Stage", thed_stage);
|
||||
self:zoom(1);
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -17,4 +17,47 @@ function SongMeterDisplayCommand(pn)
|
||||
local xAdd = (pn == PLAYER_1) and -24 or 24
|
||||
return cmd(draworder,5;rotationz,-90;zoom,0;addx,xAdd;sleep,1.5;decelerate,0.5;zoom,1;addx,xAdd*-1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function thify_number(n)
|
||||
if n >= 10 and n < 20 then return n .. "th" end
|
||||
local th_suffixes= {"st", "nd", "rd"}
|
||||
local end_digit= n % 10
|
||||
return n .. (th_suffixes[end_digit] or "th")
|
||||
end
|
||||
|
||||
local numbered_stages= {
|
||||
Stage_1st= true,
|
||||
Stage_2nd= true,
|
||||
Stage_3rd= true,
|
||||
Stage_4th= true,
|
||||
Stage_5th= true,
|
||||
Stage_6th= true,
|
||||
Stage_Next= true,
|
||||
}
|
||||
|
||||
function is_stage_final()
|
||||
-- The correct way to determine whether the player has reached Final Stage
|
||||
-- is to check the number of stages left.
|
||||
-- If you use the SongsPerPlay preference, you become incorrect after a
|
||||
-- continue occurs.
|
||||
local master_player= GAMESTATE:GetMasterPlayerNumber()
|
||||
local stages_left= GAMESTATE:GetNumStagesLeft(master_player)
|
||||
local stage_cost= GAMESTATE:GetCurrentSong():GetStageCost()
|
||||
return (stages_left - stage_cost) < 1
|
||||
end
|
||||
|
||||
function thified_curstage_index(on_eval)
|
||||
local cur_stage= GAMESTATE:GetCurrentStage()
|
||||
local adjust= 1
|
||||
-- hack: ScreenEvaluation shows the current stage, but it needs to show
|
||||
-- the last stage instead. Adjust the amount.
|
||||
if on_eval then
|
||||
adjust= 0
|
||||
end
|
||||
if numbered_stages[cur_stage] then
|
||||
return thify_number(GAMESTATE:GetCurrentStageIndex() + adjust)
|
||||
else
|
||||
return ToEnumShortString(cur_stage)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2023,7 +2023,7 @@ SmallBanner4OffCommand=
|
||||
|
||||
SmallBanner5X=SCREEN_CENTER_X+48
|
||||
SmallBanner5Y=SCREEN_TOP+100+16
|
||||
SmallBanner5OnCommand=zoom,0.5
|
||||
SmallBanner5OnCommand=visible,false
|
||||
SmallBanner5OfCommand=
|
||||
|
||||
SmallBanner6X=SCREEN_CENTER_X+72
|
||||
|
||||
Reference in New Issue
Block a user