better stagedisplay. needs SCREENMAN:GetTopScreen() but seems to be unable to handle it.

This commit is contained in:
Jonathan Payne
2012-03-18 12:38:24 -07:00
parent cd3fc694cc
commit 217d5c2b52
3 changed files with 35 additions and 113 deletions
@@ -1,37 +0,0 @@
local stages = Def.ActorFrame {
BeginCommand=cmd(playcommand,"Set";);
CurrentSongChangedMessageCommand=cmd(finishtweening;playcommand,"Set";);
};
local ScreenName = Var "LoadingScreen";
function MakeBitmapTest()
return LoadFont(ScreenName,"StageDisplay") .. {
};
end
for s in ivalues(Stage) do
stages[#stages+1] = MakeBitmapTest() .. {
InitCommand=cmd(shadowlength,2);
SetCommand=function(self, params)
local Stage = GAMESTATE:GetCurrentStage();
local StageIndex = GAMESTATE:GetCurrentStageIndex();
local screen = SCREENMAN:GetTopScreen();
local cStageOutlineColor = ColorDarkTone( StageToStrokeColor(s) );
cStageOutlineColor[4] = 0.75;
if screen and screen.GetStageStats then
local ss = screen:GetStageStats();
Stage = ss:GetStage();
StageIndex = ss:GetStageIndex();
end
self:visible( Stage == s );
self:settext( StageToLocalizedString(Stage) );
self:diffuse( StageToColor(s) );
self:diffusebottomedge( ColorMidTone(StageToColor(s)) );
self:strokecolor( cStageOutlineColor );
end;
}
end
return stages;
@@ -1,76 +1,31 @@
local curScreen = Var "LoadingScreen";
local curStage = GAMESTATE:GetCurrentStage();
local curStageIndex = GAMESTATE:GetCurrentStageIndex();
local stages = Def.ActorFrame {
BeginCommand=cmd(playcommand,"Set";);
CurrentSongChangedMessageCommand=cmd(finishtweening;playcommand,"Set";);
};
local ScreenName = Var "LoadingScreen";
function MakeBitmapTest()
return LoadFont(ScreenName,"StageDisplay") .. {
local t = Def.ActorFrame {};
t[#t+1] = Def.ActorFrame {
LoadActor(THEME:GetPathB("_frame","3x3"),"rounded black",64,12);
LoadFont("Common Normal") .. {
InitCommand=cmd(y,-1;shadowlength,1;playcommand,"Set");
SetCommand=function(self)
if GAMESTATE:GetCurrentCourse() then
self:settext( GAMESTATE:GetCurrentStageIndex()+1 .. " / " .. GAMESTATE:GetCurrentCourse():GetEstimatedNumStages() );
elseif GAMESTATE:IsEventMode() then
self:settextf("Stage %s", curStageIndex+1);
else
if THEME:GetMetric(curScreen,"StageDisplayUseShortString") then
self:settextf("%s", ToEnumShortString(curStage));
self:zoom(0.75);
else
self:settextf("%s Stage", ToEnumShortString(curStage));
self:zoom(1);
end;
end;
--
self:diffuse(StageToColor(curStage));
self:diffusetopedge(ColorLightTone(StageToColor(curStage)));
end;
};
end
if not PREFSMAN:GetPreference("EventMode") then
for s in ivalues(Stage) do
stages[#stages+1] = MakeBitmapTest() .. {
SetCommand=function(self, params)
local tRemap = {
Stage_1st = 1,
Stage_2nd = 2,
Stage_3rd = 3,
Stage_4th = 4,
Stage_5th = 5,
Stage_6th = 6,
--[[ 'Stage_Next' = 6,
'Stage_Final' = 7,
'Stage_Extra1' = 8,
'Stage_Extra2' = 9,
'Stage_Nonstop' = 10,
'Stage_Oni' = 11,
'Stage_Endless' = 12,
'Stage_Event' = 13,
'Stage_Demo' = 14, --]]
}
local Stage = GAMESTATE:GetCurrentStage();
local StageIndex = GAMESTATE:GetCurrentStageIndex();
local screen = SCREENMAN:GetTopScreen();
-- local cStageOutlineColor = ColorDarkTone( StageToStrokeColor(s) );
-- cStageOutlineColor[4] = 0.75;
if screen and screen.GetStageStats then
local ss = screen:GetStageStats();
Stage = ss:GetStage();
StageIndex = ss:GetStageIndex();
end
self:visible( Stage == s );
if tRemap[Stage] == PREFSMAN:GetPreference("SongsPerPlay") then
Stage = 'Stage_Final';
else
Stage = Stage;
s = s;
end;
self:settext( string.format( THEME:GetString("ScreenWithMenuElements","StageCounter"), StageToLocalizedString(Stage) ) );
self:diffuse( (Stage == 'Stage_Final') and StageToColor('Stage_Final') or StageToColor(s) );
self:diffusebottomedge( (Stage == 'Stage_Final') and ColorMidTone(StageToColor('Stage_Final')) or ColorMidTone(StageToColor(s)) );
self:strokecolor( (Stage == 'Stage_Final') and ColorDarkTone(StageToColor('Stage_Final')) or ColorDarkTone(StageToColor(s)) );
end;
}
end
else
stages[#stages+1] = MakeBitmapTest() .. {
SetCommand=function(self,params)
if Var "LoadingScreen" then
local Offset = THEME:GetMetric(Var "LoadingScreen","StageDisplayNumberOffset");
local Stage = GAMESTATE:GetCurrentStageIndex();
local RealStage = Stage + Offset;
self:settextf( THEME:GetString("ScreenWithMenuElements","EventStageCounter"), RealStage );
self:diffuse( StageToColor('Stage_1st') );
self:diffusebottomedge( ColorMidTone(StageToColor('Stage_1st')) );
self:strokecolor( Color.Alpha( ColorDarkTone(StageToColor('Stage_1st')), 0.75) );
end;
end;
}
end
return stages;
};
return t
+7 -3
View File
@@ -584,6 +584,9 @@ TimerOffCommand=
StageDisplayNumberOffset=1
#
StageDisplayUseShortString=false
# This is useful
ArcadeOverlayX=
ArcadeOverlayY=
@@ -1378,11 +1381,12 @@ BPMDisplayY=SCREEN_BOTTOM-17
BPMDisplayOnCommand=draworder,101
BPMDisplayOffCommand=bounceend,0.25;zoom,0
#
ShowStageDisplay=not GAMESTATE:IsCourseMode()
ShowStageDisplay=true
StageDisplayX=SCREEN_CENTER_X
StageDisplayY=SCREEN_TOP+24
StageDisplayOnCommand=zoom,0.675;
StageDisplayY=SCREEN_BOTTOM-50
StageDisplayOnCommand=draworder,102
StageDisplayOffCommand=bounceend,0.25;zoom,0
StageDisplayUseShortString=true
#
ShowScoreFrame=ThemePrefs.Get("GameplayFooter");
ScoreFrameX=SCREEN_CENTER_X