2 using System.Collections.Generic;
4 using System.Runtime.InteropServices;
6 using System.Diagnostics;
12 internal class CStage選曲 : CStage
15 public int nスクロールバー相対y座標
19 if ( act曲リスト != null )
21 return act曲リスト.nスクロールバー相対y座標;
29 public bool bIsEnumeratingSongs
33 return act曲リスト.bIsEnumeratingSongs;
37 act曲リスト.bIsEnumeratingSongs = value;
44 return this.act曲リスト.bスクロール中;
47 public int n確定された曲の難易度
57 public C曲リストノード r確定された曲
62 public int n現在選択中の曲の難易度
66 return this.act曲リスト.n現在選択中の曲の現在の難易度レベル;
69 public Cスコア r現在選択中のスコア
73 return this.act曲リスト.r現在選択中のスコア;
76 public C曲リストノード r現在選択中の曲
80 return this.act曲リスト.r現在選択中の曲;
87 base.eステージID = CStage.Eステージ.選曲;
88 base.eフェーズID = CStage.Eフェーズ.共通_通常状態;
90 base.list子Activities.Add( this.actオプションパネル = new CActオプションパネル() );
91 base.list子Activities.Add( this.actFIFO = new CActFIFOBlack() );
92 base.list子Activities.Add( this.actFIfrom結果画面 = new CActFIFOBlack() );
93 base.list子Activities.Add( this.actFOtoNowLoading = new CActFIFOBlack() ); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略
94 base.list子Activities.Add( this.act曲リスト = new CActSelect曲リスト() );
95 base.list子Activities.Add( this.actステータスパネル = new CActSelectステータスパネル() );
96 base.list子Activities.Add( this.act演奏履歴パネル = new CActSelect演奏履歴パネル() );
97 base.list子Activities.Add( this.actPreimageパネル = new CActSelectPreimageパネル() );
98 base.list子Activities.Add( this.actPresound = new CActSelectPresound() );
99 base.list子Activities.Add( this.actArtistComment = new CActSelectArtistComment() );
100 base.list子Activities.Add( this.actInformation = new CActSelectInformation() );
101 base.list子Activities.Add( this.actSortSongs = new CActSortSongs() );
102 base.list子Activities.Add( this.actShowCurrentPosition = new CActSelectShowCurrentPosition() );
103 base.list子Activities.Add( this.actQuickConfig = new CActSelectQuickConfig() );
104 base.list子Activities.Add( this.actAVI = new CAct演奏AVI() );
106 this.CommandHistory = new CCommandHistory(); // #24063 2011.1.16 yyagi
112 public void t選択曲変更通知()
114 this.actPreimageパネル.t選択曲が変更された();
115 this.actPresound.t選択曲が変更された();
116 this.act演奏履歴パネル.t選択曲が変更された();
117 this.actステータスパネル.t選択曲が変更された();
118 this.actArtistComment.t選択曲が変更された();
120 #region [ プラグインにも通知する(BOX, RANDOM, BACK なら通知しない)]
121 //---------------------
122 if( CDTXMania.app != null )
124 var c曲リストノード = CDTXMania.stage選曲.r現在選択中の曲;
125 var cスコア = CDTXMania.stage選曲.r現在選択中のスコア;
127 if( c曲リストノード != null && cスコア != null && c曲リストノード.eノード種別 == C曲リストノード.Eノード種別.SCORE )
129 string str選択曲ファイル名 = cスコア.ファイル情報.ファイルの絶対パス;
130 CSetDef setDef = null;
131 int nブロック番号inSetDef = -1;
134 if( !string.IsNullOrEmpty( c曲リストノード.pathSetDefの絶対パス ) && File.Exists( c曲リストノード.pathSetDefの絶対パス ) )
136 setDef = new CSetDef( c曲リストノード.pathSetDefの絶対パス );
137 nブロック番号inSetDef = c曲リストノード.SetDefのブロック番号;
138 n曲番号inブロック = CDTXMania.stage選曲.act曲リスト.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( c曲リストノード );
141 foreach( CDTXMania.STPlugin stPlugin in CDTXMania.app.listプラグイン )
143 Directory.SetCurrentDirectory( stPlugin.strプラグインフォルダ );
144 stPlugin.plugin.On選択曲変更( str選択曲ファイル名, setDef, nブロック番号inSetDef, n曲番号inブロック );
145 Directory.SetCurrentDirectory( CDTXMania.strEXEのあるフォルダ );
149 //---------------------
158 /// <param name="cs"></param>
159 public void Refresh( CSongs管理 cs, bool bRemakeSongTitleBar)
161 this.act曲リスト.Refresh( cs, bRemakeSongTitleBar );
164 public override void On活性化()
166 Trace.TraceInformation( "選曲ステージを活性化します。" );
170 this.eフェードアウト完了時の戻り値 = E戻り値.継続;
171 this.bBGM再生済み = false;
172 for( int i = 0; i < 4; i++ )
173 this.ctキー反復用[ i ] = new CCounter( 0, 0, 0, CDTXMania.Timer );
174 this.ct決定演出待機 = new CCounter();
175 this.b決定演出カウンタ使用中 = false;
178 this.actステータスパネル.t選択曲が変更された(); // 最大ランクを更新
182 Trace.TraceInformation( "選曲ステージの活性化を完了しました。" );
186 public override void On非活性化()
188 Trace.TraceInformation( "選曲ステージを非活性化します。" );
192 for( int i = 0; i < 4; i++ )
194 this.ctキー反復用[ i ] = null;
196 this.ct決定演出待機 = null;
201 Trace.TraceInformation( "選曲ステージの非活性化を完了しました。" );
205 public override void OnManagedリソースの作成()
209 this.tx背景 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_background.png" ) );
210 this.tx背景_決定後 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_background decide.png" ) );
211 this.tx上部パネル = CDTXMania.tテクスチャの生成Af( CSkin.Path( @"Graphics\5_header panel.png" ) );
212 this.tx下部パネル = CDTXMania.tテクスチャの生成Af( CSkin.Path( @"Graphics\5_footer panel.png" ) );
213 this.txFLIP = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect skill number on gauge etc.png" ) );
214 base.OnManagedリソースの作成();
217 public override void OnManagedリソースの解放()
221 CDTXMania.tテクスチャの解放( ref this.tx背景 );
222 CDTXMania.tテクスチャの解放( ref this.tx背景_決定後 );
223 CDTXMania.tテクスチャの解放( ref this.tx上部パネル );
224 CDTXMania.tテクスチャの解放( ref this.tx下部パネル );
225 CDTXMania.tテクスチャの解放( ref this.txFLIP );
226 base.OnManagedリソースの解放();
229 public override int On進行描画()
234 //---------------------
237 this.ct登場時アニメ用共通 = new CCounter( 0, 100, 3, CDTXMania.Timer );
238 if( CDTXMania.r直前のステージ == CDTXMania.stage結果 )
240 this.actFIfrom結果画面.tフェードイン開始();
241 base.eフェーズID = CStage.Eフェーズ.選曲_結果画面からのフェードイン;
245 this.actFIFO.tフェードイン開始();
246 base.eフェーズID = CStage.Eフェーズ.共通_フェードイン;
249 base.b初めての進行描画 = false;
251 //---------------------
254 this.ct登場時アニメ用共通.t進行();
256 if( this.tx背景 != null )
257 this.tx背景.t2D描画( CDTXMania.app.Device, 0, 0 );
258 if( this.tx背景_決定後 != null )
260 if( CDTXMania.stage選曲.ct決定演出待機.n現在の値 < 1000 )
262 this.tx背景_決定後.n透明度 = (int)( 255 * ( ( CDTXMania.stage選曲.ct決定演出待機.n現在の値 ) / 500.0 ) );
264 else if( CDTXMania.stage選曲.ct決定演出待機.n現在の値 > 1000 )
266 this.tx背景_決定後.n透明度 = 255;
268 this.tx背景_決定後.t2D描画( CDTXMania.app.Device, 0, 0 );
271 this.actPreimageパネル.On進行描画();
272 // this.bIsEnumeratingSongs = !this.actPreimageパネル.bIsPlayingPremovie; // #27060 2011.3.2 yyagi: #PREMOVIE再生中は曲検索を中断する
274 this.act曲リスト.On進行描画();
276 if( this.ct登場時アニメ用共通.b進行中 )
278 double db登場割合 = ( (double) this.ct登場時アニメ用共通.n現在の値 ) / 100.0; // 100が最終値
279 double dbY表示割合 = Math.Sin( Math.PI / 2 * db登場割合 );
280 y = ( (int) ( this.tx上部パネル.sz画像サイズ.Height * dbY表示割合 ) ) - this.tx上部パネル.sz画像サイズ.Height;
283 if( this.tx上部パネル != null )
285 this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0f, 78.0f - ( this.ct登場時アニメ用共通.n現在の値 * 0.61f ) , new Rectangle(0, 17, 200, 55 ) );
286 this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0f, 24.0f + ( this.ct登場時アニメ用共通.n現在の値 * 0.57f ) , new Rectangle(0, 81, 200, 55 ) );
287 this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0f, 150.0f, new Rectangle(0, 150, 200, 12 ) );
288 this.tx上部パネル.t2D描画( CDTXMania.app.Device, 0f, 143.0f, new Rectangle(0, 143, 200, 3 ) );
291 //this.actInformation.On進行描画();
293 if ( this.tx下部パネル != null )
295 CDTXMania.app.Device,
297 SampleFramework.GameWindowSize.Height - this.tx下部パネル.sz画像サイズ.Height
300 this.actステータスパネル.On進行描画();
301 if( CDTXMania.ConfigIni.bDrums有効 )
302 this.act演奏履歴パネル.On進行描画();
303 this.actShowCurrentPosition.On進行描画(); // #27648 2011.3.28 yyagi
305 if( base.eフェーズID != CStage.Eフェーズ.選曲_決定演出 && base.eフェーズID != Eフェーズ.選曲_NowLoading画面へのフェードアウト )
307 this.actArtistComment.On進行描画();
308 this.actPresound.On進行描画();
311 switch ( base.eフェーズID )
313 case CStage.Eフェーズ.共通_フェードイン:
314 if( this.actFIFO.On進行描画() != 0 )
316 base.eフェーズID = CStage.Eフェーズ.共通_通常状態;
320 case CStage.Eフェーズ.共通_フェードアウト:
321 if( this.actFIFO.On進行描画() == 0 )
325 return (int) this.eフェードアウト完了時の戻り値;
327 case CStage.Eフェーズ.選曲_結果画面からのフェードイン:
328 if( this.actFIfrom結果画面.On進行描画() != 0 )
330 base.eフェーズID = CStage.Eフェーズ.共通_通常状態;
334 case CStage.Eフェーズ.選曲_NowLoading画面へのフェードアウト:
336 if( this.actFOtoNowLoading.On進行描画() == 0 )
341 return (int) this.eフェードアウト完了時の戻り値;
345 if( !this.bBGM再生済み && ( base.eフェーズID == CStage.Eフェーズ.共通_通常状態 ) )
347 CDTXMania.Skin.bgm選曲画面.n音量_次に鳴るサウンド = 100;
348 CDTXMania.Skin.bgm選曲画面.t再生する();
349 this.bBGM再生済み = true;
353 //Debug.WriteLine( "パンくず=" + this.r現在選択中の曲.strBreadcrumbs );
357 if( base.eフェーズID == CStage.Eフェーズ.共通_通常状態
358 && CDTXMania.act現在入力を占有中のプラグイン == null )
360 #region [ 簡易CONFIGでMore、またはShift+F1: 詳細CONFIG呼び出し ]
361 if ( actQuickConfig.bGotoDetailConfig )
363 actQuickConfig.tDeativatePopupMenu();
364 this.actPresound.tサウンド停止();
365 this.eフェードアウト完了時の戻り値 = E戻り値.コンフィグ呼び出し; // #24525 2011.3.16 yyagi: [SHIFT]-[F1]でCONFIG呼び出し
366 this.actFIFO.tフェードアウト開始();
367 base.eフェーズID = CStage.Eフェーズ.共通_フェードアウト;
368 CDTXMania.Skin.sound取消音.t再生する();
372 if ( !this.actSortSongs.bIsActivePopupMenu && !this.actQuickConfig.bIsActivePopupMenu )
375 if ( CDTXMania.Input管理.Keyboard.bキーが押された( (int) SlimDX.DirectInput.Key.Escape ) || ( ( CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.LC ) || CDTXMania.Pad.b押されたGB( Eパッド.Cancel ) || CDTXMania.Pad.b押されたGB( Eパッド.Pick ) ) && ( ( this.act曲リスト.r現在選択中の曲 != null ) && ( this.act曲リスト.r現在選択中の曲.r親ノード == null ) ) ) )
377 CDTXMania.Skin.sound取消音.t再生する();
378 this.eフェードアウト完了時の戻り値 = E戻り値.タイトルに戻る;
379 this.actFIFO.tフェードアウト開始();
380 base.eフェーズID = CStage.Eフェーズ.共通_フェードアウト;
384 #region [ Shift-F1: CONFIG画面 ]
385 if ( ( CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDX.DirectInput.Key.RightShift ) || CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDX.DirectInput.Key.LeftShift ) ) &&
386 CDTXMania.Input管理.Keyboard.bキーが押された( (int) SlimDX.DirectInput.Key.F1 ) )
387 { // [SHIFT] + [F1] CONFIG
388 this.actPresound.tサウンド停止();
389 this.eフェードアウト完了時の戻り値 = E戻り値.コンフィグ呼び出し; // #24525 2011.3.16 yyagi: [SHIFT]-[F1]でCONFIG呼び出し
390 this.actFIFO.tフェードアウト開始();
391 base.eフェーズID = CStage.Eフェーズ.共通_フェードアウト;
392 CDTXMania.Skin.sound取消音.t再生する();
396 #region [ Shift-F2: 未使用 ]
397 // #24525 2011.3.16 yyagi: [SHIFT]+[F2]は廃止(将来発生するかもしれない別用途のためにキープ)
399 if ( ( CDTXMania.Input管理.Keyboard.bキーが押されている( (int)SlimDX.DirectInput.Key.RightShift ) || CDTXMania.Input管理.Keyboard.bキーが押されている( (int)SlimDX.DirectInput.Key.LeftShift ) ) &&
400 CDTXMania.Input管理.Keyboard.bキーが押された( (int)SlimDX.DirectInput.Key.F2 ) )
401 { // [SHIFT] + [F2] CONFIGURATION
402 this.actPresound.tサウンド停止();
403 this.eフェードアウト完了時の戻り値 = E戻り値.コンフィグ呼び出し;
404 this.actFIFO.tフェードアウト開始();
405 base.eフェーズID = CStage.Eフェーズ.共通_フェードアウト;
406 CDTXMania.Skin.sound取消音.t再生する();
411 if ( this.act曲リスト.r現在選択中の曲 != null )
414 //2016.02.20 kairera0467 XG風の場合は使わない。
415 if ( CDTXMania.Input管理.Keyboard.bキーが押された( (int) SlimDX.DirectInput.Key.RightArrow ) && !CDTXMania.bXGRelease )
417 if ( this.act曲リスト.r現在選択中の曲 != null )
419 switch ( this.act曲リスト.r現在選択中の曲.eノード種別 )
421 case C曲リストノード.Eノード種別.BOX:
423 CDTXMania.Skin.sound決定音.t再生する();
424 bool bNeedChangeSkin = this.act曲リスト.tBOXに入る();
425 if ( bNeedChangeSkin )
427 this.eフェードアウト完了時の戻り値 = E戻り値.スキン変更;
428 base.eフェーズID = Eフェーズ.選曲_NowLoading画面へのフェードアウト;
437 if (( CDTXMania.Pad.b押されたDGB( Eパッド.Decide ) || CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.RD ) ) ||
438 ( ( CDTXMania.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && CDTXMania.Input管理.Keyboard.bキーが押された( (int) SlimDX.DirectInput.Key.Return ) ) ) )
440 if ( this.act曲リスト.r現在選択中の曲 != null )
442 switch ( this.act曲リスト.r現在選択中の曲.eノード種別 )
444 case C曲リストノード.Eノード種別.SCORE:
445 CDTXMania.Skin.sound曲決定音.t再生する();
450 case C曲リストノード.Eノード種別.SCORE_MIDI:
454 case C曲リストノード.Eノード種別.BOX:
456 CDTXMania.Skin.sound決定音.t再生する();
457 bool bNeedChangeSkin = this.act曲リスト.tBOXに入る();
458 if ( bNeedChangeSkin )
460 this.eフェードアウト完了時の戻り値 = E戻り値.スキン変更;
461 base.eフェーズID = Eフェーズ.選曲_NowLoading画面へのフェードアウト;
466 case C曲リストノード.Eノード種別.BACKBOX:
468 CDTXMania.Skin.sound決定音.t再生する();
469 bool bNeedChangeSkin = this.act曲リスト.tBOXを出る();
470 if ( bNeedChangeSkin )
472 this.eフェードアウト完了時の戻り値 = E戻り値.スキン変更;
473 base.eフェーズID = Eフェーズ.選曲_NowLoading画面へのフェードアウト;
478 case C曲リストノード.Eノード種別.RANDOM:
479 CDTXMania.Skin.sound曲決定音.t再生する();
488 this.ctキー反復用.Up.tキー反復( CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDX.DirectInput.Key.LeftArrow ), new CCounter.DGキー処理( this.tカーソルを上へ移動する ) );
489 this.ctキー反復用.R.tキー反復( CDTXMania.Pad.b押されているGB( Eパッド.R ), new CCounter.DGキー処理( this.tカーソルを上へ移動する ) );
490 if ( CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.SD ) )
496 this.ctキー反復用.Down.tキー反復( CDTXMania.Input管理.Keyboard.bキーが押されている( (int) SlimDX.DirectInput.Key.RightArrow ), new CCounter.DGキー処理( this.tカーソルを下へ移動する ) );
497 this.ctキー反復用.B.tキー反復( CDTXMania.Pad.b押されているGB( Eパッド.G ), new CCounter.DGキー処理( this.tカーソルを下へ移動する ) );
498 if ( CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.FT ) )
503 #region [ Upstairs / Left ]
504 if ( ( ( this.act曲リスト.r現在選択中の曲 != null ) && ( this.act曲リスト.r現在選択中の曲.r親ノード != null ) ) &&
505 ( CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.LC ) ||
506 CDTXMania.Pad.b押されたGB( Eパッド.Pick ) || CDTXMania.Pad.b押されたGB( Eパッド.Cancel ) ) )
508 this.actPresound.tサウンド停止();
509 CDTXMania.Skin.sound取消音.t再生する();
510 this.act曲リスト.tBOXを出る();
514 #region [ BDx2: 簡易CONFIG ]
515 if ( CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.BD ) )
516 { // [BD]x2 スクロール速度変更
517 CommandHistory.Add( E楽器パート.DRUMS, EパッドFlag.BD );
518 EパッドFlag[] comChangeScrollSpeed = new EパッドFlag[] { EパッドFlag.BD, EパッドFlag.BD };
519 if ( CommandHistory.CheckCommand( comChangeScrollSpeed, E楽器パート.DRUMS ) )
521 CDTXMania.Skin.sound変更音.t再生する();
522 this.actQuickConfig.tActivatePopupMenu( E楽器パート.DRUMS );
526 #region [ HHx2: 難易度変更 ]
527 if ( CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.HH ) || CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.HHO ) )
529 CommandHistory.Add( E楽器パート.DRUMS, EパッドFlag.HH );
530 EパッドFlag[] comChangeDifficulty = new EパッドFlag[] { EパッドFlag.HH, EパッドFlag.HH };
531 if ( CommandHistory.CheckCommand( comChangeDifficulty, E楽器パート.DRUMS ) )
533 this.act曲リスト.t難易度レベルをひとつ進める();
537 #region [ Bx2 Guitar: 難易度変更 ]
538 if( CDTXMania.Pad.b押された( E楽器パート.GUITAR, Eパッド.B ) )
540 CommandHistory.Add( E楽器パート.GUITAR, EパッドFlag.B );
541 EパッドFlag[] comChangeDifficultyG = new EパッドFlag[] { EパッドFlag.B, EパッドFlag.B };
542 if ( CommandHistory.CheckCommand( comChangeDifficultyG, E楽器パート.GUITAR ) )
544 Debug.WriteLine( "ギター難易度変更" );
545 this.act曲リスト.t難易度レベルをひとつ進める();
546 //CDTXMania.Skin.sound変更音.t再生する();
550 #region [ Bx2 Bass: 難易度変更 ]
551 if( CDTXMania.Pad.b押された( E楽器パート.BASS, Eパッド.B ) )
553 CommandHistory.Add( E楽器パート.BASS, EパッドFlag.B );
554 EパッドFlag[] comChangeDifficultyB = new EパッドFlag[] { EパッドFlag.B, EパッドFlag.B };
555 if ( CommandHistory.CheckCommand( comChangeDifficultyB, E楽器パート.BASS ) )
557 Debug.WriteLine( "ベース難易度変更" );
558 this.act曲リスト.t難易度レベルをひとつ進める();
562 #region [ Yx2 Guitar: ギターとベースを入れ替え ]
563 if ( CDTXMania.Pad.b押された( E楽器パート.GUITAR, Eパッド.Y ) )
564 { // Yx2 ギターとベースを入れ替え
565 CommandHistory.Add( E楽器パート.GUITAR, EパッドFlag.Y );
566 EパッドFlag[] comSwapGtBs1 = new EパッドFlag[] { EパッドFlag.Y, EパッドFlag.Y };
567 if ( CommandHistory.CheckCommand( comSwapGtBs1, E楽器パート.GUITAR ) )
569 Debug.WriteLine( "ギターとベースの入れ替え1" );
570 CDTXMania.Skin.sound変更音.t再生する();
571 CDTXMania.ConfigIni.bIsSwappedGuitarBass = !CDTXMania.ConfigIni.bIsSwappedGuitarBass;
575 #region [ Yx2 Bass: ギターとベースを入れ替え ]
576 if ( CDTXMania.Pad.b押された( E楽器パート.BASS, Eパッド.Y ) )
578 CommandHistory.Add( E楽器パート.BASS, EパッドFlag.Y );
580 EパッドFlag[] comSwapGtBs1 = new EパッドFlag[] { EパッドFlag.Y, EパッドFlag.Y };
581 if ( CommandHistory.CheckCommand( comSwapGtBs1, E楽器パート.BASS ) )
583 Debug.WriteLine( "ギターとベースの入れ替え2" );
584 CDTXMania.Skin.sound変更音.t再生する();
585 CDTXMania.ConfigIni.bIsSwappedGuitarBass = !CDTXMania.ConfigIni.bIsSwappedGuitarBass;
589 #region [ Px2 Guitar: 簡易CONFIG ]
590 if ( CDTXMania.Pad.b押された( E楽器パート.GUITAR, Eパッド.P ) )
592 CommandHistory.Add( E楽器パート.GUITAR, EパッドFlag.P );
593 EパッドFlag[] comChangeScrollSpeed = new EパッドFlag[] { EパッドFlag.P, EパッドFlag.P };
594 if ( CommandHistory.CheckCommand( comChangeScrollSpeed, E楽器パート.GUITAR ) )
596 CDTXMania.Skin.sound変更音.t再生する();
597 this.actQuickConfig.tActivatePopupMenu( E楽器パート.GUITAR );
601 #region [ Px2 Bass: 簡易CONFIG ]
602 if ( CDTXMania.Pad.b押された( E楽器パート.BASS, Eパッド.P ) )
604 CommandHistory.Add( E楽器パート.BASS, EパッドFlag.P );
605 EパッドFlag[] comChangeScrollSpeed = new EパッドFlag[] { EパッドFlag.P, EパッドFlag.P };
606 if ( CommandHistory.CheckCommand( comChangeScrollSpeed, E楽器パート.BASS ) )
608 CDTXMania.Skin.sound変更音.t再生する();
609 this.actQuickConfig.tActivatePopupMenu( E楽器パート.BASS );
613 #region [ Y P Guitar: ソート画面 ]
614 if ( CDTXMania.Pad.b押されている( E楽器パート.GUITAR, Eパッド.Y ) && CDTXMania.Pad.b押された( E楽器パート.GUITAR, Eパッド.P ) )
616 CDTXMania.Skin.sound変更音.t再生する();
617 this.actSortSongs.tActivatePopupMenu( E楽器パート.GUITAR, ref this.act曲リスト );
620 #region [ Y P Bass: ソート画面 ]
621 if ( CDTXMania.Pad.b押されている( E楽器パート.BASS, Eパッド.Y ) && CDTXMania.Pad.b押された( E楽器パート.BASS, Eパッド.P ) )
623 CDTXMania.Skin.sound変更音.t再生する();
624 this.actSortSongs.tActivatePopupMenu( E楽器パート.BASS, ref this.act曲リスト );
627 #region [ HTx2 Drums: ソート画面 ]
628 if ( CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.HT ) )
629 { // [HT]x2 ソート画面 2013.12.31.kairera0467
630 CommandHistory.Add( E楽器パート.DRUMS, EパッドFlag.HT );
631 EパッドFlag[] comSort = new EパッドFlag[] { EパッドFlag.HT, EパッドFlag.HT };
632 if ( CommandHistory.CheckCommand( comSort, E楽器パート.DRUMS ) )
634 CDTXMania.Skin.sound変更音.t再生する();
635 this.actSortSongs.tActivatePopupMenu( E楽器パート.DRUMS, ref this.act曲リスト );
644 if( CDTXMania.Input管理.Keyboard.bキーが押された( (int) SlimDX.DirectInput.Key.F5 ) )
646 Debug.WriteLine( "ギターとベースの入れ替え1" );
647 CDTXMania.Skin.sound変更音.t再生する();
648 CDTXMania.ConfigIni.bIsSwappedGuitarBass = !CDTXMania.ConfigIni.bIsSwappedGuitarBass;
651 this.actSortSongs.t進行描画();
652 this.actQuickConfig.t進行描画();
654 else if( base.eフェーズID == CStage.Eフェーズ.選曲_決定演出
655 && CDTXMania.act現在入力を占有中のプラグイン == null )
658 if( ( CDTXMania.Pad.b押されたDGB( Eパッド.Decide ) || CDTXMania.Pad.b押された( E楽器パート.DRUMS, Eパッド.RD ) ) ||
659 ( ( CDTXMania.ConfigIni.bEnterがキー割り当てのどこにも使用されていない && CDTXMania.Input管理.Keyboard.bキーが押された( (int)SlimDX.DirectInput.Key.Return ) ) ) )
662 if( this.ct決定演出待機.b進行中 )
664 this.ct決定演出待機.n現在の値 = this.ct決定演出待機.n終了値;
672 public enum E戻り値 : int
687 [StructLayout( LayoutKind.Sequential )]
688 private struct STキー反復用カウンタ
691 public CCounter Down;
694 public CCounter this[ int index ]
712 throw new IndexOutOfRangeException();
734 throw new IndexOutOfRangeException();
738 private CActSelectArtistComment actArtistComment;
739 private CActFIFOBlack actFIFO;
740 private CActFIFOBlack actFIfrom結果画面;
741 private CActFIFOBlack actFOtoNowLoading; // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略
742 private CActSelectInformation actInformation;
743 private CActSelectPreimageパネル actPreimageパネル;
744 private CActSelectPresound actPresound;
745 private CActオプションパネル actオプションパネル;
746 public CActSelectステータスパネル actステータスパネル;
747 private CActSelect演奏履歴パネル act演奏履歴パネル;
748 public CActSelect曲リスト act曲リスト;
749 private CActSelectShowCurrentPosition actShowCurrentPosition;
751 private CActSortSongs actSortSongs;
752 private CActSelectQuickConfig actQuickConfig;
753 private CAct演奏AVI actAVI;
755 private bool bBGM再生済み;
756 private STキー反復用カウンタ ctキー反復用;
757 public CCounter ct登場時アニメ用共通;
758 public CCounter ct決定演出待機; //テスト
759 private bool b決定演出カウンタ使用中;
760 private E戻り値 eフェードアウト完了時の戻り値;
761 private CTextureAf tx下部パネル;
762 private CTextureAf tx上部パネル;
763 private CTexture tx背景;
764 private CTexture tx背景_決定後;
765 private CTexture txFLIP;
767 private struct STCommandTime // #24063 2011.1.16 yyagi コマンド入力時刻の記録用
769 public E楽器パート eInst; // 使用楽器
770 public EパッドFlag ePad; // 押されたコマンド(同時押しはOR演算で列挙する)
771 public long time; // コマンド入力時刻
773 private class CCommandHistory // #24063 2011.1.16 yyagi コマンド入力履歴を保持・確認するクラス
775 readonly int buffersize = 16;
776 private List<STCommandTime> stct;
778 public CCommandHistory() // コンストラクタ
780 stct = new List<STCommandTime>( buffersize );
786 /// <param name="_eInst">楽器の種類</param>
787 /// <param name="_ePad">入力コマンド(同時押しはOR演算で列挙すること)</param>
788 public void Add( E楽器パート _eInst, EパッドFlag _ePad )
790 STCommandTime _stct = new STCommandTime {
793 time = CDTXMania.Timer.n現在時刻
796 if ( stct.Count >= buffersize )
801 //Debug.WriteLine( "CMDHIS: 楽器=" + _stct.eInst + ", CMD=" + _stct.ePad + ", time=" + _stct.time );
803 public void RemoveAt( int index )
805 stct.RemoveAt( index );
809 /// コマンド入力に成功しているか調べる
811 /// <param name="_ePad">入力が成功したか調べたいコマンド</param>
812 /// <param name="_eInst">対象楽器</param>
813 /// <returns>コマンド入力成功時true</returns>
814 public bool CheckCommand( EパッドFlag[] _ePad, E楽器パート _eInst)
816 int targetCount = _ePad.Length;
817 int stciCount = stct.Count;
818 if ( stciCount < targetCount )
820 //Debug.WriteLine("NOT start checking...stciCount=" + stciCount + ", targetCount=" + targetCount);
824 long curTime = CDTXMania.Timer.n現在時刻;
825 //Debug.WriteLine("Start checking...targetCount=" + targetCount);
826 for ( int i = targetCount - 1, j = stciCount - 1; i >= 0; i--, j-- )
828 if ( _ePad[ i ] != stct[ j ].ePad )
830 //Debug.WriteLine( "CMD解析: false targetCount=" + targetCount + ", i=" + i + ", j=" + j + ": ePad[]=" + _ePad[i] + ", stci[j] = " + stct[j].ePad );
833 if ( stct[ j ].eInst != _eInst )
835 //Debug.WriteLine( "CMD解析: false " + i );
838 if ( curTime - stct[ j ].time > 500 )
840 //Debug.WriteLine( "CMD解析: false " + i + "; over 500ms" );
843 curTime = stct[ j ].time;
846 //Debug.Write( "CMD解析: 成功!(" + _ePad.Length + ") " );
847 //for ( int i = 0; i < _ePad.Length; i++ ) Debug.Write( _ePad[ i ] + ", " );
848 //Debug.WriteLine( "" );
849 //stct.RemoveRange( 0, targetCount ); // #24396 2011.2.13 yyagi
850 stct.Clear(); // #24396 2011.2.13 yyagi Clear all command input history in case you succeeded inputting some command
855 private CCommandHistory CommandHistory;
857 private void tカーソルを下へ移動する()
859 CDTXMania.Skin.soundカーソル移動音.t再生する();
860 this.act曲リスト.t次に移動();
862 private void tカーソルを上へ移動する()
864 CDTXMania.Skin.soundカーソル移動音.t再生する();
865 this.act曲リスト.t前に移動();
867 private void t曲をランダム選択する()
869 C曲リストノード song = this.act曲リスト.r現在選択中の曲;
870 if( ( song.stackランダム演奏番号.Count == 0 ) || ( song.listランダム用ノードリスト == null ) )
872 if( song.listランダム用ノードリスト == null )
874 song.listランダム用ノードリスト = this.t指定された曲が存在する場所の曲を列挙する_子リスト含む( song );
876 int count = song.listランダム用ノードリスト.Count;
881 int[] numArray = new int[ count ];
882 for( int i = 0; i < count; i++ )
886 for( int j = 0; j < ( count * 1.5 ); j++ )
888 int index = CDTXMania.Random.Next( count );
889 int num5 = CDTXMania.Random.Next( count );
890 int num6 = numArray[ num5 ];
891 numArray[ num5 ] = numArray[ index ];
892 numArray[ index ] = num6;
894 for( int k = 0; k < count; k++ )
896 song.stackランダム演奏番号.Push( numArray[ k ] );
898 if( CDTXMania.ConfigIni.bLogDTX詳細ログ出力 )
900 StringBuilder builder = new StringBuilder( 0x400 );
901 builder.Append( string.Format( "ランダムインデックスリストを作成しました: {0}曲: ", song.stackランダム演奏番号.Count ) );
902 for( int m = 0; m < count; m++ )
904 builder.Append( string.Format( "{0} ", numArray[ m ] ) );
906 Trace.TraceInformation( builder.ToString() );
909 this.r確定された曲 = song.listランダム用ノードリスト[ song.stackランダム演奏番号.Pop() ];
910 this.n確定された曲の難易度 = this.act曲リスト.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( this.r確定された曲 );
911 this.r確定されたスコア = this.r確定された曲.arスコア[ this.n確定された曲の難易度 ];
912 this.eフェードアウト完了時の戻り値 = E戻り値.選曲した;
913 // this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略
915 base.eフェーズID = CStage.Eフェーズ.選曲_決定演出;
917 base.eフェーズID = CStage.Eフェーズ.選曲_NowLoading画面へのフェードアウト;
919 if( CDTXMania.ConfigIni.bLogDTX詳細ログ出力 )
921 int[] numArray2 = song.stackランダム演奏番号.ToArray();
922 StringBuilder builder2 = new StringBuilder( 0x400 );
923 builder2.Append( "ランダムインデックスリスト残り: " );
924 if( numArray2.Length > 0 )
926 for( int n = 0; n < numArray2.Length; n++ )
928 builder2.Append( string.Format( "{0} ", numArray2[ n ] ) );
933 builder2.Append( "(なし)" );
935 Trace.TraceInformation( builder2.ToString() );
937 CDTXMania.Skin.bgm選曲画面.t停止する();
939 private void t曲を選択する()
941 this.r確定された曲 = this.act曲リスト.r現在選択中の曲;
942 this.r確定されたスコア = this.act曲リスト.r現在選択中のスコア;
943 this.n確定された曲の難易度 = this.act曲リスト.n現在選択中の曲の現在の難易度レベル;
944 if( ( this.r確定された曲 != null ) && ( this.r確定されたスコア != null ) )
946 this.eフェードアウト完了時の戻り値 = E戻り値.選曲した;
947 // this.actFOtoNowLoading.tフェードアウト開始(); // #27787 2012.3.10 yyagi 曲決定時の画面フェードアウトの省略
949 base.eフェーズID = CStage.Eフェーズ.選曲_決定演出;
951 base.eフェーズID = CStage.Eフェーズ.選曲_NowLoading画面へのフェードアウト;
954 CDTXMania.Skin.bgm選曲画面.t停止する();
956 private void t決定アニメーション()
959 if( this.b決定演出カウンタ使用中 )
962 if( this.ct決定演出待機.b終了値に達した )
965 this.b決定演出カウンタ使用中 = false;
969 if( base.eフェーズID == Eフェーズ.選曲_決定演出 )
971 if( this.ct決定演出待機.b進行中 )
973 this.actPresound.tサウンド停止();
974 //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.白, "MUSIC DECIDED." );
975 //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.白, "PLEASE WAIT " + this.ct決定演出待機.n現在の値.ToString() );
978 if( this.ct決定演出待機.b終了値に達した )
984 private void t決定アニメーション開始()
986 if( !this.b決定演出カウンタ使用中 )
988 this.b決定演出カウンタ使用中 = true;
989 this.ct決定演出待機 = new CCounter( 0, 6000, 1, CDTXMania.Timer );
992 private void t決定アニメーション終了()
995 this.actFOtoNowLoading.tフェードアウト開始();
996 base.eフェーズID = CStage.Eフェーズ.選曲_NowLoading画面へのフェードアウト;
998 private List<C曲リストノード> t指定された曲が存在する場所の曲を列挙する_子リスト含む( C曲リストノード song )
1000 List<C曲リストノード> list = new List<C曲リストノード>();
1002 if( ( song == null ) && ( CDTXMania.Songs管理.list曲ルート.Count > 0 ) )
1004 foreach( C曲リストノード c曲リストノード in CDTXMania.Songs管理.list曲ルート )
1006 if( ( c曲リストノード.eノード種別 == C曲リストノード.Eノード種別.SCORE ) || ( c曲リストノード.eノード種別 == C曲リストノード.Eノード種別.SCORE_MIDI ) )
1008 list.Add( c曲リストノード );
1010 if( ( c曲リストノード.list子リスト != null ) && CDTXMania.ConfigIni.bランダムセレクトで子BOXを検索対象とする )
1012 this.t指定された曲の子リストの曲を列挙する_孫リスト含む( c曲リストノード, ref list );
1017 this.t指定された曲の子リストの曲を列挙する_孫リスト含む( song, ref list );
1020 private void t指定された曲の子リストの曲を列挙する_孫リスト含む( C曲リストノード r親, ref List<C曲リストノード> list )
1022 if( ( r親 != null ) && ( r親.list子リスト != null ) )
1024 foreach( C曲リストノード c曲リストノード in r親.list子リスト )
1026 if( ( c曲リストノード.eノード種別 == C曲リストノード.Eノード種別.SCORE ) || ( c曲リストノード.eノード種別 == C曲リストノード.Eノード種別.SCORE_MIDI ) )
1028 list.Add( c曲リストノード );
1030 if( ( c曲リストノード.list子リスト != null ) && CDTXMania.ConfigIni.bランダムセレクトで子BOXを検索対象とする )
1032 this.t指定された曲の子リストの曲を列挙する_孫リスト含む( c曲リストノード, ref list );