{\r
internal class CStage演奏ドラム画面 : CStage\r
{\r
+#if DAMAGELEVELTUNING\r
+ // ----------------------------------\r
+ public float[,] gaugeDelta = {\r
+ { 0.003f, 0.005f },\r
+ { 0.001f, 0.002f },\r
+ { 0.000f, 0.000f },\r
+ { -0.025f, -0.020f },\r
+ { -0.050f, -0.030f }\r
+ };\r
+ public float[] damageLevelFactor = {\r
+ 0.5f, 1.0f, 1.5f\r
+ };\r
+ // ----------------------------------\r
+#endif \r
+ \r
// プロパティ\r
\r
public bool bAUTOでないチップが1つでもバーを通過した \r
private void t判定にあわせてゲージを増減する( E楽器パート part, E判定 e今回の判定 )\r
{\r
double num;\r
- switch( e今回の判定 )\r
+\r
+#if DAMAGELEVELTUNING\r
+ switch (e今回の判定)\r
+ {\r
+ case E判定.Perfect:\r
+ num = (part == E楽器パート.DRUMS) ? gaugeDelta[0, 0] : gaugeDelta[0, 1];\r
+ break;\r
+\r
+ case E判定.Great:\r
+ num = (part == E楽器パート.DRUMS) ? gaugeDelta[1, 0] : gaugeDelta[1, 1];\r
+ break;\r
+\r
+ case E判定.Good:\r
+ num = (part == E楽器パート.DRUMS) ? gaugeDelta[2, 0] : gaugeDelta[2, 1];\r
+ break;\r
+\r
+ case E判定.Poor:\r
+ num = (part == E楽器パート.DRUMS) ? gaugeDelta[3, 0] : gaugeDelta[3, 1];\r
+ break;\r
+\r
+ case E判定.Miss:\r
+ num = (part == E楽器パート.DRUMS) ? gaugeDelta[4, 0] : gaugeDelta[4, 1];\r
+ switch (CDTXMania.ConfigIni.eダメージレベル)\r
+ {\r
+ case Eダメージレベル.少ない:\r
+ num *= damageLevelFactor[0];\r
+ break;\r
+\r
+ case Eダメージレベル.普通:\r
+ num *= damageLevelFactor[1];\r
+ break;\r
+\r
+ case Eダメージレベル.大きい:\r
+ num *= damageLevelFactor[2];\r
+ break;\r
+ }\r
+ break;\r
+\r
+ default:\r
+ num = 0.0;\r
+ break;\r
+ }\r
+#else\r
+ switch (e今回の判定)\r
{\r
case E判定.Perfect:\r
num = ( part == E楽器パート.DRUMS ) ? 0.01 : 0.015;\r
num = 0.0;\r
break;\r
}\r
+#endif\r
this.actGauge.db現在のゲージ値 += num;\r
\r
if( this.actGauge.db現在のゲージ値 > 1.0 )\r
\r
// プロパティ\r
\r
+#if DAMAGELEVELTUNING\r
+ //----------------------------------------\r
+ public float[,] fGaugeFactor = new float[5,2];\r
+ public float[] fDamageLevelFactor = new float[3];\r
+ //----------------------------------------\r
+#endif\r
public int nBGAlpha;\r
public bool bAVI有効;\r
public bool bBGA有効;\r
\r
public CConfigIni()\r
{\r
+#if DAMAGELEVELTUNING\r
+ //----------------------------------------\r
+ this.fGaugeFactor[0,0] = 0.003f;\r
+ this.fGaugeFactor[0,1] = 0.005f;\r
+ this.fGaugeFactor[1,0] = 0.001f;\r
+ this.fGaugeFactor[1,1] = 0.002f;\r
+ this.fGaugeFactor[2,0] = 0.000f;\r
+ this.fGaugeFactor[2,1] = 0.000f;\r
+ this.fGaugeFactor[3,0] = -0.025f;\r
+ this.fGaugeFactor[3,1] = -0.020f;\r
+ this.fGaugeFactor[4,0] = -0.050f;\r
+ this.fGaugeFactor[4,1] = -0.030f;\r
+\r
+ this.fDamageLevelFactor[0] = 0.5f;\r
+ this.fDamageLevelFactor[1] = 1.0f;\r
+ this.fDamageLevelFactor[2] = 1.5f;\r
+ //----------------------------------------\r
+#endif\r
this.strDTXManiaのバージョン = "Unknown";\r
this.str曲データ検索パス = @".\";\r
this.b全画面モード = false;\r
sw.WriteLine( ";-------------------" );\r
sw.WriteLine( "[System]" );\r
sw.WriteLine();\r
+\r
+#if DAMAGELEVELTUNING\r
+ //------------------------------\r
+ sw.WriteLine("; ライフゲージのパラメータ調整(調整完了後削除予定)");\r
+ sw.WriteLine("; GaugeFactorD: ドラムのPerfect, Great,... の回復量(ライフMAXを1.0としたときの値を指定)");\r
+ sw.WriteLine("; GaugeFactorG: Gt/BsのPerfect, Great,... の回復量(ライフMAXを1.0としたときの値を指定)");\r
+ sw.WriteLine("; DamageFactorD: DamageLevelがSmall, Normal, Largeの時に対するダメージ係数");\r
+ sw.WriteLine("GaugeFactorD={0}, {1}, {2}, {3}, {4}", this.fGaugeFactor[0, 0], this.fGaugeFactor[1, 0], this.fGaugeFactor[2, 0], this.fGaugeFactor[3, 0], this.fGaugeFactor[4, 0]);\r
+ sw.WriteLine("GaugeFactorG={0}, {1}, {2}, {3}, {4}", this.fGaugeFactor[0, 1], this.fGaugeFactor[1, 1], this.fGaugeFactor[2, 1], this.fGaugeFactor[3, 1], this.fGaugeFactor[4, 1]);\r
+ sw.WriteLine("DamageFactor={0}, {1}, {2}", this.fDamageLevelFactor[0], this.fDamageLevelFactor[1], fDamageLevelFactor[2]);\r
+ sw.WriteLine();\r
+ //------------------------------\r
+#endif\r
+ \r
sw.WriteLine( "; リリースバージョン" );\r
sw.WriteLine( "Version={0}", CDTXMania.VERSION );\r
sw.WriteLine();\r
//-----------------------------\r
case Eセクション種別.System:\r
{\r
+#if DAMAGELEVELTUNING\r
+ //----------------------------------------\r
+ if (str3.Equals("GaugeFactorD"))\r
+ {\r
+ int p = 0;\r
+ string[] splittedFactor = str4.Split(',');\r
+ foreach (string s in splittedFactor) {\r
+ this.fGaugeFactor[p++, 0] = Convert.ToSingle(s);\r
+ }\r
+ } else\r
+ if (str3.Equals("GaugeFactorG"))\r
+ {\r
+ int p = 0;\r
+ string[] splittedFactor = str4.Split(',');\r
+ foreach (string s in splittedFactor)\r
+ {\r
+ this.fGaugeFactor[p++, 1] = Convert.ToSingle(s);\r
+ }\r
+ }\r
+ else\r
+ if (str3.Equals("DamageFactor"))\r
+ {\r
+ int p = 0;\r
+ string[] splittedFactor = str4.Split(',');\r
+ foreach (string s in splittedFactor)\r
+ {\r
+ this.fDamageLevelFactor[p++] = Convert.ToSingle(s);\r
+ }\r
+ }\r
+ else\r
+ //----------------------------------------\r
+#endif\r
if( str3.Equals( "Version" ) )\r
{\r
this.strDTXManiaのバージョン = str4;\r
{\r
Trace.TraceInformation( "----------------------" );\r
Trace.TraceInformation( "■ 演奏(ドラム画面)" );\r
+#if DAMAGELEVELTUNING\r
+for (int i = 0; i < 5; i++)\r
+{\r
+ for (int j = 0; j < 2; j++)\r
+ {\r
+ stage演奏ドラム画面.gaugeDelta[i, j] = ConfigIni.fGaugeFactor[i, j];\r
+ }\r
+}\r
+for (int i = 0; i < 3; i++) {\r
+ stage演奏ドラム画面.damageLevelFactor[i] = ConfigIni.fDamageLevelFactor[i];\r
+} \r
+#endif\r
r直前のステージ = r現在のステージ;\r
r現在のステージ = stage演奏ドラム画面;\r
}\r
base.IsFixedTimeStep = false;\r
base.Window.ClientSize = new Size(ConfigIni.nウインドウwidth, ConfigIni.nウインドウheight); // #23510 2010.10.31 yyagi: to recover window size. width and height are able to get from Config.ini.\r
base.InactiveSleepTime = TimeSpan.FromMilliseconds((float)(ConfigIni.n非フォーカス時スリープms)); // #23568 2010.11.3 yyagi: to support valiable sleep value when !IsActive\r
- // #23568 2010.11.4 ikanick changed ( 1 -> ConfigIni )\r
+ // #23568 2010.11.4 ikanick changed ( 1 -> ConfigIni )\r
//---------------------\r
#endregion\r
\r
this.t指定フォルダ内でのプラグイン検索と生成( dir + "\\", strプラグイン型名 );\r
}\r
//-----------------\r
- private void Window_MouseDoubleClick( object sender, MouseEventArgs e) // #23510 2010.11.04 yyagi: to reset window size to 640x480\r
+ private void Window_MouseDoubleClick( object sender, MouseEventArgs e) // #23510 2010.11.13 yyagi: to go full screen mode\r
{\r
- this.Window.ClientSize = new Size(640, 480);\r
+ ConfigIni.bウィンドウモード = false;\r
+ this.t全画面・ウィンドウモード切り替え();\r
}\r
#endregion\r
}\r
using System.Reflection;\r
using System.Security.Permissions;\r
using System.Windows.Forms;\r
+using System.Runtime.InteropServices;\r
using SampleFramework.Properties;\r
\r
namespace SampleFramework\r
/// </summary>\r
public event EventHandler SystemResume;\r
\r
- /// <summary>\r
+ /// <summary>\r
/// Occurs when a screen saver is about to be activated.\r
/// </summary>\r
public event CancelEventHandler Screensaver;\r
\r
- /// <summary>\r
+ /// <summary>\r
/// Gets a value indicating whether this instance is minimized.\r
/// </summary>\r
/// <value>\r
\r
// resume application processing\r
OnResume(EventArgs.Empty);\r
- }\r
-\r
- /// <summary>\r
+ }\r
+\r
+\r
+ #region #23510 2010.11.14 yyagi add: 縦横比固定でのウインドウサイズ変更 定数定義 from http://www.vcskicks.com/maintain-aspect-ratio.php\r
+ //double so division keeps decimal points\r
+ const double widthRatio = 640;\r
+ const double heightRatio = 480;\r
+\r
+ const int WM_SIZING = 0x214;\r
+ const int WMSZ_LEFT = 1;\r
+ const int WMSZ_RIGHT = 2;\r
+ const int WMSZ_TOP = 3;\r
+ const int WMSZ_BOTTOM = 6;\r
+\r
+ public struct RECT\r
+ {\r
+ public int Left;\r
+ public int Top;\r
+ public int Right;\r
+ public int Bottom;\r
+ }\r
+ #endregion\r
+\r
+ /// <summary>\r
/// Handles raw window messages.\r
/// </summary>\r
/// <param name="m">The raw message.</param>\r
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]\r
protected override void WndProc(ref Message m)\r
{\r
- if (m.Msg == WindowConstants.WM_SIZE)\r
+ if (m.Msg == WindowConstants.WM_SIZE)\r
{\r
if (m.WParam == WindowConstants.SIZE_MINIMIZED)\r
{\r
m.Result = IntPtr.Zero;\r
return;\r
}\r
- }\r
- }\r
-\r
- base.WndProc(ref m);\r
+ }\r
+ #region #23510 2010.11.13 yyagi: reset to 640x480\r
+ if ((m.WParam.ToInt32() & 0xFFFF) == MENU_VIEW) \r
+ {\r
+ base.ClientSize = new Size(640, 480);\r
+ }\r
+ #endregion\r
+ }\r
+\r
+ #region #23510 2010.11.14 yyagi add: 縦横比固定でのウインドウサイズ変更 from http://www.vcskicks.com/maintain-aspect-ratio.php\r
+ else if (m.Msg == WM_SIZING)\r
+ {\r
+ RECT rc = (RECT)Marshal.PtrToStructure(m.LParam, typeof(RECT));\r
+ int res = m.WParam.ToInt32();\r
+ if (res == WMSZ_LEFT || res == WMSZ_RIGHT)\r
+ {\r
+ //Left or right resize -> adjust height (bottom)\r
+ rc.Bottom = rc.Top + (int)(heightRatio * this.Width / widthRatio);\r
+ }\r
+ else if (res == WMSZ_TOP || res == WMSZ_BOTTOM)\r
+ {\r
+ //Up or down resize -> adjust width (right)\r
+ rc.Right = rc.Left + (int)(widthRatio * this.Height / heightRatio);\r
+ }\r
+ else if (res == WMSZ_RIGHT + WMSZ_BOTTOM)\r
+ {\r
+ //Lower-right corner resize -> adjust height (could have been width)\r
+ rc.Bottom = rc.Top + (int)(heightRatio * this.Width / widthRatio);\r
+ }\r
+ else if (res == WMSZ_LEFT + WMSZ_TOP)\r
+ {\r
+ //Upper-left corner -> adjust width (could have been height)\r
+ rc.Left = rc.Right - (int)(widthRatio * this.Height / heightRatio);\r
+ }\r
+ Marshal.StructureToPtr(rc, m.LParam, true);\r
+ }\r
+ #endregion\r
+\r
+\r
+ base.WndProc(ref m);\r
}\r
\r
void UpdateScreen()\r
static Icon GetDefaultIcon()\r
{\r
return (Icon)Resources.sdx_icon_black.Clone();\r
- }\r
- }\r
+ }\r
+\r
+ #region システムメニューに"640x480"を追加 #23510 2010.11.13 yyagi add: to set "640x480" menu in systemmenu. See also http://cs2ch.blog123.fc2.com/blog-entry-80.html\r
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]\r
+ private struct MENUITEMINFO\r
+ {\r
+ public uint cbSize;\r
+ public uint fMask;\r
+ public uint fType;\r
+ public uint fState;\r
+ public uint wID;\r
+ public IntPtr hSubMenu;\r
+ public IntPtr hbmpChecked;\r
+ public IntPtr hbmpUnchecked;\r
+ public IntPtr dwItemData;\r
+ public string dwTypeData;\r
+ public uint cch;\r
+ public IntPtr hbmpItem;\r
+ }\r
+\r
+ [DllImport("user32", ExactSpelling = true)]\r
+ private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);\r
+ [DllImport("user32", CharSet = CharSet.Auto)]\r
+ private static extern bool InsertMenuItem(IntPtr hMenu, uint uItem, bool fByPosition, ref MENUITEMINFO lpmii);\r
+\r
+ private const uint MENU_VIEW = 0x9999;\r
+ private const uint MFT_SEPARATOR = 0x00000800;\r
+ private const uint MIIM_FTYPE = 0x00000100;\r
+ private const uint MIIM_STRING = 0x00000040;\r
+ private const uint MIIM_ID = 0x00000002;\r
+\r
+ protected override void OnCreateControl()\r
+ {\r
+ base.OnCreateControl();\r
+\r
+ //システムメニューのハンドル取得 \r
+ IntPtr hSysMenu = GetSystemMenu(this.Handle, false);\r
+\r
+ //セパレーターの挿入 \r
+ MENUITEMINFO item1 = new MENUITEMINFO();\r
+ item1.cbSize = (uint)Marshal.SizeOf(item1);\r
+ item1.fMask = MIIM_FTYPE;\r
+ item1.fType = MFT_SEPARATOR;\r
+ InsertMenuItem(hSysMenu, 5, true, ref item1);\r
+\r
+ //メニュー項目の挿入 \r
+ MENUITEMINFO item2 = new MENUITEMINFO();\r
+ item2.cbSize = (uint)Marshal.SizeOf(item2);\r
+ item2.fMask = MIIM_STRING | MIIM_ID;\r
+ item2.wID = MENU_VIEW;\r
+ item2.dwTypeData = "&640x480";\r
+ InsertMenuItem(hSysMenu, 6, true, ref item2);\r
+ } \r
+ #endregion\r
+ }\r
}\r