Input: Improved UI to let users know when conflicting key bindings exist, etc.

This commit is contained in:
Souryo 2017-05-02 23:16:26 -04:00
parent 562f3be5d3
commit f5806ed5bb
10 changed files with 300 additions and 86 deletions

View File

@ -196,6 +196,8 @@
<Control ID="chkDisplayPort4">Jugador 4</Control>
<Control ID="lblDisplayPosition">Posición de pantalla:</Control>
<Control ID="chkDisplayInputHorizontally">Mostrar horizontalmente</Control>
<Control ID="lblKeyBinding">Warning: Your current configuration contains conflicting key bindings - some physical buttons on your keyword or gamepad are mapped to multiple buttons on the NES controller. If this is not intentional, please review and correct your key bindings.</Control>
</Form>
<Form ID="frmControllerConfig" Title="Configuración de controles">
<Control ID="lblTurboSpeed">Velocidad de modo turbo:</Control>
@ -220,6 +222,7 @@
<Control ID="mnuSnes30Layout1">Mando #1</Control>
<Control ID="mnuSnes30Layout2">Mando #2</Control>
<Control ID="tpgSet4">Mapeado #4</Control>
<Control ID="lblHint">Tabs with an icon contain key bindings for this player.&#13;&#10;Each button can be mapped to up to 4 different keyboard keys or gamepad buttons.</Control>
<Control ID="btnReset">Reiniciar</Control>
<Control ID="btnClear">Deshacer controles</Control>
<Control ID="btnOK">OK</Control>

View File

@ -196,6 +196,8 @@
<Control ID="chkDisplayPort4">Joueur 4</Control>
<Control ID="lblDisplayPosition">Position d'affichage :</Control>
<Control ID="chkDisplayInputHorizontally">Afficher horizontalement</Control>
<Control ID="lblKeyBinding">Attention: Votre configuration actuel contient des conflicts - certaines touches sur votre clavier ou manetter sont mappées à plusieurs boutons sur la console. Veuillez réviser votre configuration et la corriger au besoin.</Control>
</Form>
<Form ID="frmControllerConfig" Title="Configuration de la manette">
<Control ID="lblTurboSpeed">Vitesse du mode turbo:</Control>
@ -222,6 +224,8 @@
<Control ID="mnuSnes30Layout1">Manette #1</Control>
<Control ID="mnuSnes30Layout2">Manette #2</Control>
<Control ID="lblHint">Les tabs sans icône sont vides.&#13;&#10;Chaque bouton peut être mappé à 4 boutons différents sur votre clavier et/ou votre manette.</Control>
<Control ID="btnClear">Effacer le mappage</Control>
<Control ID="btnOK">OK</Control>
<Control ID="btnCancel">Annuler</Control>

View File

@ -196,6 +196,8 @@
<Control ID="chkDisplayPort4">プレーヤー4</Control>
<Control ID="lblDisplayPosition">表示位置:</Control>
<Control ID="chkDisplayInputHorizontally">水平表示</Control>
<Control ID="lblKeyBinding">注意: 使っている設定の中には同じキーが複数のボタン―にマッピングされています。 間違いでこの設定にした場合は、設定を確認して直してください。</Control>
</Form>
<Form ID="frmControllerConfig" Title="コントローラ設定">
<Control ID="lblTurboSpeed">ターボの速度:</Control>
@ -222,6 +224,8 @@
<Control ID="mnuSnes30Layout1">コントローラ1</Control>
<Control ID="mnuSnes30Layout2">コントローラ2</Control>
<Control ID="lblHint">アイコンの付いてあるタブにはマッピングが設定されています。&#13;&#10;コントローラのボタンはキーボードのキーとゲームパッドのボタンを同時にマッピング出来ます。</Control>
<Control ID="btnClear">キーセットを削除</Control>
<Control ID="btnOK">OK</Control>
<Control ID="btnCancel">キャンセル</Control>

View File

@ -196,6 +196,8 @@
<Control ID="chkDisplayPort4">Jogador 4</Control>
<Control ID="lblDisplayPosition">Posição da tela</Control>
<Control ID="chkDisplayInputHorizontally">Mostrar horizontalmente</Control>
<Control ID="lblKeyBinding">Warning: Your current configuration contains conflicting key bindings - some physical buttons on your keyword or gamepad are mapped to multiple buttons on the NES controller. If this is not intentional, please review and correct your key bindings.</Control>
</Form>
<Form ID="frmControllerConfig" Title="Configuração de controles">
<Control ID="lblTurboSpeed">Velocidade de modo turbo:</Control>
@ -220,6 +222,7 @@
<Control ID="mnuSnes30Layout1">Layout #1</Control>
<Control ID="mnuSnes30Layout2">Layout #2</Control>
<Control ID="tpgSet4">Mapeado #4</Control>
<Control ID="lblHint">Tabs with an icon contain key bindings for this player.&#13;&#10;Each button can be mapped to up to 4 different keyboard keys or gamepad buttons.</Control>
<Control ID="btnReset">Reiniciar</Control>
<Control ID="btnClear">Desfazer controles</Control>
<Control ID="btnOK">OK</Control>

View File

