cleanup ScreenRanking
generalize scrolling lists with ListDisplay
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
_shared2
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
_ScreenRanking common
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
_ScreenRanking common
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
_ScreenRanking common
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
_shared2
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
_shared2
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
_shared2
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
_ScreenRanking common
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,261 @@
|
|||||||
|
[Char Widths]
|
||||||
|
import=_20px fonts
|
||||||
|
LineSpacing=24
|
||||||
|
Top=7
|
||||||
|
Baseline=27
|
||||||
|
0=17
|
||||||
|
1=17
|
||||||
|
2=17
|
||||||
|
3=17
|
||||||
|
4=17
|
||||||
|
5=17
|
||||||
|
6=17
|
||||||
|
7=17
|
||||||
|
8=17
|
||||||
|
9=120
|
||||||
|
10=0
|
||||||
|
11=17
|
||||||
|
12=17
|
||||||
|
13=0
|
||||||
|
14=17
|
||||||
|
15=17
|
||||||
|
16=17
|
||||||
|
17=17
|
||||||
|
18=17
|
||||||
|
19=17
|
||||||
|
20=17
|
||||||
|
21=17
|
||||||
|
22=17
|
||||||
|
23=17
|
||||||
|
24=17
|
||||||
|
25=17
|
||||||
|
26=17
|
||||||
|
27=17
|
||||||
|
28=0
|
||||||
|
29=0
|
||||||
|
30=0
|
||||||
|
31=0
|
||||||
|
32=9
|
||||||
|
33=9
|
||||||
|
34=14
|
||||||
|
35=18
|
||||||
|
36=18
|
||||||
|
37=27
|
||||||
|
38=24
|
||||||
|
39=8
|
||||||
|
40=11
|
||||||
|
41=11
|
||||||
|
42=15
|
||||||
|
43=18
|
||||||
|
44=9
|
||||||
|
45=9
|
||||||
|
46=9
|
||||||
|
47=8
|
||||||
|
48=18
|
||||||
|
49=18
|
||||||
|
50=18
|
||||||
|
51=18
|
||||||
|
52=18
|
||||||
|
53=18
|
||||||
|
54=18
|
||||||
|
55=18
|
||||||
|
56=18
|
||||||
|
57=18
|
||||||
|
58=9
|
||||||
|
59=9
|
||||||
|
60=18
|
||||||
|
61=18
|
||||||
|
62=18
|
||||||
|
63=17
|
||||||
|
64=20
|
||||||
|
65=21
|
||||||
|
66=21
|
||||||
|
67=21
|
||||||
|
68=21
|
||||||
|
69=20
|
||||||
|
70=18
|
||||||
|
71=22
|
||||||
|
72=22
|
||||||
|
73=11
|
||||||
|
74=18
|
||||||
|
75=22
|
||||||
|
76=18
|
||||||
|
77=25
|
||||||
|
78=22
|
||||||
|
79=22
|
||||||
|
80=20
|
||||||
|
81=22
|
||||||
|
82=21
|
||||||
|
83=20
|
||||||
|
84=20
|
||||||
|
85=22
|
||||||
|
86=21
|
||||||
|
87=27
|
||||||
|
88=21
|
||||||
|
89=21
|
||||||
|
90=20
|
||||||
|
91=11
|
||||||
|
92=8
|
||||||
|
93=11
|
||||||
|
94=18
|
||||||
|
95=14
|
||||||
|
96=9
|
||||||
|
97=18
|
||||||
|
98=18
|
||||||
|
99=18
|
||||||
|
100=18
|
||||||
|
101=18
|
||||||
|
102=11
|
||||||
|
103=18
|
||||||
|
104=18
|
||||||
|
105=9
|
||||||
|
106=9
|
||||||
|
107=18
|
||||||
|
108=9
|
||||||
|
109=27
|
||||||
|
110=18
|
||||||
|
111=18
|
||||||
|
112=18
|
||||||
|
113=18
|
||||||
|
114=12
|
||||||
|
115=17
|
||||||
|
116=12
|
||||||
|
117=18
|
||||||
|
118=17
|
||||||
|
119=25
|
||||||
|
120=18
|
||||||
|
121=17
|
||||||
|
122=15
|
||||||
|
123=11
|
||||||
|
124=8
|
||||||
|
125=11
|
||||||
|
126=18
|
||||||
|
127=17
|
||||||
|
128=18
|
||||||
|
129=10
|
||||||
|
130=8
|
||||||
|
131=18
|
||||||
|
132=14
|
||||||
|
133=27
|
||||||
|
134=18
|
||||||
|
135=18
|
||||||
|
136=9
|
||||||
|
137=27
|
||||||
|
138=20
|
||||||
|
139=9
|
||||||
|
140=27
|
||||||
|
141=10
|
||||||
|
142=20
|
||||||
|
143=10
|
||||||
|
144=10
|
||||||
|
145=8
|
||||||
|
146=8
|
||||||
|
147=14
|
||||||
|
148=14
|
||||||
|
149=14
|
||||||
|
150=14
|
||||||
|
151=27
|
||||||
|
152=9
|
||||||
|
153=26
|
||||||
|
154=17
|
||||||
|
155=9
|
||||||
|
156=27
|
||||||
|
157=10
|
||||||
|
158=15
|
||||||
|
159=21
|
||||||
|
160=9
|
||||||
|
161=9
|
||||||
|
162=18
|
||||||
|
163=18
|
||||||
|
164=18
|
||||||
|
165=18
|
||||||
|
166=8
|
||||||
|
167=18
|
||||||
|
168=9
|
||||||
|
169=22
|
||||||
|
170=11
|
||||||
|
171=18
|
||||||
|
172=18
|
||||||
|
173=9
|
||||||
|
174=22
|
||||||
|
175=14
|
||||||
|
176=11
|
||||||
|
177=18
|
||||||
|
178=11
|
||||||
|
179=11
|
||||||
|
180=9
|
||||||
|
181=18
|
||||||
|
182=23
|
||||||
|
183=9
|
||||||
|
184=9
|
||||||
|
185=11
|
||||||
|
186=11
|
||||||
|
187=18
|
||||||
|
188=27
|
||||||
|
189=27
|
||||||
|
190=27
|
||||||
|
191=17
|
||||||
|
192=21
|
||||||
|
193=21
|
||||||
|
194=21
|
||||||
|
195=21
|
||||||
|
196=21
|
||||||
|
197=21
|
||||||
|
198=27
|
||||||
|
199=21
|
||||||
|
200=20
|
||||||
|
201=20
|
||||||
|
202=20
|
||||||
|
203=20
|
||||||
|
204=11
|
||||||
|
205=11
|
||||||
|
206=11
|
||||||
|
207=11
|
||||||
|
208=21
|
||||||
|
209=22
|
||||||
|
210=22
|
||||||
|
211=22
|
||||||
|
212=22
|
||||||
|
213=22
|
||||||
|
214=22
|
||||||
|
215=18
|
||||||
|
216=22
|
||||||
|
217=22
|
||||||
|
218=22
|
||||||
|
219=22
|
||||||
|
220=22
|
||||||
|
221=21
|
||||||
|
222=20
|
||||||
|
223=18
|
||||||
|
224=18
|
||||||
|
225=18
|
||||||
|
226=18
|
||||||
|
227=18
|
||||||
|
228=18
|
||||||
|
229=18
|
||||||
|
230=27
|
||||||
|
231=18
|
||||||
|
232=18
|
||||||
|
233=18
|
||||||
|
234=18
|
||||||
|
235=18
|
||||||
|
236=9
|
||||||
|
237=9
|
||||||
|
238=9
|
||||||
|
239=9
|
||||||
|
240=18
|
||||||
|
241=18
|
||||||
|
242=18
|
||||||
|
243=18
|
||||||
|
244=18
|
||||||
|
245=18
|
||||||
|
246=18
|
||||||
|
247=18
|
||||||
|
248=18
|
||||||
|
249=18
|
||||||
|
250=18
|
||||||
|
251=18
|
||||||
|
252=18
|
||||||
|
253=17
|
||||||
|
254=18
|
||||||
|
255=17
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
_blank
|
||||||
@@ -3434,67 +3434,81 @@ Unlock20X=250
|
|||||||
Unlock20Y=325
|
Unlock20Y=325
|
||||||
|
|
||||||
[ScreenRanking]
|
[ScreenRanking]
|
||||||
|
StepsTypesToHide=dance-couple,dance-solo,pump-halfdouble
|
||||||
|
ShowCategories=1
|
||||||
|
CoursesToShow=Courses/DDRMAX/NaokiStandard.crs,Courses/DDRMAX/ParanoiaBrothers.crs,Courses/Samples/PlayersBest1-4.crs
|
||||||
|
ShowAllStepsScores=0
|
||||||
|
DifficultiesToShow=easy,medium,hard,challenge
|
||||||
NextScreen=ScreenUnlock
|
NextScreen=ScreenUnlock
|
||||||
CategoryX=517
|
|
||||||
CategoryY=32
|
SecondsPerPage=10
|
||||||
CategoryWidth=222
|
PageFadeSeconds=1.0
|
||||||
CategoryOnCommand=addx,640;sleep,0.0;bounceend,1;addx,-640
|
EmptyScoreName=STEP
|
||||||
CategoryOffCommand=sleep,0.0;linear,0.5;diffusealpha,0
|
NoScoreName=STEP
|
||||||
|
|
||||||
|
RowSpacingX=0
|
||||||
|
RowSpacingY=60
|
||||||
|
ColSpacingX=0
|
||||||
|
ColSpacingY=0
|
||||||
|
StepsTypeColor1=0.6,0.6,1,1
|
||||||
|
StepsTypeColor2=1,0.3,0.3,1
|
||||||
|
StepsTypeColor3=0.3,1,0.3,1
|
||||||
|
StepsTypeColor4=1.0,1,1.0,1
|
||||||
|
StepsTypeColor5=1.0,1,1.0,1
|
||||||
|
|
||||||
BannerX=517
|
BannerX=517
|
||||||
BannerY=44
|
BannerY=44
|
||||||
BannerWidth=220
|
BannerOnCommand=scaletoclipped,220,58;addx,640;sleep,0.0;bounceend,1;addx,-640
|
||||||
BannerHeight=58
|
|
||||||
BannerOnCommand=addx,640;sleep,0.0;bounceend,1;addx,-640
|
|
||||||
BannerOffCommand=sleep,0.0;linear,0.5;diffusealpha,0
|
BannerOffCommand=sleep,0.0;linear,0.5;diffusealpha,0
|
||||||
BannerFrameX=0
|
BannerFrameX=0
|
||||||
BannerFrameY=0
|
BannerFrameY=0
|
||||||
BannerFrameOnCommand=hidden,1
|
BannerFrameOnCommand=hidden,1
|
||||||
BannerFrameOffCommand=
|
BannerFrameOffCommand=
|
||||||
TypeX=520
|
CategoryX=517
|
||||||
TypeY=60
|
CategoryY=32
|
||||||
TypeOnCommand=addx,640;sleep,0.0;bounceend,1;addx,-640
|
CategoryOnCommand=addx,640;sleep,0.0;bounceend,1;addx,-640
|
||||||
TypeOffCommand=sleep,0.0;linear,0.5;diffusealpha,0
|
CategoryOffCommand=sleep,0.0;linear,0.5;diffusealpha,0
|
||||||
LineSpacingX=0
|
StepsTypeX=520
|
||||||
LineSpacingY=60
|
StepsTypeY=60
|
||||||
BulletsStartX=100
|
StepsTypeOnCommand=addx,640;sleep,0.0;bounceend,1;addx,-640
|
||||||
BulletsStartY=140
|
StepsTypeOffCommand=sleep,0.0;linear,0.5;diffusealpha,0
|
||||||
Bullets1OnCommand=addx,640;sleep,0.2;bounceend,1;addx,-640
|
|
||||||
Bullets2OnCommand=addx,640;sleep,0.3;bounceend,1;addx,-640
|
BulletStartX=100
|
||||||
Bullets3OnCommand=addx,640;sleep,0.4;bounceend,1;addx,-640
|
BulletStartY=140
|
||||||
Bullets4OnCommand=addx,640;sleep,0.5;bounceend,1;addx,-640
|
Bullet1OnCommand=addx,640;sleep,0.2;bounceend,1;addx,-640
|
||||||
Bullets5OnCommand=addx,640;sleep,0.6;bounceend,1;addx,-640
|
Bullet2OnCommand=addx,640;sleep,0.3;bounceend,1;addx,-640
|
||||||
Bullets1OffCommand=sleep,0.2;linear,0.5;diffusealpha,0
|
Bullet3OnCommand=addx,640;sleep,0.4;bounceend,1;addx,-640
|
||||||
Bullets2OffCommand=sleep,0.3;linear,0.5;diffusealpha,0
|
Bullet4OnCommand=addx,640;sleep,0.5;bounceend,1;addx,-640
|
||||||
Bullets3OffCommand=sleep,0.4;linear,0.5;diffusealpha,0
|
Bullet5OnCommand=addx,640;sleep,0.6;bounceend,1;addx,-640
|
||||||
Bullets4OffCommand=sleep,0.5;linear,0.5;diffusealpha,0
|
Bullet1OffCommand=sleep,0.2;linear,0.5;diffusealpha,0
|
||||||
Bullets5OffCommand=sleep,0.6;linear,0.5;diffusealpha,0
|
Bullet2OffCommand=sleep,0.3;linear,0.5;diffusealpha,0
|
||||||
TextZoom=1.0
|
Bullet3OffCommand=sleep,0.4;linear,0.5;diffusealpha,0
|
||||||
TextSongZoom=0.7
|
Bullet4OffCommand=sleep,0.5;linear,0.5;diffusealpha,0
|
||||||
TextColor=0.8,0.8,1,1
|
Bullet5OffCommand=sleep,0.6;linear,0.5;diffusealpha,0
|
||||||
NamesStartX=180
|
NameStartX=180
|
||||||
NamesStartY=140
|
NameStartY=140
|
||||||
Names1OnCommand=addx,640;sleep,0.2;bounceend,1;addx,-640
|
Name1OnCommand=horizalign,left;addx,640;sleep,0.2;bounceend,1;addx,-640
|
||||||
Names2OnCommand=addx,640;sleep,0.3;bounceend,1;addx,-640
|
Name2OnCommand=horizalign,left;addx,640;sleep,0.3;bounceend,1;addx,-640
|
||||||
Names3OnCommand=addx,640;sleep,0.4;bounceend,1;addx,-640
|
Name3OnCommand=horizalign,left;addx,640;sleep,0.4;bounceend,1;addx,-640
|
||||||
Names4OnCommand=addx,640;sleep,0.5;bounceend,1;addx,-640
|
Name4OnCommand=horizalign,left;addx,640;sleep,0.5;bounceend,1;addx,-640
|
||||||
Names5OnCommand=addx,640;sleep,0.6;bounceend,1;addx,-640
|
Name5OnCommand=horizalign,left;addx,640;sleep,0.6;bounceend,1;addx,-640
|
||||||
Names1OffCommand=sleep,0.2;linear,0.5;diffusealpha,0
|
Name1OffCommand=sleep,0.2;linear,0.5;diffusealpha,0
|
||||||
Names2OffCommand=sleep,0.3;linear,0.5;diffusealpha,0
|
Name2OffCommand=sleep,0.3;linear,0.5;diffusealpha,0
|
||||||
Names3OffCommand=sleep,0.4;linear,0.5;diffusealpha,0
|
Name3OffCommand=sleep,0.4;linear,0.5;diffusealpha,0
|
||||||
Names4OffCommand=sleep,0.5;linear,0.5;diffusealpha,0
|
Name4OffCommand=sleep,0.5;linear,0.5;diffusealpha,0
|
||||||
Names5OffCommand=sleep,0.6;linear,0.5;diffusealpha,0
|
Name5OffCommand=sleep,0.6;linear,0.5;diffusealpha,0
|
||||||
ScoresStartX=520
|
ScoreStartX=520
|
||||||
ScoresStartY=140
|
ScoreStartY=140
|
||||||
Scores1OnCommand=addx,640;sleep,0.2;bounceend,1;addx,-640
|
Score1OnCommand=horizalign,right;addx,640;sleep,0.2;bounceend,1;addx,-640
|
||||||
Scores2OnCommand=addx,640;sleep,0.3;bounceend,1;addx,-640
|
Score2OnCommand=horizalign,right;addx,640;sleep,0.3;bounceend,1;addx,-640
|
||||||
Scores3OnCommand=addx,640;sleep,0.4;bounceend,1;addx,-640
|
Score3OnCommand=horizalign,right;addx,640;sleep,0.4;bounceend,1;addx,-640
|
||||||
Scores4OnCommand=addx,640;sleep,0.5;bounceend,1;addx,-640
|
Score4OnCommand=horizalign,right;addx,640;sleep,0.5;bounceend,1;addx,-640
|
||||||
Scores5OnCommand=addx,640;sleep,0.6;bounceend,1;addx,-640
|
Score5OnCommand=horizalign,right;addx,640;sleep,0.6;bounceend,1;addx,-640
|
||||||
Scores1OffCommand=sleep,0.2;linear,0.5;diffusealpha,0
|
Score1OffCommand=sleep,0.2;linear,0.5;diffusealpha,0
|
||||||
Scores2OffCommand=sleep,0.3;linear,0.5;diffusealpha,0
|
Score2OffCommand=sleep,0.3;linear,0.5;diffusealpha,0
|
||||||
Scores3OffCommand=sleep,0.4;linear,0.5;diffusealpha,0
|
Score3OffCommand=sleep,0.4;linear,0.5;diffusealpha,0
|
||||||
Scores4OffCommand=sleep,0.5;linear,0.5;diffusealpha,0
|
Score4OffCommand=sleep,0.5;linear,0.5;diffusealpha,0
|
||||||
Scores5OffCommand=sleep,0.6;linear,0.5;diffusealpha,0
|
Score5OffCommand=sleep,0.6;linear,0.5;diffusealpha,0
|
||||||
PointsStartX=380
|
PointsStartX=380
|
||||||
PointsStartY=140
|
PointsStartY=140
|
||||||
Points1OnCommand=addx,640;sleep,0.2;bounceend,1;addx,-640
|
Points1OnCommand=addx,640;sleep,0.2;bounceend,1;addx,-640
|
||||||
@@ -3519,43 +3533,6 @@ Time2OffCommand=sleep,0.3;linear,0.5;diffusealpha,0
|
|||||||
Time3OffCommand=sleep,0.4;linear,0.5;diffusealpha,0
|
Time3OffCommand=sleep,0.4;linear,0.5;diffusealpha,0
|
||||||
Time4OffCommand=sleep,0.5;linear,0.5;diffusealpha,0
|
Time4OffCommand=sleep,0.5;linear,0.5;diffusealpha,0
|
||||||
Time5OffCommand=sleep,0.6;linear,0.5;diffusealpha,0
|
Time5OffCommand=sleep,0.6;linear,0.5;diffusealpha,0
|
||||||
PercentStartX=170
|
|
||||||
PercentStartY=140
|
|
||||||
Percent1OnCommand=addx,640;sleep,0.2;bounceend,1;addx,-640
|
|
||||||
Percent2OnCommand=addx,640;sleep,0.3;bounceend,1;addx,-640
|
|
||||||
Percent3OnCommand=addx,640;sleep,0.4;bounceend,1;addx,-640
|
|
||||||
Percent4OnCommand=addx,640;sleep,0.5;bounceend,1;addx,-640
|
|
||||||
Percent5OnCommand=addx,640;sleep,0.6;bounceend,1;addx,-640
|
|
||||||
Percent1OffCommand=sleep,0.2;linear,0.5;diffusealpha,0
|
|
||||||
Percent2OffCommand=sleep,0.3;linear,0.5;diffusealpha,0
|
|
||||||
Percent3OffCommand=sleep,0.4;linear,0.5;diffusealpha,0
|
|
||||||
Percent4OffCommand=sleep,0.5;linear,0.5;diffusealpha,0
|
|
||||||
Percent5OffCommand=sleep,0.6;linear,0.5;diffusealpha,0
|
|
||||||
DifficultyStartX=170
|
|
||||||
DifficultyStartY=96
|
|
||||||
DifficultySpacingX=110
|
|
||||||
DifficultySpacingY=0
|
|
||||||
DifficultyOnCommand=addx,640;sleep,0.1;bounceend,1;addx,-640
|
|
||||||
DifficultyOffCommand=sleep,0.1;linear,0.5;diffusealpha,0
|
|
||||||
SecondsPerPage=5
|
|
||||||
ShowCategories=1
|
|
||||||
ShowSongScores=0
|
|
||||||
NumSongsToShow=10
|
|
||||||
CoursesToShow=Courses/DDRMAX/NaokiStandard.crs,Courses/DDRMAX/ParanoiaBrothers.crs,Courses/Samples/PlayersBest1-4.crs
|
|
||||||
NotesTypesToHide=dance-couple,dance-solo,pump-halfdouble
|
|
||||||
TextColor1=0.6,0.6,1,1
|
|
||||||
TextColor2=1,0.3,0.3,1
|
|
||||||
TextColor3=0.3,1,0.3,1
|
|
||||||
EmptyScoreName=STEP
|
|
||||||
NoScoreName=STEP
|
|
||||||
DifficultiesToShow=easy,medium,hard,challenge
|
|
||||||
PageFadeSeconds=1.0
|
|
||||||
|
|
||||||
# Not all game types have NotesTypesToHide set, so add a few dummy colors
|
|
||||||
# to prevent a crash.
|
|
||||||
TextColor4=1.0,1,1.0,1
|
|
||||||
TextColor5=1.0,1,1.0,1
|
|
||||||
|
|
||||||
|
|
||||||
[ScreenSoundOptions]
|
[ScreenSoundOptions]
|
||||||
StyleIcon=0
|
StyleIcon=0
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ public:
|
|||||||
//
|
//
|
||||||
// other properties
|
// other properties
|
||||||
//
|
//
|
||||||
|
bool GetHidden() { return m_bHidden; }
|
||||||
void SetHidden( bool b ) { m_bHidden = b; }
|
void SetHidden( bool b ) { m_bHidden = b; }
|
||||||
void SetShadowLength( float fLength );
|
void SetShadowLength( float fLength );
|
||||||
void EnableShadow( bool b ) { m_bShadow = b; }
|
void EnableShadow( bool b ) { m_bShadow = b; }
|
||||||
|
|||||||
@@ -149,6 +149,10 @@ void UtilSetXY( Actor& actor, CString sClassName )
|
|||||||
|
|
||||||
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName )
|
float UtilCommand( Actor& actor, CString sClassName, CString sCommandName )
|
||||||
{
|
{
|
||||||
|
// If Actor is hidden, it won't get updated or drawn, so don't bother tweening.
|
||||||
|
if( actor.GetHidden() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
float ret = actor.Command( "playcommand," + sCommandName );
|
float ret = actor.Command( "playcommand," + sCommandName );
|
||||||
|
|
||||||
// HACK: It's very often that we command things to TweenOffScreen
|
// HACK: It's very often that we command things to TweenOffScreen
|
||||||
|
|||||||
@@ -159,6 +159,8 @@ void GameState::Reset()
|
|||||||
void GameState::BeginGame()
|
void GameState::BeginGame()
|
||||||
{
|
{
|
||||||
m_timeGameStarted = time(NULL);
|
m_timeGameStarted = time(NULL);
|
||||||
|
|
||||||
|
m_vpsNamesThatWereFilled.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameState::EndGame()
|
void GameState::EndGame()
|
||||||
@@ -1176,6 +1178,9 @@ void GameState::StoreRankingName( PlayerNumber pn, CString name )
|
|||||||
for( unsigned i=0; i<aFeats.size(); i++ )
|
for( unsigned i=0; i<aFeats.size(); i++ )
|
||||||
{
|
{
|
||||||
*aFeats[i].pStringToFill = name;
|
*aFeats[i].pStringToFill = name;
|
||||||
|
|
||||||
|
// save name pointers as we fill them
|
||||||
|
m_vpsNamesThatWereFilled.push_back( aFeats[i].pStringToFill );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -247,9 +247,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
void GetRankingFeats( PlayerNumber pn, vector<RankingFeats> &asFeatsOut );
|
void GetRankingFeats( PlayerNumber pn, vector<RankingFeats> &asFeatsOut );
|
||||||
|
void StoreRankingName( PlayerNumber pn, CString name ); // Called by name entry screens
|
||||||
/* Called by name entry screens: */
|
vector<CString*> m_vpsNamesThatWereFilled; // filled on StoreRankingName,
|
||||||
void StoreRankingName( PlayerNumber pn, CString name );
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Arrow positioning
|
// Arrow positioning
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
#include "global.h"
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Class: ListDisplay
|
||||||
|
|
||||||
|
Desc: See header.
|
||||||
|
|
||||||
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
|
Chris Danford
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ListDisplay.h"
|
||||||
|
#include "RageUtil.h"
|
||||||
|
#include "GameConstantsAndTypes.h"
|
||||||
|
#include "PrefsManager.h"
|
||||||
|
#include "RageLog.h"
|
||||||
|
#include "PrefsManager.h"
|
||||||
|
#include "Course.h"
|
||||||
|
#include "SongManager.h"
|
||||||
|
#include <math.h>
|
||||||
|
#include "ThemeManager.h"
|
||||||
|
#include "Steps.h"
|
||||||
|
#include "GameState.h"
|
||||||
|
#include "StyleDef.h"
|
||||||
|
#include "RageTexture.h"
|
||||||
|
|
||||||
|
|
||||||
|
ListDisplay::ListDisplay()
|
||||||
|
{
|
||||||
|
m_iNumItemsToShow = 0;
|
||||||
|
m_fItemWidth = 0;
|
||||||
|
m_fItemHeight = 0;
|
||||||
|
m_fItemAtTopOfList = 0;
|
||||||
|
|
||||||
|
m_quadMask.SetBlendMode( BLEND_NO_EFFECT ); // don't change color values
|
||||||
|
m_quadMask.SetUseZBuffer( true ); // we want to write to the Zbuffer
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ListDisplay::Load(
|
||||||
|
const vector<Actor*> &m_vpItems,
|
||||||
|
int iNumItemsToShow,
|
||||||
|
float fItemWidth,
|
||||||
|
float fItemHeight,
|
||||||
|
bool bLoop,
|
||||||
|
float fSecondsPerItem,
|
||||||
|
float fSecondsPauseBetweenItems,
|
||||||
|
bool bSlide )
|
||||||
|
{
|
||||||
|
ASSERT( iNumItemsToShow > 0 );
|
||||||
|
ASSERT( fItemWidth > 0 );
|
||||||
|
ASSERT( fItemHeight > 0 );
|
||||||
|
ASSERT( fSecondsPerItem > 0 );
|
||||||
|
ASSERT( fSecondsPauseBetweenItems >= 0 );
|
||||||
|
|
||||||
|
m_SubActors = m_vpItems;
|
||||||
|
m_iNumItemsToShow = iNumItemsToShow;
|
||||||
|
m_fItemWidth = fItemWidth;
|
||||||
|
m_fItemHeight = fItemHeight;
|
||||||
|
m_bLoop = bLoop;
|
||||||
|
m_fSecondsPerItem = fSecondsPerItem;
|
||||||
|
m_fSecondsPauseBetweenItems = fSecondsPauseBetweenItems;
|
||||||
|
m_bSlide = bSlide;
|
||||||
|
m_fItemAtTopOfList = m_bLoop ? 0 : -m_iNumItemsToShow;
|
||||||
|
m_fSecondsPauseCountdown = 0;
|
||||||
|
|
||||||
|
RectF rectBarSize(-m_fItemWidth/2, -m_fItemHeight/2,
|
||||||
|
m_fItemWidth/2, m_fItemHeight/2);
|
||||||
|
m_quadMask.StretchTo( rectBarSize );
|
||||||
|
m_quadMask.SetZ( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
float ListDisplay::GetSecondsForCompleteScrollThrough()
|
||||||
|
{
|
||||||
|
float fTotalItems = m_iNumItemsToShow + m_SubActors.size();
|
||||||
|
return fTotalItems * (m_fSecondsPerItem + m_fSecondsPauseBetweenItems );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ListDisplay::Update( float fDeltaTime )
|
||||||
|
{
|
||||||
|
ActorFrame::Update( fDeltaTime );
|
||||||
|
|
||||||
|
while( fDeltaTime > 0 )
|
||||||
|
{
|
||||||
|
// handle pause
|
||||||
|
if( fDeltaTime > m_fSecondsPauseCountdown )
|
||||||
|
{
|
||||||
|
fDeltaTime -= m_fSecondsPauseCountdown;
|
||||||
|
m_fSecondsPauseCountdown = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_fSecondsPauseCountdown -= fDeltaTime;
|
||||||
|
fDeltaTime = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// handle scrolling
|
||||||
|
float fPercentUntilNextItem = (int)m_fItemAtTopOfList+1 - m_fItemAtTopOfList;
|
||||||
|
float fSecsUntilNextItem = fPercentUntilNextItem * m_fSecondsPerItem;
|
||||||
|
|
||||||
|
if( fDeltaTime > fSecsUntilNextItem )
|
||||||
|
{
|
||||||
|
fDeltaTime -= fSecsUntilNextItem;
|
||||||
|
m_fItemAtTopOfList += fPercentUntilNextItem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_fItemAtTopOfList += fDeltaTime / m_fSecondsPerItem;
|
||||||
|
fDeltaTime = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( m_bLoop )
|
||||||
|
wrap( m_fItemAtTopOfList, m_SubActors.size() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ListDisplay::DrawPrimitives()
|
||||||
|
{
|
||||||
|
if( m_SubActors.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// write to z buffer so that top and bottom are clipped
|
||||||
|
float fIndexFullyOnScreenTop = -(m_iNumItemsToShow-1)/2.f;
|
||||||
|
float fIndexFullyOnScreenBottom = (m_iNumItemsToShow-1)/2.f;
|
||||||
|
float fIndexCompletelyOffScreenTop = fIndexFullyOnScreenTop - 1;
|
||||||
|
float fIndexCompletelyOffScreenBottom = fIndexFullyOnScreenBottom + 1;
|
||||||
|
|
||||||
|
m_quadMask.SetY( fIndexCompletelyOffScreenTop * m_fItemHeight );
|
||||||
|
m_quadMask.Draw();
|
||||||
|
m_quadMask.SetY( fIndexCompletelyOffScreenBottom * m_fItemHeight );
|
||||||
|
m_quadMask.Draw();
|
||||||
|
|
||||||
|
int iItemToDraw = (int)m_fItemAtTopOfList;
|
||||||
|
float fRemainder = m_fItemAtTopOfList - (int)m_fItemAtTopOfList;
|
||||||
|
float fIndex = fIndexFullyOnScreenTop - fRemainder;
|
||||||
|
float fY = (fIndex)*m_fItemHeight;
|
||||||
|
|
||||||
|
for( int i=0; i<m_iNumItemsToShow+1; i++ )
|
||||||
|
{
|
||||||
|
if( iItemToDraw >= 0 && iItemToDraw < m_SubActors.size() )
|
||||||
|
{
|
||||||
|
float fX = 0;
|
||||||
|
if( m_bSlide && fIndex>fIndexFullyOnScreenBottom-1 )
|
||||||
|
fX = SCALE( fIndex, fIndexFullyOnScreenBottom, fIndexFullyOnScreenBottom-1.f, 640.f, 0.f );
|
||||||
|
m_SubActors[iItemToDraw]->SetXY( roundf(fX), roundf(fY) );
|
||||||
|
m_SubActors[iItemToDraw]->Draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
iItemToDraw++;
|
||||||
|
if( m_bLoop )
|
||||||
|
wrap( iItemToDraw, m_SubActors.size() );
|
||||||
|
fY += m_fItemHeight;
|
||||||
|
fIndex += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
#ifndef ListDisplay_H
|
||||||
|
#define ListDisplay_H
|
||||||
|
/*
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Class: ListDisplay
|
||||||
|
|
||||||
|
Desc: Holds course name and banner.
|
||||||
|
|
||||||
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
|
Chris Danford
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ActorFrame.h"
|
||||||
|
#include "Quad.h"
|
||||||
|
|
||||||
|
class ListDisplay : public ActorFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ListDisplay();
|
||||||
|
|
||||||
|
virtual void Update( float fDeltaTime );
|
||||||
|
virtual void DrawPrimitives();
|
||||||
|
|
||||||
|
void Load(
|
||||||
|
const vector<Actor*> &m_vpItems,
|
||||||
|
int iNumItemsToShow,
|
||||||
|
float fItemWidth,
|
||||||
|
float fItemHeight,
|
||||||
|
bool bLoop,
|
||||||
|
float fSecondsPerItem,
|
||||||
|
float fSecondsPauseBetweenItems,
|
||||||
|
bool bSlide );
|
||||||
|
|
||||||
|
float GetSecondsForCompleteScrollThrough();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_iNumItemsToShow;
|
||||||
|
float m_fItemWidth;
|
||||||
|
float m_fItemHeight;
|
||||||
|
bool m_bLoop;
|
||||||
|
float m_fSecondsPerItem;
|
||||||
|
float m_fSecondsPauseBetweenItems;
|
||||||
|
bool m_bSlide;
|
||||||
|
|
||||||
|
float m_fItemAtTopOfList;
|
||||||
|
float m_fSecondsPauseCountdown;
|
||||||
|
Quad m_quadMask;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
+416
-347
@@ -24,60 +24,57 @@
|
|||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
|
|
||||||
static int g_iLastSongShown = 0;
|
|
||||||
|
|
||||||
|
#define STEPS_TYPES_TO_HIDE THEME->GetMetric ("ScreenRanking","StepsTypesToHide")
|
||||||
#define CATEGORY_WIDTH THEME->GetMetricF("ScreenRanking","CategoryWidth")
|
#define SHOW_CATEGORIES THEME->GetMetricB("ScreenRanking","ShowCategories")
|
||||||
#define BANNER_WIDTH THEME->GetMetricF("ScreenRanking","BannerWidth")
|
#define SHOW_ALL_STEPS_SCORES THEME->GetMetricB("ScreenRanking","ShowAllStepsScores")
|
||||||
#define BANNER_HEIGHT THEME->GetMetricF("ScreenRanking","BannerHeight")
|
#define DIFFICULTIES_TO_SHOW THEME->GetMetric ("ScreenRanking","DifficultiesToShow")
|
||||||
#define LINE_SPACING_X THEME->GetMetricF("ScreenRanking","LineSpacingX")
|
#define COURSES_TO_SHOW PREFSMAN->m_sCoursesToShowRanking
|
||||||
#define LINE_SPACING_Y THEME->GetMetricF("ScreenRanking","LineSpacingY")
|
|
||||||
#define BULLETS_START_X THEME->GetMetricF("ScreenRanking","BulletsStartX")
|
|
||||||
#define BULLETS_START_Y THEME->GetMetricF("ScreenRanking","BulletsStartY")
|
|
||||||
#define BULLETS_ON_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Bullets%dOnCommand",l+1))
|
|
||||||
#define BULLETS_OFF_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Bullets%dOffCommand",l+1))
|
|
||||||
#define TEXT_ZOOM THEME->GetMetricF("ScreenRanking","TextZoom")
|
|
||||||
#define TEXT_SONGZOOM THEME->GetMetricF("ScreenRanking","TextSongZoom")
|
|
||||||
#define TEXT_COLOR( i ) THEME->GetMetricC("ScreenRanking",ssprintf("TextColor%d",i+1))
|
|
||||||
#define NAMES_START_X THEME->GetMetricF("ScreenRanking","NamesStartX")
|
|
||||||
#define NAMES_START_Y THEME->GetMetricF("ScreenRanking","NamesStartY")
|
|
||||||
#define NAMES_ON_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Names%dOnCommand",l+1))
|
|
||||||
#define NAMES_OFF_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Names%dOffCommand",l+1))
|
|
||||||
#define SCORES_START_X THEME->GetMetricF("ScreenRanking","ScoresStartX")
|
|
||||||
#define SCORES_START_Y THEME->GetMetricF("ScreenRanking","ScoresStartY")
|
|
||||||
#define SCORES_ON_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Scores%dOnCommand",l+1))
|
|
||||||
#define SCORES_OFF_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Scores%dOffCommand",l+1))
|
|
||||||
#define POINTS_START_X THEME->GetMetricF("ScreenRanking","PointsStartX")
|
|
||||||
#define POINTS_START_Y THEME->GetMetricF("ScreenRanking","PointsStartY")
|
|
||||||
#define POINTS_ON_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Points%dOnCommand",l+1))
|
|
||||||
#define POINTS_OFF_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Points%dOffCommand",l+1))
|
|
||||||
#define TIME_START_X THEME->GetMetricF("ScreenRanking","TimeStartX")
|
|
||||||
#define TIME_START_Y THEME->GetMetricF("ScreenRanking","TimeStartY")
|
|
||||||
#define TIME_ON_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Time%dOnCommand",l+1))
|
|
||||||
#define TIME_OFF_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Time%dOffCommand",l+1))
|
|
||||||
#define PERCENT_START_X THEME->GetMetricF("ScreenRanking","PercentStartX")
|
|
||||||
#define PERCENT_START_Y THEME->GetMetricF("ScreenRanking","PercentStartY")
|
|
||||||
#define PERCENT_ON_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Percent%dOnCommand",l+1))
|
|
||||||
#define PERCENT_OFF_COMMAND( l ) THEME->GetMetric ("ScreenRanking",ssprintf("Percent%dOffCommand",l+1))
|
|
||||||
#define PERCENT_DECIMAL_PLACES THEME->GetMetricI("ScreenRanking","PercentDecimalPlaces")
|
|
||||||
#define PERCENT_TOTAL_SIZE THEME->GetMetricI("ScreenRanking","PercentTotalSize")
|
|
||||||
#define DIFFICULTY_START_X THEME->GetMetricF("ScreenRanking","DifficultyStartX")
|
|
||||||
#define DIFFICULTY_START_Y THEME->GetMetricF("ScreenRanking","DifficultyStartY")
|
|
||||||
#define DIFFICULTY_SPACING_X THEME->GetMetricF("ScreenRanking","DifficultySpacingX")
|
|
||||||
#define DIFFICULTY_SPACING_Y THEME->GetMetricF("ScreenRanking","DifficultySpacingY")
|
|
||||||
#define DIFFICULTY_ON_COMMAND THEME->GetMetric ("ScreenRanking","DifficultyOnCommand")
|
|
||||||
#define DIFFICULTY_OFF_COMMAND THEME->GetMetric ("ScreenRanking","DifficultyOffCommand")
|
|
||||||
#define SECONDS_PER_PAGE THEME->GetMetricF("ScreenRanking","SecondsPerPage")
|
#define SECONDS_PER_PAGE THEME->GetMetricF("ScreenRanking","SecondsPerPage")
|
||||||
#define PAGE_FADE_SECONDS THEME->GetMetricF("ScreenRanking","PageFadeSeconds")
|
#define PAGE_FADE_SECONDS THEME->GetMetricF("ScreenRanking","PageFadeSeconds")
|
||||||
#define SHOW_CATEGORIES THEME->GetMetricB("ScreenRanking","ShowCategories")
|
#define PERCENT_DECIMAL_PLACES THEME->GetMetricI("ScreenRanking","PercentDecimalPlaces")
|
||||||
#define SHOW_SONG_SCORES THEME->GetMetricB("ScreenRanking","ShowSongScores")
|
#define PERCENT_TOTAL_SIZE THEME->GetMetricI("ScreenRanking","PercentTotalSize")
|
||||||
#define NUM_SONGS_TO_SHOW THEME->GetMetricI("ScreenRanking","NumSongsToShow")
|
|
||||||
#define NOTES_TYPES_TO_HIDE THEME->GetMetric ("ScreenRanking","NotesTypesToHide")
|
|
||||||
#define EMPTY_SCORE_NAME THEME->GetMetric ("ScreenRanking","EmptyScoreName")
|
#define EMPTY_SCORE_NAME THEME->GetMetric ("ScreenRanking","EmptyScoreName")
|
||||||
#define NO_SCORE_NAME THEME->GetMetric ("ScreenRanking","NoScoreName")
|
#define NO_SCORE_NAME THEME->GetMetric ("ScreenRanking","NoScoreName")
|
||||||
#define DIFFICULTIES_TO_SHOW THEME->GetMetric ("ScreenRanking","DifficultiesToShow")
|
|
||||||
|
|
||||||
#define COURSES_TO_SHOW PREFSMAN->m_sCoursesToShowRanking
|
#define ROW_SPACING_X THEME->GetMetricF("ScreenRanking","RowSpacingX")
|
||||||
|
#define ROW_SPACING_Y THEME->GetMetricF("ScreenRanking","RowSpacingY")
|
||||||
|
#define COL_SPACING_X THEME->GetMetricF("ScreenRanking","ColSpacingX")
|
||||||
|
#define COL_SPACING_Y THEME->GetMetricF("ScreenRanking","ColSpacingY")
|
||||||
|
#define STEPS_TYPE_COLOR( i ) THEME->GetMetricC("ScreenRanking",ssprintf("StepsTypeColor%d",i+1))
|
||||||
|
#define NUM_ROW_ITEMS_TO_SHOW THEME->GetMetricI("ScreenRanking","NumRowItemsToShow")
|
||||||
|
|
||||||
|
#define BULLET_START_X THEME->GetMetricF("ScreenRanking","BulletStartX")
|
||||||
|
#define BULLET_START_Y THEME->GetMetricF("ScreenRanking","BulletStartY")
|
||||||
|
#define NAME_START_X THEME->GetMetricF("ScreenRanking","NameStartX")
|
||||||
|
#define NAME_START_Y THEME->GetMetricF("ScreenRanking","NameStartY")
|
||||||
|
#define SCORE_START_X THEME->GetMetricF("ScreenRanking","ScoreStartX")
|
||||||
|
#define SCORE_START_Y THEME->GetMetricF("ScreenRanking","ScoreStartY")
|
||||||
|
#define POINTS_START_X THEME->GetMetricF("ScreenRanking","PointsStartX")
|
||||||
|
#define POINTS_START_Y THEME->GetMetricF("ScreenRanking","PointsStartY")
|
||||||
|
#define TIME_START_X THEME->GetMetricF("ScreenRanking","TimeStartX")
|
||||||
|
#define TIME_START_Y THEME->GetMetricF("ScreenRanking","TimeStartY")
|
||||||
|
#define DIFFICULTY_START_X THEME->GetMetricF("ScreenRanking","DifficultyStartX")
|
||||||
|
#define DIFFICULTY_Y THEME->GetMetricF("ScreenRanking","DifficultyY")
|
||||||
|
#define SONG_TITLE_OFFSET_X THEME->GetMetricF("ScreenRanking","SongTitleOffsetX")
|
||||||
|
#define SONG_TITLE_OFFSET_Y THEME->GetMetricF("ScreenRanking","SongTitleOffsetY")
|
||||||
|
#define SONG_FRAME_OFFSET_X THEME->GetMetricF("ScreenRanking","SongFrameOffsetX")
|
||||||
|
#define SONG_FRAME_OFFSET_Y THEME->GetMetricF("ScreenRanking","SongFrameOffsetY")
|
||||||
|
#define STEPS_SCORE_OFFSET_START_X THEME->GetMetricF("ScreenRanking","StepsScoreOffsetStartX")
|
||||||
|
#define STEPS_SCORE_OFFSET_Y THEME->GetMetricF("ScreenRanking","StepsScoreOffsetY")
|
||||||
|
|
||||||
|
#define BULLET_X(row) (BULLET_START_X+ROW_SPACING_X*row)
|
||||||
|
#define BULLET_Y(row) (BULLET_START_Y+ROW_SPACING_Y*row)
|
||||||
|
#define NAME_X(row) (NAME_START_X+ROW_SPACING_X*row)
|
||||||
|
#define NAME_Y(row) (NAME_START_Y+ROW_SPACING_Y*row)
|
||||||
|
#define SCORE_X(row) (SCORE_START_X+ROW_SPACING_X*row)
|
||||||
|
#define SCORE_Y(row) (SCORE_START_Y+ROW_SPACING_Y*row)
|
||||||
|
#define POINTS_X(row) (POINTS_START_X+ROW_SPACING_X*row)
|
||||||
|
#define POINTS_Y(row) (POINTS_START_Y+ROW_SPACING_Y*row)
|
||||||
|
#define TIME_X(row) (TIME_START_X+ROW_SPACING_X*row)
|
||||||
|
#define TIME_Y(row) (TIME_START_Y+ROW_SPACING_Y*row)
|
||||||
|
#define DIFFICULTY_X(col) (DIFFICULTY_START_X+COL_SPACING_X*col)
|
||||||
|
#define STEPS_SCORE_OFFSET_X(col) (STEPS_SCORE_OFFSET_START_X+COL_SPACING_X*col)
|
||||||
|
|
||||||
const ScreenMessage SM_ShowNextPage = (ScreenMessage)(SM_User+67);
|
const ScreenMessage SM_ShowNextPage = (ScreenMessage)(SM_User+67);
|
||||||
const ScreenMessage SM_HidePage = (ScreenMessage)(SM_User+68);
|
const ScreenMessage SM_HidePage = (ScreenMessage)(SM_User+68);
|
||||||
@@ -85,105 +82,147 @@ const ScreenMessage SM_HidePage = (ScreenMessage)(SM_User+68);
|
|||||||
|
|
||||||
ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
|
ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
|
||||||
{
|
{
|
||||||
m_sprCategory.SetName( "Category" );
|
// init Actors for category and course
|
||||||
this->AddChild( &m_sprCategory );
|
|
||||||
|
|
||||||
m_banner.SetName( "Banner" );
|
|
||||||
this->AddChild( &m_banner );
|
|
||||||
|
|
||||||
m_sprBannerFrame.SetName( "BannerFrame" );
|
|
||||||
this->AddChild( &m_sprBannerFrame );
|
|
||||||
|
|
||||||
m_textCategory.SetName( "Category" );
|
|
||||||
m_textCategory.LoadFromFont( THEME->GetPathToF("ScreenRanking title") );
|
|
||||||
m_textCategory.EnableShadow( false );
|
|
||||||
this->AddChild( &m_textCategory );
|
|
||||||
|
|
||||||
m_sprType.SetName( "Type" );
|
|
||||||
this->AddChild( &m_sprType );
|
|
||||||
|
|
||||||
|
|
||||||
// make the list of difficulties to show
|
|
||||||
vector<CString> sShowDiffs;
|
|
||||||
split( DIFFICULTIES_TO_SHOW, ",", sShowDiffs, true );
|
|
||||||
|
|
||||||
for( vector<CString>::const_iterator iter = sShowDiffs.begin(); iter != sShowDiffs.end(); iter++ )
|
|
||||||
{
|
{
|
||||||
m_vDiffsToShow.push_back( StringToDifficulty( *iter ) );
|
m_Banner.SetName( "Banner" );
|
||||||
}
|
m_Banner.SetHidden( true );
|
||||||
|
this->AddChild( &m_Banner );
|
||||||
|
|
||||||
|
m_sprBannerFrame.SetName( "BannerFrame" );
|
||||||
|
m_sprBannerFrame.SetHidden( true );
|
||||||
|
this->AddChild( &m_sprBannerFrame );
|
||||||
|
|
||||||
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
m_textCategory.SetName( "Category" );
|
||||||
{
|
m_textCategory.LoadFromFont( THEME->GetPathToF("ScreenRanking category") );
|
||||||
m_sprBullets[l].Load( THEME->GetPathToG("ScreenRanking bullets 1x5") );
|
m_textCategory.EnableShadow( false );
|
||||||
m_sprBullets[l].SetDiffuseAlpha( 0 );
|
m_textCategory.SetHidden( true );
|
||||||
this->AddChild( &m_sprBullets[l] );
|
this->AddChild( &m_textCategory );
|
||||||
|
|
||||||
m_textNames[l].LoadFromFont( THEME->GetPathToF("ScreenRanking letters") );
|
m_textStepsType.SetName( "StepsType" );
|
||||||
m_textNames[l].SetDiffuseAlpha( 0 );
|
m_textStepsType.LoadFromFont( THEME->GetPathToF("ScreenRanking steps type") );
|
||||||
this->AddChild( &m_textNames[l] );
|
m_textStepsType.EnableShadow( false );
|
||||||
|
m_textStepsType.SetHidden( true );
|
||||||
|
this->AddChild( &m_textStepsType );
|
||||||
|
|
||||||
m_textScores[l].LoadFromFont( THEME->GetPathToF("ScreenRanking letters") );
|
|
||||||
m_textScores[l].SetDiffuseAlpha( 0 );
|
|
||||||
this->AddChild( &m_textScores[l] );
|
|
||||||
|
|
||||||
m_textPoints[l].LoadFromFont( THEME->GetPathToF("ScreenRanking letters") );
|
|
||||||
m_textPoints[l].SetDiffuseAlpha( 0 );
|
|
||||||
this->AddChild( &m_textPoints[l] );
|
|
||||||
|
|
||||||
m_textTime[l].LoadFromFont( THEME->GetPathToF("ScreenRanking letters") );
|
|
||||||
m_textTime[l].SetDiffuseAlpha( 0 );
|
|
||||||
this->AddChild( &m_textTime[l] );
|
|
||||||
|
|
||||||
if( PREFSMAN->m_sCoursesToShowRanking == "" )
|
|
||||||
PREFSMAN->m_sCoursesToShowRanking = THEME->GetMetric("ScreenRanking","CoursesToShow");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// init all the difficulty graphics
|
|
||||||
for( int d=0; d<NUM_DIFFICULTIES; d++ )
|
|
||||||
{
|
|
||||||
bool bShowThis = find(m_vDiffsToShow.begin(), m_vDiffsToShow.end(), d) != m_vDiffsToShow.end();
|
|
||||||
|
|
||||||
m_sprDiffHeaders[d].Load( THEME->GetPathToG(("ScreenRanking difficulty 1x5")) );
|
|
||||||
m_sprDiffHeaders[d].SetDiffuseAlpha( 0 );
|
|
||||||
if( bShowThis )
|
|
||||||
this->AddChild( &m_sprDiffHeaders[d] );
|
|
||||||
|
|
||||||
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
||||||
{
|
{
|
||||||
m_textPercent[l][d].LoadFromFont( THEME->GetPathToF("ScreenRanking letters") );
|
m_sprBullets[l].SetName( ssprintf("Bullet%d",l+1) );
|
||||||
m_textPercent[l][d].SetDiffuseAlpha( 0 );
|
m_sprBullets[l].Load( THEME->GetPathToG( ssprintf("ScreenRanking bullets 1x%d",NUM_RANKING_LINES) ) );
|
||||||
if( bShowThis )
|
m_sprBullets[l].SetState( l );
|
||||||
this->AddChild( &m_textPercent[l][d] );
|
m_sprBullets[l].StopAnimating();
|
||||||
|
m_sprBullets[l].SetHidden( true );
|
||||||
|
this->AddChild( &m_sprBullets[l] );
|
||||||
|
|
||||||
|
m_textNames[l].SetName( ssprintf("Name%d",l+1) );
|
||||||
|
m_textNames[l].LoadFromFont( THEME->GetPathToF("ScreenRanking name") );
|
||||||
|
m_textNames[l].SetHidden( true );
|
||||||
|
this->AddChild( &m_textNames[l] );
|
||||||
|
|
||||||
|
m_textScores[l].SetName( ssprintf("Score%d",l+1) );
|
||||||
|
m_textScores[l].LoadFromFont( THEME->GetPathToF("ScreenRanking score") );
|
||||||
|
m_textScores[l].SetHidden( true );
|
||||||
|
this->AddChild( &m_textScores[l] );
|
||||||
|
|
||||||
|
m_textPoints[l].SetName( ssprintf("Points%d",l+1) );
|
||||||
|
m_textPoints[l].LoadFromFont( THEME->GetPathToF("ScreenRanking points") );
|
||||||
|
m_textPoints[l].SetHidden( true );
|
||||||
|
this->AddChild( &m_textPoints[l] );
|
||||||
|
|
||||||
|
m_textTime[l].SetName( ssprintf("Time%d",l+1) );
|
||||||
|
m_textTime[l].LoadFromFont( THEME->GetPathToF("ScreenRanking time") );
|
||||||
|
m_textTime[l].SetHidden( true );
|
||||||
|
this->AddChild( &m_textTime[l] );
|
||||||
|
|
||||||
|
// TODO: Think of a better way to handle this
|
||||||
|
if( PREFSMAN->m_sCoursesToShowRanking == "" )
|
||||||
|
PREFSMAN->m_sCoursesToShowRanking = THEME->GetMetric("ScreenRanking","CoursesToShow");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make the list of difficulties to show
|
||||||
vector<StepsType> aNotesTypesToShow;
|
|
||||||
GAMEMAN->GetNotesTypesForGame( GAMESTATE->m_CurGame, aNotesTypesToShow );
|
|
||||||
|
|
||||||
// subtract hidden NotesTypes
|
|
||||||
{
|
{
|
||||||
vector<CString> asNotesTypesToHide;
|
vector<CString> sShowDiffs;
|
||||||
split( NOTES_TYPES_TO_HIDE, ",", asNotesTypesToHide, true );
|
split( DIFFICULTIES_TO_SHOW, ",", sShowDiffs, true );
|
||||||
for( unsigned i=0; i<asNotesTypesToHide.size(); i++ )
|
|
||||||
|
for( vector<CString>::const_iterator iter = sShowDiffs.begin(); iter != sShowDiffs.end(); iter++ )
|
||||||
{
|
{
|
||||||
StepsType nt = GameManager::StringToNotesType(asNotesTypesToHide[i]);
|
m_vDiffsToShow.push_back( StringToDifficulty( *iter ) );
|
||||||
if( nt != STEPS_TYPE_INVALID )
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// init Actors for all_steps
|
||||||
|
{
|
||||||
|
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
||||||
|
for( int d=0; d<NUM_DIFFICULTIES; d++ )
|
||||||
|
{
|
||||||
|
bool bShowThis = find(m_vDiffsToShow.begin(), m_vDiffsToShow.end(), d) != m_vDiffsToShow.end();
|
||||||
|
if( !bShowThis )
|
||||||
|
continue; // skip
|
||||||
|
|
||||||
|
m_sprDifficulty[d].SetName( ssprintf("Difficulty%d",d) );
|
||||||
|
m_sprDifficulty[d].Load( THEME->GetPathToG(ssprintf("ScreenRanking difficulty 1x%d",NUM_DIFFICULTIES)) );
|
||||||
|
m_sprDifficulty[d].SetHidden( true );
|
||||||
|
this->AddChild( &m_sprDifficulty[d] );
|
||||||
|
}
|
||||||
|
for( int s=0; s<num_songs; s++ )
|
||||||
|
{
|
||||||
|
StepsScoreRowItem* pStepsScoreRowItem = new StepsScoreRowItem;
|
||||||
|
|
||||||
|
pStepsScoreRowItem->m_sprSongFrame.SetName( "SongFrame" );
|
||||||
|
pStepsScoreRowItem->m_sprSongFrame.SetHidden( true );
|
||||||
|
pStepsScoreRowItem->m_sprSongFrame.Load( THEME->GetPathToG("ScreenRanking song frame") );
|
||||||
|
pStepsScoreRowItem->AddChild( &pStepsScoreRowItem->m_sprSongFrame );
|
||||||
|
|
||||||
|
pStepsScoreRowItem->m_textSongTitle.SetName( "SongTitle" );
|
||||||
|
pStepsScoreRowItem->m_textSongTitle.SetHidden( true );
|
||||||
|
pStepsScoreRowItem->m_textSongTitle.LoadFromFont( THEME->GetPathToF("ScreenRanking song title") );
|
||||||
|
pStepsScoreRowItem->AddChild( &pStepsScoreRowItem->m_textSongTitle );
|
||||||
|
|
||||||
|
for( int d=0; d<NUM_DIFFICULTIES; d++ )
|
||||||
{
|
{
|
||||||
const vector<StepsType>::iterator iter = find( aNotesTypesToShow.begin(), aNotesTypesToShow.end(), nt );
|
pStepsScoreRowItem->m_textStepsScore[d].SetName( "StepsScore" );
|
||||||
if( iter != aNotesTypesToShow.end() )
|
pStepsScoreRowItem->m_textStepsScore[d].LoadFromFont( THEME->GetPathToF("ScreenRanking steps score") );
|
||||||
aNotesTypesToShow.erase( iter );
|
pStepsScoreRowItem->m_textStepsScore[d].SetHidden( true );
|
||||||
|
pStepsScoreRowItem->AddChild( &pStepsScoreRowItem->m_textStepsScore[d] );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_vpStepsScoreRowItem.push_back( pStepsScoreRowItem );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ListScoreRowItems.SetName( "ListScoreRowItems" );
|
||||||
|
this->AddChild( &m_ListScoreRowItems );
|
||||||
|
m_ListScoreRowItems.SetXY( CENTER_X, CENTER_Y );
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate which StepsTypes to show
|
||||||
|
vector<StepsType> aStepsTypesToShow;
|
||||||
|
{
|
||||||
|
GAMEMAN->GetNotesTypesForGame( GAMESTATE->m_CurGame, aStepsTypesToShow );
|
||||||
|
|
||||||
|
// subtract hidden StepsTypes
|
||||||
|
{
|
||||||
|
vector<CString> asStepsTypesToHide;
|
||||||
|
split( STEPS_TYPES_TO_HIDE, ",", asStepsTypesToHide, true );
|
||||||
|
for( unsigned i=0; i<asStepsTypesToHide.size(); i++ )
|
||||||
|
{
|
||||||
|
StepsType nt = GameManager::StringToNotesType(asStepsTypesToHide[i]);
|
||||||
|
if( nt != STEPS_TYPE_INVALID )
|
||||||
|
{
|
||||||
|
const vector<StepsType>::iterator iter = find( aStepsTypesToShow.begin(), aStepsTypesToShow.end(), nt );
|
||||||
|
if( iter != aStepsTypesToShow.end() )
|
||||||
|
aStepsTypesToShow.erase( iter );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
// fill m_vPagesToShow
|
// fill m_vPagesToShow
|
||||||
|
//
|
||||||
if( SHOW_CATEGORIES )
|
if( SHOW_CATEGORIES )
|
||||||
{
|
{
|
||||||
for( unsigned i=0; i<aNotesTypesToShow.size(); i++ )
|
for( unsigned i=0; i<aStepsTypesToShow.size(); i++ )
|
||||||
{
|
{
|
||||||
for( int c=0; c<NUM_RANKING_CATEGORIES; c++ )
|
for( int c=0; c<NUM_RANKING_CATEGORIES; c++ )
|
||||||
{
|
{
|
||||||
@@ -191,7 +230,7 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
|
|||||||
pts.type = PageToShow::TYPE_CATEGORY;
|
pts.type = PageToShow::TYPE_CATEGORY;
|
||||||
pts.colorIndex = i;
|
pts.colorIndex = i;
|
||||||
pts.category = (RankingCategory)c;
|
pts.category = (RankingCategory)c;
|
||||||
pts.nt = aNotesTypesToShow[i];
|
pts.nt = aStepsTypesToShow[i];
|
||||||
m_vPagesToShow.push_back( pts );
|
m_vPagesToShow.push_back( pts );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,14 +239,14 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
|
|||||||
{
|
{
|
||||||
vector<CString> asCoursePaths;
|
vector<CString> asCoursePaths;
|
||||||
split( COURSES_TO_SHOW, ",", asCoursePaths, true );
|
split( COURSES_TO_SHOW, ",", asCoursePaths, true );
|
||||||
for( unsigned i=0; i<aNotesTypesToShow.size(); i++ )
|
for( unsigned i=0; i<aStepsTypesToShow.size(); i++ )
|
||||||
{
|
{
|
||||||
for( unsigned c=0; c<asCoursePaths.size(); c++ )
|
for( unsigned c=0; c<asCoursePaths.size(); c++ )
|
||||||
{
|
{
|
||||||
PageToShow pts;
|
PageToShow pts;
|
||||||
pts.type = PageToShow::TYPE_COURSE;
|
pts.type = PageToShow::TYPE_COURSE;
|
||||||
pts.colorIndex = i;
|
pts.colorIndex = i;
|
||||||
pts.nt = aNotesTypesToShow[i];
|
pts.nt = aStepsTypesToShow[i];
|
||||||
pts.pCourse = SONGMAN->GetCourseFromPath( asCoursePaths[c] );
|
pts.pCourse = SONGMAN->GetCourseFromPath( asCoursePaths[c] );
|
||||||
if( pts.pCourse )
|
if( pts.pCourse )
|
||||||
m_vPagesToShow.push_back( pts );
|
m_vPagesToShow.push_back( pts );
|
||||||
@@ -215,33 +254,18 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( SHOW_SONG_SCORES )
|
if( SHOW_ALL_STEPS_SCORES )
|
||||||
{
|
{
|
||||||
vector<Song*> vpSongs = SONGMAN->GetAllSongs();
|
vector<Song*> vpSongs = SONGMAN->GetAllSongs();
|
||||||
if( !vpSongs.empty() )
|
if( !vpSongs.empty() )
|
||||||
{
|
{
|
||||||
for( unsigned i=0; i<aNotesTypesToShow.size(); i++ )
|
for( unsigned i=0; i<aStepsTypesToShow.size(); i++ )
|
||||||
{
|
{
|
||||||
/* Wrap first; the number of songs can change if we reload. */
|
PageToShow pts;
|
||||||
wrap( g_iLastSongShown,vpSongs.size() );
|
pts.type = PageToShow::TYPE_ALL_STEPS;
|
||||||
|
pts.colorIndex = i;
|
||||||
int FirstSongShown = g_iLastSongShown;
|
pts.nt = aStepsTypesToShow[i];
|
||||||
|
m_vPagesToShow.push_back( pts );
|
||||||
for( int j=0; j<NUM_SONGS_TO_SHOW; j++ )
|
|
||||||
{
|
|
||||||
PageToShow pts;
|
|
||||||
pts.type = PageToShow::TYPE_SONG;
|
|
||||||
pts.colorIndex = i;
|
|
||||||
pts.pSong = vpSongs[g_iLastSongShown];
|
|
||||||
pts.nt = aNotesTypesToShow[i];
|
|
||||||
m_vPagesToShow.push_back( pts );
|
|
||||||
|
|
||||||
g_iLastSongShown++;
|
|
||||||
wrap( g_iLastSongShown,vpSongs.size() );
|
|
||||||
|
|
||||||
if( g_iLastSongShown == FirstSongShown )
|
|
||||||
break; /* don't show songs twice */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,20 +278,25 @@ ScreenRanking::ScreenRanking( CString sClassName ) : ScreenAttract( sClassName )
|
|||||||
this->PostScreenMessage( SM_ShowNextPage, 0.5f );
|
this->PostScreenMessage( SM_ShowNextPage, 0.5f );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScreenRanking::~ScreenRanking()
|
||||||
|
{
|
||||||
|
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
||||||
|
|
||||||
|
// delete dynamically allocated members
|
||||||
|
for( int s=0; s<num_songs; s++ )
|
||||||
|
delete m_vpStepsScoreRowItem[s];
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenRanking::HandleScreenMessage( const ScreenMessage SM )
|
void ScreenRanking::HandleScreenMessage( const ScreenMessage SM )
|
||||||
{
|
{
|
||||||
switch( SM )
|
switch( SM )
|
||||||
{
|
{
|
||||||
// redundant
|
|
||||||
// case SM_BeginFadingOut:
|
|
||||||
// m_Out.CloseWipingRight(SM_GoToNextScreen);
|
|
||||||
// break;
|
|
||||||
case SM_ShowNextPage:
|
case SM_ShowNextPage:
|
||||||
if( m_vPagesToShow.size() > 0 )
|
if( m_vPagesToShow.size() > 0 )
|
||||||
{
|
{
|
||||||
SetPage( m_vPagesToShow[0] );
|
float fSecsToShow = SetPage( m_vPagesToShow[0] );
|
||||||
m_vPagesToShow.erase( m_vPagesToShow.begin() );
|
m_vPagesToShow.erase( m_vPagesToShow.begin() );
|
||||||
this->PostScreenMessage( SM_HidePage, SECONDS_PER_PAGE-PAGE_FADE_SECONDS );
|
this->PostScreenMessage( SM_HidePage, fSecsToShow-PAGE_FADE_SECONDS );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -283,172 +312,230 @@ void ScreenRanking::HandleScreenMessage( const ScreenMessage SM )
|
|||||||
ScreenAttract::HandleScreenMessage( SM );
|
ScreenAttract::HandleScreenMessage( SM );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenRanking::SetPage( PageToShow pts )
|
float ScreenRanking::SetPage( PageToShow pts )
|
||||||
{
|
{
|
||||||
bool bShowNames=false, bShowScores=false, bShowPoints=false, bShowTime=false, bShowDifficulty=false, bShowPercent=false;
|
bool bBanner = false;
|
||||||
|
bool bBannerFrame = false;
|
||||||
|
bool bShowCategory = false;
|
||||||
|
bool bShowStepsType = false;
|
||||||
|
bool bShowBullets = false;
|
||||||
|
bool bShowNames = false;
|
||||||
|
bool bShowScores = false;
|
||||||
|
bool bShowPoints = false;
|
||||||
|
bool bShowTime = false;
|
||||||
|
bool bShowDifficulty = false;
|
||||||
|
bool bShowStepsScore = false;
|
||||||
switch( pts.type )
|
switch( pts.type )
|
||||||
{
|
{
|
||||||
case PageToShow::TYPE_CATEGORY:
|
case PageToShow::TYPE_CATEGORY:
|
||||||
|
bBanner = false;
|
||||||
|
bBannerFrame = false;
|
||||||
|
bShowCategory = true;
|
||||||
|
bShowStepsType = true;
|
||||||
|
bShowBullets = true;
|
||||||
bShowNames = true;
|
bShowNames = true;
|
||||||
bShowScores = true;
|
bShowScores = true;
|
||||||
bShowPoints = false;
|
bShowPoints = false;
|
||||||
bShowTime = false;
|
bShowTime = false;
|
||||||
bShowDifficulty = false;
|
bShowDifficulty = false;
|
||||||
bShowPercent = false;
|
bShowStepsScore = false;
|
||||||
break;
|
break;
|
||||||
case PageToShow::TYPE_COURSE:
|
case PageToShow::TYPE_COURSE:
|
||||||
|
bBanner = true;
|
||||||
|
bBannerFrame = true;
|
||||||
|
bShowCategory = false;
|
||||||
|
bShowStepsType = true;
|
||||||
|
bShowBullets = true;
|
||||||
bShowNames = true;
|
bShowNames = true;
|
||||||
bShowScores = !pts.pCourse->IsOni();
|
bShowScores = !pts.pCourse->IsOni();
|
||||||
bShowPoints = pts.pCourse->IsOni();
|
bShowPoints = pts.pCourse->IsOni();
|
||||||
bShowTime = pts.pCourse->IsOni();
|
bShowTime = pts.pCourse->IsOni();
|
||||||
bShowDifficulty = false;
|
bShowDifficulty = false;
|
||||||
bShowPercent = false;
|
bShowStepsScore = false;
|
||||||
break;
|
break;
|
||||||
case PageToShow::TYPE_SONG:
|
case PageToShow::TYPE_ALL_STEPS:
|
||||||
|
bBanner = false;
|
||||||
|
bBannerFrame = false;
|
||||||
|
bShowCategory = false;
|
||||||
|
bShowStepsType = true;
|
||||||
|
bShowBullets = false;
|
||||||
bShowNames = false;
|
bShowNames = false;
|
||||||
bShowScores = false;
|
bShowScores = false;
|
||||||
bShowPoints = false;
|
bShowPoints = false;
|
||||||
bShowTime = false;
|
bShowTime = false;
|
||||||
bShowDifficulty = true;
|
bShowDifficulty = true;
|
||||||
bShowPercent = true;
|
bShowStepsScore = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int l, d;
|
|
||||||
|
|
||||||
// Reset
|
// Reset
|
||||||
m_sprCategory.Reset();
|
m_Banner.SetHidden( !bBanner );
|
||||||
SET_XY_AND_ON_COMMAND( m_sprCategory );
|
if( bBanner )
|
||||||
m_banner.Reset();
|
|
||||||
SET_XY_AND_ON_COMMAND( m_banner );
|
|
||||||
m_sprBannerFrame.Reset();
|
|
||||||
SET_XY_AND_ON_COMMAND( m_sprBannerFrame );
|
|
||||||
m_textCategory.Reset();
|
|
||||||
SET_XY_AND_ON_COMMAND( m_textCategory );
|
|
||||||
m_sprType.Reset();
|
|
||||||
SET_XY_AND_ON_COMMAND( m_sprType );
|
|
||||||
|
|
||||||
for( l=0; l<NUM_RANKING_LINES; l++ )
|
|
||||||
{
|
{
|
||||||
m_sprBullets[l].Reset();
|
m_Banner.Reset();
|
||||||
m_sprBullets[l].SetXY( BULLETS_START_X+LINE_SPACING_X*l, BULLETS_START_Y+LINE_SPACING_Y*l );
|
SET_XY_AND_ON_COMMAND( m_Banner );
|
||||||
m_sprBullets[l].StopAnimating();
|
|
||||||
m_sprBullets[l].SetState(l);
|
|
||||||
m_sprBullets[l].Command( BULLETS_ON_COMMAND(l) );
|
|
||||||
|
|
||||||
m_textNames[l].Reset();
|
|
||||||
m_textNames[l].SetXY( NAMES_START_X+LINE_SPACING_X*l, NAMES_START_Y+LINE_SPACING_Y*l );
|
|
||||||
m_textNames[l].SetZoom( TEXT_ZOOM );
|
|
||||||
m_textNames[l].SetDiffuseAlpha( 0 );
|
|
||||||
m_textNames[l].EnableShadow( false );
|
|
||||||
m_textNames[l].SetHorizAlign( Actor::align_left );
|
|
||||||
if( bShowNames )
|
|
||||||
{
|
|
||||||
m_textNames[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
|
||||||
m_textNames[l].Command( NAMES_ON_COMMAND(l) );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_textScores[l].Reset();
|
|
||||||
m_textScores[l].SetXY( SCORES_START_X+LINE_SPACING_X*l, SCORES_START_Y+LINE_SPACING_Y*l );
|
|
||||||
m_textScores[l].SetZoom( TEXT_ZOOM );
|
|
||||||
m_textScores[l].SetDiffuseAlpha( 0 );
|
|
||||||
m_textScores[l].EnableShadow( false );
|
|
||||||
m_textScores[l].SetHorizAlign( Actor::align_right );
|
|
||||||
if( bShowScores )
|
|
||||||
{
|
|
||||||
m_textScores[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
|
||||||
m_textScores[l].Command( SCORES_ON_COMMAND(l) );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_textPoints[l].Reset();
|
|
||||||
m_textPoints[l].SetXY( POINTS_START_X+LINE_SPACING_X*l, POINTS_START_Y+LINE_SPACING_Y*l );
|
|
||||||
m_textPoints[l].SetZoom( TEXT_ZOOM );
|
|
||||||
m_textPoints[l].SetDiffuseAlpha( 0 );
|
|
||||||
m_textPoints[l].EnableShadow( false );
|
|
||||||
m_textPoints[l].SetHorizAlign( Actor::align_right );
|
|
||||||
if( bShowPoints )
|
|
||||||
{
|
|
||||||
m_textPoints[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
|
||||||
m_textPoints[l].Command( POINTS_ON_COMMAND(l) );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_textTime[l].Reset();
|
|
||||||
m_textTime[l].SetXY( TIME_START_X+LINE_SPACING_X*l, TIME_START_Y+LINE_SPACING_Y*l );
|
|
||||||
m_textTime[l].SetZoom( TEXT_ZOOM );
|
|
||||||
m_textTime[l].SetDiffuseAlpha( 0 );
|
|
||||||
m_textTime[l].EnableShadow( false );
|
|
||||||
m_textTime[l].SetHorizAlign( Actor::align_right );
|
|
||||||
if( bShowTime )
|
|
||||||
{
|
|
||||||
m_textTime[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
|
||||||
m_textTime[l].Command( TIME_ON_COMMAND(l) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for( d=0; d<NUM_DIFFICULTIES; d++ )
|
m_sprBannerFrame.SetHidden( !bBannerFrame );
|
||||||
|
if( bBannerFrame )
|
||||||
{
|
{
|
||||||
m_sprDiffHeaders[d].Reset();
|
m_sprBannerFrame.Reset();
|
||||||
m_sprDiffHeaders[d].SetXY( DIFFICULTY_START_X+DIFFICULTY_SPACING_X*d, DIFFICULTY_START_Y+DIFFICULTY_SPACING_Y*d );
|
SET_XY_AND_ON_COMMAND( m_sprBannerFrame );
|
||||||
m_sprDiffHeaders[d].SetDiffuseAlpha( 0 );
|
}
|
||||||
m_sprDiffHeaders[d].StopAnimating();
|
|
||||||
m_sprDiffHeaders[d].SetState(d);
|
|
||||||
if( bShowDifficulty )
|
|
||||||
{
|
|
||||||
m_sprDiffHeaders[d].SetDiffuseAlpha( 1 );
|
|
||||||
m_sprDiffHeaders[d].Command( DIFFICULTY_ON_COMMAND );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
m_textCategory.SetHidden( !bShowCategory );
|
||||||
|
if( bShowCategory )
|
||||||
|
{
|
||||||
|
m_textCategory.Reset();
|
||||||
|
SET_XY_AND_ON_COMMAND( m_textCategory );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_textStepsType.SetHidden( !bShowStepsType );
|
||||||
|
if( bShowStepsType )
|
||||||
|
{
|
||||||
|
m_textStepsType.Reset();
|
||||||
|
SET_XY_AND_ON_COMMAND( m_textStepsType );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
||||||
{
|
{
|
||||||
m_textPercent[l][d].Reset();
|
m_sprBullets[l].SetHidden( !bShowBullets );
|
||||||
m_textPercent[l][d].SetZoom( TEXT_SONGZOOM );
|
if( bShowBullets )
|
||||||
m_textPercent[l][d].SetXY( PERCENT_START_X+DIFFICULTY_SPACING_X*d, PERCENT_START_Y+LINE_SPACING_Y*l );
|
|
||||||
m_textPercent[l][d].SetDiffuseAlpha( 0 );
|
|
||||||
m_textPercent[l][d].EnableShadow( false );
|
|
||||||
if( bShowPercent )
|
|
||||||
{
|
{
|
||||||
m_textPercent[l][d].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
m_sprBullets[l].Reset();
|
||||||
m_textPercent[l][d].Command( PERCENT_ON_COMMAND(l) );
|
m_sprBullets[l].StopAnimating();
|
||||||
|
m_sprBullets[l].SetState( l );
|
||||||
|
m_sprBullets[l].SetXY( BULLET_X(l), BULLET_Y(l) );
|
||||||
|
ON_COMMAND( m_sprBullets[l] );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_textNames[l].SetHidden( !bShowNames );
|
||||||
|
if( bShowNames )
|
||||||
|
{
|
||||||
|
m_textNames[l].Reset();
|
||||||
|
m_textNames[l].SetXY( NAME_X(l), NAME_Y(l) );
|
||||||
|
m_textNames[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
|
ON_COMMAND( m_textNames[l] );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_textScores[l].SetHidden( !bShowScores );
|
||||||
|
if( bShowScores )
|
||||||
|
{
|
||||||
|
m_textScores[l].Reset();
|
||||||
|
m_textScores[l].SetXY( SCORE_X(l), SCORE_Y(l) );
|
||||||
|
m_textScores[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
|
ON_COMMAND( m_textScores[l] );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_textPoints[l].SetHidden( !bShowPoints );
|
||||||
|
if( bShowPoints )
|
||||||
|
{
|
||||||
|
m_textPoints[l].Reset();
|
||||||
|
m_textPoints[l].SetXY( POINTS_X(l), POINTS_Y(l) );
|
||||||
|
m_textPoints[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
|
ON_COMMAND( m_textPoints[l] );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_textTime[l].SetHidden( !bShowTime );
|
||||||
|
if( bShowTime )
|
||||||
|
{
|
||||||
|
m_textTime[l].Reset();
|
||||||
|
m_textTime[l].SetXY( TIME_X(l), TIME_Y(l) );
|
||||||
|
m_textTime[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
|
ON_COMMAND( m_textTime[l] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
||||||
|
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
|
||||||
|
{
|
||||||
|
m_sprDifficulty[*dc_iter].SetHidden( !bShowDifficulty );
|
||||||
|
if( bShowDifficulty )
|
||||||
|
{
|
||||||
|
m_sprDifficulty[*dc_iter].Reset();
|
||||||
|
m_sprDifficulty[*dc_iter].StopAnimating();
|
||||||
|
m_sprDifficulty[*dc_iter].SetState( *dc_iter );
|
||||||
|
m_sprDifficulty[*dc_iter].SetXY( DIFFICULTY_X(*dc_iter), DIFFICULTY_Y );
|
||||||
|
ON_COMMAND( m_sprDifficulty[*dc_iter] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ListScoreRowItems.SetHidden( !bShowStepsScore );
|
||||||
|
if( bShowStepsScore )
|
||||||
|
{
|
||||||
|
m_ListScoreRowItems.Reset();
|
||||||
|
SET_XY_AND_ON_COMMAND( m_ListScoreRowItems );
|
||||||
|
|
||||||
|
vector<Actor*> vpActors;
|
||||||
|
for( int i=0; i<m_vpStepsScoreRowItem.size(); i++ )
|
||||||
|
vpActors.push_back( m_vpStepsScoreRowItem[i] );
|
||||||
|
m_ListScoreRowItems.Load( vpActors, NUM_ROW_ITEMS_TO_SHOW, SCREEN_WIDTH, ROW_SPACING_Y, false, 1, 0, false );
|
||||||
|
|
||||||
|
for( int s=0; s<num_songs; s++ )
|
||||||
|
{
|
||||||
|
StepsScoreRowItem *pStepsScoreRowItems = m_vpStepsScoreRowItem[s];
|
||||||
|
pStepsScoreRowItems->m_sprSongFrame.Reset();
|
||||||
|
pStepsScoreRowItems->m_sprSongFrame.SetXY( SONG_FRAME_OFFSET_X, SONG_FRAME_OFFSET_Y );
|
||||||
|
pStepsScoreRowItems->m_sprSongFrame.SetUseZBuffer( true );
|
||||||
|
ON_COMMAND( pStepsScoreRowItems->m_sprSongFrame );
|
||||||
|
|
||||||
|
pStepsScoreRowItems->m_textSongTitle.Reset();
|
||||||
|
pStepsScoreRowItems->m_textSongTitle.SetXY( SONG_TITLE_OFFSET_X, SONG_TITLE_OFFSET_Y );
|
||||||
|
pStepsScoreRowItems->m_textSongTitle.SetUseZBuffer( true );
|
||||||
|
ON_COMMAND( pStepsScoreRowItems->m_textSongTitle );
|
||||||
|
|
||||||
|
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
|
||||||
|
{
|
||||||
|
pStepsScoreRowItems->m_textStepsScore[*dc_iter].Reset();
|
||||||
|
pStepsScoreRowItems->m_textStepsScore[*dc_iter].SetXY( STEPS_SCORE_OFFSET_X(*dc_iter), STEPS_SCORE_OFFSET_Y );
|
||||||
|
pStepsScoreRowItems->m_textStepsScore[*dc_iter].SetUseZBuffer( true );
|
||||||
|
pStepsScoreRowItems->m_textStepsScore[*dc_iter].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
|
ON_COMMAND( pStepsScoreRowItems->m_textStepsScore[*dc_iter] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// get ranking feat list
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
// init page
|
// init page
|
||||||
|
//
|
||||||
switch( pts.type )
|
switch( pts.type )
|
||||||
{
|
{
|
||||||
case PageToShow::TYPE_CATEGORY:
|
case PageToShow::TYPE_CATEGORY:
|
||||||
{
|
{
|
||||||
m_sprCategory.Load( THEME->GetPathToG(ssprintf("ScreenRanking category %c", 'A'+pts.category)) );
|
m_textCategory.SetText( ssprintf("Type %c", 'A'+pts.category) );
|
||||||
m_sprType.Load( THEME->GetPathToG("ScreenRanking type "+GameManager::NotesTypeToString(pts.nt)) );
|
m_textStepsType.SetText( GameManager::NotesTypeToString(pts.nt) );
|
||||||
|
|
||||||
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
||||||
{
|
{
|
||||||
ProfileManager::CategoryData::HighScore hs;
|
ProfileManager::CategoryData::HighScore hs;
|
||||||
|
bool bRecentHighScore = false;
|
||||||
if( l < (int)PROFILEMAN->m_CategoryDatas[MEMORY_CARD_MACHINE][pts.nt][pts.category].vHighScores.size() )
|
if( l < (int)PROFILEMAN->m_CategoryDatas[MEMORY_CARD_MACHINE][pts.nt][pts.category].vHighScores.size() )
|
||||||
|
{
|
||||||
hs = PROFILEMAN->m_CategoryDatas[MEMORY_CARD_MACHINE][pts.nt][pts.category].vHighScores[l];
|
hs = PROFILEMAN->m_CategoryDatas[MEMORY_CARD_MACHINE][pts.nt][pts.category].vHighScores[l];
|
||||||
|
CString *psName = &PROFILEMAN->m_CategoryDatas[MEMORY_CARD_MACHINE][pts.nt][pts.category].vHighScores[l].sName;
|
||||||
|
bRecentHighScore = find( GAMESTATE->m_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
hs.sName = NO_SCORE_NAME;
|
hs.sName = NO_SCORE_NAME;
|
||||||
|
}
|
||||||
if( hs.sName.empty() )
|
if( hs.sName.empty() )
|
||||||
hs.sName = EMPTY_SCORE_NAME;
|
hs.sName = EMPTY_SCORE_NAME;
|
||||||
|
|
||||||
m_textNames[l].SetText( hs.sName );
|
m_textNames[l].SetText( hs.sName );
|
||||||
m_textScores[l].SetText( ssprintf("%09i",hs.iScore) );
|
m_textScores[l].SetText( ssprintf("%09i",hs.iScore) );
|
||||||
m_textNames[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
m_textNames[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
m_textScores[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
m_textScores[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
|
|
||||||
bool bRecentHighScore = false;
|
|
||||||
// FIXME
|
|
||||||
// for( int p=0; p<NUM_PLAYERS; p++ )
|
|
||||||
// {
|
|
||||||
// bRecentHighScore |=
|
|
||||||
// pts.nt == GAMESTATE->m_RankingNotesType &&
|
|
||||||
// GAMESTATE->m_RankingCategory[p] == pts.category &&
|
|
||||||
// GAMESTATE->m_iRankingIndex[p] == l;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if( bRecentHighScore )
|
if( bRecentHighScore )
|
||||||
{
|
{
|
||||||
@@ -462,30 +549,26 @@ void ScreenRanking::SetPage( PageToShow pts )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
return SECONDS_PER_PAGE;
|
||||||
case PageToShow::TYPE_COURSE:
|
case PageToShow::TYPE_COURSE:
|
||||||
{
|
{
|
||||||
m_textCategory.SetDiffuseAlpha(0);
|
m_Banner.LoadFromCourse( pts.pCourse );
|
||||||
m_sprCategory.SetDiffuseAlpha(0);
|
m_textStepsType.SetText( GameManager::NotesTypeToString(pts.nt) );
|
||||||
CString path = THEME->GetPathToG("ScreenRanking category "+pts.pCourse->m_sName, true);
|
|
||||||
if( IsAFile(path) )
|
|
||||||
{
|
|
||||||
m_sprCategory.Load( path );
|
|
||||||
m_sprCategory.SetDiffuseAlpha(1);
|
|
||||||
} else {
|
|
||||||
m_textCategory.SetMaxWidth( CATEGORY_WIDTH );
|
|
||||||
m_textCategory.SetText( pts.pCourse->m_sName );
|
|
||||||
m_textCategory.SetDiffuseAlpha(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_sprType.Load( THEME->GetPathToG("ScreenRanking type "+GameManager::NotesTypeToString(pts.nt)) );
|
|
||||||
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
||||||
{
|
{
|
||||||
Course::MemCardData::HighScore hs;
|
Course::MemCardData::HighScore hs;
|
||||||
|
bool bRecentHighScore = false;
|
||||||
if( l < (int)pts.pCourse->m_MemCardDatas[pts.nt][MEMORY_CARD_MACHINE].vHighScores.size() )
|
if( l < (int)pts.pCourse->m_MemCardDatas[pts.nt][MEMORY_CARD_MACHINE].vHighScores.size() )
|
||||||
|
{
|
||||||
hs = pts.pCourse->m_MemCardDatas[pts.nt][MEMORY_CARD_MACHINE].vHighScores[l];
|
hs = pts.pCourse->m_MemCardDatas[pts.nt][MEMORY_CARD_MACHINE].vHighScores[l];
|
||||||
|
CString *psName = &pts.pCourse->m_MemCardDatas[pts.nt][MEMORY_CARD_MACHINE].vHighScores[l].sName;
|
||||||
|
bRecentHighScore = find( GAMESTATE->m_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
hs.sName = NO_SCORE_NAME;
|
hs.sName = NO_SCORE_NAME;
|
||||||
|
}
|
||||||
if( hs.sName.empty() )
|
if( hs.sName.empty() )
|
||||||
hs.sName = EMPTY_SCORE_NAME;
|
hs.sName = EMPTY_SCORE_NAME;
|
||||||
|
|
||||||
@@ -500,114 +583,100 @@ void ScreenRanking::SetPage( PageToShow pts )
|
|||||||
m_textTime[l].SetText( "" );
|
m_textTime[l].SetText( "" );
|
||||||
m_textScores[l].SetText( ssprintf("%09d",hs.iScore) );
|
m_textScores[l].SetText( ssprintf("%09d",hs.iScore) );
|
||||||
}
|
}
|
||||||
m_textNames[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
m_textNames[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
m_textPoints[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
m_textPoints[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
m_textTime[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
m_textTime[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
m_textScores[l].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
m_textScores[l].SetDiffuse( STEPS_TYPE_COLOR(pts.colorIndex) );
|
||||||
for( int p=0; p<NUM_PLAYERS; p++ )
|
|
||||||
|
if( bRecentHighScore )
|
||||||
{
|
{
|
||||||
bool bHighlight = false;
|
m_textNames[l].SetEffectGlowBlink(0.1f);
|
||||||
// FIXME
|
m_textScores[l].SetEffectGlowBlink(0.1f);
|
||||||
// bHighlight = pts.pCourse == GAMESTATE->m_pRankingCourse &&
|
}
|
||||||
// pts.nt == GAMESTATE->m_RankingNotesType &&
|
else
|
||||||
// GAMESTATE->m_iRankingIndex[p] == l;
|
{
|
||||||
if( bHighlight )
|
m_textNames[l].SetEffectNone();
|
||||||
{
|
m_textScores[l].SetEffectNone();
|
||||||
m_textNames[l].SetEffectGlowBlink(0.1f);
|
|
||||||
m_textScores[l].SetEffectGlowBlink(0.1f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_textNames[l].SetEffectNone();
|
|
||||||
m_textScores[l].SetEffectNone();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
return SECONDS_PER_PAGE;
|
||||||
case PageToShow::TYPE_SONG:
|
case PageToShow::TYPE_ALL_STEPS:
|
||||||
{
|
{
|
||||||
m_textCategory.SetDiffuseAlpha(0);
|
m_textStepsType.SetText( GameManager::NotesTypeToString(pts.nt) );
|
||||||
m_sprCategory.SetDiffuseAlpha(0);
|
|
||||||
|
|
||||||
m_banner.LoadFromSong( pts.pSong );
|
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
||||||
m_banner.ScaleToClipped( BANNER_WIDTH, BANNER_HEIGHT );
|
for( int s=0; s<num_songs; s++ )
|
||||||
m_banner.SetDiffuseAlpha(1);
|
|
||||||
|
|
||||||
m_sprBannerFrame.Load( THEME->GetPathToG("ScreenRanking banner frame") );
|
|
||||||
m_sprBannerFrame.SetDiffuseAlpha(1);
|
|
||||||
|
|
||||||
m_textCategory.SetMaxWidth( CATEGORY_WIDTH );
|
|
||||||
m_textCategory.SetText( pts.pSong->GetFullTranslitTitle() );
|
|
||||||
m_textCategory.SetDiffuseAlpha(1);
|
|
||||||
|
|
||||||
m_sprType.SetDiffuse( RageColor(1,1,1,1) );
|
|
||||||
m_sprType.Load( THEME->GetPathToG("ScreenRanking type "+GameManager::NotesTypeToString(pts.nt)) );
|
|
||||||
|
|
||||||
for( DiffVectorCIter dIter = m_vDiffsToShow.begin(); dIter != m_vDiffsToShow.end(); dIter++ )
|
|
||||||
{
|
{
|
||||||
int d = (int)*dIter;
|
Song* pSong = SONGMAN->GetAllSongs()[s];
|
||||||
|
StepsScoreRowItem *pStepsScoreRowItem = m_vpStepsScoreRowItem[s];
|
||||||
|
|
||||||
Difficulty dc = (Difficulty)d;
|
pStepsScoreRowItem->m_textSongTitle.SetText( pSong->GetFullDisplayTitle() );
|
||||||
Steps* pSteps = pts.pSong->GetStepsByDifficulty( pts.nt, dc );
|
|
||||||
|
|
||||||
|
for( vector<Difficulty>::iterator dc_iter = m_vDiffsToShow.begin(); dc_iter != m_vDiffsToShow.end(); dc_iter++ )
|
||||||
if( pSteps == NULL )
|
|
||||||
m_sprDiffHeaders[d].SetHidden( true );
|
|
||||||
else
|
|
||||||
m_sprDiffHeaders[d].SetDiffuse( RageColor(1,1,1,1) );
|
|
||||||
|
|
||||||
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
|
||||||
{
|
{
|
||||||
|
Steps* pSteps = pSong->GetStepsByDifficulty( pts.nt, *dc_iter, false );
|
||||||
|
BitmapText* pTextStepsScore = &pStepsScoreRowItem->m_textStepsScore[*dc_iter];
|
||||||
|
|
||||||
if( pSteps == NULL )
|
if( pSteps == NULL )
|
||||||
{
|
{
|
||||||
m_textPercent[l][d].SetHidden( true );
|
pTextStepsScore->SetHidden( true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Steps::MemCardData::HighScore hs;
|
Steps::MemCardData::HighScore hs;
|
||||||
if( l < (int)pSteps->m_MemCardDatas[MEMORY_CARD_MACHINE].vHighScores.size() )
|
bool bRecentHighScore = false;
|
||||||
hs = pSteps->m_MemCardDatas[MEMORY_CARD_MACHINE].vHighScores[l];
|
if( !pSteps->m_MemCardDatas[MEMORY_CARD_MACHINE].vHighScores.empty() )
|
||||||
|
{
|
||||||
|
hs = pSteps->m_MemCardDatas[MEMORY_CARD_MACHINE].vHighScores[0];
|
||||||
|
CString *psName = &pSteps->m_MemCardDatas[MEMORY_CARD_MACHINE].vHighScores[0].sName;
|
||||||
|
bRecentHighScore = find( GAMESTATE->m_vpsNamesThatWereFilled.begin(), GAMESTATE->m_vpsNamesThatWereFilled.end(), psName ) != GAMESTATE->m_vpsNamesThatWereFilled.end();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
hs.sName = NO_SCORE_NAME;
|
hs.sName = NO_SCORE_NAME;
|
||||||
|
}
|
||||||
if( hs.sName.empty() )
|
if( hs.sName.empty() )
|
||||||
hs.sName = EMPTY_SCORE_NAME;
|
hs.sName = EMPTY_SCORE_NAME;
|
||||||
|
|
||||||
CString s;
|
CString s;
|
||||||
s = hs.sName + "\n";
|
s = hs.sName + "\n";
|
||||||
s += ssprintf( "%0*.*f%%", PERCENT_TOTAL_SIZE, PERCENT_DECIMAL_PLACES, hs.fPercentDP*100 );
|
s += ssprintf( "%0*.*f%%", PERCENT_TOTAL_SIZE, PERCENT_DECIMAL_PLACES, hs.fPercentDP*100 );
|
||||||
m_textPercent[l][d].SetText( s );
|
pTextStepsScore->SetText( s );
|
||||||
m_textPercent[l][d].SetDiffuse( TEXT_COLOR(pts.colorIndex) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
return m_ListScoreRowItems.GetSecondsForCompleteScrollThrough();
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenRanking::TweenPageOffScreen()
|
void ScreenRanking::TweenPageOffScreen()
|
||||||
{
|
{
|
||||||
int l, d;
|
OFF_COMMAND( m_Banner );
|
||||||
|
|
||||||
OFF_COMMAND( m_sprCategory );
|
|
||||||
OFF_COMMAND( m_banner );
|
|
||||||
OFF_COMMAND( m_sprBannerFrame );
|
OFF_COMMAND( m_sprBannerFrame );
|
||||||
OFF_COMMAND( m_sprType );
|
|
||||||
OFF_COMMAND( m_textCategory );
|
OFF_COMMAND( m_textCategory );
|
||||||
|
OFF_COMMAND( m_textStepsType );
|
||||||
|
|
||||||
for( l=0; l<NUM_RANKING_LINES; l++ )
|
for( int l=0; l<NUM_RANKING_LINES; l++ )
|
||||||
{
|
{
|
||||||
m_sprBullets[l].Command( BULLETS_OFF_COMMAND(l) );
|
OFF_COMMAND( m_sprBullets[l] );
|
||||||
m_textNames[l].Command( NAMES_OFF_COMMAND(l) );
|
OFF_COMMAND( m_textNames[l] );
|
||||||
m_textScores[l].Command( SCORES_OFF_COMMAND(l) );
|
OFF_COMMAND( m_textScores[l] );
|
||||||
m_textPoints[l].Command( POINTS_OFF_COMMAND(l) );
|
OFF_COMMAND( m_textPoints[l] );
|
||||||
m_textTime[l].Command( TIME_OFF_COMMAND(l) );
|
OFF_COMMAND( m_textTime[l] );
|
||||||
for( d=0; d<NUM_DIFFICULTIES; d++ )
|
|
||||||
m_textPercent[l][d].Command( PERCENT_OFF_COMMAND(l) );
|
|
||||||
}
|
}
|
||||||
for( d=0; d<NUM_DIFFICULTIES; d++ )
|
const unsigned num_songs = SONGMAN->GetAllSongs().size();
|
||||||
m_sprDiffHeaders[d].Command( DIFFICULTY_OFF_COMMAND );
|
for( vector<Difficulty>::iterator dc_iter=m_vDiffsToShow.begin(); dc_iter!=m_vDiffsToShow.end(); dc_iter++ )
|
||||||
|
{
|
||||||
|
OFF_COMMAND( m_sprDifficulty[*dc_iter] );
|
||||||
|
for( int s=0; s<num_songs; s++ )
|
||||||
|
{
|
||||||
|
// m_vpTextStepsScore[*dc_iter][s];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OFF_COMMAND( m_ListScoreRowItems );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
||||||
Chris Danford
|
Chris Danford
|
||||||
|
Ben Nordstrom
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
#include "Sprite.h"
|
#include "Sprite.h"
|
||||||
#include "BitmapText.h"
|
#include "BitmapText.h"
|
||||||
#include "Banner.h"
|
#include "Banner.h"
|
||||||
|
#include "ListDisplay.h"
|
||||||
|
|
||||||
class Course;
|
class Course;
|
||||||
class Song;
|
class Song;
|
||||||
@@ -23,45 +25,48 @@ class ScreenRanking : public ScreenAttract
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ScreenRanking( CString sName );
|
ScreenRanking( CString sName );
|
||||||
|
~ScreenRanking();
|
||||||
|
|
||||||
void HandleScreenMessage( const ScreenMessage SM );
|
void HandleScreenMessage( const ScreenMessage SM );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
struct PageToShow
|
struct PageToShow
|
||||||
{
|
{
|
||||||
enum { TYPE_CATEGORY, TYPE_COURSE, TYPE_SONG } type;
|
enum { TYPE_CATEGORY, TYPE_COURSE, TYPE_ALL_STEPS } type;
|
||||||
int colorIndex;
|
int colorIndex;
|
||||||
StepsType nt; // used in category and course
|
StepsType nt;
|
||||||
RankingCategory category;
|
RankingCategory category;
|
||||||
Course* pCourse;
|
Course* pCourse;
|
||||||
Song* pSong;
|
PageToShow(): pCourse(NULL) { }
|
||||||
PageToShow(): pCourse(NULL), pSong(NULL) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void SetPage( PageToShow pts );
|
float SetPage( PageToShow pts );
|
||||||
void TweenPageOnScreen();
|
void TweenPageOnScreen();
|
||||||
void TweenPageOffScreen();
|
void TweenPageOffScreen();
|
||||||
|
|
||||||
|
|
||||||
Sprite m_sprCategory;
|
Banner m_Banner; // for course
|
||||||
Banner m_banner;
|
Sprite m_sprBannerFrame; // for course
|
||||||
Sprite m_sprBannerFrame;
|
BitmapText m_textCategory; // for category
|
||||||
BitmapText m_textCategory;
|
BitmapText m_textStepsType; // for category, course, all_steps
|
||||||
Sprite m_sprType;
|
|
||||||
Sprite m_sprBullets[NUM_RANKING_LINES];
|
Sprite m_sprBullets[NUM_RANKING_LINES]; // for category and course
|
||||||
Sprite m_sprDiffHeaders[NUM_DIFFICULTIES];
|
BitmapText m_textNames[NUM_RANKING_LINES]; // for category and course
|
||||||
BitmapText m_textNames[NUM_RANKING_LINES];
|
BitmapText m_textScores[NUM_RANKING_LINES]; // for category and course
|
||||||
BitmapText m_textScores[NUM_RANKING_LINES]; // for category
|
|
||||||
BitmapText m_textPoints[NUM_RANKING_LINES]; // for course
|
BitmapText m_textPoints[NUM_RANKING_LINES]; // for course
|
||||||
BitmapText m_textTime[NUM_RANKING_LINES]; // for course
|
BitmapText m_textTime[NUM_RANKING_LINES]; // for course
|
||||||
BitmapText m_textPercent[NUM_RANKING_LINES][NUM_DIFFICULTIES]; // for song
|
Sprite m_sprDifficulty[NUM_DIFFICULTIES]; // for all_steps
|
||||||
|
struct StepsScoreRowItem : public ActorFrame // for all_steps
|
||||||
|
{
|
||||||
|
Sprite m_sprSongFrame;
|
||||||
|
BitmapText m_textSongTitle;
|
||||||
|
BitmapText m_textStepsScore[NUM_DIFFICULTIES];
|
||||||
|
};
|
||||||
|
vector<StepsScoreRowItem*> m_vpStepsScoreRowItem; // for all_steps
|
||||||
|
ListDisplay m_ListScoreRowItems;
|
||||||
|
|
||||||
vector<PageToShow> m_vPagesToShow;
|
vector<PageToShow> m_vPagesToShow;
|
||||||
|
|
||||||
vector<Difficulty> m_vDiffsToShow;
|
vector<Difficulty> m_vDiffsToShow;
|
||||||
|
|
||||||
typedef vector<Difficulty>::iterator DiffVectorIter;
|
|
||||||
typedef vector<Difficulty>::const_iterator DiffVectorCIter;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ IntDir=.\../Debug6
|
|||||||
TargetDir=\stepmania\stepmania\Program
|
TargetDir=\stepmania\stepmania\Program
|
||||||
TargetName=StepMania-debug
|
TargetName=StepMania-debug
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -102,8 +102,8 @@ IntDir=.\Debug
|
|||||||
TargetDir=\stepmania\stepmania
|
TargetDir=\stepmania\stepmania
|
||||||
TargetName=default
|
TargetName=default
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c \
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c \
|
||||||
verstub.cpp /Fo$(IntDir)\
|
verstub.cpp /Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ IntDir=.\../Release6
|
|||||||
TargetDir=\stepmania\stepmania\Program
|
TargetDir=\stepmania\stepmania\Program
|
||||||
TargetName=StepMania
|
TargetName=StepMania
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -184,8 +184,8 @@ IntDir=.\StepMania___Xbox_Release
|
|||||||
TargetDir=\stepmania\stepmania
|
TargetDir=\stepmania\stepmania
|
||||||
TargetName=default
|
TargetName=default
|
||||||
SOURCE="$(InputPath)"
|
SOURCE="$(InputPath)"
|
||||||
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c \
|
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c \
|
||||||
verstub.cpp /Fo$(IntDir)\
|
verstub.cpp /Fo$(IntDir)\
|
||||||
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
|
||||||
# End Special Build Tool
|
# End Special Build Tool
|
||||||
|
|
||||||
@@ -4007,6 +4007,25 @@ SOURCE=.\JukeboxMenu.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ListDisplay.cpp
|
||||||
|
|
||||||
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
|
||||||
|
|
||||||
|
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
|
||||||
|
|
||||||
|
!ENDIF
|
||||||
|
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\ListDisplay.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\MemoryCardDisplay.cpp
|
SOURCE=.\MemoryCardDisplay.cpp
|
||||||
|
|
||||||
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
!IF "$(CFG)" == "StepMania - Win32 Debug"
|
||||||
|
|||||||
Reference in New Issue
Block a user