mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
Merge pull request #6419 from Card-Forge/revert-6234-ok_shortcut
Revert "gui-desktop : add keyboard shortcut to press OK/Yes button"
This commit is contained in:
@@ -113,16 +113,6 @@ public class KeyboardShortcuts {
|
||||
}
|
||||
};
|
||||
|
||||
/** Press OK Button */
|
||||
final Action actPressButton = new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(final ActionEvent e) {
|
||||
if (!Singletons.getControl().getCurrentScreen().isMatchScreen()) { return; }
|
||||
if (matchUI == null) { return; }
|
||||
matchUI.getGameController().selectButtonOk();
|
||||
}
|
||||
};
|
||||
|
||||
/** Alpha Strike. */
|
||||
final Action actAllAttack = new AbstractAction() {
|
||||
@Override
|
||||
@@ -225,7 +215,6 @@ public class KeyboardShortcuts {
|
||||
list.add(new Shortcut(FPref.SHORTCUT_MACRO_RECORD, localizer.getMessage("lblSHORTCUT_MACRO_RECORD"), actMacroRecord, am, im));
|
||||
list.add(new Shortcut(FPref.SHORTCUT_MACRO_NEXT_ACTION, localizer.getMessage("lblSHORTCUT_MACRO_NEXT_ACTION"), actMacroNextAction, am, im));
|
||||
list.add(new Shortcut(FPref.SHORTCUT_CARD_ZOOM, localizer.getMessage("lblSHORTCUT_CARD_ZOOM"), actZoomCard, am, im));
|
||||
list.add(new Shortcut(FPref.SHORTCUT_PRESS_BUTTON, localizer.getMessage("lblSHORTCUT_PRESS_BUTTON"), actPressButton, am, im));
|
||||
return list;
|
||||
} // End initMatchShortcuts()
|
||||
|
||||
|
||||
@@ -40,8 +40,6 @@ import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.localinstance.properties.ForgePreferences;
|
||||
import forge.model.FModel;
|
||||
import forge.toolbox.FList;
|
||||
import forge.toolbox.FMouseAdapter;
|
||||
import forge.toolbox.FOptionPane;
|
||||
@@ -83,7 +81,6 @@ public class ListChooser<T> {
|
||||
// initialized before; listeners may be added to it
|
||||
private final FList<T> lstChoices;
|
||||
private final FOptionPane optionPane;
|
||||
private final int okShortCut = Integer.parseInt(FModel.getPreferences().getPref(ForgePreferences.FPref.SHORTCUT_PRESS_BUTTON));
|
||||
|
||||
public ListChooser(final String title, final int minChoices, final int maxChoices, final Collection<T> list, final Function<T, String> display) {
|
||||
FThreads.assertExecutedByEdt(true);
|
||||
@@ -131,8 +128,7 @@ public class ListChooser<T> {
|
||||
|
||||
this.lstChoices.addKeyListener(new KeyAdapter() {
|
||||
@Override public void keyPressed(final KeyEvent e) {
|
||||
int code = e.getKeyCode();
|
||||
if (KeyEvent.VK_ENTER == code || okShortCut == code) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||
ListChooser.this.commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,7 @@ import javax.swing.text.StyleConstants;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import forge.gui.FThreads;
|
||||
import forge.localinstance.properties.ForgePreferences;
|
||||
import forge.localinstance.skin.FSkinProp;
|
||||
import forge.model.FModel;
|
||||
import forge.toolbox.FSkin.SkinImage;
|
||||
import forge.util.Localizer;
|
||||
import forge.view.FDialog;
|
||||
@@ -182,7 +180,6 @@ public class FOptionPane extends FDialog {
|
||||
final int gapBottom = comp == null ? gapAboveButtons : padding;
|
||||
FLabel centeredLabel = null;
|
||||
FTextPane prompt = null;
|
||||
final int okShortCut = Integer.parseInt(FModel.getPreferences().getPref(ForgePreferences.FPref.SHORTCUT_PRESS_BUTTON));
|
||||
|
||||
if (icon != null) {
|
||||
if (icon.getWidth() < 100) {
|
||||
@@ -256,22 +253,28 @@ public class FOptionPane extends FDialog {
|
||||
btn.addKeyListener(new KeyAdapter() { //hook certain keys to move focus between buttons
|
||||
@Override
|
||||
public void keyPressed(final KeyEvent e) {
|
||||
int code = e.getKeyCode();
|
||||
if(okShortCut == code) {
|
||||
btn.doClick();
|
||||
}
|
||||
else if(KeyEvent.VK_LEFT == code && option > 0){
|
||||
switch (e.getKeyCode()) {
|
||||
case KeyEvent.VK_LEFT:
|
||||
if (option > 0) {
|
||||
buttons[option - 1].requestFocusInWindow();
|
||||
}
|
||||
else if( KeyEvent.VK_RIGHT == code && option < lastOption){
|
||||
break;
|
||||
case KeyEvent.VK_RIGHT:
|
||||
if (option < lastOption) {
|
||||
buttons[option + 1].requestFocusInWindow();
|
||||
}
|
||||
else if(KeyEvent.VK_HOME == code && option > 0) {
|
||||
break;
|
||||
case KeyEvent.VK_HOME:
|
||||
if (option > 0) {
|
||||
buttons[0].requestFocusInWindow();
|
||||
}
|
||||
else if(KeyEvent.VK_END == code && option < lastOption) {
|
||||
break;
|
||||
case KeyEvent.VK_END:
|
||||
if (option < lastOption) {
|
||||
buttons[lastOption].requestFocusInWindow();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (option == defaultOption) {
|
||||
|
||||
@@ -418,7 +418,6 @@ lblSHORTCUT_AUTOYIELD_ALWAYS_NO=Duel: Auto-Bestätigen von Fähigkeiten auf dem
|
||||
lblSHORTCUT_MACRO_RECORD=Duell: Aktion-Abfolge-Makro aufnehmen
|
||||
lblSHORTCUT_MACRO_NEXT_ACTION=Duel: führe nächste Aktion im gespeicherten Makro aus
|
||||
lblSHORTCUT_CARD_ZOOM=Duell: Zoome ausgewählte Karte
|
||||
lblSHORTCUT_PRESS_BUTTON=Duell: Drücken Sie die OK/Ja-Taste
|
||||
#VSubmenuDraft.java
|
||||
lblBoosterDraft=Booster-Draft
|
||||
lblHeaderBoosterDraft=Format: Booster-Draft
|
||||
|
||||
@@ -420,7 +420,6 @@ lblSHORTCUT_AUTOYIELD_ALWAYS_NO=Match: auto-yield ability on stack (Always No)
|
||||
lblSHORTCUT_MACRO_RECORD=Match: record a macro sequence of actions
|
||||
lblSHORTCUT_MACRO_NEXT_ACTION=Match: execute next action in a recorded macro
|
||||
lblSHORTCUT_CARD_ZOOM=Match: zoom the currently selected card
|
||||
lblSHORTCUT_PRESS_BUTTON=Match: Press OK/Yes button
|
||||
#VSubmenuDraft.java
|
||||
lblBoosterDraft=Booster Draft
|
||||
lblHeaderBoosterDraft=Sanctioned Format: Booster Draft
|
||||
|
||||
@@ -418,7 +418,6 @@ lblSHORTCUT_SHOWTARGETING=Partida: alternar la orientación visual de superposic
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_YES=Partida: ceder automáticamente en cada habilidad de la pila (Siempre Sí)
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_NO=Partida: ceder automáticamente en cada habilidad de la pila (Siempre No)
|
||||
lblSHORTCUT_MACRO_RECORD=Partida: Grabar una macro de secuencia de acciones
|
||||
lblSHORTCUT_PRESS_BUTTON=Partida: Presione el botón Aceptar/Sí
|
||||
lblSHORTCUT_MACRO_NEXT_ACTION=Partida: Ejecutar siguiente acción en una macro grabada
|
||||
lblSHORTCUT_CARD_ZOOM=Partida: hacer zoom en la carta seleccionada
|
||||
#VSubmenuDraft.java
|
||||
|
||||
@@ -416,7 +416,6 @@ lblSHORTCUT_SHOWTARGETING=Correspondance : basculer la superposition visuelle du
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_YES=Match : capacité de rendement automatique sur la pile (toujours oui)
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_NO=Match : capacité de rendement automatique sur la pile (toujours non)
|
||||
lblSHORTCUT_MACRO_RECORD=Match : enregistrer une macro séquence d''actions
|
||||
lblSHORTCUT_PRESS_BUTTON=Match: appuyez sur le bouton OK/Oui
|
||||
lblSHORTCUT_MACRO_NEXT_ACTION=Match : exécuter l''action suivante dans une macro enregistrée
|
||||
lblSHORTCUT_CARD_ZOOM=Match : zoomer la carte actuellement sélectionnée
|
||||
#VSubmenuDraft.java
|
||||
|
||||
@@ -415,7 +415,6 @@ lblSHORTCUT_SHOWTARGETING=Incontro: attiva / disattiva gli indicatori dei bersag
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_YES=Incontro: consenso automatico in pila: sempre Sì
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_NO=Incontro: consenso automatico in pila: sempre No
|
||||
lblSHORTCUT_MACRO_RECORD=Incontro: registra una macro (sequenza di azioni)
|
||||
lblSHORTCUT_PRESS_BUTTON=Incontro: premere il pulsante OK/Sì
|
||||
lblSHORTCUT_MACRO_NEXT_ACTION=Incontro: esegue l''azione successiva in una macro registrata
|
||||
lblSHORTCUT_CARD_ZOOM=Incontro: ingrandisce la carta attualmente selezionata
|
||||
#VSubmenuDraft.java
|
||||
|
||||
@@ -416,7 +416,6 @@ lblSHORTCUT_SHOWTARGETING=ビジュアルオーバーレイのターゲットを
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_YES=スタック解決時、優先権の自動放棄(常にはい)
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_NO=スタック解決時、優先権の自動放棄(常にいいえ)
|
||||
lblSHORTCUT_MACRO_RECORD=アクションのマクロシーケンスを記録します
|
||||
lblSHORTCUT_PRESS_BUTTON=はいボタンを押してください
|
||||
lblSHORTCUT_MACRO_NEXT_ACTION=記録されたマクロで次のアクションを実行します
|
||||
lblSHORTCUT_CARD_ZOOM=現在選択されているカードをズームします
|
||||
#VSubmenuDraft.java
|
||||
|
||||
@@ -428,7 +428,6 @@ lblSHORTCUT_SHOWTARGETING=Partida\: mudar a indicação visual do alvo
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_YES=Partida\: resolver automático a pilha (Sempre Sim)
|
||||
lblSHORTCUT_AUTOYIELD_ALWAYS_NO=Partida\: resolver automático a pilha (Sempre Não)
|
||||
lblSHORTCUT_MACRO_RECORD=Partida\: grave uma sequência macro das ações
|
||||
lblSHORTCUT_PRESS_BUTTON=Partida\: pressione o bot<6F>o OK/Sim
|
||||
lblSHORTCUT_MACRO_NEXT_ACTION=Partida\: execute a próxima ação em uma macro gravada
|
||||
lblSHORTCUT_CARD_ZOOM=Partida\: amplie a carta selecionada atual
|
||||
#VSubmenuDraft.java
|
||||
|
||||
@@ -420,7 +420,6 @@ lblSHORTCUT_AUTOYIELD_ALWAYS_NO=匹配:自动让过堆叠中的异能(所有
|
||||
lblSHORTCUT_MACRO_RECORD=匹配:记录操作宏的动作序列
|
||||
lblSHORTCUT_MACRO_NEXT_ACTION=匹配:在录制的宏中执行下一个操作
|
||||
lblSHORTCUT_CARD_ZOOM=匹配:缩放当前选定的图片
|
||||
lblSHORTCUT_PRESS_BUTTON=按“是”按钮
|
||||
#VSubmenuDraft.java
|
||||
lblBoosterDraft=轮抓
|
||||
lblHeaderBoosterDraft=游戏模式:轮抓
|
||||
|
||||
@@ -283,8 +283,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
|
||||
SHORTCUT_AUTOYIELD_ALWAYS_NO ("78"),
|
||||
SHORTCUT_MACRO_RECORD ("16 82"),
|
||||
SHORTCUT_MACRO_NEXT_ACTION ("16 50"),
|
||||
SHORTCUT_CARD_ZOOM("90"),
|
||||
SHORTCUT_PRESS_BUTTON("32");
|
||||
SHORTCUT_CARD_ZOOM("90");
|
||||
|
||||
private final String strDefaultVal;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user