@ -196,6 +196,8 @@
<Control ID="chkDisplayPort4">Порт 4</Control>
<Control ID="lblDisplayPosition">Позиция :</Control>
<Control ID="chkDisplayInputHorizontally">Отображать горизонтально</Control>
<Control ID="lblKeyBinding">Warning: Your current configuration contains conflicting key bindings - some physical buttons on your keyword or gamepad are mapped to multiple buttons on the NES controller. If this is not intentional, please review and correct your key bindings.</Control>
</Form>
<Form ID="frmControllerConfig" Title="Настройки контроллера">
<Control ID="lblTurboSpeed">Скорость турбо-кнопок:</Control>
@ -222,6 +224,8 @@
<Control ID="mnuSnes30Layout1">Контроллер #1</Control>
<Control ID="mnuSnes30Layout2">Контроллер #2</Control>
<Control ID="lblHint">Tabs with an icon contain key bindings for this player.&#13;&#10;Each button can be mapped to up to 4 different keyboard keys or gamepad buttons.</Control>
<Control ID="btnClear">Очистить</Control>
<Control ID="btnOK">OK</Control>
<Control ID="btnCancel">Отмена</Control>

View File

@ -196,6 +196,8 @@
<Control ID="chkDisplayPort4">Порт 4</Control>
<Control ID="lblDisplayPosition">Позиція :</Control>
<Control ID="chkDisplayInputHorizontally">Відображати горизонтально</Control>
<Control ID="lblKeyBinding">Warning: Your current configuration contains conflicting key bindings - some physical buttons on your keyword or gamepad are mapped to multiple buttons on the NES controller. If this is not intentional, please review and correct your key bindings.</Control>
</Form>
<Form ID="frmControllerConfig" Title="Налаштування контролера">
<Control ID="lblTurboSpeed">Швидкість турбо-кнопок:</Control>
@ -222,6 +224,8 @@
<Control ID="mnuSnes30Layout1">Контролер #1</Control>
<Control ID="mnuSnes30Layout2">Контролер #2</Control>
<Control ID="lblHint">Tabs with an icon contain key bindings for this player.&#13;&#10;Each button can be mapped to up to 4 different keyboard keys or gamepad buttons.</Control>
<Control ID="btnClear">Очистити</Control>
<Control ID="btnOK">OK</Control>
<Control ID="btnCancel">Відміна</Control>

View File

