OSDN Git Service

作業部屋#50705 CActResultImage.csをXGとGITADORAで分離。
[dtxmaniaxg-verk/dtxmaniaxg-verk-git.git] / DTXManiaプロジェクト / コード / ステージ / 05.選曲 / XG / CActSelectステータスパネルXG.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Runtime.InteropServices;
5 using System.Drawing;
6 using SlimDX;
7 using System.IO;
8 using FDK;
9
10 namespace DTXMania
11 {
12         internal class CActSelectステータスパネルXG : CActSelectステータスパネル共通
13         {
14                 // メソッド
15
16                 public CActSelectステータスパネルXG()
17                 {
18                         base.b活性化してない = true;
19                 }
20                 public override void t選択曲が変更された()
21                 {
22                         C曲リストノード c曲リストノード = CDTXMania.stage選曲XG.r現在選択中の曲;
23                         Cスコア cスコア = CDTXMania.stage選曲XG.r現在選択中のスコア;
24                         if( ( c曲リストノード != null ) && ( cスコア != null ) )
25                         {
26                                 this.n現在選択中の曲の難易度 = CDTXMania.stage選曲XG.n現在選択中の曲の難易度;
27                                 for( int i = 0; i < 3; i++ )
28                                 {
29                     if (CDTXMania.ConfigIni.eSkillMode == ESkillType.DTXMania)
30                         this.n現在選択中の曲の最高ランク[i] = cスコア.譜面情報.最大ランク[i];
31                     else if (CDTXMania.ConfigIni.eSkillMode == ESkillType.XG )
32                         this.n現在選択中の曲の最高ランク[i] = DTXMania.CScoreIni.tXGランク値を計算して返す( cスコア.譜面情報.最大スキル[i] );
33
34                                         int nLevel = cスコア.譜面情報.レベル[ i ];
35                                         if( nLevel < 0 )
36                                         {
37                                                 nLevel = 0;
38                                         }
39                                         if( nLevel > 99 )
40                                         {
41                                                 nLevel = 99;
42                                         }
43                                         this.n現在選択中の曲のレベル[ i ] = nLevel;
44                                         this.n現在選択中の曲の最高ランク[ i ] = cスコア.譜面情報.最大ランク[ i ];
45                                         this.b現在選択中の曲がフルコンボ[ i ] = cスコア.譜面情報.フルコンボ[ i ];
46                                         this.db現在選択中の曲の最高スキル値[ i ] = cスコア.譜面情報.最大スキル[ i ];
47
48                     for( int j = 0; j < 5; j++ )
49                     {
50                         if( c曲リストノード.arスコア[ j ] != null )
51                         {
52                             this.n現在選択中の曲のレベル難易度毎DGB[j][i] = c曲リストノード.arスコア[j].譜面情報.レベル[i];
53                             this.n現在選択中の曲のレベル小数点難易度毎DGB[j][i] = c曲リストノード.arスコア[j].譜面情報.レベルDec[i];
54                             //this.n現在選択中の曲の最高ランク難易度毎[j][i] = c曲リストノード.arスコア[j].譜面情報.最大ランク[i];
55                             if ( CDTXMania.ConfigIni.eSkillMode == ESkillType.DTXMania )
56                                 this.n現在選択中の曲の最高ランク難易度毎[ j ][ i ] = c曲リストノード.arスコア[ j ].譜面情報.最大ランク[ i ];
57                             else if ( CDTXMania.ConfigIni.eSkillMode == ESkillType.XG )
58                                 this.n現在選択中の曲の最高ランク難易度毎[ j ][ i ] = ( DTXMania.CScoreIni.tXGランク値を計算して返す( c曲リストノード.arスコア[ j ].譜面情報.最大スキル[ i ] ) == (int)DTXMania.CScoreIni.ERANK.S && DTXMania.CScoreIni.tXGランク値を計算して返す( c曲リストノード.arスコア[ j ].譜面情報.最大スキル[ i ] ) >= 95 ? DTXMania.CScoreIni.tXGランク値を計算して返す( cスコア.譜面情報.最大スキル[ i ] ) : c曲リストノード.arスコア[ j ].譜面情報.最大ランク[ i ]);
59                             this.db現在選択中の曲の最高スキル値難易度毎[ j ][ i ] = c曲リストノード.arスコア[ j ].譜面情報.最大スキル[i];
60                             this.b現在選択中の曲がフルコンボ難易度毎[j][i] = c曲リストノード.arスコア[j].譜面情報.フルコンボ[i];
61                             this.b現在選択中の曲に譜面がある[j][i] = c曲リストノード.arスコア[j].譜面情報.b譜面がある[i];
62                         }
63                     }
64                                 }
65                                 for( int i = 0; i < 5; i++ )
66                                 {
67                                         this.str難易度ラベル[ i ] = c曲リストノード.ar難易度ラベル[ i ];
68                                 }
69                                 if( this.r直前の曲 != c曲リストノード )
70                                 {
71                                         this.n難易度開始文字位置 = 0;
72                                 }
73                                 this.r直前の曲 = c曲リストノード;
74                         }
75                 }
76
77
78                 // CActivity 実装
79
80                 public override void On活性化()
81                 {
82                         this.n現在選択中の曲の難易度 = 0;
83                         for( int i = 0; i < 3; i++ )
84                         {
85                                 this.n現在選択中の曲のレベル[ i ] = 0;
86                 this.db現在選択中の曲の曲別スキル値難易度毎[ i ] = 0.0;
87                                 this.n現在選択中の曲の最高ランク[ i ] = (int)CScoreIni.ERANK.UNKNOWN;
88                                 this.b現在選択中の曲がフルコンボ[ i ] = false;
89                                 this.db現在選択中の曲の最高スキル値[ i ] = 0.0;
90                 for (int j = 0; j < 5; j++)
91                 {
92                     this.n現在選択中の曲のレベル難易度毎DGB[j][i] = 0;
93                     this.n現在選択中の曲のレベル小数点難易度毎DGB[j][i] = 0;
94                     this.db現在選択中の曲の最高スキル値難易度毎[j][i] = 0.0;
95                     this.n現在選択中の曲の最高ランク難易度毎[j][i] = (int)CScoreIni.ERANK.UNKNOWN;
96                     this.b現在選択中の曲がフルコンボ難易度毎[j][i] = false;
97                 }
98                         }
99                         for( int j = 0; j < 5; j++ )
100                         {
101                                 this.str難易度ラベル[ j ] = "";
102                 this.n選択中の曲のレベル難易度毎[ j ] = 0;
103
104                 this.db現在選択中の曲の曲別スキル値難易度毎[j] = 0.0;
105                         }
106                         this.n難易度開始文字位置 = 0;
107                         this.r直前の曲 = null;
108                         base.On活性化();
109                 }
110                 public override void On非活性化()
111                 {
112                         this.ct登場アニメ用 = null;
113                         this.ct難易度スクロール用 = null;
114                         this.ct難易度矢印用 = null;
115             this.ct難易度変更カウンター = null;
116                         base.On非活性化();
117                 }
118                 public override void OnManagedリソースの作成()
119                 {
120                         if( !base.b活性化してない )
121                         {
122                                 this.txパネル本体 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_status panel.png" ) );
123                                 this.txゲージ用数字他 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_skill icon.png" ), false );
124                 this.tx難易度パネル = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_difficulty panel.png" ) );
125                 this.tx難易度数字XG = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_LevelNumber.png" ) );
126                                 base.OnManagedリソースの作成();
127                         }
128                 }
129                 public override void OnManagedリソースの解放()
130                 {
131                         if( !base.b活性化してない )
132                         {
133                                 CDTXMania.tテクスチャの解放( ref this.txパネル本体 );
134                                 CDTXMania.tテクスチャの解放( ref this.txゲージ用数字他 );
135                 CDTXMania.tテクスチャの解放( ref this.tx難易度パネル );
136                 CDTXMania.tテクスチャの解放( ref this.tx難易度数字XG );
137
138                 CDTXMania.tテクスチャの解放( ref this.tx決定後_難易度パネル1P );
139                 CDTXMania.tテクスチャの解放( ref this.tx決定後_難易度パネル2P );
140                                 base.OnManagedリソースの解放();
141                         }
142                 }
143                 public override int On進行描画()
144                 {
145                         if( !base.b活性化してない )
146                         {
147                                 #region [ 初めての進行描画 ]
148                                 //-----------------
149                                 if( base.b初めての進行描画 )
150                                 {
151                                         this.ct登場アニメ用 = new CCounter( 0, 100, 5, CDTXMania.Timer );
152                                         this.ct難易度スクロール用 = new CCounter( 0, 20, 1, CDTXMania.Timer );
153                                         this.ct難易度矢印用 = new CCounter( 0, 5, 80, CDTXMania.Timer );
154                     this.ct難易度変更カウンター = new CCounter( 1, 10, 10, CDTXMania.Timer );
155                                         base.b初めての進行描画 = false;
156                                 }
157                                 //-----------------
158                                 #endregion
159
160                 #region [ 本体位置 ]
161                 for( int i = 0; i < 3; i++ )
162                 {
163                     this.n本体X[ i ] = 0;
164                     this.n本体Y[ i ] = 0;
165                 }
166
167                 if( CDTXMania.ConfigIni.bDrums有効 )
168                 {
169                     this.n本体X[ 0 ] = 346;
170                     this.n本体Y[ 0 ] = 43;
171                 }
172                 else if( CDTXMania.ConfigIni.bGuitar有効 )
173                 {
174                     int nSwapflag1P = CDTXMania.ConfigIni.bIsSwappedGuitarBass ? 2 : 1;
175                     int nSwapflag2P = CDTXMania.ConfigIni.bIsSwappedGuitarBass ? 1 : 2;
176                     this.n本体X[ nSwapflag1P ] = 346;
177                     this.n本体Y[ nSwapflag1P ] = 43;
178
179                     this.n本体X[ nSwapflag2P ] = 218;
180                     this.n本体Y[ nSwapflag2P ] = 546;
181                 }
182                 #endregion
183
184                                 // 進行
185
186                                 this.ct登場アニメ用.t進行();
187                 this.ct難易度変更カウンター.t進行();
188
189                                 this.ct難易度スクロール用.t進行();
190                                 if( this.ct難易度スクロール用.b終了値に達した )
191                                 {
192                                         int num = this.n現在の難易度ラベルが完全表示されているかを調べてスクロール方向を返す();
193                                         if( num < 0 )
194                                         {
195                                                 this.n難易度開始文字位置--;
196                                         }
197                                         else if( num > 0 )
198                                         {
199                                                 this.n難易度開始文字位置++;
200                                         }
201                                         this.ct難易度スクロール用.n現在の値 = 0;
202                                 }
203         
204                                 this.ct難易度矢印用.t進行Loop();
205                                 
206                                 // 描画
207
208                                 #region [ パネル本体の描画 ]
209                                 //-----------------
210                                 if( this.txパネル本体 != null && CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[5] != null )
211                                 {
212                     {
213                         var mat1 = Matrix.Identity;
214                         mat1 *= Matrix.RotationX(1.60f - (float)((float)CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[5].n現在の値 * 0.016f));
215                         mat1 *= Matrix.RotationY(0.0f);
216                         mat1 *= Matrix.RotationZ(0.0f);
217                         mat1 *= Matrix.Translation(0f, 260f, 0f);
218
219                         var mat2 = Matrix.Identity;
220                         mat2 *= Matrix.RotationX(1.60f - (float)((float)CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[5].n現在の値 * 0.016f));
221                         mat2 *= Matrix.RotationY(0.0f);
222                         mat2 *= Matrix.RotationZ(0.0f);
223                         mat2 *= Matrix.Translation(0f, -240f, 0f);
224
225                         if( CDTXMania.ConfigIni.bDrums有効 )
226                         {
227                             if( CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[ 5 ].n現在の値 != 100 )
228                                 this.txパネル本体.t3D描画( CDTXMania.app.Device, mat1 , new Rectangle( 0, 0, 1280, 200 ) );
229                             else
230                                                     this.txパネル本体.t2D描画( CDTXMania.app.Device, 0, this.n本体Y[ 0 ] - 43, new Rectangle(0, 0, 1280, 200) );
231                         }
232                         else if ( CDTXMania.ConfigIni.bGuitar有効 )
233                         {
234                             if( CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[5].n現在の値 != 100 )
235                             {
236                                 if (!CDTXMania.ConfigIni.bIsSwappedGuitarBass)
237                                 {
238                                     this.txパネル本体.t3D描画(CDTXMania.app.Device, mat1, new Rectangle(0, 200, 1280, 200));
239                                     this.txパネル本体.t3D描画(CDTXMania.app.Device, mat2, new Rectangle(0, 400, 1280, 200));
240                                 }
241                                 else
242                                 {
243                                     this.txパネル本体.t3D描画(CDTXMania.app.Device, mat1, new Rectangle(0, 600, 1280, 200));
244                                     this.txパネル本体.t3D描画(CDTXMania.app.Device, mat2, new Rectangle(0, 800, 1280, 200));
245                                 }
246                             }
247                             else
248                             {
249                                 if (!CDTXMania.ConfigIni.bIsSwappedGuitarBass)
250                                 {
251                                     this.txパネル本体.t2D描画(CDTXMania.app.Device, 0, this.n本体Y[ 1 ] - 43, new Rectangle(0, 200, 1280, 200));
252                                     this.txパネル本体.t2D描画(CDTXMania.app.Device, 0, this.n本体Y[ 2 ] - 43, new Rectangle(0, 400, 1280, 200));
253                                 }
254                                 else
255                                 {
256                                     this.txパネル本体.t2D描画(CDTXMania.app.Device, 0, this.n本体Y[ 2 ] - 43, new Rectangle(0, 600, 1280, 200));
257                                     this.txパネル本体.t2D描画(CDTXMania.app.Device, 0, this.n本体Y[ 1 ] - 43, new Rectangle(0, 800, 1280, 200));
258                                 }
259
260                             }
261                         }
262                     }
263                                 }
264                                 //-----------------
265                                 #endregion
266                 #region[ 難易度パネルの描画 ]
267                 int[] y差分 = new int[ 5 ];
268                 int[] x差分 = new int[ 5 ];
269                 int n難易度ラベル合計値 = 0;
270                 int n難易度ラベル合計値1P = 0;
271                 int n難易度ラベル合計値2P = 0;
272                 if( this.tx難易度パネル != null && CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[5] != null )
273                 {
274                     for (int i = 0; i < 5; i++)
275                     {
276                         if (this.n現在選択中の曲の難易度 == i)
277                         {
278                             y差分[i] += this.ct難易度変更カウンター.n現在の値;
279                             x差分[i] += 132;
280                         }
281                     }
282                     if( CDTXMania.ConfigIni.bDrums有効 )
283                     {
284                         if( CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[5].n現在の値 == 100 )
285                         {
286                             for( int i = 0; i < 5; i++ )
287                             {
288                                 if( this.str難易度ラベル[ i ] != null || CDTXMania.stage選曲XG.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.RANDOM )
289                                 {
290                                     //ランダムの場合は全てのパネルを描画する。
291                                     this.tx難易度パネル.t2D描画( CDTXMania.app.Device, 346 + ( 143 * i ), this.n本体Y[ 0 ] - y差分[ i ], new Rectangle( x差分[ i ], 0 + ( 98 * i ), 132, 98 ) );
292                                     n難易度ラベル合計値++;
293                                 }
294                             }
295                             if( n難易度ラベル合計値 == 0 && CDTXMania.stage選曲XG.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.SCORE ) //難易度ラベルが存在しなかった場合は5に描画する。
296                                 this.tx難易度パネル.t2D描画( CDTXMania.app.Device, 346 + ( 143 * 4 ), this.n本体Y[ 0 ] - 10, new Rectangle( 132, 0 + ( 98 * 4 ), 132, 98 ) );
297                         }
298                         else
299                         {
300                             for( int i = 0; i < 5; i++ )
301                             {
302                                 var mat = Matrix.Identity;
303                                 mat *= Matrix.RotationX( 1.60f - (float)( (float)CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[ 5 ].n現在の値 * 0.016f ) );
304                                 mat *= Matrix.RotationY( 0.0f );
305                                 mat *= Matrix.RotationZ( 0.0f );
306                                 mat *= Matrix.Translation(-228f + (i * 143f), 268f + y差分[i], 0f);
307
308                                 if( this.str難易度ラベル[i] != null )
309                                     this.tx難易度パネル.t3D描画(CDTXMania.app.Device, mat, new Rectangle(x差分[i], 98 * i, 132, 98));
310                             }
311                         }
312                     }
313                     else if( CDTXMania.ConfigIni.bGuitar有効 )
314                     {
315                         if( CDTXMania.stage選曲.act曲リスト.ct登場アニメ用[5].n現在の値 == 100 )
316                         {
317                             for( int i = 0; i < 5; i++ )
318                             {
319                                 for( int j = 0; j < 2; j++ )
320                                 {
321                                     if( this.str難易度ラベル[ i ] != null || CDTXMania.stage選曲XG.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.RANDOM )
322                                     {
323                                         this.tx難易度パネル.t2D描画( CDTXMania.app.Device, this.n本体X[ j + 1 ] + ( 143 * i ), this.n本体Y[ j + 1 ] - y差分[ i ], new Rectangle( x差分[ i ], 0 + ( 98 * i ), 132, 98 ) );
324                                         if( j == 0 ) n難易度ラベル合計値1P++;
325                                         else n難易度ラベル合計値2P++;
326                                     }
327                                 }
328                     //            else if (CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.SCORE)
329                     //                flag = flag + 1;
330
331                     //            if (this.str難易度ラベル[i] != null || CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.RANDOM)
332                     //                this.tx難易度パネル.t2D描画(CDTXMania.app.Device, this.n本体X[2] + (143 * i), this.n本体Y[2] - y差分[i], new Rectangle(x差分[i], 0 + (98 * i), 132, 98));
333                             }
334                             for( int i = 0; i < 2; i++ )
335                             {
336                                 if( ( i == 0 ? n難易度ラベル合計値1P == 0 : n難易度ラベル合計値2P == 1 ) && CDTXMania.stage選曲XG.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.SCORE ) //難易度ラベルが存在しなかった場合は5に描画する。
337                                     this.tx難易度パネル.t2D描画( CDTXMania.app.Device, 346 + ( 143 * 4 ), this.n本体Y[ i + 1 ] - 10, new Rectangle( 132, 0 + ( 98 * 4 ), 132, 98 ) );
338                             }
339                     //        if (flag == 5)
340                     //        {
341                     //            this.tx難易度パネル.t2D描画(CDTXMania.app.Device, this.n本体X[1] + (143 * 4), this.n本体Y[1] - 10, new Rectangle(132, 0 + (98 * 4), 132, 98));
342                     //            this.tx難易度パネル.t2D描画(CDTXMania.app.Device, this.n本体X[2] + (143 * 4), this.n本体Y[2] - 10, new Rectangle(132, 0 + (98 * 4), 132, 98));
343                     //        }
344                     //    }
345                     //    else
346                     //    {
347                     //        for (int i = 0; i < 5; i++)
348                     //        {
349                     //            var mat1 = Matrix.Identity;
350                     //            mat1 *= Matrix.RotationX(1.60f - (float)((float)CDTXMania.stage選曲.act曲リスト.ct登場アニメ用[5].n現在の値 * 0.016f));
351                     //            mat1 *= Matrix.RotationY(0.0f);
352                     //            mat1 *= Matrix.RotationZ(0.0f);
353                     //            mat1 *= Matrix.Translation(-228f + (i * 143f), 268f + y差分[i], 0f);
354
355                     //            var mat2 = Matrix.Identity;
356                     //            mat2 *= Matrix.RotationX(1.60f - (float)((float)CDTXMania.stage選曲.act曲リスト.ct登場アニメ用[5].n現在の値 * 0.016f));
357                     //            mat2 *= Matrix.RotationY(0.0f);
358                     //            mat2 *= Matrix.RotationZ(0.0f);
359                     //            mat2 *= Matrix.Translation(-355f + (i * 143f), -235f + y差分[i], 0f);
360
361
362                     //            if (this.str難易度ラベル[i] != null)
363                     //                this.tx難易度パネル.t3D描画(CDTXMania.app.Device, mat1 , new Rectangle(0 + x差分[i], 0 + (98 * i), 132, 98));
364
365                     //            if (this.str難易度ラベル[i] != null)
366                     //                this.tx難易度パネル.t3D描画(CDTXMania.app.Device, mat2 , new Rectangle(0 + x差分[i], 0 + (98 * i), 132, 98));
367                     //        }
368                         }
369                     }
370                 }
371                 #endregion
372
373                                 Cスコア cスコア = CDTXMania.stage選曲XG.r現在選択中のスコア;
374
375                 if( CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[ 5 ] != null )
376                 {
377                     if( CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[ 5 ].b終了値に達した )
378                     {
379                         #region [ 難易度文字列の描画 ]
380                         //-----------------
381                         for( int i = 0; i < 5; i++ )
382                         {
383                             if( CDTXMania.r現在のステージ.eフェーズID == CStage.Eフェーズ.共通_通常状態 )
384                             {
385                                 CDTXMania.act文字コンソール.tPrint( 346 + ( i * 142 ), 8, ( this.n現在選択中の曲の難易度 == i ) ? C文字コンソール.Eフォント種別.赤 : C文字コンソール.Eフォント種別.白, this.str難易度ラベル[ i ] );
386                                 if( CDTXMania.ConfigIni.bGuitar有効 )
387                                     CDTXMania.act文字コンソール.tPrint( 218 + ( i * 142 ), 670, ( this.n現在選択中の曲の難易度 == i ) ? C文字コンソール.Eフォント種別.赤 : C文字コンソール.Eフォント種別.白, this.str難易度ラベル[ i ] );
388                             }
389                         }
390                         //-----------------
391                         #endregion
392                         #region [ 選択曲の Lv の描画 ]
393                                         //-----------------
394                                     if( ( cスコア != null ) && ( this.tx難易度数字XG != null ) )
395                                     {
396                             if( CDTXMania.r現在のステージ.eフェーズID == CStage.Eフェーズ.共通_通常状態 )
397                                 this.tx難易度数字XG.n透明度 = (int)( CDTXMania.stage選曲XG.act曲リスト.ct登場アニメ用[ 5 ].n現在の値 * 2.6f );
398                             for( int j = 0; j < 3; j++ )
399                             {
400                                 if( this.n本体X[ j ] == 0 ) continue;
401                                 for( int i = 0; i < 5; i++ )
402                                 {
403                                     int[] n難易度整数 = new int[5];
404                                     int[] n難易度小数 = new int[5];
405                                     n難易度整数[ i ] = (int)this.n現在選択中の曲のレベル難易度毎DGB[ i ][ j ] / 10;
406                                     n難易度小数[ i ] = ( this.n現在選択中の曲のレベル難易度毎DGB[ i ][ j ] - (n難易度整数[ i ] * 10 ) ) * 10;
407                                     n難易度小数[ i ] += this.n現在選択中の曲のレベル小数点難易度毎DGB[ i ][ j ];
408
409                                     if( this.str難易度ラベル[ i ] != null && this.b現在選択中の曲に譜面がある[ i ][ j ])
410                                     {
411                                         this.t大文字表示(73 + this.n本体X[ j ] + (i * 143), 19 + this.n本体Y[j] - y差分[i], string.Format("{0:0}", n難易度整数[i]));
412                                         this.t小文字表示(102 + this.n本体X[ j ] + (i * 143), 37 + this.n本体Y[j] - y差分[i], string.Format("{0,2:00}", n難易度小数[i]));
413                                         this.tx難易度数字XG.t2D描画(CDTXMania.app.Device, 94 + this.n本体X[j] + (i * 143), 51 + this.n本体Y[j] - y差分[i], new Rectangle(145, 54, 7, 8));
414                                     }
415                                     else if ((this.str難易度ラベル[i] != null && !this.b現在選択中の曲に譜面がある[i][j]) || CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.RANDOM)
416                                     {
417                                         this.t大文字表示(73 + this.n本体X[j] + (i * 143), 19 + this.n本体Y[j] - y差分[i], ("-"));
418                                         this.t小文字表示(102 + this.n本体X[j] + (i * 143), 37 + this.n本体Y[j] - y差分[i], ("--"));
419                                         this.tx難易度数字XG.t2D描画(CDTXMania.app.Device, 94 + this.n本体X[j] + (i * 143), 51 + this.n本体Y[j] - y差分[i], new Rectangle(145, 54, 7, 8));
420                                     }
421                                 }
422                                 if( n難易度ラベル合計値 == 0 )
423                                 {
424                             
425                                 }
426                             }
427                                     }
428                                     //-----------------
429                                         #endregion
430                         #region [ 選択曲の 曲別スキルの描画 ]
431                         //-----------------
432                         for( int j = 0; j < 3; j++ )
433                         {
434                             if( this.n本体X[ j ] != 0 )
435                             {
436                                 int[] n曲別スキル位置 = new int[] { 223, 223, 1144 };
437                                 if( CDTXMania.ConfigIni.bIsSwappedGuitarBass )
438                                     n曲別スキル位置 = new int[] { 223, 1144, 223 };
439                                 double[] db現在の曲のレベルXG = new double[ 5 ];
440                                 double db曲別スキル = 0;
441
442                                 for( int i = 0; i < 5; i++ )
443                                 {
444                                     if( this.str難易度ラベル[ i ] != null )
445                                     {
446                                         db現在の曲のレベルXG[ i ] = this.n現在選択中の曲のレベル難易度毎DGB[ i ][ j ] / 10.0;
447                                         db現在の曲のレベルXG[ i ] += this.n現在選択中の曲のレベル小数点難易度毎DGB[ i ][ j ] / 100.0;
448                                         if( ( ( this.db現在選択中の曲の最高スキル値難易度毎[ i ][ j ] / 100.0 ) * db現在の曲のレベルXG[ i ] * 20.0 ) > db曲別スキル )
449                                             db曲別スキル = ( this.db現在選択中の曲の最高スキル値難易度毎[ i ][ j ] / 100.0 ) * db現在の曲のレベルXG[ i ] * 20.0;
450                                     }
451                                 }
452                                 if( db曲別スキル != 0 )
453                                 {
454                                     if( this.txゲージ用数字他 != null )
455                                         this.txゲージ用数字他.t2D描画( CDTXMania.app.Device, n曲別スキル位置[ j ], this.n本体Y[ j ] + 51, new Rectangle( 0, 32, 64, 38 ) );
456                                     this.t達成率表示( n曲別スキル位置[ j ] + 11, this.n本体Y[ j ] + 69, string.Format( "{0,6:##0.00}", db曲別スキル ) );
457                                 }
458                             }
459                         }
460                         //-----------------
461                         #endregion
462                         #region [ 選択曲の 最高スキル値ゲージ+数値の描画 ]
463                         //-----------------
464                         for (int j = 0; j < 3; j++)
465                         {
466                             if ( this.n本体X[j] != 0 )
467                             {
468                                 for (int i = 0; i < 5; i++)
469                                 {
470                                     if (this.str難易度ラベル[i] != null && this.db現在選択中の曲の最高スキル値難易度毎[i][j] != 0.00)
471                                     {
472                                         this.t達成率表示(76 + this.n本体X[j] + (i * 143), 77 + this.n本体Y[j] - y差分[i], string.Format("{0,6:##0.00}%", this.db現在選択中の曲の最高スキル値難易度毎[i][j]));
473                                     }
474                                 }
475                                 if( j == 0 )
476                                 {
477                                     if( n難易度ラベル合計値 == 0 && this.db現在選択中の曲の最高スキル値[j] != 0.00 )
478                                     {
479                                         this.t達成率表示(76 + this.n本体X[j] + (4 * 143), 77 + this.n本体Y[j] - 10, string.Format("{0,6:##0.00}%", this.db現在選択中の曲の最高スキル値[j]));
480                                     }
481                                 }
482                                 else
483                                 {
484                                     if( ( j == 1 ? n難易度ラベル合計値1P == 0 : n難易度ラベル合計値2P == 0 ) && this.db現在選択中の曲の最高スキル値[j] != 0.00 )
485                                     {
486                                         this.t達成率表示(76 + this.n本体X[j] + (4 * 143), 77 + this.n本体Y[j] - 10, string.Format("{0,6:##0.00}%", this.db現在選択中の曲の最高スキル値[j]));
487                                     }
488                                 }
489                             }
490                         }
491                         //-----------------
492                         #endregion
493                         #region [ 選択曲の 最高ランクの描画 ]
494                         //-----------------
495                         for (int j = 0; j < 3; j++)
496                         {
497                             if (this.n本体X[j] != 0 && this.txゲージ用数字他 != null)
498                             {
499                                 for (int i = 0; i < 5; i++)
500                                 {
501                                     if (this.str難易度ラベル[i] != null && this.db現在選択中の曲の最高スキル値難易度毎[i][j] != 0.00)
502                                     {
503                                         int nMaxRank = this.n現在選択中の曲の最高ランク難易度毎[i][j];
504                                         if (nMaxRank != 99)
505                                         {
506                                             if (nMaxRank < 0)
507                                                 nMaxRank = 0;
508                                             if (nMaxRank > 6)
509                                                 nMaxRank = 6;
510
511                                             this.txゲージ用数字他.t2D描画(CDTXMania.app.Device, (7 + this.n本体X[j] + (i * 143)), 61 + this.n本体Y[j] - y差分[i], new Rectangle(42 + (nMaxRank * 32), 0, 32, 32));
512                                         }
513                                     }
514                                 }
515                                 if( j == 0 )
516                                 {
517                                     if( ( n難易度ラベル合計値 == 0 ) && this.db現在選択中の曲の最高スキル値[j] != 0.00)
518                                     {
519                                         int nMaxRank = this.n現在選択中の曲の最高ランク[j];
520
521                                         if (nMaxRank != 99)
522                                         {
523                                             if (nMaxRank < 0)
524                                                 nMaxRank = 0;
525
526                                             if (nMaxRank > 6)
527                                                 nMaxRank = 6;
528
529                                             this.txゲージ用数字他.t2D描画(CDTXMania.app.Device, (7 + this.n本体X[j] + (4 * 143)), 61 + this.n本体Y[j] - 10, new Rectangle(42 + (nMaxRank * 32), 0, 32, 32));
530                                         }
531                                     }
532                                 }
533                                 else
534                                 {
535                                     if( ( j == 1 ? n難易度ラベル合計値1P == 0 : n難易度ラベル合計値2P == 0 ) && this.db現在選択中の曲の最高スキル値[j] != 0.00)
536                                     {
537                                         int nMaxRank = this.n現在選択中の曲の最高ランク[j];
538
539                                         if (nMaxRank != 99)
540                                         {
541                                             if (nMaxRank < 0)
542                                                 nMaxRank = 0;
543
544                                             if (nMaxRank > 6)
545                                                 nMaxRank = 6;
546
547                                             this.txゲージ用数字他.t2D描画(CDTXMania.app.Device, (7 + this.n本体X[j] + (4 * 143)), 61 + this.n本体Y[j] - 10, new Rectangle(42 + (nMaxRank * 32), 0, 32, 32));
548                                         }
549                                     }
550                                 }
551
552                             }
553                         }
554                         //-----------------
555                         #endregion
556                         #region [ 選択曲の FullCombo Excellent の 描画 ]
557                         //-----------------
558                         for (int j = 0; j < 3; j++)
559                         {
560                             if (this.n本体X[j] != 0 && this.txゲージ用数字他 != null)
561                             {
562                                 for (int i = 0; i < 5; i++)
563                                 {
564                                     if (this.db現在選択中の曲の最高スキル値難易度毎[i][j] == 100 && this.str難易度ラベル[i] != null)
565                                         this.txゲージ用数字他.t2D描画(CDTXMania.app.Device, 40 + this.n本体X[j] + (i * 143), 63 + this.n本体Y[j] - y差分[i], new Rectangle(266, 0, 42, 32));
566                                     else if (this.b現在選択中の曲がフルコンボ難易度毎[i][j] && this.str難易度ラベル[i] != null)
567                                         this.txゲージ用数字他.t2D描画(CDTXMania.app.Device, 40 + this.n本体X[j] + (i * 143), 63 + this.n本体Y[j] - y差分[i], new Rectangle(0, 0, 42, 32));
568                                 }
569                                 if( j == 0 )
570                                 {
571                                     if( n難易度ラベル合計値 == 0 )
572                                     {
573                                         if (this.db現在選択中の曲の最高スキル値[j] == 100)
574                                             this.txゲージ用数字他.t2D描画(CDTXMania.app.Device, 40 + this.n本体X[j] + (4 * 143), 63 + this.n本体Y[j] - 10, new Rectangle(266, 0, 42, 32));
575                                         else if (this.b現在選択中の曲がフルコンボ[j])
576                                             this.txゲージ用数字他.t2D描画(CDTXMania.app.Device, 40 + this.n本体X[j] + (4 * 143), 63 + this.n本体Y[j] - 10, new Rectangle(0, 0, 42, 32));
577                                     }
578                                 }
579                                 else
580                                 {
581                                     if( j == 1 ? n難易度ラベル合計値1P == 0 : n難易度ラベル合計値2P == 0 )
582                                     {
583                                         if (this.db現在選択中の曲の最高スキル値[j] == 100)
584                                             this.txゲージ用数字他.t2D描画(CDTXMania.app.Device, 40 + this.n本体X[j] + (4 * 143), 63 + this.n本体Y[j] - 10, new Rectangle(266, 0, 42, 32));
585                                         else if (this.b現在選択中の曲がフルコンボ[j])
586                                             this.txゲージ用数字他.t2D描画(CDTXMania.app.Device, 40 + this.n本体X[j] + (4 * 143), 63 + this.n本体Y[j] - 10, new Rectangle(0, 0, 42, 32));
587                                     }
588                                 }
589                             }
590                         }
591                         //-----------------
592                         #endregion
593
594                         if( CDTXMania.r現在のステージ.eフェーズID == CStage.Eフェーズ.選曲_決定演出 || CDTXMania.r現在のステージ.eフェーズID == CStage.Eフェーズ.選曲_NowLoading画面へのフェードアウト )
595                         {
596                             this.n本体Y[ 0 ] = 43 - ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 <= 250 && CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 >= 0 ? (int)( 70 * ( ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 ) / 250.0 ) ) : 0 );
597                             this.n本体Y[ 1 ] = 43 - ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 <= 250 && CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 >= 0 ? (int)( 70 * ( ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 ) / 250.0 ) ) : 0 );
598                             this.n本体Y[ 2 ] = 546 + ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 <= 250 && CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 >= 0 ? (int)( 70 * ( ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 ) / 250.0 ) ) : 0 );
599                             this.txパネル本体.n透明度 = (int)( 255 - ( 255 * ( ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 ) / 250.0 ) ) );
600                             this.txゲージ用数字他.n透明度 = (int)( 255 - ( 255 * ( ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 ) / 250.0 ) ) );
601                             this.tx難易度パネル.n透明度 = (int)( 255 - ( 255 * ( ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 ) / 250.0 ) ) );
602                             this.tx難易度数字XG.n透明度 = (int)( 255 - ( 255 * ( ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 ) / 250.0 ) ) );
603                             if( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 > 250 )
604                             {
605                                 this.txパネル本体.n透明度 = 0;
606                                 this.txゲージ用数字他.n透明度 = 0;
607                                 this.tx難易度数字XG.n透明度 = 0;
608                             }
609                             if( this.tx決定後_難易度パネル1P == null )
610                                 this.t決定アニメ_難易度パネルを生成する();
611                             if( this.tx決定後_難易度パネル1P != null && ( CDTXMania.ConfigIni.bGuitar有効 && CDTXMania.stage選曲XG.r確定されたスコア.譜面情報.b譜面がある.Guitar ) )
612                             {
613                                 //挙動が謎のためY軸回転は保留。
614
615                                 if( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 < 400 )
616                                 {
617                                     int nX = (int)( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 < 200 ? 100 * ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 / 200.0 ) : 100 - 100 * ( ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 - 200.0 ) / 200.0 ) );
618                                     this.tx決定後_難易度パネル1P.t2D描画( CDTXMania.app.Device, 254 - nX, 162 );
619                                     //CDTXMania.act文字コンソール.tPrint( 0, 64, C文字コンソール.Eフォント種別.白, nX.ToString() );
620                                 }
621                                 else
622                                 {
623                                     this.tx決定後_難易度パネル1P.t2D描画( CDTXMania.app.Device, 254, 162 );
624                                 }
625                             }
626                             else if( this.tx決定後_難易度パネル1P != null && CDTXMania.stage選曲XG.r確定されたスコア.譜面情報.b譜面がある.Drums )
627                             {
628                                 //挙動が謎のためY軸回転は保留。
629
630                                 if( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 < 400 )
631                                 {
632                                     int nX = (int)( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 < 200 ? 100 * ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 / 200.0 ) : 100 - 100 * ( ( CDTXMania.stage選曲XG.ct決定演出待機.n現在の値 - 200.0 ) / 200.0 ) );
633                                     this.tx決定後_難易度パネル1P.t2D描画( CDTXMania.app.Device, 254 - nX, 162 );
634                                     //CDTXMania.act文字コンソール.tPrint( 0, 64, C文字コンソール.Eフォント種別.白, nX.ToString() );
635                                 }
636                                 else
637                                 {
638                                     this.tx決定後_難易度パネル1P.t2D描画( CDTXMania.app.Device, 254, 162 );
639                                 }
640                             }
641                             /*
642                             if( this.tx決定後_難易度パネル2P == null && CDTXMania.ConfigIni.bGuitar有効 )
643                                 this.t決定アニメ_難易度パネルを生成する();
644                             if( this.tx決定後_難易度パネル2P != null && CDTXMania.stage選曲.r確定されたスコア.譜面情報.b譜面がある.Bass )
645                             {
646                                 if( CDTXMania.stage選曲.ct決定演出待機.n現在の値 < 400 )
647                                 {
648                                     int nX = (int)( CDTXMania.stage選曲.ct決定演出待機.n現在の値 < 200 ? 100 * ( CDTXMania.stage選曲.ct決定演出待機.n現在の値 / 200.0 ) : 100 - 100 * ( ( CDTXMania.stage選曲.ct決定演出待機.n現在の値 - 200.0 ) / 200.0 ) );
649                                     this.tx決定後_難易度パネル2P.t2D描画( CDTXMania.app.Device, 870 + nX, 162 );
650                                 }
651                                 else
652                                 {
653                                     this.tx決定後_難易度パネル2P.t2D描画( CDTXMania.app.Device, 870, 162 );
654                                 }
655                             }*/
656                         }
657                     }
658                 }
659                         }
660                         return 0;
661                 }
662
663
664                 // その他
665
666                 #region [ private ]
667                 //-----------------
668                 [StructLayout( LayoutKind.Sequential )]
669                 private struct ST数字
670                 {
671                         public char ch;
672                         public Rectangle rc;
673                         public ST数字( char ch, Rectangle rc )
674                         {
675                                 this.ch = ch;
676                                 this.rc = rc;
677                         }
678                 }
679
680                 private STDGBVALUE<bool> b現在選択中の曲がフルコンボ;
681                 private CCounter ct登場アニメ用;
682                 private CCounter ct難易度スクロール用;
683                 private CCounter ct難易度矢印用;
684                 private STDGBVALUE<double> db現在選択中の曲の最高スキル値;
685                 private STDGBVALUE<int> n現在選択中の曲のレベル;
686                 private STDGBVALUE<int> n現在選択中の曲の最高ランク;
687
688         private int[] n選択中の曲のレベル難易度毎 = new int[5];
689         
690                 private int n難易度開始文字位置;
691                 private const int n難易度表示可能文字数 = 0x24;
692         private STDGBVALUE<int> n本体X;
693         private STDGBVALUE<int> n本体Y;
694                 private C曲リストノード r直前の曲;
695                 private string[] str難易度ラベル = new string[] { "", "", "", "", "" };
696                 private CTexture txゲージ用数字他;
697         private CTexture tx難易度パネル;
698         private CTexture tx難易度数字XG;
699
700         private CTexture tx決定後_難易度パネル1P;
701         private CTexture tx決定後_難易度パネル2P;
702
703         [StructLayout(LayoutKind.Sequential)]
704         private struct ST文字位置
705         {
706             public char ch;
707             public Point pt;
708             public ST文字位置( char ch, Point pt )
709             {
710                 this.ch = ch;
711                 this.pt = pt;
712             }
713         }
714         [StructLayout(LayoutKind.Sequential)]
715         private struct ST達成率数字
716         {
717             public char ch;
718             public Rectangle rc;
719             public ST達成率数字( char ch, Rectangle rc )
720             {
721                 this.ch = ch;
722                 this.rc = rc;
723             }
724         }
725         //2016.02.23 kairera0467 初期化の行数を大幅短縮。
726         private ST文字位置[] st小文字位置 = new ST文字位置[] {
727             new ST文字位置( '0', new Point( 13, 40 ) ),
728             new ST文字位置( '1', new Point( 26, 40 ) ),
729             new ST文字位置( '2', new Point( 39, 40 ) ),
730             new ST文字位置( '3', new Point( 52, 40 ) ),
731             new ST文字位置( '4', new Point( 65, 40 ) ),
732             new ST文字位置( '5', new Point( 78, 40 ) ),
733             new ST文字位置( '6', new Point( 91, 40 ) ),
734             new ST文字位置( '7', new Point( 105, 40 ) ),
735             new ST文字位置( '8', new Point( 118, 40 ) ),
736             new ST文字位置( '9', new Point( 131, 40 ) ),
737             new ST文字位置( '-', new Point( 0, 40 ) )
738         };
739
740         private ST文字位置[] st大文字位置 = new ST文字位置[] {
741             new ST文字位置( '.', new Point( 144, 0 ) ),
742             new ST文字位置( '1', new Point( 22, 0 ) ),
743             new ST文字位置( '2', new Point( 44, 0 ) ),
744             new ST文字位置( '3', new Point( 66, 0 ) ),
745             new ST文字位置( '4', new Point( 88, 0 ) ),
746             new ST文字位置( '5', new Point( 110, 0 ) ),
747             new ST文字位置( '6', new Point( 132, 0 ) ),
748             new ST文字位置( '7', new Point( 153, 0 ) ),
749             new ST文字位置( '8', new Point( 176, 0 ) ),
750             new ST文字位置( '9', new Point( 198, 0 ) ),
751             new ST文字位置( '0', new Point( 220, 0 ) ),
752             new ST文字位置( '-', new Point( 0, 0 ) )
753         };
754
755         private ST達成率数字[] st達成率数字 = new ST達成率数字[]{
756             new ST達成率数字( '0', new Rectangle( 0, 62, 7, 16 ) ),
757             new ST達成率数字( '1', new Rectangle( 7, 62, 7, 16 ) ),
758             new ST達成率数字( '2', new Rectangle( 14, 62, 7, 16 ) ),
759             new ST達成率数字( '3', new Rectangle( 21, 62, 7, 16 ) ),
760             new ST達成率数字( '4', new Rectangle( 28, 62, 7, 16 ) ),
761             new ST達成率数字( '5', new Rectangle( 35, 62, 7, 16 ) ),
762             new ST達成率数字( '6', new Rectangle( 42, 62, 7, 16 ) ),
763             new ST達成率数字( '7', new Rectangle( 49, 62, 7, 16 ) ),
764             new ST達成率数字( '8', new Rectangle( 56, 62, 7, 16 ) ),
765             new ST達成率数字( '9', new Rectangle( 63, 62, 7, 16 ) ),
766             new ST達成率数字( '%', new Rectangle( 70, 62, 9, 16 ) ),
767             new ST達成率数字( '.', new Rectangle( 79, 62, 3, 16 ) )
768         };
769
770                 private int n現在の難易度ラベルが完全表示されているかを調べてスクロール方向を返す()
771                 {
772                         int num = 0;
773                         int length = 0;
774                         for( int i = 0; i < 5; i++ )
775                         {
776                                 if( ( this.str難易度ラベル[ i ] != null ) && ( this.str難易度ラベル[ i ].Length > 0 ) )
777                                 {
778                                         length = this.str難易度ラベル[ i ].Length;
779                                 }
780                                 if( this.n現在選択中の曲の難易度 == i )
781                                 {
782                                         break;
783                                 }
784                                 if( ( this.str難易度ラベル[ i ] != null ) && ( this.str難易度ラベル.Length > 0 ) )
785                                 {
786                                         num += length + 2;
787                                 }
788                         }
789                         if( num >= ( this.n難易度開始文字位置 + 55 ) ) // 0x24 -> 55
790                         {
791                                 return 1;
792                         }
793                         if( ( num + length ) <= this.n難易度開始文字位置 )
794                         {
795                                 return -1;
796                         }
797                         if( ( ( num + length ) - 1 ) >= ( this.n難易度開始文字位置 + 55 ) )    // 0x24 -> 55
798                         {
799                                 return 1;
800                         }
801                         if( num < this.n難易度開始文字位置 )
802                         {
803                                 return -1;
804                         }
805                         return 0;
806                 }
807         private void t小文字表示(int x, int y, string str)
808         {
809             foreach (char ch in str)
810             {
811                 for( int i = 0; i < this.st小文字位置.Length; i++ )
812                 {
813                     if (this.st小文字位置[i].ch == ch)
814                     {
815                         Rectangle rectangle = new Rectangle(this.st小文字位置[i].pt.X, this.st小文字位置[i].pt.Y, 13, 22);
816                         if (this.tx難易度数字XG != null)
817                         {
818                             this.tx難易度数字XG.t2D描画(CDTXMania.app.Device, x, y, rectangle);
819                         }
820                         break;
821                     }
822                 }
823                 x += 12;
824             }
825         }
826         private void t大文字表示(int x, int y, string str)
827         {
828             for( int i = 0; i < str.Length; i++ )
829             {
830                 char c = str[ i ];
831                 for( int j = 0; j < this.st大文字位置.Length; j++ )
832                 {
833                     if( this.st大文字位置[ j ].ch == c )
834                     {
835                         Rectangle rc画像内の描画領域 = new Rectangle( this.st大文字位置[ j ].pt.X, this.st大文字位置[ j ].pt.Y, 22, 40);
836                         if( c == '.' )
837                         {
838                             rc画像内の描画領域.Width -= 2;
839                             rc画像内の描画領域.Height -= 2;
840                         }
841                         if( this.tx難易度数字XG != null )
842                         {
843                             this.tx難易度数字XG.t2D描画(CDTXMania.app.Device, x, y, rc画像内の描画領域);
844                         }
845                         break;
846                     }
847                 }
848                 if( c == '.' ) x += 0;
849                 else x += 24;
850             }
851         }
852         private void t達成率表示(int x, int y, string str)
853         {
854             for (int j = 0; j < str.Length; j++)
855             {
856                 char c = str[j];
857                 for (int i = 0; i < this.st達成率数字.Length; i++)
858                 {
859                     if (this.st達成率数字[i].ch == c)
860                     {
861                         Rectangle rectangle = new Rectangle(this.st達成率数字[i].rc.X, this.st達成率数字[i].rc.Y, 7, 16);
862
863                         if( c == '.' )
864                             rectangle.Width -= 2;
865                         else if( c == '%' )
866                             rectangle.Width += 2;
867                         if (this.tx難易度数字XG != null)
868                         {
869                             this.tx難易度数字XG.t2D描画(CDTXMania.app.Device, x, y, rectangle);
870                         }
871                         break;
872                     }
873                 }
874                 if (c == '.')
875                     x += 4;
876                 else
877                     x += 8;
878             }
879         }
880         private void t決定アニメ_難易度パネルを生成する()
881         {
882             //ギター・ベースの場合、1枚の画像を2回読み込むことになるので回避。
883             Image imgPanel;
884             imgPanel = CDTXMania.tテクスチャをImageで読み込む( CSkin.Path( @"Graphics\5_base info panel.png" ) );
885             int[] arPanelRectX = new int[] { 164, 326, 650, 488 }; //Drums(使用しない), Guitar, Bass, GuitarF, BassF
886
887             #region[ ドラム ]
888             if( CDTXMania.ConfigIni.bDrums有効 && imgPanel != null )
889             {
890                 Bitmap bPanel = new Bitmap( 155, 362 );
891                 Graphics graphics = Graphics.FromImage( bPanel );
892
893                 Image imgLabel;
894                 Image imgLevelNum;
895
896                 graphics.PageUnit = GraphicsUnit.Pixel;
897                 graphics.DrawImage( imgPanel, new Rectangle( 0, 0, 155, 362 ), new Rectangle( 2, 2, 155, 362 ), GraphicsUnit.Pixel );
898
899                 imgLabel = CDTXMania.tテクスチャをImageで読み込む( CSkin.Path( @"Graphics\6_difficulty panel.png" ) );
900                 graphics.DrawImage( imgLabel, new Rectangle( 14, 31, 130, 72 ), this.t指定したラベル名から難易度パネル画像の座標を取得する( CDTXMania.stage選曲XG.r確定された曲.ar難易度ラベル[ CDTXMania.stage選曲.n確定された曲の難易度 ] ), GraphicsUnit.Pixel );
901
902                 imgLevelNum = CDTXMania.tテクスチャをImageで読み込む( CSkin.Path( @"Graphics\5_LevelNumber.png" ) );
903
904                 //XG譜面
905                 if( !CDTXMania.stage選曲XG.r確定されたスコア.譜面情報.b完全にCLASSIC譜面である.Drums )
906                 {
907                     #region[ XG譜面 ]
908                     int n難易度整数;
909                     int n難易度小数;
910                     string str難易度;
911                     n難易度整数 = (int)this.n現在選択中の曲のレベル難易度毎DGB[ CDTXMania.stage選曲.n確定された曲の難易度 ][ 0 ] / 10;
912                     n難易度小数 = ( this.n現在選択中の曲のレベル難易度毎DGB[ CDTXMania.stage選曲.n確定された曲の難易度 ][ 0 ] - ( n難易度整数 * 10 ) ) * 10;
913                     n難易度小数 += this.n現在選択中の曲のレベル小数点難易度毎DGB[ CDTXMania.stage選曲.n確定された曲の難易度 ][ 0 ];
914                     str難易度 = n難易度整数.ToString() + string.Format( "{0,2:00}", n難易度小数 );
915
916                     if( CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.SCORE )
917                     {
918                         for( int j = 0; j < this.st大文字位置.Length; j++ )
919                         {
920                             if( this.st大文字位置[ j ].ch == str難易度[ 0 ] )
921                             {
922                                 Rectangle rc画像内の描画領域 = new Rectangle( this.st大文字位置[ j ].pt.X, this.st大文字位置[ j ].pt.Y, 22, 40 );
923                                 graphics.DrawImage( imgLevelNum, new Rectangle( 84, 55, 22, 40 ), rc画像内の描画領域, GraphicsUnit.Pixel );
924                                 break;
925                             }
926                         }
927                         graphics.DrawImage( imgLevelNum, new Rectangle( 105, 74, 9, 22 ), new Rectangle( 144, 40, 9, 22 ), GraphicsUnit.Pixel );
928                         for( int k = 0; k < 2; k++ )
929                         {
930                             for( int j = 0; j < this.st小文字位置.Length; j++ )
931                             {
932                                 if( this.st小文字位置[ j ].ch == str難易度[ k + 1 ] )
933                                 {
934                                     Rectangle rc画像内の描画領域 = new Rectangle( this.st小文字位置[ j ].pt.X, this.st小文字位置[ j ].pt.Y, 12, 22 );
935                                     graphics.DrawImage( imgLevelNum, new Rectangle( 113 + ( 12 * k ), 74, 12, 22 ), rc画像内の描画領域, GraphicsUnit.Pixel );
936                                     break;
937                                 }
938                             }
939                         }
940                     }
941                     else if( CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.RANDOM )
942                     {
943                         graphics.DrawImage( imgLevelNum, new Rectangle( 84, 55, 22, 40 ), new Rectangle( 0, 0, 22, 40 ), GraphicsUnit.Pixel );
944                         graphics.DrawImage( imgLevelNum, new Rectangle( 105, 74, 9, 22 ), new Rectangle( 144, 40, 9, 22 ), GraphicsUnit.Pixel );
945                         for( int k = 0; k < 2; k++ )
946                         {
947                             graphics.DrawImage( imgLevelNum, new Rectangle( 113 + ( 12 * k ), 74, 12, 22 ), new Rectangle( 0, 40, 12, 22 ), GraphicsUnit.Pixel );
948                         }
949                     }
950                     #endregion
951                 }
952                 else
953                 {
954                     #region[ CLASSIC譜面 ]
955                     string str難易度;
956                     str難易度 = string.Format( "{0,2:00}", (int)this.n現在選択中の曲のレベル難易度毎DGB[ CDTXMania.stage選曲.n確定された曲の難易度 ][ 0 ] );
957
958                     if( CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.SCORE )
959                     {
960                         for( int j = 0; j < 2; j++ )
961                         {
962                             for( int k = 0; k < this.st大文字位置.Length; k++ )
963                             {
964                                 if( this.st大文字位置[ k ].ch == str難易度[ j ] )
965                                 {
966                                     Rectangle rc画像内の描画領域 = new Rectangle( this.st大文字位置[ k ].pt.X, this.st大文字位置[ k ].pt.Y, 22, 40 );
967                                     graphics.DrawImage( imgLevelNum, new Rectangle( 94 + ( 22 * j ), 56, 22, 40 ), rc画像内の描画領域, GraphicsUnit.Pixel );
968                                     break;
969                                 }
970                             }
971                         }
972                     }
973                     else if( CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.RANDOM )
974                     {
975                         graphics.DrawImage( imgLevelNum, new Rectangle( 94, 55, 22, 40 ), new Rectangle( 0, 0, 22, 40 ), GraphicsUnit.Pixel );
976                         graphics.DrawImage( imgLevelNum, new Rectangle( 116, 55, 22, 40 ), new Rectangle( 0, 0, 22, 40 ), GraphicsUnit.Pixel );
977                     }
978                     #endregion
979                 }
980
981                 this.tx決定後_難易度パネル1P = new CTexture( CDTXMania.app.Device, bPanel, CDTXMania.TextureFormat, false );
982
983                 CDTXMania.t安全にDisposeする( ref bPanel );
984                 CDTXMania.t安全にDisposeする( ref graphics );
985                 CDTXMania.t安全にDisposeする( ref imgPanel );
986                 CDTXMania.t安全にDisposeする( ref imgLabel );
987                 CDTXMania.t安全にDisposeする( ref imgLevelNum );
988             }
989             #endregion
990             #region[ ギター・ベース ]
991             else if( CDTXMania.ConfigIni.bGuitar有効 && imgPanel != null )
992             {
993                 for( int i = 1; i <= 2; i++ )
994                 {
995                     Bitmap bPanel = new Bitmap( 155, 362 );
996                     Graphics gPanel = Graphics.FromImage( bPanel );
997
998                     Image imgLabel;
999                     Image imgLevelNum;
1000
1001                     gPanel.PageUnit = GraphicsUnit.Pixel;
1002                     gPanel.DrawImage( imgPanel, new Rectangle( 0, 0, 155, 362 ), new Rectangle( arPanelRectX[ i + ( CDTXMania.ConfigIni.bIsSwappedGuitarBass ? 1 : -1 ) ], 2, 155, 362 ), GraphicsUnit.Pixel );
1003
1004                     imgLabel = CDTXMania.tテクスチャをImageで読み込む( CSkin.Path( @"Graphics\6_difficulty panel.png" ) );
1005                     gPanel.DrawImage( imgLabel, new Rectangle( 14, 32, 130, 72 ), this.t指定したラベル名から難易度パネル画像の座標を取得する( CDTXMania.stage選曲.r確定された曲.ar難易度ラベル[ CDTXMania.stage選曲.n確定された曲の難易度 ] ), GraphicsUnit.Pixel );
1006
1007                     imgLevelNum = CDTXMania.tテクスチャをImageで読み込む( CSkin.Path( @"Graphics\5_LevelNumber.png" ) );
1008
1009                     //XG譜面
1010                     if( !CDTXMania.stage選曲.r確定されたスコア.譜面情報.b完全にCLASSIC譜面である[ i ] )
1011                     {
1012                         #region[ XG譜面 ]
1013                         int n難易度整数;
1014                         int n難易度小数;
1015                         string str難易度;
1016                         n難易度整数 = (int)this.n現在選択中の曲のレベル難易度毎DGB[ CDTXMania.stage選曲.n確定された曲の難易度 ][ i ] / 10;
1017                         n難易度小数 = ( this.n現在選択中の曲のレベル難易度毎DGB[ CDTXMania.stage選曲.n確定された曲の難易度 ][ i ] - ( n難易度整数 * 10 ) ) * 10;
1018                         n難易度小数 += this.n現在選択中の曲のレベル小数点難易度毎DGB[ CDTXMania.stage選曲.n確定された曲の難易度 ][ i ];
1019                         str難易度 = n難易度整数.ToString() + string.Format( "{0,2:00}", n難易度小数 );
1020
1021                         if( CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.SCORE )
1022                         {
1023                             for( int j = 0; j < this.st大文字位置.Length; j++ )
1024                             {
1025                                 if( this.st大文字位置[ j ].ch == str難易度[ 0 ] )
1026                                 {
1027                                     Rectangle rc画像内の描画領域 = new Rectangle( this.st大文字位置[ j ].pt.X, this.st大文字位置[ j ].pt.Y, 22, 40 );
1028                                     gPanel.DrawImage( imgLevelNum, new Rectangle( 84, 56, 22, 40 ), rc画像内の描画領域, GraphicsUnit.Pixel );
1029                                     break;
1030                                 }
1031                             }
1032                             gPanel.DrawImage( imgLevelNum, new Rectangle( 105, 74, 9, 22 ), new Rectangle( 144, 40, 9, 22 ), GraphicsUnit.Pixel );
1033                             for( int k = 0; k < 2; k++ )
1034                             {
1035                                 for( int j = 0; j < this.st小文字位置.Length; j++ )
1036                                 {
1037                                     if( this.st小文字位置[ j ].ch == str難易度[ k + 1 ] )
1038                                     {
1039                                         Rectangle rc画像内の描画領域 = new Rectangle( this.st小文字位置[ j ].pt.X, this.st小文字位置[ j ].pt.Y, 12, 22 );
1040                                         gPanel.DrawImage( imgLevelNum, new Rectangle( 113 + ( 12 * k ), 74, 12, 22 ), rc画像内の描画領域, GraphicsUnit.Pixel );
1041                                         break;
1042                                     }
1043                                 }
1044                             }
1045                         }
1046                         else if( CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.RANDOM )
1047                         {
1048                             gPanel.DrawImage( imgLevelNum, new Rectangle( 84, 55, 22, 40 ), new Rectangle( 0, 0, 22, 40 ), GraphicsUnit.Pixel );
1049                             gPanel.DrawImage( imgLevelNum, new Rectangle( 105, 74, 9, 22 ), new Rectangle( 144, 40, 9, 22 ), GraphicsUnit.Pixel );
1050                             for( int k = 0; k < 2; k++ )
1051                             {
1052                                 gPanel.DrawImage( imgLevelNum, new Rectangle( 113 + ( 12 * k ), 74, 12, 22 ), new Rectangle( 0, 40, 12, 22 ), GraphicsUnit.Pixel );
1053                             }
1054                         }
1055                         #endregion
1056                     }
1057                     else
1058                     {
1059                         #region[ CLASSIC譜面 ]
1060                         string str難易度;
1061                         str難易度 = string.Format( "{0,2:00}", (int)this.n現在選択中の曲のレベル難易度毎DGB[ CDTXMania.stage選曲.n確定された曲の難易度 ][ i ] );
1062
1063                         if( CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.SCORE )
1064                         {
1065                             for( int j = 0; j < 2; j++ )
1066                             {
1067                                 for( int k = 0; k < this.st大文字位置.Length; k++ )
1068                                 {
1069                                     if( this.st大文字位置[ k ].ch == str難易度[ j ] )
1070                                     {
1071                                         Rectangle rc画像内の描画領域 = new Rectangle( this.st大文字位置[ k ].pt.X, this.st大文字位置[ k ].pt.Y, 22, 40 );
1072                                         gPanel.DrawImage( imgLevelNum, new Rectangle( 94 + ( 22 * j ), 56, 22, 40 ), rc画像内の描画領域, GraphicsUnit.Pixel );
1073                                         break;
1074                                     }
1075                                 }
1076                             }
1077                         }
1078                         else if( CDTXMania.stage選曲.r現在選択中の曲.eノード種別 == C曲リストノード.Eノード種別.RANDOM )
1079                         {
1080                             gPanel.DrawImage( imgLevelNum, new Rectangle( 94, 55, 22, 40 ), new Rectangle( 0, 0, 22, 40 ), GraphicsUnit.Pixel );
1081                             gPanel.DrawImage( imgLevelNum, new Rectangle( 116, 55, 22, 40 ), new Rectangle( 0, 0, 22, 40 ), GraphicsUnit.Pixel );
1082                         }
1083                         #endregion
1084                     }
1085
1086                     if( i == 1 )
1087                         this.tx決定後_難易度パネル1P = new CTexture( CDTXMania.app.Device, bPanel, CDTXMania.TextureFormat, false );
1088                     else if( i == 2 )
1089                         this.tx決定後_難易度パネル2P = new CTexture( CDTXMania.app.Device, bPanel, CDTXMania.TextureFormat, false );
1090
1091                     CDTXMania.t安全にDisposeする( ref bPanel );
1092                     CDTXMania.t安全にDisposeする( ref gPanel );
1093                     CDTXMania.t安全にDisposeする( ref imgLabel );
1094                     CDTXMania.t安全にDisposeする( ref imgLevelNum );
1095                 }
1096             }
1097             #endregion
1098             CDTXMania.t安全にDisposeする( ref imgPanel );
1099         }
1100         private Rectangle t指定したラベル名から難易度パネル画像の座標を取得する( string strラベル名 )
1101         {
1102             string strRawScriptFile;
1103
1104             Rectangle rect = new Rectangle( 0, 0, 130, 72 );
1105
1106             //ファイルの存在チェック
1107             if( File.Exists( CSkin.Path( @"Script\difficult.dtxs" ) ) )
1108             {
1109                 //スクリプトを開く
1110                 StreamReader reader = new StreamReader( CSkin.Path( @"Script\difficult.dtxs" ), Encoding.GetEncoding( "Shift_JIS" ) );
1111                 strRawScriptFile = reader.ReadToEnd();
1112
1113                 strRawScriptFile = strRawScriptFile.Replace( Environment.NewLine, "\n" );
1114                 string[] delimiter = { "\n" };
1115                 string[] strSingleLine = strRawScriptFile.Split( delimiter, StringSplitOptions.RemoveEmptyEntries );
1116
1117                 for( int i = 0; i < strSingleLine.Length; i++ )
1118                 {
1119                     if( strSingleLine[ i ].StartsWith( "//" ) )
1120                         continue; //コメント行の場合は無視
1121
1122                     //まずSplit
1123                     string[] arScriptLine = strSingleLine[ i ].Split( ',' );
1124
1125                     if( ( arScriptLine.Length >= 4 && arScriptLine.Length <= 5 ) == false )
1126                         continue; //引数が4つか5つじゃなければ無視。
1127
1128                     if( arScriptLine[ 0 ] != "6" )
1129                         continue; //使用するシーンが違うなら無視。
1130
1131                     if( arScriptLine.Length == 4 )
1132                     {
1133                         if( String.Compare( arScriptLine[ 1 ], strラベル名, true ) != 0 )
1134                             continue; //ラベル名が違うなら無視。大文字小文字区別しない
1135                     }
1136                     else if( arScriptLine.Length == 5 )
1137                     {
1138                         if( arScriptLine[ 4 ] == "1" )
1139                         {
1140                             if( arScriptLine[ 1 ] != strラベル名 )
1141                                 continue; //ラベル名が違うなら無視。
1142                         }
1143                         else
1144                         {
1145                             if( String.Compare( arScriptLine[ 1 ], strラベル名, true ) != 0 )
1146                                 continue; //ラベル名が違うなら無視。大文字小文字区別しない
1147                         }
1148                     }
1149                     rect.X = Convert.ToInt32( arScriptLine[ 2 ] );
1150                     rect.Y = Convert.ToInt32( arScriptLine[ 3 ] );
1151
1152                     reader.Close();
1153                     break;
1154                 }
1155             }
1156
1157             return rect;
1158         }
1159
1160                 //-----------------
1161                 #endregion
1162         }
1163 }