2 using System.Collections.Generic;
\r
4 using System.Globalization;
\r
5 using System.Runtime.InteropServices;
\r
6 using System.Drawing;
\r
7 using System.Drawing.Imaging;
\r
8 using System.Diagnostics;
\r
9 using System.Drawing.Text;
\r
16 internal class CActSelect曲リスト : CActivity
\r
20 public bool bIsEnumeratingSongs
\r
29 if( this.n目標のスクロールカウンタ == 0 )
\r
31 return ( this.n現在のスクロールカウンタ != 0 );
\r
36 public int n現在のアンカ難易度レベル
\r
41 public int n現在選択中の曲の現在の難易度レベル
\r
45 return this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( this.r現在選択中の曲 );
\r
48 public Cスコア r現在選択中のスコア
\r
52 if( this.r現在選択中の曲 != null )
\r
54 return this.r現在選択中の曲.arスコア[ this.n現在選択中の曲の現在の難易度レベル ];
\r
59 public C曲リストノード r現在選択中の曲
\r
65 public int nスクロールバー相対y座標
\r
71 // t選択曲が変更された()内で使う、直前の選曲の保持
\r
72 // (前と同じ曲なら選択曲変更に掛かる再計算を省略して高速化するため)
\r
73 private C曲リストノード song_last = null;
\r
78 public CActSelect曲リスト()
\r
80 this.r現在選択中の曲 = null;
\r
81 this.n現在のアンカ難易度レベル = 0;
\r
82 base.b活性化してない = true;
\r
83 this.bIsEnumeratingSongs = false;
\r
89 public int n現在のアンカ難易度レベルに最も近い難易度レベルを返す( C曲リストノード song )
\r
94 return this.n現在のアンカ難易度レベル; // 曲がまったくないよ
\r
96 if( song.arスコア[ this.n現在のアンカ難易度レベル ] != null )
\r
97 return this.n現在のアンカ難易度レベル; // 難易度ぴったりの曲があったよ
\r
99 if( ( song.eノード種別 == C曲リストノード.Eノード種別.BOX ) || ( song.eノード種別 == C曲リストノード.Eノード種別.BACKBOX ) )
\r
100 return 0; // BOX と BACKBOX は関係無いよ
\r
103 // 現在のアンカレベルから、難易度上向きに検索開始。
\r
105 int n最も近いレベル = this.n現在のアンカ難易度レベル;
\r
107 for( int i = 0; i < 5; i++ )
\r
109 if( song.arスコア[ n最も近いレベル ] != null )
\r
112 n最も近いレベル = ( n最も近いレベル + 1 ) % 5; // 曲がなかったので次の難易度レベルへGo。(5以上になったら0に戻る。)
\r
116 // 見つかった曲がアンカより下のレベルだった場合……
\r
117 // アンカから下向きに検索すれば、もっとアンカに近い曲があるんじゃね?
\r
119 if( n最も近いレベル < this.n現在のアンカ難易度レベル )
\r
121 // 現在のアンカレベルから、難易度下向きに検索開始。
\r
123 n最も近いレベル = this.n現在のアンカ難易度レベル;
\r
125 for( int i = 0; i < 5; i++ )
\r
127 if( song.arスコア[ n最も近いレベル ] != null )
\r
130 n最も近いレベル = ( ( n最も近いレベル - 1 ) + 5 ) % 5; // 曲がなかったので次の難易度レベルへGo。(0未満になったら4に戻る。)
\r
136 public C曲リストノード r指定された曲が存在するリストの先頭の曲( C曲リストノード song )
\r
138 List<C曲リストノード> songList = GetSongListWithinMe( song );
\r
139 return ( songList == null ) ? null : songList[ 0 ];
\r
141 public C曲リストノード r指定された曲が存在するリストの末尾の曲( C曲リストノード song )
\r
143 List<C曲リストノード> songList = GetSongListWithinMe( song );
\r
144 return ( songList == null ) ? null : songList[ songList.Count - 1 ];
\r
147 private List<C曲リストノード> GetSongListWithinMe( C曲リストノード song )
\r
149 if ( song.r親ノード == null ) // root階層のノートだったら
\r
151 return CDTXMania.Instance.Songs管理.list曲ルート; // rootのリストを返す
\r
155 if ( ( song.r親ノード.list子リスト != null ) && ( song.r親ノード.list子リスト.Count > 0 ) )
\r
157 return song.r親ノード.list子リスト;
\r
167 public delegate void DGSortFunc( List<C曲リストノード> songList, E楽器パート eInst, int order, params object[] p);
\r
169 /// 主にCSong管理.cs内にあるソート機能を、delegateで呼び出す。
\r
171 /// <param name="sf">ソート用に呼び出すメソッド</param>
\r
172 /// <param name="eInst">ソート基準とする楽器</param>
\r
173 /// <param name="order">-1=降順, 1=昇順</param>
\r
174 public void t曲リストのソート( DGSortFunc sf, E楽器パート eInst, int order, params object[] p )
\r
176 List<C曲リストノード> songList = GetSongListWithinMe( this.r現在選択中の曲 );
\r
177 if ( songList == null )
\r
183 // CDTXMania.Instance.Songs管理.t曲リストのソート3_演奏回数の多い順( songList, eInst, order );
\r
184 sf( songList, eInst, order, p );
\r
185 // this.r現在選択中の曲 = CDTXMania
\r
186 this.t現在選択中の曲を元に曲バーを再構成する();
\r
190 public bool tBOXに入る()
\r
192 //Trace.TraceInformation( "box enter" );
\r
193 //Trace.TraceInformation( "Skin現在Current : " + CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName( false ) );
\r
194 //Trace.TraceInformation( "Skin現在System : " + CSkin.strSystemSkinSubfolderFullName );
\r
195 //Trace.TraceInformation( "Skin現在BoxDef : " + CSkin.strBoxDefSkinSubfolderFullName );
\r
196 //Trace.TraceInformation( "Skin現在: " + CSkin.GetSkinName( CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName( false ) ) );
\r
197 //Trace.TraceInformation( "Skin現pt: " + CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName( false ) );
\r
198 //Trace.TraceInformation( "Skin指定: " + CSkin.GetSkinName( this.r現在選択中の曲.strSkinPath ) );
\r
199 //Trace.TraceInformation( "Skinpath: " + this.r現在選択中の曲.strSkinPath );
\r
201 if ( CSkin.GetSkinName( CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName( false ) ) != CSkin.GetSkinName( this.r現在選択中の曲.strSkinPath )
\r
202 && CSkin.bUseBoxDefSkin )
\r
205 // BOXに入るときは、スキン変更発生時のみboxdefスキン設定の更新を行う
\r
206 CDTXMania.Instance.Skin.SetCurrentSkinSubfolderFullName( this.r現在選択中の曲.strSkinPath, false );
\r
209 //Trace.TraceInformation( "Skin変更: " + CSkin.GetSkinName( CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName( false ) ) );
\r
210 //Trace.TraceInformation( "Skin変更Current : " + CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName( false ) );
\r
211 //Trace.TraceInformation( "Skin変更System : " + CSkin.strSystemSkinSubfolderFullName );
\r
212 //Trace.TraceInformation( "Skin変更BoxDef : " + CSkin.strBoxDefSkinSubfolderFullName );
\r
214 if( ( this.r現在選択中の曲.list子リスト != null ) && ( this.r現在選択中の曲.list子リスト.Count > 0 ) )
\r
216 this.r現在選択中の曲 = this.r現在選択中の曲.list子リスト[ 0 ];
\r
217 this.t現在選択中の曲を元に曲バーを再構成する();
\r
218 this.t選択曲が変更された(false); // #27648 項目数変更を反映させる
\r
222 public bool tBOXを出る()
\r
224 //Trace.TraceInformation( "box exit" );
\r
225 //Trace.TraceInformation( "Skin現在Current : " + CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName(false) );
\r
226 //Trace.TraceInformation( "Skin現在System : " + CSkin.strSystemSkinSubfolderFullName );
\r
227 //Trace.TraceInformation( "Skin現在BoxDef : " + CSkin.strBoxDefSkinSubfolderFullName );
\r
228 //Trace.TraceInformation( "Skin現在: " + CSkin.GetSkinName( CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName(false) ) );
\r
229 //Trace.TraceInformation( "Skin現pt: " + CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName(false) );
\r
230 //Trace.TraceInformation( "Skin指定: " + CSkin.GetSkinName( this.r現在選択中の曲.strSkinPath ) );
\r
231 //Trace.TraceInformation( "Skinpath: " + this.r現在選択中の曲.strSkinPath );
\r
233 if ( CSkin.GetSkinName( CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName( false ) ) != CSkin.GetSkinName( this.r現在選択中の曲.strSkinPath )
\r
234 && CSkin.bUseBoxDefSkin )
\r
238 // スキン変更が発生しなくても、boxdef圏外に出る場合は、boxdefスキン設定の更新が必要
\r
239 // (ユーザーがboxdefスキンをConfig指定している場合への対応のために必要)
\r
240 // tBoxに入る()とは処理が微妙に異なるので注意
\r
241 CDTXMania.Instance.Skin.SetCurrentSkinSubfolderFullName(
\r
242 ( this.r現在選択中の曲.strSkinPath == "" ) ? "" : CDTXMania.Instance.Skin.GetSkinSubfolderFullNameFromSkinName( CSkin.GetSkinName( this.r現在選択中の曲.strSkinPath ) ), false );
\r
243 //Trace.TraceInformation( "SKIN変更: " + CSkin.GetSkinName( CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName(false) ) );
\r
244 //Trace.TraceInformation( "SKIN変更Current : "+ CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName(false) );
\r
245 //Trace.TraceInformation( "SKIN変更System : "+ CSkin.strSystemSkinSubfolderFullName );
\r
246 //Trace.TraceInformation( "SKIN変更BoxDef : "+ CSkin.strBoxDefSkinSubfolderFullName );
\r
247 if ( this.r現在選択中の曲.r親ノード != null )
\r
249 this.r現在選択中の曲 = this.r現在選択中の曲.r親ノード;
\r
250 this.t現在選択中の曲を元に曲バーを再構成する();
\r
251 this.t選択曲が変更された(false); // #27648 項目数変更を反映させる
\r
255 public void t現在選択中の曲を元に曲バーを再構成する()
\r
258 for( int i = 0; i < 13; i++ )
\r
260 this.t曲名バーの生成( i, this.stバー情報[ i ].strタイトル文字列, this.stバー情報[ i ].col文字色 );
\r
263 public void t次に移動()
\r
265 if( this.r現在選択中の曲 != null )
\r
267 this.n目標のスクロールカウンタ += 100;
\r
270 public void t前に移動()
\r
272 if( this.r現在選択中の曲 != null )
\r
274 this.n目標のスクロールカウンタ -= 100;
\r
277 public void t難易度レベルをひとつ進める()
\r
279 if( ( this.r現在選択中の曲 == null ) || ( this.r現在選択中の曲.nスコア数 <= 1 ) )
\r
280 return; // 曲にスコアが0~1個しかないなら進める意味なし。
\r
283 // 難易度レベルを+1し、現在選曲中のスコアを変更する。
\r
285 this.n現在のアンカ難易度レベル = this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( this.r現在選択中の曲 );
\r
287 for( int i = 0; i < 5; i++ )
\r
289 this.n現在のアンカ難易度レベル = ( this.n現在のアンカ難易度レベル + 1 ) % 5; // 5以上になったら0に戻る。
\r
290 if( this.r現在選択中の曲.arスコア[ this.n現在のアンカ難易度レベル ] != null ) // 曲が存在してるならここで終了。存在してないなら次のレベルへGo。
\r
295 // 曲毎に表示しているスキル値を、新しい難易度レベルに合わせて取得し直す。(表示されている13曲全部。)
\r
297 C曲リストノード song = this.r現在選択中の曲;
\r
298 for( int i = 0; i < 5; i++ )
\r
299 song = this.r前の曲( song );
\r
301 for( int i = this.n現在の選択行 - 5; i < ( ( this.n現在の選択行 - 5 ) + 13 ); i++ )
\r
303 int index = ( i + 13 ) % 13;
\r
304 for( int m = 0; m < 3; m++ )
\r
306 this.stバー情報[ index ].nスキル値[ m ] = (int) song.arスコア[ this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( song ) ].譜面情報.最大スキル[ m ];
\r
308 song = this.r次の曲( song );
\r
312 // 選曲ステージに変更通知を発出し、関係Activityの対応を行ってもらう。
\r
314 CDTXMania.Instance.stage選曲.t選択曲変更通知();
\r
321 /// <param name="cs"></param>
\r
322 public void Refresh(CSongs管理 cs, bool bRemakeSongTitleBar ) // #26070 2012.2.28 yyagi
\r
326 if ( cs != null && cs.list曲ルート.Count > 0 ) // 新しい曲リストを検索して、1曲以上あった
\r
328 CDTXMania.Instance.Songs管理 = cs;
\r
330 if ( this.r現在選択中の曲 != null ) // r現在選択中の曲==null とは、「最初songlist.dbが無かった or 検索したが1曲もない」
\r
332 this.r現在選択中の曲 = searchCurrentBreadcrumbsPosition( CDTXMania.Instance.Songs管理.list曲ルート, this.r現在選択中の曲.strBreadcrumbs );
\r
333 if ( bRemakeSongTitleBar ) // 選曲画面以外に居るときには再構成しない (非活性化しているときに実行すると例外となる)
\r
335 this.t現在選択中の曲を元に曲バーを再構成する();
\r
337 #if false // list子リストの中まではmatchしてくれないので、検索ロジックは手書きで実装 (searchCurrentBreadcrumbs())
\r
338 string bc = this.r現在選択中の曲.strBreadcrumbs;
\r
339 Predicate<C曲リストノード> match = delegate( C曲リストノード c )
\r
341 return ( c.strBreadcrumbs.Equals( bc ) );
\r
343 int nMatched = CDTXMania.Instance.Songs管理.list曲ルート.FindIndex( match );
\r
345 this.r現在選択中の曲 = ( nMatched == -1 ) ? null : CDTXMania.Instance.Songs管理.list曲ルート[ nMatched ];
\r
346 this.t現在選択中の曲を元に曲バーを再構成する();
\r
352 this.r現在選択中の曲 = null;
\r
358 /// 現在選曲している位置を検索する
\r
359 /// (曲一覧クラスを新しいものに入れ替える際に用いる)
\r
361 /// <param name="ln">検索対象のList</param>
\r
362 /// <param name="bc">検索するパンくずリスト(文字列)</param>
\r
363 /// <returns></returns>
\r
364 private C曲リストノード searchCurrentBreadcrumbsPosition( List<C曲リストノード> ln, string bc )
\r
366 foreach (C曲リストノード n in ln)
\r
368 if ( n.strBreadcrumbs == bc )
\r
372 else if ( n.list子リスト != null && n.list子リスト.Count > 0 ) // 子リストが存在するなら、再帰で探す
\r
374 C曲リストノード r = searchCurrentBreadcrumbsPosition( n.list子リスト, bc );
\r
375 if ( r != null ) return r;
\r
382 /// BOXのアイテム数と、今何番目を選択しているかをセットする
\r
384 public void t選択曲が変更された( bool bForce ) // #27648
\r
386 C曲リストノード song = CDTXMania.Instance.stage選曲.r現在選択中の曲;
\r
387 if ( song == null )
\r
389 if ( song == song_last && bForce == false )
\r
393 List<C曲リストノード> list = ( song.r親ノード != null ) ? song.r親ノード.list子リスト : CDTXMania.Instance.Songs管理.list曲ルート;
\r
394 int index = list.IndexOf( song ) + 1;
\r
397 nCurrentPosition = nNumOfItems = 0;
\r
401 nCurrentPosition = index;
\r
402 nNumOfItems = list.Count;
\r
408 public override void On活性化()
\r
413 this.e楽器パート = E楽器パート.DRUMS;
\r
414 this.b登場アニメ全部完了 = false;
\r
415 this.n目標のスクロールカウンタ = 0;
\r
416 this.n現在のスクロールカウンタ = 0;
\r
417 this.nスクロールタイマ = -1;
\r
420 // 曲リスト文字は2倍(面積4倍)でテクスチャに描画してから縮小表示するので、フォントサイズは2倍とする。
\r
422 FontStyle regular = FontStyle.Regular;
\r
423 if( CDTXMania.Instance.ConfigIni.b選曲リストフォントを斜体にする ) regular |= FontStyle.Italic;
\r
424 if( CDTXMania.Instance.ConfigIni.b選曲リストフォントを太字にする ) regular |= FontStyle.Bold;
\r
425 this.ft曲リスト用フォント = new Font(
\r
426 CDTXMania.Instance.ConfigIni.str選曲リストフォント,
\r
427 (float) ( CDTXMania.Instance.ConfigIni.n選曲リストフォントのサイズdot * 2 * Scale.Y ), // 後でScale.Yを掛けないように直すこと(Config.ini初期値変更)
\r
433 // 現在選択中の曲がない(=はじめての活性化)なら、現在選択中の曲をルートの先頭ノードに設定する。
\r
435 if( ( this.r現在選択中の曲 == null ) && ( CDTXMania.Instance.Songs管理.list曲ルート.Count > 0 ) )
\r
436 this.r現在選択中の曲 = CDTXMania.Instance.Songs管理.list曲ルート[ 0 ];
\r
445 this.t選択曲が変更された(true); // #27648 2012.3.31 yyagi 選曲画面に入った直後の 現在位置/全アイテム数 の表示を正しく行うため
\r
447 public override void On非活性化()
\r
449 if( this.b活性化してない )
\r
452 TextureFactory.t安全にDisposeする( ref this.ft曲リスト用フォント );
\r
454 for( int i = 0; i < 13; i++ )
\r
455 this.ct登場アニメ用[ i ] = null;
\r
459 public override void OnManagedリソースの作成()
\r
461 if( this.b活性化してない )
\r
464 this.tx曲名バー.Score = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect bar score.png" ), false );
\r
465 this.tx曲名バー.Box = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect bar box.png" ), false );
\r
466 this.tx曲名バー.Other = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect bar other.png" ), false );
\r
468 this.tx選曲バー.Score = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect bar score selected.png" ), false );
\r
469 this.tx選曲バー.Box = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect bar box selected.png" ), false );
\r
470 this.tx選曲バー.Other = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect bar other selected.png" ), false );
\r
472 this.txスキル数字 = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect skill number on list.png" ), false );
\r
473 for( int i = 0; i < 13; i++ )
\r
474 this.t曲名バーの生成( i, this.stバー情報[ i ].strタイトル文字列, this.stバー情報[ i ].col文字色 );
\r
476 int c = ( CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja" ) ? 0 : 1;
\r
477 #region [ Songs not found画像 ]
\r
480 using( Bitmap image = new Bitmap( SampleFramework.GameWindowSize.Width, (int)(128 * Scale.Y) ) )
\r
481 using( Graphics graphics = Graphics.FromImage( image ) )
\r
483 string[] s1 = { "曲データが見つかりません。", "Songs not found." };
\r
484 string[] s2 = { "曲データをDTXManiaGR.exe以下の", "You need to install songs." };
\r
485 string[] s3 = { "フォルダにインストールして下さい。", "" };
\r
486 graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) (2f * Scale.X), (float) (2f * Scale.Y) );
\r
487 graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 0f );
\r
488 graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) (2f * Scale.X), (float) (44f * Scale.Y) );
\r
489 graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) (42f * Scale.Y) );
\r
490 graphics.DrawString( s3[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) (2f * Scale.X), (float) (86f * Scale.Y) );
\r
491 graphics.DrawString( s3[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) (84f * Scale.Y) );
\r
493 this.txSongNotFound = new CTexture( CDTXMania.Instance.Device, image, CDTXMania.Instance.TextureFormat );
\r
495 this.txSongNotFound.vc拡大縮小倍率 = new Vector3( 0.5f, 0.5f, 1f ); // 半分のサイズで表示する。
\r
498 catch( CTextureCreateFailedException )
\r
500 Trace.TraceError( "SoungNotFoundテクスチャの作成に失敗しました。" );
\r
501 this.txSongNotFound = null;
\r
504 #region [ "曲データを検索しています"画像 ]
\r
507 using ( Bitmap image = new Bitmap( SampleFramework.GameWindowSize.Width, (int)(96 * Scale.Y) ) )
\r
508 using ( Graphics graphics = Graphics.FromImage( image ) )
\r
510 string[] s1 = { "曲データを検索しています。", "Now enumerating songs." };
\r
511 string[] s2 = { "そのまましばらくお待ち下さい。", "Please wait..." };
\r
512 graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) (2f * Scale.X), (float) (2f * Scale.Y) );
\r
513 graphics.DrawString( s1[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) 0f );
\r
514 graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.DarkGray, (float) (2f * Scale.X), (float) (44f * Scale.Y) );
\r
515 graphics.DrawString( s2[c], this.ft曲リスト用フォント, Brushes.White, (float) 0f, (float) (42f * Scale.Y) );
\r
517 this.txEnumeratingSongs = new CTexture( CDTXMania.Instance.Device, image, CDTXMania.Instance.TextureFormat );
\r
519 this.txEnumeratingSongs.vc拡大縮小倍率 = new Vector3( 0.5f, 0.5f, 1f ); // 半分のサイズで表示する。
\r
522 catch ( CTextureCreateFailedException )
\r
524 Trace.TraceError( "txEnumeratingSongsテクスチャの作成に失敗しました。" );
\r
525 this.txEnumeratingSongs = null;
\r
529 this.txアイテム数数字 = TextureFactory.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect skill number on gauge etc.png" ), false );
\r
531 base.OnManagedリソースの作成();
\r
533 public override void OnManagedリソースの解放()
\r
535 if( this.b活性化してない )
\r
538 TextureFactory.t安全にDisposeする( ref this.txアイテム数数字 );
\r
540 for( int i = 0; i < 13; i++ )
\r
541 TextureFactory.t安全にDisposeする( ref this.stバー情報[ i ].txタイトル名 );
\r
543 TextureFactory.t安全にDisposeする( ref this.txスキル数字 );
\r
544 TextureFactory.t安全にDisposeする( ref this.txEnumeratingSongs );
\r
545 TextureFactory.t安全にDisposeする( ref this.txSongNotFound );
\r
546 TextureFactory.t安全にDisposeする( ref this.tx曲名バー.Score );
\r
547 TextureFactory.t安全にDisposeする( ref this.tx曲名バー.Box );
\r
548 TextureFactory.t安全にDisposeする( ref this.tx曲名バー.Other );
\r
549 TextureFactory.t安全にDisposeする( ref this.tx選曲バー.Score );
\r
550 TextureFactory.t安全にDisposeする( ref this.tx選曲バー.Box );
\r
551 TextureFactory.t安全にDisposeする( ref this.tx選曲バー.Other );
\r
553 base.OnManagedリソースの解放();
\r
555 public override int On進行描画()
\r
557 if( this.b活性化してない )
\r
560 #region [ 初めての進行描画 ]
\r
561 //-----------------
\r
562 if( this.b初めての進行描画 )
\r
564 for( int i = 0; i < 13; i++ )
\r
565 this.ct登場アニメ用[ i ] = new CCounter( -i * 10, 100, 3, CDTXMania.Instance.Timer );
\r
567 this.nスクロールタイマ = CSound管理.rc演奏用タイマ.n現在時刻;
\r
568 CDTXMania.Instance.stage選曲.t選択曲変更通知();
\r
570 base.b初めての進行描画 = false;
\r
572 //-----------------
\r
576 // まだ選択中の曲が決まってなければ、曲ツリールートの最初の曲にセットする。
\r
578 if( ( this.r現在選択中の曲 == null ) && ( CDTXMania.Instance.Songs管理.list曲ルート.Count > 0 ) )
\r
579 this.r現在選択中の曲 = CDTXMania.Instance.Songs管理.list曲ルート[ 0 ];
\r
582 // 本ステージは、(1)登場アニメフェーズ → (2)通常フェーズ と二段階にわけて進む。
\r
583 // 2つしかフェーズがないので CStage.eフェーズID を使ってないところがまた本末転倒。
\r
588 if( !this.b登場アニメ全部完了 )
\r
590 #region [ (1) 登場アニメフェーズの進行。]
\r
591 //-----------------
\r
592 for( int i = 0; i < 13; i++ ) // パネルは全13枚。
\r
594 this.ct登場アニメ用[ i ].t進行();
\r
596 if( this.ct登場アニメ用[ i ].b終了値に達した )
\r
597 this.ct登場アニメ用[ i ].t停止();
\r
600 // 全部の進行が終わったら、this.b登場アニメ全部完了 を true にする。
\r
602 this.b登場アニメ全部完了 = true;
\r
603 for( int i = 0; i < 13; i++ ) // パネルは全13枚。
\r
605 if( this.ct登場アニメ用[ i ].b進行中 )
\r
607 this.b登場アニメ全部完了 = false; // まだ進行中のアニメがあるなら false のまま。
\r
611 //-----------------
\r
616 #region [ (2) 通常フェーズの進行。]
\r
617 //-----------------
\r
618 long n現在時刻 = CSound管理.rc演奏用タイマ.n現在時刻;
\r
620 if( n現在時刻 < this.nスクロールタイマ ) // 念のため
\r
621 this.nスクロールタイマ = n現在時刻;
\r
623 const int nアニメ間隔 = 2;
\r
624 while( ( n現在時刻 - this.nスクロールタイマ ) >= nアニメ間隔 )
\r
627 int n残距離 = Math.Abs( (int) ( this.n目標のスクロールカウンタ - this.n現在のスクロールカウンタ ) );
\r
629 #region [ 残距離が遠いほどスクロールを速くする(=n加速度を多くする)。]
\r
630 //-----------------
\r
635 else if( n残距離 <= 300 )
\r
639 else if( n残距離 <= 500 )
\r
647 //-----------------
\r
650 #region [ 加速度を加算し、現在のスクロールカウンタを目標のスクロールカウンタまで近づける。 ]
\r
651 //-----------------
\r
652 if( this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ ) // (A) 正の方向に未達の場合:
\r
654 this.n現在のスクロールカウンタ += n加速度; // カウンタを正方向に移動する。
\r
656 if( this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ )
\r
657 this.n現在のスクロールカウンタ = this.n目標のスクロールカウンタ; // 到着!スクロール停止!
\r
660 else if( this.n現在のスクロールカウンタ > this.n目標のスクロールカウンタ ) // (B) 負の方向に未達の場合:
\r
662 this.n現在のスクロールカウンタ -= n加速度; // カウンタを負方向に移動する。
\r
664 if( this.n現在のスクロールカウンタ < this.n目標のスクロールカウンタ ) // 到着!スクロール停止!
\r
665 this.n現在のスクロールカウンタ = this.n目標のスクロールカウンタ;
\r
667 //-----------------
\r
670 if( this.n現在のスクロールカウンタ >= 100 ) // 1行=100カウント。
\r
672 #region [ パネルを1行上にシフトする。]
\r
673 //-----------------
\r
675 // 選択曲と選択行を1つ下の行に移動。
\r
677 this.r現在選択中の曲 = this.r次の曲( this.r現在選択中の曲 );
\r
678 this.n現在の選択行 = ( this.n現在の選択行 + 1 ) % 13;
\r
681 // 選択曲から7つ下のパネル(=新しく最下部に表示されるパネル。消えてしまう一番上のパネルを再利用する)に、新しい曲の情報を記載する。
\r
683 C曲リストノード song = this.r現在選択中の曲;
\r
684 for( int i = 0; i < 7; i++ )
\r
685 song = this.r次の曲( song );
\r
687 int index = ( this.n現在の選択行 + 7 ) % 13; // 新しく最下部に表示されるパネルのインデックス(0~12)。
\r
688 this.stバー情報[ index ].strタイトル文字列 = song.strタイトル;
\r
689 this.stバー情報[ index ].col文字色 = song.col文字色;
\r
690 this.t曲名バーの生成( index, this.stバー情報[ index ].strタイトル文字列, this.stバー情報[ index ].col文字色 );
\r
693 // stバー情報[] の内容を1行ずつずらす。
\r
695 C曲リストノード song2 = this.r現在選択中の曲;
\r
696 for( int i = 0; i < 5; i++ )
\r
697 song2 = this.r前の曲( song2 );
\r
699 for( int i = 0; i < 13; i++ )
\r
701 int n = ( ( ( this.n現在の選択行 - 5 ) + i ) + 13 ) % 13;
\r
702 this.stバー情報[ n ].eバー種別 = this.e曲のバー種別を返す( song2 );
\r
703 song2 = this.r次の曲( song2 );
\r
707 // 新しく最下部に表示されるパネル用のスキル値を取得。
\r
709 for( int i = 0; i < 3; i++ )
\r
710 this.stバー情報[ index ].nスキル値[ i ] = (int) song.arスコア[ this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( song ) ].譜面情報.最大スキル[ i ];
\r
713 // 1行(100カウント)移動完了。
\r
715 this.n現在のスクロールカウンタ -= 100;
\r
716 this.n目標のスクロールカウンタ -= 100;
\r
718 this.t選択曲が変更された(false); // スクロールバー用に今何番目を選択しているかを更新
\r
720 if( this.n目標のスクロールカウンタ == 0 )
\r
721 CDTXMania.Instance.stage選曲.t選択曲変更通知(); // スクロール完了=選択曲変更!
\r
723 //-----------------
\r
726 else if( this.n現在のスクロールカウンタ <= -100 )
\r
728 #region [ パネルを1行下にシフトする。]
\r
729 //-----------------
\r
731 // 選択曲と選択行を1つ上の行に移動。
\r
733 this.r現在選択中の曲 = this.r前の曲( this.r現在選択中の曲 );
\r
734 this.n現在の選択行 = ( ( this.n現在の選択行 - 1 ) + 13 ) % 13;
\r
737 // 選択曲から5つ上のパネル(=新しく最上部に表示されるパネル。消えてしまう一番下のパネルを再利用する)に、新しい曲の情報を記載する。
\r
739 C曲リストノード song = this.r現在選択中の曲;
\r
740 for( int i = 0; i < 5; i++ )
\r
741 song = this.r前の曲( song );
\r
743 int index = ( ( this.n現在の選択行 - 5 ) + 13 ) % 13; // 新しく最上部に表示されるパネルのインデックス(0~12)。
\r
744 this.stバー情報[ index ].strタイトル文字列 = song.strタイトル;
\r
745 this.stバー情報[ index ].col文字色 = song.col文字色;
\r
746 this.t曲名バーの生成( index, this.stバー情報[ index ].strタイトル文字列, this.stバー情報[ index ].col文字色 );
\r
749 // stバー情報[] の内容を1行ずつずらす。
\r
751 C曲リストノード song2 = this.r現在選択中の曲;
\r
752 for( int i = 0; i < 5; i++ )
\r
753 song2 = this.r前の曲( song2 );
\r
755 for( int i = 0; i < 13; i++ )
\r
757 int n = ( ( ( this.n現在の選択行 - 5 ) + i ) + 13 ) % 13;
\r
758 this.stバー情報[ n ].eバー種別 = this.e曲のバー種別を返す( song2 );
\r
759 song2 = this.r次の曲( song2 );
\r
763 // 新しく最上部に表示されるパネル用のスキル値を取得。
\r
765 for( int i = 0; i < 3; i++ )
\r
766 this.stバー情報[ index ].nスキル値[ i ] = (int) song.arスコア[ this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( song ) ].譜面情報.最大スキル[ i ];
\r
769 // 1行(100カウント)移動完了。
\r
771 this.n現在のスクロールカウンタ += 100;
\r
772 this.n目標のスクロールカウンタ += 100;
\r
774 this.t選択曲が変更された(false); // スクロールバー用に今何番目を選択しているかを更新
\r
776 if( this.n目標のスクロールカウンタ == 0 )
\r
777 CDTXMania.Instance.stage選曲.t選択曲変更通知(); // スクロール完了=選択曲変更!
\r
778 //-----------------
\r
782 this.nスクロールタイマ += nアニメ間隔;
\r
784 //-----------------
\r
791 if( this.r現在選択中の曲 == null )
\r
793 #region [ 曲が1つもないなら「Songs not found.」を表示してここで帰れ。]
\r
794 //-----------------
\r
795 if ( bIsEnumeratingSongs )
\r
797 if ( this.txEnumeratingSongs != null )
\r
799 this.txEnumeratingSongs.t2D描画(
\r
800 CDTXMania.Instance.Device,
\r
808 if ( this.txSongNotFound != null )
\r
809 this.txSongNotFound.t2D描画(
\r
810 CDTXMania.Instance.Device,
\r
815 //-----------------
\r
821 if( !this.b登場アニメ全部完了 )
\r
823 #region [ (1) 登場アニメフェーズの描画。]
\r
824 //-----------------
\r
825 for( int i = 0; i < 13; i++ ) // パネルは全13枚。
\r
827 if( this.ct登場アニメ用[ i ].n現在の値 >= 0 )
\r
829 double db割合0to1 = ( (double) this.ct登場アニメ用[ i ].n現在の値 ) / 100.0;
\r
830 double db回転率 = Math.Sin( Math.PI * 3 / 5 * db割合0to1 );
\r
831 int nパネル番号 = ( ( ( this.n現在の選択行 - 5 ) + i ) + 13 ) % 13;
\r
837 #region [ バーテクスチャを描画。]
\r
838 //-----------------
\r
839 int width = (int) ( (425.0 -0.8f)* Scale.X / Math.Sin( Math.PI * 3 / 5 ) );
\r
840 //int width = (int) ( ( (double) ( ( SampleFramework.GameWindowSize.Width - this.ptバーの基本座標[ i ].X ) + 1 ) ) / Math.Sin( Math.PI * 3 / 5 ) );
\r
841 int x = SampleFramework.GameWindowSize.Width - ( (int) ( width * db回転率 ) );
\r
843 this.tバーの描画( x, y, this.stバー情報[ nパネル番号 ].eバー種別, true );
\r
844 //-----------------
\r
846 #region [ タイトル名テクスチャを描画。]
\r
847 //-----------------
\r
848 if( this.stバー情報[ nパネル番号 ].txタイトル名 != null )
\r
849 this.stバー情報[ nパネル番号 ].txタイトル名.t2D描画(
\r
850 CDTXMania.Instance.Device,
\r
851 ( x + (int) ( 44 * Scale.X ) ) + (int) ( (16f+0.5f) * Scale.X ),
\r
853 //( y + (int) ( 0 * Scale.Y ) ) + (int) ( 16 * Scale.Y )
\r
854 // ( y + (int) ( 5 * Scale.Y ) ) + (int) ( (16f-2f) * Scale.Y)
\r
856 //-----------------
\r
858 #region [ スキル値を描画。]
\r
859 //-----------------
\r
860 if( ( this.stバー情報[ nパネル番号 ].eバー種別 == Eバー種別.Score ) && ( this.e楽器パート != E楽器パート.UNKNOWN ) )
\r
861 this.tスキル値の描画( x + (int)(28 * Scale.X), y + (int)(59), this.stバー情報[ nパネル番号 ].nスキル値[ (int) this.e楽器パート ] );
\r
862 //-----------------
\r
869 #region [ バーテクスチャの描画。]
\r
870 //-----------------
\r
871 int width = (int) ( ( (double) ( ( SampleFramework.GameWindowSize.Width - this.ptバーの基本座標[ i ].X ) + 1 ) ) / Math.Sin( Math.PI * 3 / 5 ) );
\r
872 int x = SampleFramework.GameWindowSize.Width - ( (int) ( width * db回転率 ) );
\r
873 int y = this.ptバーの基本座標[ i ].Y;
\r
874 this.tバーの描画( x, y, this.stバー情報[ nパネル番号 ].eバー種別, false );
\r
875 //-----------------
\r
877 #region [ タイトル名テクスチャを描画。]
\r
878 //-----------------
\r
879 if( this.stバー情報[ nパネル番号 ].txタイトル名 != null )
\r
880 this.stバー情報[ nパネル番号 ].txタイトル名.t2D描画(
\r
881 CDTXMania.Instance.Device,
\r
882 x + (int)(44 * Scale.X),
\r
885 //-----------------
\r
887 #region [ スキル値を描画。]
\r
888 //-----------------
\r
889 if( ( this.stバー情報[ nパネル番号 ].eバー種別 == Eバー種別.Score ) && ( this.e楽器パート != E楽器パート.UNKNOWN ) )
\r
890 this.tスキル値の描画( x + (int)(14 * Scale.X), y + (int)(14 * Scale.Y), this.stバー情報[ nパネル番号 ].nスキル値[ (int) this.e楽器パート ] );
\r
891 //-----------------
\r
896 //-----------------
\r
901 #region [ (2) 通常フェーズの描画。]
\r
902 //-----------------
\r
903 for( int i = 0; i < 13; i++ ) // パネルは全13枚。
\r
905 if( ( i == 0 && this.n現在のスクロールカウンタ > 0 ) || // 最上行は、上に移動中なら表示しない。
\r
906 ( i == 12 && this.n現在のスクロールカウンタ < 0 ) ) // 最下行は、下に移動中なら表示しない。
\r
909 int nパネル番号 = ( ( ( this.n現在の選択行 - 5 ) + i ) + 13 ) % 13;
\r
911 int n次のパネル番号 = ( this.n現在のスクロールカウンタ <= 0 ) ? ( ( i + 1 ) % 13 ) : ( ( ( i - 1 ) + 13 ) % 13 );
\r
912 int x = this.ptバーの基本座標[ n見た目の行番号 ].X + ( (int) ( ( this.ptバーの基本座標[ n次のパネル番号 ].X - this.ptバーの基本座標[ n見た目の行番号 ].X ) * ( ( (double) Math.Abs( this.n現在のスクロールカウンタ ) ) / 100.0 ) ) );
\r
913 int y = this.ptバーの基本座標[ n見た目の行番号 ].Y + ( (int) ( ( this.ptバーの基本座標[ n次のパネル番号 ].Y - this.ptバーの基本座標[ n見た目の行番号 ].Y ) * ( ( (double) Math.Abs( this.n現在のスクロールカウンタ ) ) / 100.0 ) ) );
\r
915 if( ( i == 5 ) && ( this.n現在のスクロールカウンタ == 0 ) )
\r
917 // (A) スクロールが停止しているときの選択曲バーの描画。
\r
919 #region [ バーテクスチャを描画。]
\r
920 //-----------------
\r
921 this.tバーの描画( (int) ( 216 * Scale.X ), (int) ( 415 ), this.stバー情報[ nパネル番号 ].eバー種別, true );
\r
922 //-----------------
\r
924 #region [ タイトル名テクスチャを描画。]
\r
925 //-----------------
\r
926 if( this.stバー情報[ nパネル番号 ].txタイトル名 != null )
\r
927 this.stバー情報[ nパネル番号 ].txタイトル名.t2D描画(
\r
928 CDTXMania.Instance.Device,
\r
930 //(0xc9 - 1)* Scale.Y
\r
931 ( x + ( (44f + 0.5f) * Scale.X ) ),
\r
934 //-----------------
\r
936 #region [ スキル値を描画。]
\r
937 //-----------------
\r
938 if( ( this.stバー情報[ nパネル番号 ].eバー種別 == Eバー種別.Score ) && ( this.e楽器パート != E楽器パート.UNKNOWN ) )
\r
940 (int)(0xf4 * Scale.X),
\r
941 (int)(0xd3 * Scale.Y),
\r
942 this.stバー情報[ nパネル番号 ].nスキル値[ (int) this.e楽器パート ]
\r
944 //-----------------
\r
949 // (B) スクロール中の選択曲バー、またはその他のバーの描画。
\r
951 #region [ バーテクスチャを描画。]
\r
952 //-----------------
\r
953 this.tバーの描画( x, y, this.stバー情報[ nパネル番号 ].eバー種別, false );
\r
954 //-----------------
\r
956 #region [ タイトル名テクスチャを描画。]
\r
957 //-----------------
\r
958 if( this.stバー情報[ nパネル番号 ].txタイトル名 != null )
\r
959 this.stバー情報[ nパネル番号 ].txタイトル名.t2D描画(
\r
960 CDTXMania.Instance.Device,
\r
961 x + (int)(44 * Scale.X),
\r
964 //-----------------
\r
966 #region [ スキル値を描画。]
\r
967 //-----------------
\r
968 if( ( this.stバー情報[ nパネル番号 ].eバー種別 == Eバー種別.Score ) && ( this.e楽器パート != E楽器パート.UNKNOWN ) )
\r
969 this.tスキル値の描画( x + (int)(14 * Scale.X), y + (int)(14 * Scale.Y), this.stバー情報[ nパネル番号 ].nスキル値[ (int) this.e楽器パート ] );
\r
970 //-----------------
\r
974 //-----------------
\r
977 #region [ スクロール地点の計算(描画はCActSelectShowCurrentPositionにて行う) #27648 ]
\r
980 if ( nNumOfItems > 1 )
\r
982 d = ( (int)(336 * Scale.Y) - 6 - 8 ) / (double) ( nNumOfItems - 1 );
\r
983 py = (int) ( d * ( nCurrentPosition - 1 ) );
\r
990 int delta = (int) ( d * this.n現在のスクロールカウンタ / 100 );
\r
991 if ( py + delta <= (int)(336 * Scale.Y) - 6 - 8 )
\r
993 this.nスクロールバー相対y座標 = py + delta;
\r
997 #region [ アイテム数の描画 #27648 ]
\r
1006 #region [ private ]
\r
1007 //-----------------
\r
1008 private enum Eバー種別 { Score, Box, Other }
\r
1010 private struct STバー
\r
1012 public CTexture Score;
\r
1013 public CTexture Box;
\r
1014 public CTexture Other;
\r
1015 public CTexture this[ int index ]
\r
1022 return this.Score;
\r
1028 return this.Other;
\r
1030 throw new IndexOutOfRangeException();
\r
1037 this.Score = value;
\r
1045 this.Other = value;
\r
1048 throw new IndexOutOfRangeException();
\r
1053 private struct STバー情報
\r
1055 public CActSelect曲リスト.Eバー種別 eバー種別;
\r
1056 public string strタイトル文字列;
\r
1057 public CTexture txタイトル名;
\r
1058 public STDGBVALUE<int> nスキル値;
\r
1059 public Color col文字色;
\r
1062 private struct ST選曲バー
\r
1064 public CTexture Score;
\r
1065 public CTexture Box;
\r
1066 public CTexture Other;
\r
1067 public CTexture this[ int index ]
\r
1074 return this.Score;
\r
1080 return this.Other;
\r
1082 throw new IndexOutOfRangeException();
\r
1089 this.Score = value;
\r
1097 this.Other = value;
\r
1100 throw new IndexOutOfRangeException();
\r
1105 private bool b登場アニメ全部完了;
\r
1106 private Color color文字影 = Color.FromArgb( 0x40, 10, 10, 10 );
\r
1107 private CCounter[] ct登場アニメ用 = new CCounter[ 13 ];
\r
1108 private E楽器パート e楽器パート;
\r
1109 private Font ft曲リスト用フォント;
\r
1110 private long nスクロールタイマ;
\r
1111 private int n現在のスクロールカウンタ;
\r
1112 private int n現在の選択行;
\r
1113 private int n目標のスクロールカウンタ;
\r
1114 private readonly Point[] ptバーの基本座標 = new Point[] {
\r
1115 new Point( (int)(0x162 * Scale.X), (int)(20 * Scale.Y) ),
\r
1116 new Point( (int)(0x139 * Scale.X), (int)(0x36 * Scale.Y) ),
\r
1117 new Point( (int)(0x121 * Scale.X), (int)(0x58 * Scale.Y) ),
\r
1118 new Point( (int)(0x111 * Scale.X), (int)(0x7a * Scale.Y) ),
\r
1119 new Point( (int)(0x108 * Scale.X), (int)(0x9c * Scale.Y) ),
\r
1120 new Point( (int)(0xe8 * Scale.X), (int)(0xc5 * Scale.Y) ),
\r
1121 new Point( (int)(0x112 * Scale.X), (int)(0x102 * Scale.Y) ),
\r
1122 new Point( (int)(0x121 * Scale.X), (int)(0x124 * Scale.Y) ),
\r
1123 new Point( (int)(0x138 * Scale.X), (int)(0x146 * Scale.Y) ),
\r
1124 new Point( (int)(0x157 * Scale.X), (int)(360 * Scale.Y) ),
\r
1125 new Point( (int)(0x18a * Scale.X), (int)(0x18a * Scale.Y) ),
\r
1126 new Point( (int)(0x1f2 * Scale.X), (int)(0x1ac * Scale.Y) ),
\r
1127 new Point( (int)(640 * Scale.X), (int)(0x1ce * Scale.Y) )
\r
1129 private STバー情報[] stバー情報 = new STバー情報[ 13 ];
\r
1130 private CTexture txSongNotFound, txEnumeratingSongs;
\r
1131 private CTexture txスキル数字;
\r
1132 private CTexture txアイテム数数字;
\r
1133 private STバー tx曲名バー;
\r
1134 private ST選曲バー tx選曲バー;
\r
1136 private int nCurrentPosition = 0;
\r
1137 private int nNumOfItems = 0;
\r
1139 //private string strBoxDefSkinPath = "";
\r
1140 private Eバー種別 e曲のバー種別を返す( C曲リストノード song )
\r
1142 if( song != null )
\r
1144 switch( song.eノード種別 )
\r
1146 case C曲リストノード.Eノード種別.SCORE:
\r
1147 case C曲リストノード.Eノード種別.SCORE_MIDI:
\r
1148 return Eバー種別.Score;
\r
1150 case C曲リストノード.Eノード種別.BOX:
\r
1151 case C曲リストノード.Eノード種別.BACKBOX:
\r
1155 return Eバー種別.Other;
\r
1157 private C曲リストノード r次の曲( C曲リストノード song )
\r
1159 if( song == null )
\r
1162 List<C曲リストノード> list = ( song.r親ノード != null ) ? song.r親ノード.list子リスト : CDTXMania.Instance.Songs管理.list曲ルート;
\r
1164 int index = list.IndexOf( song );
\r
1169 if( index == ( list.Count - 1 ) )
\r
1172 return list[ index + 1 ];
\r
1174 private C曲リストノード r前の曲( C曲リストノード song )
\r
1176 if( song == null )
\r
1179 List<C曲リストノード> list = ( song.r親ノード != null ) ? song.r親ノード.list子リスト : CDTXMania.Instance.Songs管理.list曲ルート;
\r
1181 int index = list.IndexOf( song );
\r
1187 return list[ list.Count - 1 ];
\r
1189 return list[ index - 1 ];
\r
1191 private void tスキル値の描画( int x, int y, int nスキル値 )
\r
1193 if( nスキル値 <= 0 || nスキル値 > 100 ) // スキル値 0 = 未プレイ なので表示しない。
\r
1196 int color = ( nスキル値 == 100 ) ? 3 : ( nスキル値 / 25 );
\r
1198 int n百の位 = nスキル値 / 100;
\r
1199 int n十の位 = ( nスキル値 % 100 ) / 10;
\r
1200 int n一の位 = ( nスキル値 % 100 ) % 10;
\r
1206 this.tスキル値の描画_1桁描画( x, y, n百の位, color );
\r
1211 if( n百の位 != 0 || n十の位 != 0 )
\r
1212 this.tスキル値の描画_1桁描画( x + (int)(8 * Scale.X) , y, n十の位, color );
\r
1217 this.tスキル値の描画_1桁描画( x + (int)(16 * Scale.X), y, n一の位, color );
\r
1219 private void tスキル値の描画_1桁描画( int x, int y, int n数値, int color )
\r
1221 int dx = ( n数値 % 5 ) * (int)(9 * Scale.X);
\r
1222 int dy = ( n数値 / 5 ) * (int)(12 * Scale.Y);
\r
1227 if( this.txスキル数字 != null )
\r
1228 this.txスキル数字.t2D描画( CDTXMania.Instance.Device, x, y, new Rectangle( (int)(45 * Scale.X)+ dx, (int)(24 * Scale.Y) + dy, (int)(9 * Scale.X), (int)(12 * Scale.Y) ) );
\r
1232 if( this.txスキル数字 != null )
\r
1233 this.txスキル数字.t2D描画( CDTXMania.Instance.Device, x, y, new Rectangle( (int)(45 * Scale.X) + dx, dy, (int)(9 * Scale.X), (int)(12 * Scale.Y) ) );
\r
1237 if( this.txスキル数字 != null )
\r
1238 this.txスキル数字.t2D描画( CDTXMania.Instance.Device, x, y, new Rectangle( dx, (int) ( 24 * Scale.Y ) + dy, (int) ( 9 * Scale.X ), (int) ( 12 * Scale.Y ) ) );
\r
1242 if( this.txスキル数字 != null )
\r
1243 this.txスキル数字.t2D描画( CDTXMania.Instance.Device, x, y, new Rectangle( dx, dy, (int) ( 9 * Scale.X ), (int) ( 12 * Scale.Y ) ) );
\r
1247 private void tバーの初期化()
\r
1249 C曲リストノード song = this.r現在選択中の曲;
\r
1251 if( song == null )
\r
1254 for( int i = 0; i < 5; i++ )
\r
1255 song = this.r前の曲( song );
\r
1257 for( int i = 0; i < 13; i++ )
\r
1259 this.stバー情報[ i ].strタイトル文字列 = song.strタイトル;
\r
1260 this.stバー情報[ i ].col文字色 = song.col文字色;
\r
1261 this.stバー情報[ i ].eバー種別 = this.e曲のバー種別を返す( song );
\r
1263 for( int j = 0; j < 3; j++ )
\r
1264 this.stバー情報[ i ].nスキル値[ j ] = (int) song.arスコア[ this.n現在のアンカ難易度レベルに最も近い難易度レベルを返す( song ) ].譜面情報.最大スキル[ j ];
\r
1266 song = this.r次の曲( song );
\r
1271 private void tバーの描画( int x, int y, Eバー種別 type, bool b選択曲 )
\r
1273 if( x >= SampleFramework.GameWindowSize.Width || y >= SampleFramework.GameWindowSize.Height )
\r
1278 #region [ (A) 選択曲の場合 ]
\r
1279 //-----------------
\r
1280 if( this.tx選曲バー[ (int) type ] != null )
\r
1281 this.tx選曲バー[ (int) type ].t2D描画(
\r
1282 CDTXMania.Instance.Device,
\r
1288 256, //(int)(128 * Scale.X),
\r
1289 128 //(int)(64 * Scale.Y)
\r
1292 x += this.tx選曲バー[(int)type].sz画像サイズ.Width;
\r
1294 var rc = new Rectangle(
\r
1295 128, //(int)(64 * Scale.X),
\r
1297 128, //(int)(64 * Scale.X),
\r
1298 128 //(int)(64 * Scale.Y)
\r
1300 while( x < SampleFramework.GameWindowSize.Width )
\r
1302 if( this.tx選曲バー[ (int) type ] != null )
\r
1303 this.tx選曲バー[ (int) type ].t2D描画(
\r
1304 CDTXMania.Instance.Device,
\r
1308 ); // 胴体;64pxずつ横につなげていく。
\r
1309 x += 128; //(int)(64 * Scale.Y);
\r
1311 //-----------------
\r
1316 #region [ (B) その他の場合 ]
\r
1317 //-----------------
\r
1318 if( this.tx曲名バー[ (int) type ] != null )
\r
1319 this.tx曲名バー[ (int) type ].t2D描画(
\r
1320 CDTXMania.Instance.Device,
\r
1326 128, //(int) ( 64 * Scale.X ),
\r
1327 69 //(int) ( 32 * Scale.Y )
\r
1328 //(int)(64 * Scale.X),
\r
1329 //(int)(32 * Scale.Y)
\r
1332 x += 64; //(int) ( 64 * Scale.X );
\r
1334 var rc = new Rectangle(
\r
1340 //(int)(32 * Scale.Y),
\r
1341 //(int)(64 * Scale.X),
\r
1342 //(int)(32 * Scale.Y)
\r
1345 //0, //(int)(32 * Scale.Y),
\r
1346 //128, //(int)(64 * Scale.X),
\r
1347 //128 //(int)(32 * Scale.Y)
\r
1349 while( x < SampleFramework.GameWindowSize.Width )
\r
1351 if( this.tx曲名バー[ (int) type ] != null )
\r
1352 this.tx曲名バー[ (int) type ].t2D描画(
\r
1353 CDTXMania.Instance.Device,
\r
1357 ); // 胴体;64pxずつ横につなげていく。
\r
1358 x += 64; // (int) ( 64 * Scale.X );
\r
1360 //-----------------
\r
1364 private void t曲名バーの生成( int nバー番号, string str曲名, Color color )
\r
1366 if( nバー番号 < 0 || nバー番号 > 12 )
\r
1373 #region [ 曲名表示に必要となるサイズを取得する。]
\r
1374 //-----------------
\r
1375 using( var bmpDummy = new Bitmap( 1, 1 ) )
\r
1377 var g = Graphics.FromImage( bmpDummy );
\r
1378 g.PageUnit = GraphicsUnit.Pixel;
\r
1379 sz曲名 = g.MeasureString( str曲名, this.ft曲リスト用フォント );
\r
1381 //-----------------
\r
1384 int n最大幅px = (int)(392 * Scale.Y);
\r
1385 int height = (int)(25 * Scale.Y);
\r
1386 int width = (int) ( ( sz曲名.Width + 2 ) * 0.5f );
\r
1387 if( width > ( CDTXMania.Instance.Device.Capabilities.MaxTextureWidth / 2 ) )
\r
1388 width = CDTXMania.Instance.Device.Capabilities.MaxTextureWidth / 2; // 右端断ち切れ仕方ないよね
\r
1390 float f拡大率X = ( width <= n最大幅px ) ? 0.5f : ( ( (float) n最大幅px / (float) width ) * 0.5f ); // 長い文字列は横方向に圧縮。
\r
1392 using( var bmp = new Bitmap( width * 2, height * 2, PixelFormat.Format32bppArgb ) ) // 2倍(面積4倍)のBitmapを確保。(0.5倍で表示する前提。)
\r
1393 using( var g = Graphics.FromImage( bmp ) )
\r
1395 g.TextRenderingHint = TextRenderingHint.AntiAlias;
\r
1396 float y = ( ( (float) bmp.Height ) / 2f ) - ( ( CDTXMania.Instance.ConfigIni.n選曲リストフォントのサイズdot * Scale.Y * 2f ) / 2f );
\r
1397 g.DrawString( str曲名, this.ft曲リスト用フォント, new SolidBrush( this.color文字影 ), (float) 2f, (float) ( y + 2f ) );
\r
1398 g.DrawString( str曲名, this.ft曲リスト用フォント, new SolidBrush( color ), 0f, y );
\r
1400 TextureFactory.t安全にDisposeする( ref this.stバー情報[ nバー番号 ].txタイトル名 );
\r
1402 this.stバー情報[ nバー番号 ].txタイトル名 = new CTexture( CDTXMania.Instance.Device, bmp, CDTXMania.Instance.TextureFormat );
\r
1403 this.stバー情報[ nバー番号 ].txタイトル名.vc拡大縮小倍率 = new Vector3( f拡大率X, 0.5f, 1f );
\r
1406 catch( CTextureCreateFailedException )
\r
1408 Trace.TraceError( "曲名テクスチャの作成に失敗しました。[{0}]", str曲名 );
\r
1409 this.stバー情報[ nバー番号 ].txタイトル名 = null;
\r
1412 private void tアイテム数の描画()
\r
1414 string s = nCurrentPosition.ToString() + "/" + nNumOfItems.ToString();
\r
1415 int x = (int)(SampleFramework.GameWindowSize.Width - (8 + 12) * Scale.X);
\r
1416 int y = (int)(362 * Scale.Y);
\r
1418 for ( int p = s.Length - 1; p >= 0; p-- )
\r
1420 tアイテム数の描画_1桁描画( x, y, s[ p ] );
\r
1421 x -= (int)(8 * Scale.X);
\r
1424 private void tアイテム数の描画_1桁描画( int x, int y, char s数値 )
\r
1429 dx = (int)(48 * Scale.X);
\r
1434 int n = (int) s数値 - (int) '0';
\r
1435 dx = ( n % 6 ) * (int)(8 * Scale.X);
\r
1436 dy = ( n / 6 ) * (int)(12 * Scale.Y);
\r
1438 if ( this.txアイテム数数字 != null )
\r
1440 this.txアイテム数数字.t2D描画( CDTXMania.Instance.Device, x, y, new Rectangle( dx, dy, (int)(8 * Scale.X), (int)(12 * Scale.Y) ) );
\r
1443 //-----------------
\r