@ -64,6 +64,10 @@
this.mnuSnes30Controller = new System.Windows.Forms.ToolStripMenuItem();
this.mnuSnes30Layout1 = new System.Windows.Forms.ToolStripMenuItem();
this.mnuSnes30Layout2 = new System.Windows.Forms.ToolStripMenuItem();
this.pnlHint = new System.Windows.Forms.Panel();
this.flpHint = new System.Windows.Forms.FlowLayoutPanel();
this.picHint = new System.Windows.Forms.PictureBox();
this.lblHint = new System.Windows.Forms.Label();
this.baseConfigPanel.SuspendLayout();
this.tabMain.SuspendLayout();
this.tpgSet1.SuspendLayout();
@ -75,12 +79,15 @@
((System.ComponentModel.ISupportInitialize)(this.trkTurboSpeed)).BeginInit();
this.panel1.SuspendLayout();
this.mnuStripPreset.SuspendLayout();
this.pnlHint.SuspendLayout();
this.flpHint.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picHint)).BeginInit();
this.SuspendLayout();
//
// baseConfigPanel
//
this.baseConfigPanel.Controls.Add(this.flowLayoutPanel2);
this.baseConfigPanel.Location = new System.Drawing.Point(0, 288);
this.baseConfigPanel.Location = new System.Drawing.Point(0, 324);
this.baseConfigPanel.Size = new System.Drawing.Size(599, 29);
this.baseConfigPanel.Controls.SetChildIndex(this.flowLayoutPanel2, 0);
//
@ -90,7 +97,7 @@
this.ctrlStandardController0.Location = new System.Drawing.Point(0, 0);
this.ctrlStandardController0.Margin = new System.Windows.Forms.Padding(0);
this.ctrlStandardController0.Name = "ctrlStandardController0";
this.ctrlStandardController0.Size = new System.Drawing.Size(585, 208);
this.ctrlStandardController0.Size = new System.Drawing.Size(585, 197);
this.ctrlStandardController0.TabIndex = 0;
this.ctrlStandardController0.OnChange += new System.EventHandler(this.ctrlStandardController_OnChange);
//
@ -103,10 +110,10 @@
this.tabMain.Controls.Add(this.tpgSet4);
this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabMain.ImageList = this.imageList;
this.tabMain.Location = new System.Drawing.Point(3, 3);
this.tabMain.Location = new System.Drawing.Point(3, 38);
this.tabMain.Name = "tabMain";
this.tabMain.SelectedIndex = 0;
this.tabMain.Size = new System.Drawing.Size(593, 235);
this.tabMain.Size = new System.Drawing.Size(593, 236);
this.tabMain.TabIndex = 3;
//
// tpgSet1
@ -114,7 +121,7 @@
this.tpgSet1.Controls.Add(this.ctrlStandardController0);
this.tpgSet1.Location = new System.Drawing.Point(4, 23);
this.tpgSet1.Name = "tpgSet1";
this.tpgSet1.Size = new System.Drawing.Size(585, 208);
this.tpgSet1.Size = new System.Drawing.Size(585, 197);
this.tpgSet1.TabIndex = 0;
this.tpgSet1.Text = "Key Set #1";
this.tpgSet1.UseVisualStyleBackColor = true;
@ -164,7 +171,7 @@
this.tpgSet4.Controls.Add(this.ctrlStandardController3);
this.tpgSet4.Location = new System.Drawing.Point(4, 23);
this.tpgSet4.Name = "tpgSet4";
this.tpgSet4.Size = new System.Drawing.Size(585, 208);
this.tpgSet4.Size = new System.Drawing.Size(585, 209);
this.tpgSet4.TabIndex = 3;
this.tpgSet4.Text = "Key Set #4";
this.tpgSet4.UseVisualStyleBackColor = true;
@ -175,7 +182,7 @@
this.ctrlStandardController3.Location = new System.Drawing.Point(0, 0);
this.ctrlStandardController3.Margin = new System.Windows.Forms.Padding(0);
this.ctrlStandardController3.Name = "ctrlStandardController3";
this.ctrlStandardController3.Size = new System.Drawing.Size(585, 208);
this.ctrlStandardController3.Size = new System.Drawing.Size(585, 209);
this.ctrlStandardController3.TabIndex = 1;
this.ctrlStandardController3.OnChange += new System.EventHandler(this.ctrlStandardController_OnChange);
//
@ -213,20 +220,22 @@
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.Controls.Add(this.btnSelectPreset, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.trkTurboSpeed, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.lblTurboSpeed, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.panel1, 2, 2);
this.tableLayoutPanel1.Controls.Add(this.tabMain, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.btnSelectPreset, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.trkTurboSpeed, 2, 2);
this.tableLayoutPanel1.Controls.Add(this.lblTurboSpeed, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.panel1, 2, 3);
this.tableLayoutPanel1.Controls.Add(this.tabMain, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.pnlHint, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 3;
this.tableLayoutPanel1.RowCount = 4;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(599, 288);
this.tableLayoutPanel1.Size = new System.Drawing.Size(599, 324);
this.tableLayoutPanel1.TabIndex = 23;
//
// btnSelectPreset
@ -234,7 +243,7 @@
this.btnSelectPreset.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.btnSelectPreset.AutoSize = true;
this.btnSelectPreset.Image = ((System.Drawing.Image)(resources.GetObject("btnSelectPreset.Image")));
this.btnSelectPreset.Location = new System.Drawing.Point(3, 245);
this.btnSelectPreset.Location = new System.Drawing.Point(3, 281);
this.btnSelectPreset.Name = "btnSelectPreset";
this.btnSelectPreset.Size = new System.Drawing.Size(105, 23);
this.btnSelectPreset.TabIndex = 4;
@ -246,7 +255,7 @@
// trkTurboSpeed
//
this.trkTurboSpeed.LargeChange = 2;
this.trkTurboSpeed.Location = new System.Drawing.Point(479, 244);
this.trkTurboSpeed.Location = new System.Drawing.Point(479, 280);
this.trkTurboSpeed.Maximum = 3;
this.trkTurboSpeed.Name = "trkTurboSpeed";
this.trkTurboSpeed.Size = new System.Drawing.Size(117, 26);
@ -256,7 +265,7 @@
//
this.lblTurboSpeed.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblTurboSpeed.AutoSize = true;
this.lblTurboSpeed.Location = new System.Drawing.Point(401, 250);
this.lblTurboSpeed.Location = new System.Drawing.Point(401, 286);
this.lblTurboSpeed.Name = "lblTurboSpeed";
this.lblTurboSpeed.Size = new System.Drawing.Size(72, 13);
this.lblTurboSpeed.TabIndex = 1;
@ -266,7 +275,7 @@
//
this.panel1.Controls.Add(this.lblTurboFast);
this.panel1.Controls.Add(this.lblSlow);
this.panel1.Location = new System.Drawing.Point(476, 273);
this.panel1.Location = new System.Drawing.Point(476, 309);
this.panel1.Margin = new System.Windows.Forms.Padding(0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(120, 15);
@ -300,7 +309,7 @@
this.mnuPs4Controller,
this.mnuSnes30Controller});
this.mnuStripPreset.Name = "mnuStripPreset";
this.mnuStripPreset.Size = new System.Drawing.Size(170, 120);
this.mnuStripPreset.Size = new System.Drawing.Size(170, 98);
//
// mnuKeyboard
//
@ -381,14 +390,14 @@
// mnuPs4Layout1
//
this.mnuPs4Layout1.Name = "mnuPs4Layout1";
this.mnuPs4Layout1.Size = new System.Drawing.Size(152, 22);
this.mnuPs4Layout1.Size = new System.Drawing.Size(143, 22);
this.mnuPs4Layout1.Text = "Controller #1";
this.mnuPs4Layout1.Click += new System.EventHandler(this.mnuPs4Layout1_Click);
//
// mnuPs4Layout2
//
this.mnuPs4Layout2.Name = "mnuPs4Layout2";
this.mnuPs4Layout2.Size = new System.Drawing.Size(152, 22);
this.mnuPs4Layout2.Size = new System.Drawing.Size(143, 22);
this.mnuPs4Layout2.Text = "Controller #2";
this.mnuPs4Layout2.Click += new System.EventHandler(this.mnuPs4Layout2_Click);
//
@ -404,22 +413,65 @@
// mnuSnes30Layout1
//
this.mnuSnes30Layout1.Name = "mnuSnes30Layout1";
this.mnuSnes30Layout1.Size = new System.Drawing.Size(152, 22);
this.mnuSnes30Layout1.Size = new System.Drawing.Size(143, 22);
this.mnuSnes30Layout1.Text = "Controller #1";
this.mnuSnes30Layout1.Click += new System.EventHandler(this.mnuSnes30Layout1_Click);
//
// mnuSnes30Layout2
//
this.mnuSnes30Layout2.Name = "mnuSnes30Layout2";
this.mnuSnes30Layout2.Size = new System.Drawing.Size(152, 22);
this.mnuSnes30Layout2.Size = new System.Drawing.Size(143, 22);
this.mnuSnes30Layout2.Text = "Controller #2";
this.mnuSnes30Layout2.Click += new System.EventHandler(this.mnuSnes30Layout2_Click);
//
// pnlHint
//
this.pnlHint.BackColor = System.Drawing.Color.WhiteSmoke;
this.pnlHint.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tableLayoutPanel1.SetColumnSpan(this.pnlHint, 3);
this.pnlHint.Controls.Add(this.flpHint);
this.pnlHint.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlHint.Location = new System.Drawing.Point(3, 3);
this.pnlHint.Name = "pnlHint";
this.pnlHint.Size = new System.Drawing.Size(593, 29);
this.pnlHint.TabIndex = 5;
//
// flpHint
//
this.flpHint.Controls.Add(this.picHint);
this.flpHint.Controls.Add(this.lblHint);
this.flpHint.Dock = System.Windows.Forms.DockStyle.Fill;
this.flpHint.Location = new System.Drawing.Point(0, 0);
this.flpHint.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.flpHint.Name = "flpHint";
this.flpHint.Size = new System.Drawing.Size(591, 27);
this.flpHint.TabIndex = 0;
//
// picHint
//
this.picHint.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.picHint.Image = global::Mesen.GUI.Properties.Resources.Help;
this.picHint.Location = new System.Drawing.Point(3, 5);
this.picHint.Name = "picHint";
this.picHint.Size = new System.Drawing.Size(16, 16);
this.picHint.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.picHint.TabIndex = 0;
this.picHint.TabStop = false;
//
// lblHint
//
this.lblHint.Location = new System.Drawing.Point(25, 0);
this.lblHint.Name = "lblHint";
this.lblHint.Size = new System.Drawing.Size(520, 27);
this.lblHint.TabIndex = 1;
this.lblHint.Text = "Tabs with an icon contain key bindings for this player.\r\nEach button can be mappe" +
"d to up to 4 different keyboard keys or gamepad buttons.";
//
// frmControllerConfig
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(599, 317);
this.ClientSize = new System.Drawing.Size(599, 353);
this.Controls.Add(this.tableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "frmControllerConfig";
@ -440,6 +492,10 @@
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.mnuStripPreset.ResumeLayout(false);
this.pnlHint.ResumeLayout(false);
this.flpHint.ResumeLayout(false);
this.flpHint.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picHint)).EndInit();
this.ResumeLayout(false);
}
@ -481,5 +537,9 @@
private System.Windows.Forms.ToolStripMenuItem mnuSnes30Layout1;
private System.Windows.Forms.ToolStripMenuItem mnuSnes30Layout2;
private System.Windows.Forms.ImageList imageList;
private System.Windows.Forms.Panel pnlHint;
private System.Windows.Forms.FlowLayoutPanel flpHint;
private System.Windows.Forms.PictureBox picHint;
private System.Windows.Forms.Label lblHint;
}
}

