mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Add reset keys to default button
This commit is contained in:
parent
4c292466c1
commit
0428f5bab3
2 changed files with 88 additions and 46 deletions
|
@ -5888,6 +5888,12 @@
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="bttnResetControls" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="labelCancel" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="labelCancel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="labelNextTurn" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="labelNextTurn" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
@ -5913,6 +5919,8 @@
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="controlsDescriptionLabel" pref="498" max="32767" attributes="0"/>
|
<Component id="controlsDescriptionLabel" pref="498" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
@ -5970,7 +5978,9 @@
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="bttnResetControls" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
|
@ -6099,6 +6109,14 @@
|
||||||
<Property name="verticalAlignment" type="int" value="1"/>
|
<Property name="verticalAlignment" type="int" value="1"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="bttnResetControls">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Reset to default"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bttnResetControlsActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
|
|
|
@ -574,6 +574,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
keyConfirm = new KeyBindButton(this, KEY_CONTROL_CONFIRM);
|
keyConfirm = new KeyBindButton(this, KEY_CONTROL_CONFIRM);
|
||||||
labelConfirm = new javax.swing.JLabel();
|
labelConfirm = new javax.swing.JLabel();
|
||||||
controlsDescriptionLabel = new javax.swing.JLabel();
|
controlsDescriptionLabel = new javax.swing.JLabel();
|
||||||
|
bttnResetControls = new javax.swing.JButton();
|
||||||
saveButton = new javax.swing.JButton();
|
saveButton = new javax.swing.JButton();
|
||||||
exitButton = new javax.swing.JButton();
|
exitButton = new javax.swing.JButton();
|
||||||
|
|
||||||
|
@ -2515,12 +2516,24 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
controlsDescriptionLabel.setText("<html>Click on a button and press a key to change a keybind.<br>Space and ESC are not available, and will set the keybind to nothing.<br>If you are currently playing a game, the changes will not take effect until you start a new game.");
|
controlsDescriptionLabel.setText("<html>Click on a button and press a key to change a keybind.<br>Space and ESC are not available, and will set the keybind to nothing.<br>If you are currently playing a game, the changes will not take effect until you start a new game.");
|
||||||
controlsDescriptionLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
|
controlsDescriptionLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
|
||||||
|
|
||||||
|
bttnResetControls.setText("Reset to default");
|
||||||
|
bttnResetControls.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
bttnResetControlsActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
org.jdesktop.layout.GroupLayout tabControlsLayout = new org.jdesktop.layout.GroupLayout(tabControls);
|
org.jdesktop.layout.GroupLayout tabControlsLayout = new org.jdesktop.layout.GroupLayout(tabControls);
|
||||||
tabControls.setLayout(tabControlsLayout);
|
tabControls.setLayout(tabControlsLayout);
|
||||||
tabControlsLayout.setHorizontalGroup(
|
tabControlsLayout.setHorizontalGroup(
|
||||||
tabControlsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
tabControlsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||||
.add(tabControlsLayout.createSequentialGroup()
|
.add(tabControlsLayout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
|
.add(tabControlsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||||
|
.add(tabControlsLayout.createSequentialGroup()
|
||||||
|
.add(bttnResetControls)
|
||||||
|
.add(0, 0, Short.MAX_VALUE))
|
||||||
|
.add(tabControlsLayout.createSequentialGroup()
|
||||||
.add(tabControlsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
.add(tabControlsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
|
||||||
.add(labelCancel)
|
.add(labelCancel)
|
||||||
.add(labelNextTurn)
|
.add(labelNextTurn)
|
||||||
|
@ -2543,7 +2556,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
.add(keySkipStep, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
.add(keySkipStep, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
|
||||||
.add(keyEndStep, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
.add(keyEndStep, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
|
||||||
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
|
||||||
.add(controlsDescriptionLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 498, Short.MAX_VALUE)
|
.add(controlsDescriptionLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 498, Short.MAX_VALUE)))
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
tabControlsLayout.setVerticalGroup(
|
tabControlsLayout.setVerticalGroup(
|
||||||
|
@ -2588,6 +2601,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
.add(tabControlsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
.add(tabControlsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
|
||||||
.add(labelPriorEnd)
|
.add(labelPriorEnd)
|
||||||
.add(keyPriorEnd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
|
.add(keyPriorEnd, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
|
||||||
|
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
|
||||||
|
.add(bttnResetControls)
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -3081,6 +3096,14 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
// TODO add your handling code here:
|
// TODO add your handling code here:
|
||||||
}//GEN-LAST:event_cbCardRenderHideSetSymbolActionPerformed
|
}//GEN-LAST:event_cbCardRenderHideSetSymbolActionPerformed
|
||||||
|
|
||||||
|
private void bttnResetControlsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bttnResetControlsActionPerformed
|
||||||
|
getKeybindButtons().stream().forEach((bttn) -> {
|
||||||
|
String id = bttn.getKey();
|
||||||
|
int keyCode = getDefaultControlKey(id);
|
||||||
|
bttn.setKeyCode(keyCode);
|
||||||
|
});
|
||||||
|
}//GEN-LAST:event_bttnResetControlsActionPerformed
|
||||||
|
|
||||||
private void showProxySettings() {
|
private void showProxySettings() {
|
||||||
Connection.ProxyType proxyType = (Connection.ProxyType) cbProxyType.getSelectedItem();
|
Connection.ProxyType proxyType = (Connection.ProxyType) cbProxyType.getSelectedItem();
|
||||||
switch (proxyType) {
|
switch (proxyType) {
|
||||||
|
@ -3713,6 +3736,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
private javax.swing.JButton btnBrowseBackgroundImage;
|
private javax.swing.JButton btnBrowseBackgroundImage;
|
||||||
private javax.swing.JButton btnBrowseBattlefieldImage;
|
private javax.swing.JButton btnBrowseBattlefieldImage;
|
||||||
private javax.swing.JButton btnBrowseImageLocation;
|
private javax.swing.JButton btnBrowseImageLocation;
|
||||||
|
private javax.swing.JButton bttnResetControls;
|
||||||
private javax.swing.JCheckBox cbAllowRequestToShowHandCards;
|
private javax.swing.JCheckBox cbAllowRequestToShowHandCards;
|
||||||
private javax.swing.JCheckBox cbAskMoveToGraveOrder;
|
private javax.swing.JCheckBox cbAskMoveToGraveOrder;
|
||||||
private javax.swing.JCheckBox cbAutoOrderTrigger;
|
private javax.swing.JCheckBox cbAutoOrderTrigger;
|
||||||
|
|
Loading…
Reference in a new issue