• R/O
  • SSH
  • HTTPS

dtxmaniaxg-verk: 提交


Commit MetaInfo

修訂538 (tree)
時間2016-05-04 23:02:11
作者kairera0467

Log Message

#35905 難易度ラベルスクリプトの画像座標データを演奏画面のステータスパネルで使えるようにした。
#xxxxx 難易度ラベル読み込みメソッドの実行順を変更。

Change Summary

差異

--- trunk/DTXManiaプロジェクト/コード/ステージ/08.結果/CActResultParameterPanel.cs (revision 537)
+++ trunk/DTXManiaプロジェクト/コード/ステージ/08.結果/CActResultParameterPanel.cs (revision 538)
@@ -340,7 +340,7 @@
340340 this.txリザルトパネル.t2D描画(CDTXMania.app.Device, this.n本体X[i], this.n本体Y[i]);
341341
342342 if (this.txDifficulty != null)
343- this.txDifficulty.t2D描画(CDTXMania.app.Device, this.n本体X[i] + 510, this.n本体Y[i] + 8, new Rectangle(0, CDTXMania.nSongDifficulty * 20, this.txDifficulty.szテクスチャサイズ.Width, 20));
343+ this.txDifficulty.t2D描画(CDTXMania.app.Device, this.n本体X[i] + 510, this.n本体Y[i] + 8, new Rectangle(0, CDTXMania.nSongDifficulty * 20, 120, 20));
344344
345345 if (this.txPart != null)
346346 this.txPart.t2D描画(CDTXMania.app.Device, this.n本体X[i] + 388, this.n本体Y[i] + 8, new Rectangle(0, 0 + (20 * i), 120, 20));
@@ -499,6 +499,7 @@
499499 private CTexture txRisky;
500500 private CTexture txリザルトパネル;
501501 private CTexture[] tx文字;
502+ protected Rectangle rectDiffPanelPoint;
502503
503504
504505 private void t小文字表示(int x, int y, string str)
@@ -612,7 +613,61 @@
612613 }
613614 }
614615 }
616+ private void tスクリプトから難易度ラベルを取得する( string strラベル名 )
617+ {
618+ string strRawScriptFile;
615619
620+ //ファイルの存在チェック
621+ if( File.Exists( CSkin.Path( @"Script\difficult.dtxs" ) ) )
622+ {
623+ //スクリプトを開く
624+ StreamReader reader = new StreamReader( CSkin.Path( @"Script\difficult.dtxs" ), Encoding.GetEncoding( "Shift_JIS" ) );
625+ strRawScriptFile = reader.ReadToEnd();
626+
627+ strRawScriptFile = strRawScriptFile.Replace( Environment.NewLine, "\n" );
628+ string[] delimiter = { "\n" };
629+ string[] strSingleLine = strRawScriptFile.Split( delimiter, StringSplitOptions.RemoveEmptyEntries );
630+
631+ for( int i = 0; i < strSingleLine.Length; i++ )
632+ {
633+ if( strSingleLine[ i ].StartsWith( "//" ) )
634+ continue; //コメント行の場合は無視
635+
636+ //まずSplit
637+ string[] arScriptLine = strSingleLine[ i ].Split( ',' );
638+
639+ if( ( arScriptLine.Length >= 4 && arScriptLine.Length <= 5 ) == false )
640+ continue; //引数が4つか5つじゃなければ無視。
641+
642+ if( arScriptLine[ 0 ] != "8" )
643+ continue; //使用するシーンが違うなら無視。
644+
645+ if( arScriptLine.Length == 4 )
646+ {
647+ if( String.Compare( arScriptLine[ 1 ], strラベル名, true ) != 0 )
648+ continue; //ラベル名が違うなら無視。大文字小文字区別しない
649+ }
650+ else if( arScriptLine.Length == 5 )
651+ {
652+ if( arScriptLine[ 4 ] == "1" )
653+ {
654+ if( arScriptLine[ 1 ] != strラベル名 )
655+ continue; //ラベル名が違うなら無視。
656+ }
657+ else
658+ {
659+ if( String.Compare( arScriptLine[ 1 ], strラベル名, true ) != 0 )
660+ continue; //ラベル名が違うなら無視。大文字小文字区別しない
661+ }
662+ }
663+ this.rectDiffPanelPoint.X = Convert.ToInt32( arScriptLine[ 2 ] );
664+ this.rectDiffPanelPoint.Y = Convert.ToInt32( arScriptLine[ 3 ] );
665+
666+ reader.Close();
667+ break;
668+ }
669+ }
670+ }
616671 //-----------------
617672 #endregion
618673 }
--- trunk/DTXManiaプロジェクト/コード/ステージ/07.演奏/CAct演奏ステータスパネル共通.cs (revision 537)
+++ trunk/DTXManiaプロジェクト/コード/ステージ/07.演奏/CAct演奏ステータスパネル共通.cs (revision 538)
@@ -1,5 +1,6 @@
11 using System;
22 using System.Collections.Generic;
3+using System.IO;
34 using System.Text;
45 using System.Runtime.InteropServices;
56 using System.Drawing;
@@ -46,8 +47,9 @@
4647
4748
4849 // メソッド
49- public void tラベル名からステータスパネルを決定する(string strラベル名)
50+ public void tラベル名からステータスパネルを決定する( string strラベル名 )
5051 {
52+ this.tスクリプトから難易度ラベルを取得する( strラベル名 );
5153 if (string.IsNullOrEmpty(strラベル名))
5254 {
5355 this.nStatus = 0;
@@ -85,6 +87,70 @@
8587 base.On活性化();
8688 }
8789
90+ private void tスクリプトから難易度ラベルを取得する( string strラベル名 )
91+ {
92+ string strRawScriptFile;
93+
94+ //ファイルの存在チェック
95+ if( File.Exists( CSkin.Path( @"Script\difficult.dtxs" ) ) )
96+ {
97+ //スクリプトを開く
98+ StreamReader reader = new StreamReader( CSkin.Path( @"Script\difficult.dtxs" ), Encoding.GetEncoding( "Shift_JIS" ) );
99+ strRawScriptFile = reader.ReadToEnd();
100+
101+ strRawScriptFile = strRawScriptFile.Replace( Environment.NewLine, "\n" );
102+ string[] delimiter = { "\n" };
103+ string[] strSingleLine = strRawScriptFile.Split( delimiter, StringSplitOptions.RemoveEmptyEntries );
104+
105+ for( int i = 0; i < strSingleLine.Length; i++ )
106+ {
107+ if( strSingleLine[ i ].StartsWith( "//" ) )
108+ continue; //コメント行の場合は無視
109+
110+ //まずSplit
111+ string[] arScriptLine = strSingleLine[ i ].Split( ',' );
112+
113+ if( ( arScriptLine.Length >= 4 && arScriptLine.Length <= 5 ) == false )
114+ continue; //引数が4つか5つじゃなければ無視。
115+
116+ if( CDTXMania.ConfigIni.eNamePlate == Eタイプ.A )
117+ {
118+ if( arScriptLine[ 0 ] != "7" )
119+ continue; //使用するシーンが違うなら無視。
120+ }
121+ else if( CDTXMania.ConfigIni.eNamePlate == Eタイプ.B )
122+ {
123+ if( arScriptLine[ 0 ] != "71" )
124+ continue; //使用するシーンが違うなら無視。
125+ }
126+
127+ if( arScriptLine.Length == 4 )
128+ {
129+ if( String.Compare( arScriptLine[ 1 ], strラベル名, true ) != 0 )
130+ continue; //ラベル名が違うなら無視。大文字小文字区別しない
131+ }
132+ else if( arScriptLine.Length == 5 )
133+ {
134+ if( arScriptLine[ 4 ] == "1" )
135+ {
136+ if( arScriptLine[ 1 ] != strラベル名 )
137+ continue; //ラベル名が違うなら無視。
138+ }
139+ else
140+ {
141+ if( String.Compare( arScriptLine[ 1 ], strラベル名, true ) != 0 )
142+ continue; //ラベル名が違うなら無視。大文字小文字区別しない
143+ }
144+ }
145+ this.rectDiffPanelPoint.X = Convert.ToInt32( arScriptLine[ 2 ] );
146+ this.rectDiffPanelPoint.Y = Convert.ToInt32( arScriptLine[ 3 ] );
147+
148+ reader.Close();
149+ break;
150+ }
151+ }
152+ }
153+
88154 #region [ protected ]
89155 //-----------------
90156 [StructLayout(LayoutKind.Sequential)]
@@ -98,6 +164,7 @@
98164 public long n現在のスコアBass;
99165 public int nIndex;
100166 public int nStatus;
167+ protected Rectangle rectDiffPanelPoint;
101168 public STATUSPANEL[] stパネルマップ;
102169 //-----------------
103170 #endregion
--- trunk/DTXManiaプロジェクト/コード/ステージ/07.演奏/ギター画面/CAct演奏Guitarステータスパネル.cs (revision 537)
+++ trunk/DTXManiaプロジェクト/コード/ステージ/07.演奏/ギター画面/CAct演奏Guitarステータスパネル.cs (revision 538)
@@ -246,7 +246,7 @@
246246 if( CDTXMania.ConfigIni.eNamePlate == Eタイプ.A )
247247 {
248248 Rectangle Rect1 = new Rectangle( 7, 91, 234, 38 );
249- Rectangle RectDifficulty = new Rectangle( 0, 0 + ( this.nDifficulty * 38 ), 234, 38 );
249+ Rectangle RectDifficulty = new Rectangle( base.rectDiffPanelPoint.X, base.rectDiffPanelPoint.Y, 234, 38 );
250250
251251 this.bNamePlate = new Bitmap( 250, 266 );
252252 gNamePlate = Graphics.FromImage( this.bNamePlate );
@@ -269,7 +269,7 @@
269269 else if( CDTXMania.ConfigIni.eNamePlate == Eタイプ.B )
270270 {
271271 Rectangle Rect1 = new Rectangle( 6, 50, 234, 60 );
272- Rectangle RectDifficulty = new Rectangle( 0, 0 + ( this.nDifficulty * 60 ), 234, 60 );
272+ Rectangle RectDifficulty = new Rectangle( base.rectDiffPanelPoint.X, base.rectDiffPanelPoint.Y, 234, 60 );
273273
274274 this.bNamePlate = new Bitmap( 250, 297 );
275275 gNamePlate = Graphics.FromImage( this.bNamePlate );
--- trunk/DTXManiaプロジェクト/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsステータスパネル.cs (revision 537)
+++ trunk/DTXManiaプロジェクト/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsステータスパネル.cs (revision 538)
@@ -118,13 +118,13 @@
118118 if (CDTXMania.ConfigIni.eNamePlate == Eタイプ.A)
119119 {
120120 Rectangle Rect1 = new Rectangle(7, 167, 150, 38);
121- Rectangle Rect2 = new Rectangle(0, 0 + (this.nDifficulty * 38), 150, 38);
121+ Rectangle Rect2 = new Rectangle( base.rectDiffPanelPoint.X, base.rectDiffPanelPoint.Y, 150, 38 );
122122 gNamePlate.DrawImage(this.iDifficulty, Rect1, Rect2, GraphicsUnit.Pixel);
123123 }
124124 else if (CDTXMania.ConfigIni.eNamePlate == Eタイプ.B)
125125 {
126126 Rectangle Rect1 = new Rectangle(7, 138, 194, 60);
127- Rectangle Rect2 = new Rectangle(0, 0 + (this.nDifficulty * 60), 194, 60);
127+ Rectangle Rect2 = new Rectangle( base.rectDiffPanelPoint.X, base.rectDiffPanelPoint.Y, 194, 60 );
128128 gNamePlate.DrawImage(this.iDifficulty, Rect1, Rect2, GraphicsUnit.Pixel);
129129 if (this.iPart != null)
130130 {
--- trunk/DTXManiaプロジェクト/コード/ステージ/07.演奏/CStage演奏画面共通.cs (revision 537)
+++ trunk/DTXManiaプロジェクト/コード/ステージ/07.演奏/CStage演奏画面共通.cs (revision 538)
@@ -288,8 +288,8 @@
288288 }
289289
290290 this.bAUTOでないチップが1つでもバーを通過した = false;
291+ this.tステータスパネルの選択();
291292 base.On活性化();
292- this.tステータスパネルの選択();
293293 this.tパネル文字列の設定();
294294 this.nJudgeLinePosY.Drums = (CDTXMania.ConfigIni.bReverse.Drums ? 159 + CDTXMania.ConfigIni.nJudgeLine.Drums : 561 - CDTXMania.ConfigIni.nJudgeLine.Drums);
295295 this.nJudgeLinePosY.Guitar = (CDTXMania.ConfigIni.bReverse.Guitar ? 611 - CDTXMania.ConfigIni.nJudgeLine.Guitar : 154 + CDTXMania.ConfigIni.nJudgeLine.Guitar);
Show on old repository browser