View File

@ -15,7 +15,7 @@ namespace Mesen.GUI.Forms.Config
{
private KeyPresets _presets = new KeyPresets();
public frmControllerConfig(ControllerInfo controllerInfo)
public frmControllerConfig(ControllerInfo controllerInfo, int portNumber)
{
InitializeComponent();
@ -28,6 +28,8 @@ namespace Mesen.GUI.Forms.Config
ctrlStandardController3.Initialize(controllerInfo.Keys[3]);
ResourceHelper.ApplyResources(this, mnuStripPreset);
this.Text += ": " + ResourceHelper.GetMessage("PlayerNumber", (portNumber + 1).ToString());
}
private ctrlStandardController GetControllerControl()

View File

@ -48,6 +48,10 @@
this.cboExpansionPort = new System.Windows.Forms.ComboBox();
this.chkFourScore = new System.Windows.Forms.CheckBox();
this.chkAutoConfigureInput = new System.Windows.Forms.CheckBox();
this.pnlConflictWarning = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.picWarning = new System.Windows.Forms.PictureBox();
this.lblKeyBinding = new System.Windows.Forms.Label();
this.tpgAdvanced = new System.Windows.Forms.TabPage();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.grpDisplayInput = new System.Windows.Forms.GroupBox();
@ -64,6 +68,9 @@
this.tabMain.SuspendLayout();
this.tpgControllers.SuspendLayout();
this.tlpControllers.SuspendLayout();
this.pnlConflictWarning.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picWarning)).BeginInit();
this.tpgAdvanced.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.grpDisplayInput.SuspendLayout();
@ -74,7 +81,7 @@
//
// baseConfigPanel
//
this.baseConfigPanel.Location = new System.Drawing.Point(0, 251);
this.baseConfigPanel.Location = new System.Drawing.Point(0, 308);
this.baseConfigPanel.Size = new System.Drawing.Size(370, 29);
//
// tabMain
@ -85,7 +92,7 @@
this.tabMain.Location = new System.Drawing.Point(0, 0);
this.tabMain.Name = "tabMain";
this.tabMain.SelectedIndex = 0;
this.tabMain.Size = new System.Drawing.Size(370, 251);
this.tabMain.Size = new System.Drawing.Size(370, 308);
this.tabMain.TabIndex = 11;
//
// tpgControllers
@ -93,7 +100,7 @@
this.tpgControllers.Controls.Add(this.tlpControllers);
this.tpgControllers.Location = new System.Drawing.Point(4, 22);
this.tpgControllers.Name = "tpgControllers";
this.tpgControllers.Size = new System.Drawing.Size(362, 225);
this.tpgControllers.Size = new System.Drawing.Size(362, 282);
this.tpgControllers.TabIndex = 0;
this.tpgControllers.Text = "Controllers";
this.tpgControllers.UseVisualStyleBackColor = true;
@ -104,29 +111,31 @@
this.tlpControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tlpControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tlpControllers.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tlpControllers.Controls.Add(this.btnSetupP4, 2, 7);
this.tlpControllers.Controls.Add(this.btnSetupP3, 2, 6);
this.tlpControllers.Controls.Add(this.lblPlayer1, 0, 2);
this.tlpControllers.Controls.Add(this.lblPlayer2, 0, 3);
this.tlpControllers.Controls.Add(this.cboPlayer4, 1, 7);
this.tlpControllers.Controls.Add(this.cboPlayer3, 1, 6);
this.tlpControllers.Controls.Add(this.cboPlayer1, 1, 2);
this.tlpControllers.Controls.Add(this.lblPlayer4, 0, 7);
this.tlpControllers.Controls.Add(this.cboPlayer2, 1, 3);
this.tlpControllers.Controls.Add(this.lblPlayer3, 0, 6);
this.tlpControllers.Controls.Add(this.btnSetupP1, 2, 2);
this.tlpControllers.Controls.Add(this.btnSetupP2, 2, 3);
this.tlpControllers.Controls.Add(this.lblNesType, 0, 0);
this.tlpControllers.Controls.Add(this.cboConsoleType, 1, 0);
this.tlpControllers.Controls.Add(this.lblExpansionPort, 0, 5);
this.tlpControllers.Controls.Add(this.cboExpansionPort, 1, 5);
this.tlpControllers.Controls.Add(this.chkFourScore, 0, 4);
this.tlpControllers.Controls.Add(this.chkAutoConfigureInput, 0, 1);
this.tlpControllers.Controls.Add(this.btnSetupP4, 2, 8);
this.tlpControllers.Controls.Add(this.btnSetupP3, 2, 7);
this.tlpControllers.Controls.Add(this.lblPlayer1, 0, 3);
this.tlpControllers.Controls.Add(this.lblPlayer2, 0, 4);
this.tlpControllers.Controls.Add(this.cboPlayer4, 1, 8);
this.tlpControllers.Controls.Add(this.cboPlayer3, 1, 7);
this.tlpControllers.Controls.Add(this.cboPlayer1, 1, 3);
this.tlpControllers.Controls.Add(this.lblPlayer4, 0, 8);
this.tlpControllers.Controls.Add(this.cboPlayer2, 1, 4);
this.tlpControllers.Controls.Add(this.lblPlayer3, 0, 7);
this.tlpControllers.Controls.Add(this.btnSetupP1, 2, 3);
this.tlpControllers.Controls.Add(this.btnSetupP2, 2, 4);
this.tlpControllers.Controls.Add(this.lblNesType, 0, 1);
this.tlpControllers.Controls.Add(this.cboConsoleType, 1, 1);
this.tlpControllers.Controls.Add(this.lblExpansionPort, 0, 6);
this.tlpControllers.Controls.Add(this.cboExpansionPort, 1, 6);
this.tlpControllers.Controls.Add(this.chkFourScore, 0, 5);
this.tlpControllers.Controls.Add(this.chkAutoConfigureInput, 0, 2);
this.tlpControllers.Controls.Add(this.pnlConflictWarning, 0, 0);
this.tlpControllers.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpControllers.Location = new System.Drawing.Point(0, 0);
this.tlpControllers.Name = "tlpControllers";
this.tlpControllers.RowCount = 10;
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle());
@ -134,30 +143,31 @@
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tlpControllers.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tlpControllers.Size = new System.Drawing.Size(362, 225);
this.tlpControllers.Size = new System.Drawing.Size(362, 282);
this.tlpControllers.TabIndex = 0;
//
// btnSetupP4
//
this.btnSetupP4.AutoSize = true;
this.btnSetupP4.Location = new System.Drawing.Point(297, 192);
this.btnSetupP4.Location = new System.Drawing.Point(297, 253);
this.btnSetupP4.Name = "btnSetupP4";
this.btnSetupP4.Size = new System.Drawing.Size(62, 23);
this.btnSetupP4.TabIndex = 12;
this.btnSetupP4.Text = "Setup";
this.btnSetupP4.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.btnSetupP4.UseVisualStyleBackColor = true;
this.btnSetupP4.Click += new System.EventHandler(this.btnSetup_Click);
//
// btnSetupP3
//
this.btnSetupP3.AutoSize = true;
this.btnSetupP3.Location = new System.Drawing.Point(297, 163);
this.btnSetupP3.Location = new System.Drawing.Point(297, 224);
this.btnSetupP3.Name = "btnSetupP3";
this.btnSetupP3.Size = new System.Drawing.Size(62, 23);
this.btnSetupP3.TabIndex = 11;
this.btnSetupP3.Text = "Setup";
this.btnSetupP3.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.btnSetupP3.UseVisualStyleBackColor = true;
this.btnSetupP3.Click += new System.EventHandler(this.btnSetup_Click);
//
@ -165,7 +175,7 @@
//
this.lblPlayer1.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblPlayer1.AutoSize = true;
this.lblPlayer1.Location = new System.Drawing.Point(3, 60);
this.lblPlayer1.Location = new System.Drawing.Point(3, 121);
this.lblPlayer1.Name = "lblPlayer1";
this.lblPlayer1.Size = new System.Drawing.Size(48, 13);
this.lblPlayer1.TabIndex = 0;
@ -175,7 +185,7 @@
//
this.lblPlayer2.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblPlayer2.AutoSize = true;
this.lblPlayer2.Location = new System.Drawing.Point(3, 89);
this.lblPlayer2.Location = new System.Drawing.Point(3, 150);
this.lblPlayer2.Name = "lblPlayer2";
this.lblPlayer2.Size = new System.Drawing.Size(48, 13);
this.lblPlayer2.TabIndex = 1;
@ -186,7 +196,7 @@
this.cboPlayer4.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboPlayer4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboPlayer4.FormattingEnabled = true;
this.cboPlayer4.Location = new System.Drawing.Point(90, 192);
this.cboPlayer4.Location = new System.Drawing.Point(90, 253);
this.cboPlayer4.Name = "cboPlayer4";
this.cboPlayer4.Size = new System.Drawing.Size(201, 21);
this.cboPlayer4.TabIndex = 8;
@ -197,7 +207,7 @@
this.cboPlayer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboPlayer3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboPlayer3.FormattingEnabled = true;
this.cboPlayer3.Location = new System.Drawing.Point(90, 163);
this.cboPlayer3.Location = new System.Drawing.Point(90, 224);
this.cboPlayer3.Name = "cboPlayer3";
this.cboPlayer3.Size = new System.Drawing.Size(201, 21);
this.cboPlayer3.TabIndex = 7;
@ -208,7 +218,7 @@
this.cboPlayer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboPlayer1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboPlayer1.FormattingEnabled = true;
this.cboPlayer1.Location = new System.Drawing.Point(90, 55);
this.cboPlayer1.Location = new System.Drawing.Point(90, 116);
this.cboPlayer1.Name = "cboPlayer1";
this.cboPlayer1.Size = new System.Drawing.Size(201, 21);
this.cboPlayer1.TabIndex = 4;
@ -218,7 +228,7 @@
//
this.lblPlayer4.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblPlayer4.AutoSize = true;
this.lblPlayer4.Location = new System.Drawing.Point(3, 197);
this.lblPlayer4.Location = new System.Drawing.Point(3, 258);
this.lblPlayer4.Name = "lblPlayer4";
this.lblPlayer4.Size = new System.Drawing.Size(48, 13);
this.lblPlayer4.TabIndex = 3;
@ -229,7 +239,7 @@
this.cboPlayer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboPlayer2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboPlayer2.FormattingEnabled = true;
this.cboPlayer2.Location = new System.Drawing.Point(90, 84);
this.cboPlayer2.Location = new System.Drawing.Point(90, 145);
this.cboPlayer2.Name = "cboPlayer2";
this.cboPlayer2.Size = new System.Drawing.Size(201, 21);
this.cboPlayer2.TabIndex = 6;
@ -239,7 +249,7 @@
//
this.lblPlayer3.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblPlayer3.AutoSize = true;
this.lblPlayer3.Location = new System.Drawing.Point(3, 168);
this.lblPlayer3.Location = new System.Drawing.Point(3, 229);
this.lblPlayer3.Name = "lblPlayer3";
this.lblPlayer3.Size = new System.Drawing.Size(48, 13);
this.lblPlayer3.TabIndex = 2;
@ -248,22 +258,24 @@
// btnSetupP1
//
this.btnSetupP1.AutoSize = true;
this.btnSetupP1.Location = new System.Drawing.Point(297, 55);
this.btnSetupP1.Location = new System.Drawing.Point(297, 116);
this.btnSetupP1.Name = "btnSetupP1";
this.btnSetupP1.Size = new System.Drawing.Size(62, 23);
this.btnSetupP1.TabIndex = 9;
this.btnSetupP1.Text = "Setup";
this.btnSetupP1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.btnSetupP1.UseVisualStyleBackColor = true;
this.btnSetupP1.Click += new System.EventHandler(this.btnSetup_Click);
//
// btnSetupP2
//
this.btnSetupP2.AutoSize = true;
this.btnSetupP2.Location = new System.Drawing.Point(297, 84);
this.btnSetupP2.Location = new System.Drawing.Point(297, 145);
this.btnSetupP2.Name = "btnSetupP2";
this.btnSetupP2.Size = new System.Drawing.Size(62, 23);
this.btnSetupP2.TabIndex = 10;
this.btnSetupP2.Text = "Setup";
this.btnSetupP2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
this.btnSetupP2.UseVisualStyleBackColor = true;
this.btnSetupP2.Click += new System.EventHandler(this.btnSetup_Click);
//
@ -271,7 +283,7 @@
//
this.lblNesType.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblNesType.AutoSize = true;
this.lblNesType.Location = new System.Drawing.Point(3, 7);
this.lblNesType.Location = new System.Drawing.Point(3, 68);
this.lblNesType.Name = "lblNesType";
this.lblNesType.Size = new System.Drawing.Size(75, 13);
this.lblNesType.TabIndex = 13;
@ -284,7 +296,7 @@
this.cboConsoleType.Items.AddRange(new object[] {
"NES",
"Famicom"});
this.cboConsoleType.Location = new System.Drawing.Point(90, 3);
this.cboConsoleType.Location = new System.Drawing.Point(90, 64);
this.cboConsoleType.Name = "cboConsoleType";
this.cboConsoleType.Size = new System.Drawing.Size(109, 21);
this.cboConsoleType.TabIndex = 14;
@ -294,7 +306,7 @@
//
this.lblExpansionPort.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblExpansionPort.AutoSize = true;
this.lblExpansionPort.Location = new System.Drawing.Point(3, 140);
this.lblExpansionPort.Location = new System.Drawing.Point(3, 201);
this.lblExpansionPort.Name = "lblExpansionPort";
this.lblExpansionPort.Size = new System.Drawing.Size(81, 13);
this.lblExpansionPort.TabIndex = 16;
@ -305,7 +317,7 @@
this.cboExpansionPort.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboExpansionPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboExpansionPort.FormattingEnabled = true;
this.cboExpansionPort.Location = new System.Drawing.Point(90, 136);
this.cboExpansionPort.Location = new System.Drawing.Point(90, 197);
this.cboExpansionPort.Name = "cboExpansionPort";
this.cboExpansionPort.Size = new System.Drawing.Size(201, 21);
this.cboExpansionPort.TabIndex = 17;
@ -316,7 +328,7 @@
this.chkFourScore.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.chkFourScore.AutoSize = true;
this.tlpControllers.SetColumnSpan(this.chkFourScore, 2);
this.chkFourScore.Location = new System.Drawing.Point(3, 113);
this.chkFourScore.Location = new System.Drawing.Point(3, 174);
this.chkFourScore.Name = "chkFourScore";
this.chkFourScore.Size = new System.Drawing.Size(151, 17);
this.chkFourScore.TabIndex = 15;
@ -328,19 +340,67 @@
//
this.chkAutoConfigureInput.AutoSize = true;
this.tlpControllers.SetColumnSpan(this.chkAutoConfigureInput, 3);
this.chkAutoConfigureInput.Location = new System.Drawing.Point(3, 30);
this.chkAutoConfigureInput.Location = new System.Drawing.Point(3, 91);
this.chkAutoConfigureInput.Name = "chkAutoConfigureInput";
this.chkAutoConfigureInput.Size = new System.Drawing.Size(290, 17);
this.chkAutoConfigureInput.TabIndex = 18;
this.chkAutoConfigureInput.Text = "Automatically configure controllers when loading a game";
this.chkAutoConfigureInput.UseVisualStyleBackColor = true;
//
// pnlConflictWarning
//
this.pnlConflictWarning.BackColor = System.Drawing.Color.WhiteSmoke;
this.pnlConflictWarning.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tlpControllers.SetColumnSpan(this.pnlConflictWarning, 3);
this.pnlConflictWarning.Controls.Add(this.tableLayoutPanel1);
this.pnlConflictWarning.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlConflictWarning.Location = new System.Drawing.Point(3, 3);
this.pnlConflictWarning.Name = "pnlConflictWarning";
this.pnlConflictWarning.Size = new System.Drawing.Size(356, 55);
this.pnlConflictWarning.TabIndex = 19;
this.pnlConflictWarning.Visible = false;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.picWarning, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.lblKeyBinding, 1, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 1;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(354, 53);
this.tableLayoutPanel1.TabIndex = 0;
//
// picWarning
//
this.picWarning.Anchor = System.Windows.Forms.AnchorStyles.None;
this.picWarning.Image = global::Mesen.GUI.Properties.Resources.Warning;
this.picWarning.Location = new System.Drawing.Point(3, 18);
this.picWarning.Name = "picWarning";
this.picWarning.Size = new System.Drawing.Size(16, 16);
this.picWarning.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.picWarning.TabIndex = 0;
this.picWarning.TabStop = false;
//
// lblKeyBinding
//
this.lblKeyBinding.AutoSize = true;
this.lblKeyBinding.Location = new System.Drawing.Point(25, 0);
this.lblKeyBinding.Name = "lblKeyBinding";
this.lblKeyBinding.Size = new System.Drawing.Size(320, 52);
this.lblKeyBinding.TabIndex = 1;
this.lblKeyBinding.Text = "Warning: Your current configuration contains conflicting key bindings - some physical buttons on your keyword or gamepad are mapped to multiple buttons on the NES controller. If this is not intentional, please review and correct your key bindings.";
//
// tpgAdvanced
//
this.tpgAdvanced.Controls.Add(this.tableLayoutPanel2);
this.tpgAdvanced.Location = new System.Drawing.Point(4, 22);
this.tpgAdvanced.Name = "tpgAdvanced";
this.tpgAdvanced.Size = new System.Drawing.Size(362, 225);
this.tpgAdvanced.Size = new System.Drawing.Size(362, 282);
this.tpgAdvanced.TabIndex = 5;
this.tpgAdvanced.Text = "Advanced";
this.tpgAdvanced.UseVisualStyleBackColor = true;
@ -356,7 +416,7 @@
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(362, 225);
this.tableLayoutPanel2.Size = new System.Drawing.Size(362, 282);
this.tableLayoutPanel2.TabIndex = 0;
//
// grpDisplayInput
@ -485,7 +545,8 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(370, 280);
this.AutoSize = true;
this.ClientSize = new System.Drawing.Size(370, 337);
this.Controls.Add(this.tabMain);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
@ -499,6 +560,10 @@
this.tpgControllers.ResumeLayout(false);
this.tlpControllers.ResumeLayout(false);
this.tlpControllers.PerformLayout();
this.pnlConflictWarning.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picWarning)).EndInit();
this.tpgAdvanced.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.grpDisplayInput.ResumeLayout(false);
@ -548,5 +613,9 @@
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3;
private System.Windows.Forms.Label lblDisplayPosition;
private System.Windows.Forms.ComboBox cboDisplayInputPosition;
private System.Windows.Forms.Panel pnlConflictWarning;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label lblKeyBinding;
private System.Windows.Forms.PictureBox picWarning;
}
}

View File

@ -41,6 +41,8 @@ namespace Mesen.GUI.Forms.Config
AddBinding("DisplayInputPort4", chkDisplayPort4);
AddBinding("DisplayInputPosition", cboDisplayInputPosition);
AddBinding("DisplayInputHorizontally", chkDisplayInputHorizontally);
UpdateConflictWarning();
}
protected override void OnFormClosed(FormClosedEventArgs e)
@ -124,13 +126,23 @@ namespace Mesen.GUI.Forms.Config
chkAutoConfigureInput.Enabled = false;
chkAutoConfigureInput.Checked = false;
}
UpdateConflictWarning();
}
}
private bool FourScoreAttached
{
get
{
bool isNes = ((InputInfo)Entity).ConsoleType == ConsoleType.Nes;
return (isNes && chkFourScore.Checked) || (!isNes && ((InputInfo)Entity).ExpansionPortDevice == InteropEmu.ExpansionPortDevice.FourPlayerAdapter);
}
}
private void UpdatePlayer3And4Visibility()
{
bool isNes = ((InputInfo)Entity).ConsoleType == ConsoleType.Nes;
bool visible = (isNes && chkFourScore.Checked) || (!isNes && ((InputInfo)Entity).ExpansionPortDevice == InteropEmu.ExpansionPortDevice.FourPlayerAdapter);
bool visible = this.FourScoreAttached;
lblPlayer3.Visible = visible;
lblPlayer4.Visible = visible;
@ -176,6 +188,7 @@ namespace Mesen.GUI.Forms.Config
} else if(sender == cboPlayer4) {
btnSetupP4.Enabled = enableButton;
}
UpdateConflictWarning();
}
private void btnSetup_Click(object sender, EventArgs e)
@ -190,26 +203,74 @@ namespace Mesen.GUI.Forms.Config
} else if(sender == btnSetupP4) {
index = 3;
}
var frm = new frmControllerConfig(ConfigManager.Config.InputInfo.Controllers[index]);
Button btn = (Button)sender;
Point point = btn.PointToScreen(new Point(0, btn.Height));
Rectangle screen = Screen.FromControl(btn).Bounds;
using(var frm = new frmControllerConfig(ConfigManager.Config.InputInfo.Controllers[index], index)) {
Button btn = (Button)sender;
Point point = btn.PointToScreen(new Point(0, btn.Height));
Rectangle screen = Screen.FromControl(btn).Bounds;
if(frm.Height + point.Y > screen.Bottom) {
//Show on top instead
point.Y -= btn.Height + frm.Height;
if(frm.Height + point.Y > screen.Bottom) {
//Show on top instead
point.Y -= btn.Height + frm.Height;
}
if(frm.Width + point.X > screen.Right) {
//Show on left instead
point.X -= frm.Width - btn.Width;
}
frm.StartPosition = FormStartPosition.Manual;
frm.Top = point.Y;
frm.Left = point.X;
if(frm.ShowDialog(this) == DialogResult.OK) {
UpdateConflictWarning();
}
}
}
private void UpdateConflictWarning()
{
bool needWarning = false;
bool[] portConflicts = new bool[4];
Dictionary<uint, int> mappedKeys = new Dictionary<uint, int>();
Action<int, uint> countMapping = (int port, uint keyCode) => {
if(keyCode > 0) {
if(mappedKeys.ContainsKey(keyCode)) {
needWarning = true;
portConflicts[port] = true;
portConflicts[mappedKeys[keyCode]] = true;
} else {
mappedKeys.Add(keyCode, port);
}
}
};
for(int i = 0; i < 4; i++) {
if(i < 2 || this.FourScoreAttached && ((i == 2 && btnSetupP3.Enabled) || (i == 3 && btnSetupP4.Enabled))) {
foreach(KeyMappings mappings in ConfigManager.Config.InputInfo.Controllers[i].Keys) {
countMapping(i, mappings.A);
countMapping(i, mappings.B);
countMapping(i, mappings.Select);
countMapping(i, mappings.Start);
countMapping(i, mappings.TurboA);
countMapping(i, mappings.TurboB);
countMapping(i, mappings.TurboSelect);
countMapping(i, mappings.TurboStart);
countMapping(i, mappings.Up);
countMapping(i, mappings.Down);
countMapping(i, mappings.Left);
countMapping(i, mappings.Right);
}
}
}
if(frm.Width + point.X > screen.Right) {
//Show on left instead
point.X -= frm.Width - btn.Width;
}
pnlConflictWarning.Visible = needWarning;
btnSetupP1.Image = portConflicts[0] ? Properties.Resources.Warning : null;
btnSetupP2.Image = portConflicts[1] ? Properties.Resources.Warning : null;
btnSetupP3.Image = portConflicts[2] ? Properties.Resources.Warning : null;
btnSetupP4.Image = portConflicts[3] ? Properties.Resources.Warning : null;
frm.StartPosition = FormStartPosition.Manual;
frm.Top = point.Y;
frm.Left = point.X;
frm.ShowDialog(this);
this.Height = needWarning ? 360 : 310;
}
}
}