forked from External/mage
This commit is contained in:
parent
818a9442a9
commit
ee75192f0a
5 changed files with 83 additions and 12 deletions
|
|
@ -21,6 +21,26 @@ public final class Constants {
|
|||
}
|
||||
|
||||
public static final ImmutableList<Pair<String, String[]>> foulMagicsSets = ImmutableList.of(
|
||||
new Pair<String, String[]>("Set 2.5 - Ravnica Cultural Exchange", new String[] {
|
||||
"* March of the Machine Block",
|
||||
"* Phyrexia: All Will Be One Block",
|
||||
"* The Brothers' War Block",
|
||||
"* Dominaria United Block",
|
||||
"* Kamigawa: Neon Dynasty Block",
|
||||
"* Theros Beyond Death Block",
|
||||
"* Strixhaven: School of Mages Block",
|
||||
"* The Lost Caverns of Ixalan Block",
|
||||
"* Ikoria: Lair of Behemoths Block",
|
||||
"* Adventures in the Forgotten Realms Block",
|
||||
"Modern Horizons 3",
|
||||
"The Lord of the Rings: Tales of Middle-earth",
|
||||
"Double Masters 2022",
|
||||
"Rise of the Eldrazi",
|
||||
"Modern Horizons 2",
|
||||
"* Foundations Block",
|
||||
"* Guilds of Ravnica Block",
|
||||
"* Return to Ravnica Block",
|
||||
}),
|
||||
new Pair<String, String[]>("Set 2 - Phyrexians, Eldrazi, Asians - Oh my!", new String[] {
|
||||
"* March of the Machine Block",
|
||||
"* Phyrexia: All Will Be One Block",
|
||||
|
|
|
|||
|
|
@ -1332,6 +1332,11 @@
|
|||
<Property name="text" type="java.lang.String" value="set to default"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="cbVerticalLayout">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Vertical Layout (Experimental)"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="panelSizeDetailedSettings">
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static final String KEY_GAME_USE_PROFANITY_FILTER = "gameUseProfanityFilter";
|
||||
|
||||
// size settings
|
||||
public static final String KEY_GUI_VERTICAL_LAYOUT = "guiVerticalLayoyut";
|
||||
|
||||
|
||||
public static final String KEY_GUI_CARD_BATTLEFIELD_SIZE = "guiCardBattlefieldSize";
|
||||
public static final String KEY_GUI_CARD_HAND_SIZE = "guiCardHandSize";
|
||||
public static final String KEY_GUI_CARD_EDITOR_SIZE = "guiCardEditorSize";
|
||||
|
|
@ -866,6 +869,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
buttonSizeDefault4 = new javax.swing.JButton();
|
||||
buttonSizeDefault5 = new javax.swing.JButton();
|
||||
buttonSizeDefault6 = new javax.swing.JButton();
|
||||
cbVerticalLayout = new javax.swing.JCheckBox();
|
||||
panelSizeDetailedSettings = new javax.swing.JPanel();
|
||||
labelSizeGroup1 = new javax.swing.JLabel();
|
||||
panelSize1 = new javax.swing.JPanel();
|
||||
|
|
@ -1736,6 +1740,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
buttonSizeDefault6.setText("set to default");
|
||||
panelSizeDefaultSettings.add(buttonSizeDefault6);
|
||||
|
||||
cbVerticalLayout.setText("Vertical Layout (Experimental)");
|
||||
panelSizeDetailedSettings.add(cbVerticalLayout);
|
||||
|
||||
panelSizeDetailedSettings.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Detailed settings"));
|
||||
panelSizeDetailedSettings.setLayout(new java.awt.GridLayout(16, 1));
|
||||
|
||||
|
|
@ -2991,6 +2998,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
prefs.putInt(paramName, paramValue);
|
||||
updateCache(paramName, Integer.toString(paramValue));
|
||||
}
|
||||
// Hopefully this works
|
||||
save(prefs, dialog.cbVerticalLayout, KEY_GUI_VERTICAL_LAYOUT, "true", "false");
|
||||
|
||||
saveGUISize(false, false);
|
||||
|
||||
|
|
@ -3417,6 +3426,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
load(prefs, dialog.cbLimitedDeckAutoSave, KEY_LIMITED_DECK_AUTO_SAVE, "true");
|
||||
load(prefs, dialog.cbGameJsonLogAutoSave, KEY_JSON_GAME_LOG_AUTO_SAVE, "true", "false");
|
||||
|
||||
load(prefs, dialog.cbVerticalLayout, KEY_GUI_VERTICAL_LAYOUT, "true", "false");
|
||||
|
||||
String autoTargetParam;
|
||||
try {
|
||||
autoTargetParam = MageFrame.getPreferences().get(KEY_AUTO_TARGET_LEVEL, "1");
|
||||
|
|
@ -4073,6 +4084,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JCheckBox cbUseDefaultImageFolder;
|
||||
private javax.swing.JCheckBox cbUseRandomBattleImage;
|
||||
private javax.swing.JCheckBox cbUseSameSettingsForReplacementEffect;
|
||||
private javax.swing.JCheckBox cbVerticalLayout;
|
||||
private javax.swing.JCheckBox checkBoxBeforeCOthers;
|
||||
private javax.swing.JCheckBox checkBoxBeforeCYou;
|
||||
private javax.swing.JCheckBox checkBoxDrawOthers;
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
// do not save splitters in intermediate state, e.g. connection to new server with active game
|
||||
private boolean isSplittersFullyRestored = false;
|
||||
|
||||
private boolean vertical = false;
|
||||
|
||||
public static class MageSplitter {
|
||||
JSplitPane splitPane;
|
||||
double defaultProportion;
|
||||
|
|
@ -228,6 +230,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
public GamePanel() {
|
||||
this.vertical = PreferencesDialog.getCachedValue(KEY_GUI_VERTICAL_LAYOUT, "false").equals("true");
|
||||
initComponents = true;
|
||||
initComponents();
|
||||
|
||||
|
|
@ -259,9 +262,16 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
pnlCommandsSkipAndStack.add(pnlShortCuts, BorderLayout.NORTH);
|
||||
pnlCommandsSkipAndStack.add(stackObjects, BorderLayout.CENTER);
|
||||
// ... split: feedback + hand <|> skip + stack
|
||||
if (vertical) {
|
||||
splitHandAndStack.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||||
splitHandAndStack.setBottomComponent(pnlCommandsFeedbackAndHand);
|
||||
splitHandAndStack.setTopComponent(pnlCommandsSkipAndStack);
|
||||
splitHandAndStack.setResizeWeight(DIVIDER_KEEP_RIGHT_COMPONENT);
|
||||
} else {
|
||||
splitHandAndStack.setLeftComponent(pnlCommandsFeedbackAndHand);
|
||||
splitHandAndStack.setRightComponent(pnlCommandsSkipAndStack);
|
||||
splitHandAndStack.setResizeWeight(DIVIDER_KEEP_RIGHT_COMPONENT);
|
||||
}
|
||||
pnlCommandsFeedbackAndHand.setMinimumSize(new Dimension(0, 0)); // allow any sizes for hand
|
||||
pnlCommandsSkipAndStack.setMinimumSize(new Dimension(0, 0)); // allow any sizes for stack
|
||||
// ... all
|
||||
|
|
@ -302,7 +312,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
final JLayeredPane jLayeredBackgroundPane = new JLayeredPane();
|
||||
jLayeredBackgroundPane.setSize(1024, 768);
|
||||
this.add(jLayeredBackgroundPane);
|
||||
jLayeredBackgroundPane.add(splitGameAndBigCard, JLayeredPane.DEFAULT_LAYER);
|
||||
var basePane = this.vertical ? splitBattlefieldAndChats : splitGameAndBigCard;
|
||||
jLayeredBackgroundPane.add(basePane, JLayeredPane.DEFAULT_LAYER);
|
||||
|
||||
|
||||
Map<String, JComponent> myUi = getUIComponents(jLayeredBackgroundPane);
|
||||
Plugins.instance.updateGamePanel(myUi);
|
||||
|
|
@ -314,7 +326,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
int width = ((JComponent) e.getSource()).getWidth();
|
||||
int height = ((JComponent) e.getSource()).getHeight();
|
||||
jLayeredBackgroundPane.setSize(width, height);
|
||||
splitGameAndBigCard.setSize(width, height);
|
||||
basePane.setSize(width, height);
|
||||
|
||||
if (height < storedHeight) {
|
||||
// TODO: wtf, is it needs? Research and delete that code with storedHeight
|
||||
|
|
@ -552,7 +564,11 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
float guiScale = GUISizeHelper.dialogGuiScale;
|
||||
int hGap = GUISizeHelper.guiSizeScale(SKIP_BUTTONS_SPACE_H, guiScale);
|
||||
int vGap = GUISizeHelper.guiSizeScale(SKIP_BUTTONS_SPACE_V, guiScale);
|
||||
if (vertical) {
|
||||
pnlShortCuts.setLayout(new FlowLayout(FlowLayout.CENTER, 1, vGap));
|
||||
} else {
|
||||
pnlShortCuts.setLayout(new FlowLayout(FlowLayout.RIGHT, hGap, vGap));
|
||||
}
|
||||
// skip buttons - sizes
|
||||
Dimension strictSize = new Dimension(2 * GUISizeHelper.gameCommandButtonHeight, GUISizeHelper.gameCommandButtonHeight);
|
||||
setSkipButtonSize(btnCancelSkip, guiScale, strictSize);
|
||||
|
|
@ -2274,7 +2290,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void initComponents() {
|
||||
private boolean initComponents() {
|
||||
abilityPicker = new mage.client.components.ability.AbilityPicker(GUISizeHelper.dialogGuiScale);
|
||||
pnlHelperHandButtonsStackArea = new javax.swing.JPanel();
|
||||
pnlShortCuts = new javax.swing.JPanel();
|
||||
|
|
@ -2358,7 +2374,11 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
// split: chat <|> game logs
|
||||
splitChatAndLogs = new javax.swing.JSplitPane();
|
||||
if (vertical) {
|
||||
splitChatAndLogs.setOrientation(javax.swing.JSplitPane.HORIZONTAL_SPLIT);
|
||||
} else {
|
||||
splitChatAndLogs.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||||
}
|
||||
splitChatAndLogs.setResizeWeight(DIVIDER_KEEP_LEFT_COMPONENT);
|
||||
splitChatAndLogs.setTopComponent(userChatPanel);
|
||||
splitChatAndLogs.setBottomComponent(gameChatPanel);
|
||||
|
|
@ -2368,8 +2388,15 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
splitBattlefieldAndChats.setBorder(null);
|
||||
splitBattlefieldAndChats.setResizeWeight(DIVIDER_KEEP_RIGHT_COMPONENT);
|
||||
splitBattlefieldAndChats.setOneTouchExpandable(true);
|
||||
|
||||
if (vertical) {
|
||||
splitBattlefieldAndChats.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||||
splitBattlefieldAndChats.setBottomComponent(pnlHelperHandButtonsStackArea);
|
||||
splitBattlefieldAndChats.setTopComponent(splitChatAndLogs);
|
||||
} else {
|
||||
splitBattlefieldAndChats.setLeftComponent(pnlHelperHandButtonsStackArea);
|
||||
splitBattlefieldAndChats.setRightComponent(splitChatAndLogs);
|
||||
}
|
||||
|
||||
// warning, it's important to store/restore splitters in same order as real life GUI
|
||||
// from outer to inner (otherwise panels will be hidden or weird)
|
||||
|
|
@ -2752,8 +2779,11 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
// split: game <|> chat/log
|
||||
splitGameAndBigCard.setLeftComponent(splitBattlefieldAndChats);
|
||||
if (!vertical) {
|
||||
splitGameAndBigCard.setRightComponent(bigCardPanel);
|
||||
}
|
||||
return vertical;
|
||||
}
|
||||
|
||||
private void removeListener() {
|
||||
for (MouseListener ml : this.getMouseListeners()) {
|
||||
|
|
@ -2820,7 +2850,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
this.btnSkipForward.removeActionListener(al);
|
||||
}
|
||||
|
||||
final BasicSplitPaneUI myUi = (BasicSplitPaneUI) splitGameAndBigCard.getUI();
|
||||
final BasicSplitPaneUI myUi = vertical ? (BasicSplitPaneUI) splitBattlefieldAndChats.getUI() : (BasicSplitPaneUI) splitGameAndBigCard.getUI();
|
||||
final BasicSplitPaneDivider divider = myUi.getDivider();
|
||||
final JButton upArrowButton = (JButton) divider.getComponent(0);
|
||||
for (ActionListener al : upArrowButton.getActionListeners()) {
|
||||
|
|
|
|||
4
pom.xml
4
pom.xml
|
|
@ -56,6 +56,10 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue