* Added F7 to skip until next main phase. Added some preference options to skip handling. Clicking on phase bar opens now phase bar preferences.

This commit is contained in:
LevelX2 2014-10-05 14:33:47 +02:00
parent af4fa9d542
commit 7f46323f67
10 changed files with 655 additions and 325 deletions

View file

@ -37,13 +37,13 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="tabsPanel" min="-2" pref="430" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="tabsPanel" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="exitButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="saveButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="18" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -80,12 +80,12 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="main_card" min="-2" pref="93" max="-2" attributes="0"/>
<Component id="main_card" min="-2" pref="99" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="main_game" min="-2" pref="91" max="-2" attributes="0"/>
<Component id="main_game" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="main_gamelog" min="-2" pref="49" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="main_gamelog" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="132" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -280,60 +280,69 @@
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="77" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="jLabel9" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxDrawYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxUpkeepYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxBeforeCYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2You" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndTurnYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabelUpkeep" min="-2" max="-2" attributes="0"/>
<Component id="jLabelBeforeCombat" min="-2" max="-2" attributes="0"/>
<Component id="jLabelEndofCombat" min="-2" max="-2" attributes="0"/>
<Component id="jLabelMain2" min="-2" max="-2" attributes="0"/>
<Component id="jLabelEndOfTurn" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="78" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxUpkeepOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxBeforeCOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxDrawOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2Others" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndTurnOthers" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="77" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<Component id="jLabelYourTurn" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="32" max="-2" attributes="0"/>
<Component id="jLabelOpponentsTurn" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxDrawYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxUpkeepYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxBeforeCYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2You" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndTurnYou" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="78" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxUpkeepOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxBeforeCOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxDrawOthers" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2Others" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndTurnOthers" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Component id="jLabelMain1" alignment="0" max="32767" attributes="1"/>
<Component id="jLabelDraw" alignment="0" max="32767" attributes="1"/>
</Group>
</Group>
</Group>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Component id="jLabel4" alignment="0" max="32767" attributes="1"/>
<Component id="jLabel3" alignment="0" max="32767" attributes="1"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabelHeadLine" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<Component id="phases_stopSettings" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="187" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -343,42 +352,42 @@
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<Component id="jLabelOpponentsTurn" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="checkBoxUpkeepOthers" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<Component id="jLabelHeadLine" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<Component id="jLabel9" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabelYourTurn" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxUpkeepYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabelUpkeep" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<Component id="jLabelDraw" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxDrawYou" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxDrawOthers" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel4" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabelMain1" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainYou" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMainOthers" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel5" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabelBeforeCombat" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxBeforeCYou" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
@ -387,108 +396,174 @@
<Component id="checkBoxBeforeCOthers" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
<Component id="jLabelEndofCombat" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCYou" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndOfCOthers" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
<Component id="jLabelMain2" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2You" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxMain2Others" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="checkBoxEndTurnYou" min="-2" max="-2" attributes="0"/>
<Component id="jLabel8" min="-2" max="-2" attributes="0"/>
<Component id="jLabelEndOfTurn" min="-2" max="-2" attributes="0"/>
<Component id="checkBoxEndTurnOthers" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="120" max="32767" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="phases_stopSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="18" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Component class="javax.swing.JLabel" name="jLabelHeadLine">
<Properties>
<Property name="text" type="java.lang.String" value="Choose phases MAGE will stop on:"/>
<Property name="text" type="java.lang.String" value="Choose phases your game will stop on:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="Upkeep:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" value="Draw:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="Main:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" value="Before combat:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="End of combat:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" value="Main 2:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" value="End of turn:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Component class="javax.swing.JLabel" name="jLabelYourTurn">
<Properties>
<Property name="text" type="java.lang.String" value="Your turn"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel10">
<Component class="javax.swing.JLabel" name="jLabelOpponentsTurn">
<Properties>
<Property name="text" type="java.lang.String" value="Opponent(s) turn"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabelUpkeep">
<Properties>
<Property name="text" type="java.lang.String" value="Upkeep:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxUpkeepYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxDrawYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMainYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxBeforeCYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndOfCYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMain2You">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndTurnYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxUpkeepOthers">
</Component>
<Component class="javax.swing.JLabel" name="jLabelDraw">
<Properties>
<Property name="text" type="java.lang.String" value="Draw:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxDrawYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxDrawOthers">
</Component>
<Component class="javax.swing.JLabel" name="jLabelMain1">
<Properties>
<Property name="text" type="java.lang.String" value="Main:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMainYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMainOthers">
</Component>
<Component class="javax.swing.JLabel" name="jLabelBeforeCombat">
<Properties>
<Property name="text" type="java.lang.String" value="Before combat:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxBeforeCYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxBeforeCOthers">
</Component>
<Component class="javax.swing.JLabel" name="jLabelEndofCombat">
<Properties>
<Property name="text" type="java.lang.String" value="End of combat:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndOfCYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndOfCOthers">
</Component>
<Component class="javax.swing.JLabel" name="jLabelMain2">
<Properties>
<Property name="text" type="java.lang.String" value="Main 2:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMain2You">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxMain2Others">
</Component>
<Component class="javax.swing.JLabel" name="jLabelEndOfTurn">
<Properties>
<Property name="text" type="java.lang.String" value="End of turn:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndTurnYou">
</Component>
<Component class="javax.swing.JCheckBox" name="checkBoxEndTurnOthers">
</Component>
<Container class="javax.swing.JPanel" name="phases_stopSettings">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Stop settings">
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder/>
</Border>
</TitledBorder>
</Border>
</Property>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
<Property name="columns" type="int" value="1"/>
<Property name="rows" type="int" value="4"/>
</Layout>
<SubComponents>
<Component class="javax.swing.JCheckBox" name="cbStopAttack">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Stop on declare attackers step if you skip steps (F4/F5/F7) and attackers are available"/>
<Property name="toolTipText" type="java.lang.String" value="If you use F4, F5 or F7 to skip steps, you stop on declare attackers step if attackers are available. If this option is not activated, you also skip the declare attackers step with this actions. F9 does always skip the declare attackers step."/>
<Property name="actionCommand" type="java.lang.String" value=""/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbStopAttackActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="cbStopBlock">
<Properties>
<Property name="text" type="java.lang.String" value="Stop on your declare blockers step also if no blockers available"/>
<Property name="toolTipText" type="java.lang.String" value="Also if you have no blockers to declare, the game stops at the declare blockers step."/>
<Property name="actionCommand" type="java.lang.String" value=""/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbStopBlockActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="cbStopOnAllMain">
<Properties>
<Property name="text" type="java.lang.String" value="Skip with F7 to next main phase (if not activated skip always to your next main phase)"/>
<Property name="toolTipText" type="java.lang.String" value="If activated F7 skips to next main phases (regardless of the active players)."/>
<Property name="actionCommand" type="java.lang.String" value=""/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbStopOnAllMainActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="cbStopOnAllEnd">
<Properties>
<Property name="text" type="java.lang.String" value="Skip with F5 to next end step (if not activated only to end steps of opponents)"/>
<Property name="toolTipText" type="java.lang.String" value="If activated - F5 skips to the next end step (regardless of the current player)"/>
<Property name="actionCommand" type="java.lang.String" value=""/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[300, 25]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbStopOnAllEndActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="tabImages">
@ -693,7 +768,7 @@
<Component id="btnBrowseBackgroundImage" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="21" max="32767" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
@ -810,8 +885,8 @@
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="sounds_clips" pref="533" max="32767" attributes="0"/>
<Component id="sounds_backgroundMusic" alignment="0" max="32767" attributes="0"/>
<Component id="sounds_clips" pref="537" max="32767" attributes="0"/>
<Component id="sounds_backgroundMusic" alignment="1" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -821,10 +896,10 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="sounds_clips" min="-2" pref="68" max="-2" attributes="0"/>
<Component id="sounds_clips" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="sounds_backgroundMusic" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="247" max="32767" attributes="0"/>
<EmptySpace pref="235" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -898,7 +973,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel16" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="txtBattlefieldIBGMPath" pref="332" max="32767" attributes="0"/>
<Component id="txtBattlefieldIBGMPath" pref="301" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnBattlefieldBGMBrowse" min="-2" max="-2" attributes="0"/>
</Group>
@ -995,7 +1070,7 @@
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnlProxySettings" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="157" max="32767" attributes="0"/>
<EmptySpace pref="163" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -1073,7 +1148,7 @@
<Component id="txtPasswordField" alignment="0" max="32767" attributes="1"/>
<Component id="txtProxyUserName" alignment="0" min="-2" pref="148" max="-2" attributes="1"/>
</Group>
<Component id="txtProxyServer" alignment="0" pref="394" max="32767" attributes="1"/>
<Component id="txtProxyServer" alignment="0" pref="398" max="32767" attributes="1"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -1181,12 +1256,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="557" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="0" pref="561" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="400" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="0" pref="406" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
@ -1244,7 +1319,7 @@
</Group>
</Group>
</Group>
<EmptySpace pref="135" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -1602,6 +1677,7 @@
<Component class="javax.swing.JButton" name="saveButton">
<Properties>
<Property name="label" type="java.lang.String" value="Save"/>
<Property name="verticalAlignment" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveButtonActionPerformed"/>
@ -1610,6 +1686,7 @@
<Component class="javax.swing.JButton" name="exitButton">
<Properties>
<Property name="label" type="java.lang.String" value="Exit"/>
<Property name="verticalAlignment" type="int" value="3"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="exitButtonActionPerformed"/>

View file

@ -63,9 +63,9 @@ import mage.client.MageFrame;
import mage.client.util.Config;
import mage.client.util.ImageHelper;
import mage.client.util.gui.BufferedImageBuilder;
import mage.players.net.UserSkipPrioritySteps;
import mage.remote.Connection;
import mage.remote.Connection.ProxyType;
import mage.players.net.UserSkipPrioritySteps;
import org.apache.log4j.Logger;
/**
@ -106,21 +106,26 @@ public class PreferencesDialog extends javax.swing.JDialog {
// Phases
public static String UPKEEP_YOU = "upkeepYou";
public static String DRAW_YOU = "drawYou";
public static String MAIN_YOU = "mainYou";
public static String BEFORE_COMBAT_YOU = "beforeCombatYou";
public static String END_OF_COMBAT_YOU = "endOfCombatYou";
public static String MAIN_2_YOU = "main2You";
public static String END_OF_TURN_YOU = "endOfTurnYou";
public static final String UPKEEP_YOU = "upkeepYou";
public static final String DRAW_YOU = "drawYou";
public static final String MAIN_YOU = "mainYou";
public static final String BEFORE_COMBAT_YOU = "beforeCombatYou";
public static final String END_OF_COMBAT_YOU = "endOfCombatYou";
public static final String MAIN_2_YOU = "main2You";
public static final String END_OF_TURN_YOU = "endOfTurnYou";
public static String UPKEEP_OTHERS = "upkeepOthers";
public static String DRAW_OTHERS = "drawOthers";
public static String MAIN_OTHERS = "mainOthers";
public static String BEFORE_COMBAT_OTHERS = "beforeCombatOthers";
public static String END_OF_COMBAT_OTHERS = "endOfCombatOthers";
public static String MAIN_2_OTHERS = "main2Others";
public static String END_OF_TURN_OTHERS = "endOfTurnOthers";
public static final String UPKEEP_OTHERS = "upkeepOthers";
public static final String DRAW_OTHERS = "drawOthers";
public static final String MAIN_OTHERS = "mainOthers";
public static final String BEFORE_COMBAT_OTHERS = "beforeCombatOthers";
public static final String END_OF_COMBAT_OTHERS = "endOfCombatOthers";
public static final String MAIN_2_OTHERS = "main2Others";
public static final String END_OF_TURN_OTHERS = "endOfTurnOthers";
public static final String KEY_STOP_ATTACK = "stopDeclareAttacksStep";
public static final String KEY_STOP_BLOCK = "stopDeclareBlockersStep";
public static final String KEY_STOP_ALL_MAIN_PHASES = "stopOnAllMainPhases";
public static final String KEY_STOP_ALL_END_PHASES = "stopOnAllEndPhases";
// Size of frame to check if divider locations should be used
public static final String KEY_MAGE_PANEL_LAST_SIZE = "gamepanelLastSize";
@ -205,6 +210,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
private static final Boolean UPDATE_CACHE_POLICY = Boolean.TRUE;
public static final String OPEN_CONNECTION_TAB = "Open-Connection-Tab";
public static final String OPEN_PHASES_TAB = "Open-Phases-Tab";
public static String PHASE_ON = "on";
public static String PHASE_OFF = "off";
@ -309,30 +315,35 @@ public class PreferencesDialog extends javax.swing.JDialog {
main_gamelog = new javax.swing.JPanel();
cbGameLogAutoSave = new javax.swing.JCheckBox();
tabPhases = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabelHeadLine = new javax.swing.JLabel();
jLabelYourTurn = new javax.swing.JLabel();
jLabelOpponentsTurn = new javax.swing.JLabel();
jLabelUpkeep = new javax.swing.JLabel();
checkBoxUpkeepYou = new javax.swing.JCheckBox();
checkBoxDrawYou = new javax.swing.JCheckBox();
checkBoxMainYou = new javax.swing.JCheckBox();
checkBoxBeforeCYou = new javax.swing.JCheckBox();
checkBoxEndOfCYou = new javax.swing.JCheckBox();
checkBoxMain2You = new javax.swing.JCheckBox();
checkBoxEndTurnYou = new javax.swing.JCheckBox();
checkBoxUpkeepOthers = new javax.swing.JCheckBox();
jLabelDraw = new javax.swing.JLabel();
checkBoxDrawYou = new javax.swing.JCheckBox();
checkBoxDrawOthers = new javax.swing.JCheckBox();
jLabelMain1 = new javax.swing.JLabel();
checkBoxMainYou = new javax.swing.JCheckBox();
checkBoxMainOthers = new javax.swing.JCheckBox();
jLabelBeforeCombat = new javax.swing.JLabel();
checkBoxBeforeCYou = new javax.swing.JCheckBox();
checkBoxBeforeCOthers = new javax.swing.JCheckBox();
jLabelEndofCombat = new javax.swing.JLabel();
checkBoxEndOfCYou = new javax.swing.JCheckBox();
checkBoxEndOfCOthers = new javax.swing.JCheckBox();
jLabelMain2 = new javax.swing.JLabel();
checkBoxMain2You = new javax.swing.JCheckBox();
checkBoxMain2Others = new javax.swing.JCheckBox();
jLabelEndOfTurn = new javax.swing.JLabel();
checkBoxEndTurnYou = new javax.swing.JCheckBox();
checkBoxEndTurnOthers = new javax.swing.JCheckBox();
phases_stopSettings = new javax.swing.JPanel();
cbStopAttack = new javax.swing.JCheckBox();
cbStopBlock = new javax.swing.JCheckBox();
cbStopOnAllMain = new javax.swing.JCheckBox();
cbStopOnAllEnd = new javax.swing.JCheckBox();
tabImages = new javax.swing.JPanel();
panelCardImages = new javax.swing.JPanel();
cbUseDefaultImageFolder = new javax.swing.JCheckBox();
@ -501,37 +512,82 @@ public class PreferencesDialog extends javax.swing.JDialog {
tabMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabMainLayout.createSequentialGroup()
.addContainerGap()
.addComponent(main_card, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(main_card, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(main_gamelog, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(main_gamelog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(132, Short.MAX_VALUE))
);
main_card.getAccessibleContext().setAccessibleName("Game panel");
tabsPanel.addTab("Main", tabMain);
jLabel1.setText("Choose phases MAGE will stop on:");
jLabelHeadLine.setText("Choose phases your game will stop on:");
jLabel2.setText("Upkeep:");
jLabelYourTurn.setText("Your turn");
jLabel3.setText("Draw:");
jLabelOpponentsTurn.setText("Opponent(s) turn");
jLabel4.setText("Main:");
jLabelUpkeep.setText("Upkeep:");
jLabel5.setText("Before combat:");
jLabelDraw.setText("Draw:");
jLabel6.setText("End of combat:");
jLabelMain1.setText("Main:");
jLabel7.setText("Main 2:");
jLabelBeforeCombat.setText("Before combat:");
jLabel8.setText("End of turn:");
jLabelEndofCombat.setText("End of combat:");
jLabel9.setText("Your turn");
jLabelMain2.setText("Main 2:");
jLabel10.setText("Opponent(s) turn");
jLabelEndOfTurn.setText("End of turn:");
phases_stopSettings.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Stop settings"));
phases_stopSettings.setLayout(new java.awt.GridLayout(4, 1));
cbStopAttack.setSelected(true);
cbStopAttack.setText("Stop on declare attackers step if you skip steps (F4/F5/F7) and attackers are available");
cbStopAttack.setToolTipText("If you use F4, F5 or F7 to skip steps, you stop on declare attackers step if attackers are available. If this option is not activated, you also skip the declare attackers step with this actions. F9 does always skip the declare attackers step.");
cbStopAttack.setActionCommand("");
cbStopAttack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbStopAttackActionPerformed(evt);
}
});
phases_stopSettings.add(cbStopAttack);
cbStopBlock.setText("Stop on your declare blockers step also if no blockers available");
cbStopBlock.setToolTipText("Also if you have no blockers to declare, the game stops at the declare blockers step.");
cbStopBlock.setActionCommand("");
cbStopBlock.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbStopBlockActionPerformed(evt);
}
});
phases_stopSettings.add(cbStopBlock);
cbStopOnAllMain.setText("Skip with F7 to next main phase (if not activated skip always to your next main phase)");
cbStopOnAllMain.setToolTipText("If activated F7 skips to next main phases (regardless of the active players).");
cbStopOnAllMain.setActionCommand("");
cbStopOnAllMain.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbStopOnAllMainActionPerformed(evt);
}
});
phases_stopSettings.add(cbStopOnAllMain);
cbStopOnAllEnd.setText("Skip with F5 to next end step (if not activated only to end steps of opponents)");
cbStopOnAllEnd.setToolTipText("If activated - F5 skips to the next end step (regardless of the current player)");
cbStopOnAllEnd.setActionCommand("");
cbStopOnAllEnd.setPreferredSize(new java.awt.Dimension(300, 25));
cbStopOnAllEnd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbStopOnAllEndActionPerformed(evt);
}
});
phases_stopSettings.add(cbStopOnAllEnd);
javax.swing.GroupLayout tabPhasesLayout = new javax.swing.GroupLayout(tabPhases);
tabPhases.setLayout(tabPhasesLayout);
@ -540,48 +596,54 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addGroup(tabPhasesLayout.createSequentialGroup()
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabPhasesLayout.createSequentialGroup()
.addGap(20, 20, 20)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabPhasesLayout.createSequentialGroup()
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel8))
.addGap(77, 77, 77)
.addGap(20, 20, 20)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabPhasesLayout.createSequentialGroup()
.addGap(2, 2, 2)
.addComponent(jLabel9)
.addGap(32, 32, 32)
.addComponent(jLabel10))
.addGroup(tabPhasesLayout.createSequentialGroup()
.addGap(13, 13, 13)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxDrawYou)
.addComponent(checkBoxUpkeepYou)
.addComponent(checkBoxMainYou)
.addComponent(checkBoxBeforeCYou)
.addComponent(checkBoxEndOfCYou)
.addComponent(checkBoxMain2You)
.addComponent(checkBoxEndTurnYou))
.addGap(78, 78, 78)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxUpkeepOthers)
.addComponent(checkBoxBeforeCOthers)
.addComponent(checkBoxMainOthers)
.addComponent(checkBoxEndOfCOthers)
.addComponent(checkBoxDrawOthers)
.addComponent(checkBoxMain2Others)
.addComponent(checkBoxEndTurnOthers)))))
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabelUpkeep)
.addComponent(jLabelBeforeCombat)
.addComponent(jLabelEndofCombat)
.addComponent(jLabelMain2)
.addComponent(jLabelEndOfTurn))
.addGap(77, 77, 77)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabPhasesLayout.createSequentialGroup()
.addGap(2, 2, 2)
.addComponent(jLabelYourTurn)
.addGap(32, 32, 32)
.addComponent(jLabelOpponentsTurn))
.addGroup(tabPhasesLayout.createSequentialGroup()
.addGap(13, 13, 13)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxDrawYou)
.addComponent(checkBoxUpkeepYou)
.addComponent(checkBoxMainYou)
.addComponent(checkBoxBeforeCYou)
.addComponent(checkBoxEndOfCYou)
.addComponent(checkBoxMain2You)
.addComponent(checkBoxEndTurnYou))
.addGap(78, 78, 78)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxUpkeepOthers)
.addComponent(checkBoxBeforeCOthers)
.addComponent(checkBoxMainOthers)
.addComponent(checkBoxEndOfCOthers)
.addComponent(checkBoxDrawOthers)
.addComponent(checkBoxMain2Others)
.addComponent(checkBoxEndTurnOthers)))))
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabelMain1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabelDraw, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGroup(tabPhasesLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabelHeadLine)))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(tabPhasesLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)))
.addContainerGap(187, Short.MAX_VALUE))
.addComponent(phases_stopSettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addContainerGap())
);
tabPhasesLayout.setVerticalGroup(
tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -589,54 +651,56 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addContainerGap()
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(tabPhasesLayout.createSequentialGroup()
.addComponent(jLabel10)
.addComponent(jLabelOpponentsTurn)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(checkBoxUpkeepOthers))
.addGroup(tabPhasesLayout.createSequentialGroup()
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(tabPhasesLayout.createSequentialGroup()
.addComponent(jLabel1)
.addComponent(jLabelHeadLine)
.addGap(20, 20, 20))
.addComponent(jLabel9))
.addComponent(jLabelYourTurn))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxUpkeepYou)
.addComponent(jLabel2))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabelUpkeep))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel3)
.addComponent(jLabelDraw)
.addComponent(checkBoxDrawYou)
.addComponent(checkBoxDrawOthers))
.addGap(4, 4, 4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel4)
.addComponent(jLabelMain1)
.addComponent(checkBoxMainYou)
.addComponent(checkBoxMainOthers))
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabPhasesLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabelBeforeCombat, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxBeforeCYou, javax.swing.GroupLayout.Alignment.TRAILING)))
.addGroup(tabPhasesLayout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(checkBoxBeforeCOthers)))
.addGap(7, 7, 7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel6)
.addComponent(jLabelEndofCombat)
.addComponent(checkBoxEndOfCYou)
.addComponent(checkBoxEndOfCOthers))
.addGap(9, 9, 9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel7)
.addComponent(jLabelMain2)
.addComponent(checkBoxMain2You)
.addComponent(checkBoxMain2Others))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(tabPhasesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(checkBoxEndTurnYou)
.addComponent(jLabel8)
.addComponent(jLabelEndOfTurn)
.addComponent(checkBoxEndTurnOthers))
.addContainerGap(120, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(phases_stopSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(18, Short.MAX_VALUE))
);
tabsPanel.addTab("Phases", tabPhases);
@ -796,7 +860,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addComponent(txtBackgroundImagePath, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnBrowseBackgroundImage)))
.addGap(0, 21, Short.MAX_VALUE))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(panelBackgroundImagesLayout.createSequentialGroup()
.addGroup(panelBackgroundImagesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cbUseRandomBattleImage)
@ -907,7 +971,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addContainerGap()
.addComponent(jLabel16)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtBattlefieldIBGMPath, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE)
.addComponent(txtBattlefieldIBGMPath, javax.swing.GroupLayout.DEFAULT_SIZE, 301, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnBattlefieldBGMBrowse))
.addGroup(sounds_backgroundMusicLayout.createSequentialGroup()
@ -932,18 +996,18 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addGroup(tabSoundsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(tabSoundsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(sounds_clips, javax.swing.GroupLayout.DEFAULT_SIZE, 533, Short.MAX_VALUE)
.addComponent(sounds_backgroundMusic, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(sounds_clips, javax.swing.GroupLayout.DEFAULT_SIZE, 537, Short.MAX_VALUE)
.addComponent(sounds_backgroundMusic, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
tabSoundsLayout.setVerticalGroup(
tabSoundsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(tabSoundsLayout.createSequentialGroup()
.addContainerGap()
.addComponent(sounds_clips, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sounds_clips, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(sounds_backgroundMusic, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(247, Short.MAX_VALUE))
.addContainerGap(235, Short.MAX_VALUE))
);
sounds_clips.getAccessibleContext().setAccessibleDescription("");
@ -1013,7 +1077,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addGroup(pnlProxyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(txtPasswordField, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtProxyUserName, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(txtProxyServer, javax.swing.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE))
.addComponent(txtProxyServer, javax.swing.GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE))
.addContainerGap())
);
pnlProxyLayout.setVerticalGroup(
@ -1083,7 +1147,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addComponent(cbProxyType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnlProxySettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(157, Short.MAX_VALUE))
.addContainerGap(163, Short.MAX_VALUE))
);
pnlProxySettings.getAccessibleContext().setAccessibleDescription("");
@ -1289,7 +1353,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(135, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -1328,16 +1392,17 @@ public class PreferencesDialog extends javax.swing.JDialog {
tabAvatars.setLayout(tabAvatarsLayout);
tabAvatarsLayout.setHorizontalGroup(
tabAvatarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 557, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 561, Short.MAX_VALUE)
);
tabAvatarsLayout.setVerticalGroup(
tabAvatarsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE)
);
tabsPanel.addTab("Avatars", tabAvatars);
saveButton.setLabel("Save");
saveButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
saveButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveButtonActionPerformed(evt);
@ -1345,6 +1410,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
});
exitButton.setLabel("Exit");
exitButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
exitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitButtonActionPerformed(evt);
@ -1366,12 +1432,12 @@ public class PreferencesDialog extends javax.swing.JDialog {
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(tabsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 430, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(tabsPanel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(exitButton)
.addComponent(saveButton))
.addContainerGap(18, Short.MAX_VALUE))
.addContainerGap())
);
pack();
@ -1406,6 +1472,11 @@ public class PreferencesDialog extends javax.swing.JDialog {
save(prefs, dialog.checkBoxMain2Others, MAIN_2_OTHERS);
save(prefs, dialog.checkBoxEndTurnOthers, END_OF_TURN_OTHERS);
save(prefs, dialog.cbStopAttack, KEY_STOP_ATTACK, "true", "false", UPDATE_CACHE_POLICY);
save(prefs, dialog.cbStopBlock, KEY_STOP_BLOCK, "true", "false", UPDATE_CACHE_POLICY);
save(prefs, dialog.cbStopOnAllMain, KEY_STOP_ALL_MAIN_PHASES, "true", "false", UPDATE_CACHE_POLICY);
save(prefs, dialog.cbStopOnAllEnd, KEY_STOP_ALL_END_PHASES, "true", "false", UPDATE_CACHE_POLICY);
// images
save(prefs, dialog.cbUseDefaultImageFolder, KEY_CARD_IMAGES_USE_DEFAULT, "true", "false", UPDATE_CACHE_POLICY);
saveImagesPath(prefs);
@ -1663,6 +1734,22 @@ public class PreferencesDialog extends javax.swing.JDialog {
// TODO add your handling code here:
}//GEN-LAST:event_showToolTipsInAnyZoneActionPerformed
private void cbStopAttackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbStopAttackActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_cbStopAttackActionPerformed
private void cbStopBlockActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbStopBlockActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_cbStopBlockActionPerformed
private void cbStopOnAllMainActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbStopOnAllMainActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_cbStopOnAllMainActionPerformed
private void cbStopOnAllEndActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbStopOnAllEndActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_cbStopOnAllEndActionPerformed
private void showProxySettings() {
if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) {
this.pnlProxy.setVisible(true);
@ -1688,7 +1775,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
if (args.length > 0) {
String param1 = args[0];
if (param1.equals(OPEN_CONNECTION_TAB)) {
param = 3;
param = 4;
}
if (param1.equals(OPEN_PHASES_TAB)) {
param = 1;
}
}
final int openedTab = param;
@ -1698,7 +1788,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
if (!dialog.isVisible()) {
Preferences prefs = MageFrame.getPreferences();
// Phases
// Main & Phases
loadPhases(prefs);
// Images
@ -1713,11 +1803,11 @@ public class PreferencesDialog extends javax.swing.JDialog {
// Selected avatar
loadSelectedAvatar(prefs);
dialog.reset();
// open specified tab before displaying
openTab(openedTab);
dialog.setLocation(300, 200);
dialog.reset();
dialog.setVisible(true);
} else {
@ -1728,29 +1818,35 @@ public class PreferencesDialog extends javax.swing.JDialog {
}
private static void loadPhases(Preferences prefs) {
load(prefs, dialog.checkBoxUpkeepYou, UPKEEP_YOU);
load(prefs, dialog.checkBoxDrawYou, DRAW_YOU);
load(prefs, dialog.checkBoxMainYou, MAIN_YOU);
load(prefs, dialog.checkBoxBeforeCYou, BEFORE_COMBAT_YOU);
load(prefs, dialog.checkBoxEndOfCYou, END_OF_COMBAT_YOU);
load(prefs, dialog.checkBoxMain2You, MAIN_2_YOU);
load(prefs, dialog.checkBoxEndTurnYou, END_OF_TURN_YOU);
load(prefs, dialog.checkBoxUpkeepOthers, UPKEEP_OTHERS);
load(prefs, dialog.checkBoxDrawOthers, DRAW_OTHERS);
load(prefs, dialog.checkBoxMainOthers, MAIN_OTHERS);
load(prefs, dialog.checkBoxBeforeCOthers, BEFORE_COMBAT_OTHERS);
load(prefs, dialog.checkBoxEndOfCOthers, END_OF_COMBAT_OTHERS);
load(prefs, dialog.checkBoxMain2Others, MAIN_2_OTHERS);
load(prefs, dialog.checkBoxEndTurnOthers, END_OF_TURN_OTHERS);
load(prefs, dialog.displayBigCardsInHand, KEY_HAND_USE_BIG_CARDS, "true");
load(prefs, dialog.displayBigCardsInHand, KEY_HAND_USE_BIG_CARDS, "true","true");
load(prefs, dialog.showToolTipsInAnyZone, KEY_SHOW_TOOLTIPS_ANY_ZONE, "true");
load(prefs, dialog.showCardName, KEY_SHOW_CARD_NAMES, "true");
load(prefs, dialog.nonLandPermanentsInOnePile, KEY_PERMANENTS_IN_ONE_PILE, "true");
load(prefs, dialog.showPlayerNamesPermanently, KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true");
load(prefs, dialog.showAbilityPickerForced, KEY_SHOW_ABILITY_PICKER_FORCED, "true");
load(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true");
load(prefs, dialog.checkBoxUpkeepYou, UPKEEP_YOU, "on","off");
load(prefs, dialog.checkBoxDrawYou, DRAW_YOU, "on","off");
load(prefs, dialog.checkBoxMainYou, MAIN_YOU, "on","on");
load(prefs, dialog.checkBoxBeforeCYou, BEFORE_COMBAT_YOU, "on","off");
load(prefs, dialog.checkBoxEndOfCYou, END_OF_COMBAT_YOU, "on","off");
load(prefs, dialog.checkBoxMain2You, MAIN_2_YOU, "on","on");
load(prefs, dialog.checkBoxEndTurnYou, END_OF_TURN_YOU, "on","off");
load(prefs, dialog.checkBoxUpkeepOthers, UPKEEP_OTHERS, "on","off");
load(prefs, dialog.checkBoxDrawOthers, DRAW_OTHERS, "on","off");
load(prefs, dialog.checkBoxMainOthers, MAIN_OTHERS, "on","on");
load(prefs, dialog.checkBoxBeforeCOthers, BEFORE_COMBAT_OTHERS, "on","on");
load(prefs, dialog.checkBoxEndOfCOthers, END_OF_COMBAT_OTHERS, "on","off");
load(prefs, dialog.checkBoxMain2Others, MAIN_2_OTHERS, "on","on");
load(prefs, dialog.checkBoxEndTurnOthers, END_OF_TURN_OTHERS, "on","on");
load(prefs, dialog.cbStopAttack, KEY_STOP_ATTACK, "true", "true");
load(prefs, dialog.cbStopBlock, KEY_STOP_BLOCK, "true", "true");
load(prefs, dialog.cbStopOnAllMain, KEY_STOP_ALL_MAIN_PHASES, "true", "false");
load(prefs, dialog.cbStopOnAllEnd, KEY_STOP_ALL_END_PHASES, "true", "false");
}
private static void loadImagesSettings(Preferences prefs) {
@ -1886,6 +1982,11 @@ public class PreferencesDialog extends javax.swing.JDialog {
userSkipPrioritySteps.getOpponentTurn().setEndOfCombat(dialog.checkBoxEndOfCOthers.isSelected());
userSkipPrioritySteps.getOpponentTurn().setMain2(dialog.checkBoxMain2Others.isSelected());
userSkipPrioritySteps.getOpponentTurn().setEndOfTurn(dialog.checkBoxEndTurnOthers.isSelected());
userSkipPrioritySteps.setStopOnDeclareAttackersDuringSkipActions(dialog.cbStopAttack.isSelected());
userSkipPrioritySteps.setStopOnDeclareBlockerIfNoneAvailable(dialog.cbStopBlock.isSelected());
userSkipPrioritySteps.setStopOnAllEndPhases(dialog.cbStopOnAllEnd.isSelected());
userSkipPrioritySteps.setStopOnAllMainPhases(dialog.cbStopOnAllMain.isSelected());
return userSkipPrioritySteps;
}
@ -1893,7 +1994,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
private static void openTab(int index) {
try {
if (index > 0) {
dialog.tabsPanel.setSelectedIndex(3);
dialog.tabsPanel.setSelectedIndex(index);
}
} catch (Exception e) {
e.printStackTrace();
@ -2089,6 +2190,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
private javax.swing.JComboBox<String> cbPreferedImageLanguage;
private javax.swing.JComboBox<ProxyType> cbProxyType;
private javax.swing.JCheckBox cbSaveToZipFiles;
private javax.swing.JCheckBox cbStopAttack;
private javax.swing.JCheckBox cbStopBlock;
private javax.swing.JCheckBox cbStopOnAllEnd;
private javax.swing.JCheckBox cbStopOnAllMain;
private javax.swing.JCheckBox cbUseDefaultBackground;
private javax.swing.JCheckBox cbUseDefaultBattleImage;
private javax.swing.JCheckBox cbUseDefaultImageFolder;
@ -2109,22 +2214,22 @@ public class PreferencesDialog extends javax.swing.JDialog {
private javax.swing.JCheckBox checkBoxUpkeepYou;
private javax.swing.JCheckBox displayBigCardsInHand;
private javax.swing.JButton exitButton;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JLabel jLabelBeforeCombat;
private javax.swing.JLabel jLabelDraw;
private javax.swing.JLabel jLabelEndOfTurn;
private javax.swing.JLabel jLabelEndofCombat;
private javax.swing.JLabel jLabelHeadLine;
private javax.swing.JLabel jLabelMain1;
private javax.swing.JLabel jLabelMain2;
private javax.swing.JLabel jLabelOpponentsTurn;
private javax.swing.JLabel jLabelUpkeep;
private javax.swing.JLabel jLabelYourTurn;
private javax.swing.JPanel jPanel10;
private javax.swing.JPanel jPanel11;
private javax.swing.JPanel jPanel12;
@ -2151,6 +2256,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
private javax.swing.JCheckBox nonLandPermanentsInOnePile;
private javax.swing.JPanel panelBackgroundImages;
private javax.swing.JPanel panelCardImages;
private javax.swing.JPanel phases_stopSettings;
private javax.swing.JPanel pnlProxy;
private javax.swing.JPanel pnlProxySettings;
private javax.swing.JCheckBox rememberPswd;

View file

@ -931,7 +931,7 @@ public final class GamePanel extends javax.swing.JPanel {
this.getActionMap().put("F4_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
btnEndTurnActionPerformed(null);
btnEndTurnActionPerformed(actionEvent);
}
});
@ -940,7 +940,16 @@ public final class GamePanel extends javax.swing.JPanel {
this.getActionMap().put("F5_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
btnUntilEndOfTurnActionPerformed(null);
btnUntilEndOfTurnActionPerformed(actionEvent);
}
});
ks = KeyStroke.getKeyStroke(KeyEvent.VK_F7, 0);
this.getInputMap(c).put(ks, "F7_PRESS");
this.getActionMap().put("F7_PRESS", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
btnUntilNextMainPhaseActionPerformed(actionEvent);
}
});
@ -1170,13 +1179,20 @@ public final class GamePanel extends javax.swing.JPanel {
jPhases.setLayout(null);
jPhases.setPreferredSize(new Dimension(X_PHASE_WIDTH, 450));
MouseAdapter phasesMouseAdapter = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent evt) {
mouseClickPhaseBar(evt);
}
};
String[] phases = {"Untap", "Upkeep", "Draw", "Main1",
"Combat_Start", "Combat_Attack", "Combat_Block", "Combat_Damage", "Combat_End",
"Main2", "Cleanup", "Next_Turn"};
for (String name : phases) {
createPhaseButton(name);
createPhaseButton(name, phasesMouseAdapter);
}
int i = 0;
for (String name : hoverButtons.keySet()) {
HoverButton hoverButton = hoverButtons.get(name);
@ -1185,6 +1201,7 @@ public final class GamePanel extends javax.swing.JPanel {
jPhases.add(hoverButton);
i++;
}
jPhases.addMouseListener(phasesMouseAdapter);
pnlReplay.setOpaque(false);
HelperPanel helper = new HelperPanel();
@ -1199,7 +1216,7 @@ public final class GamePanel extends javax.swing.JPanel {
phasesContainer = new JPanel();
phasesContainer.setLayout(new RelativeLayout(RelativeLayout.Y_AXIS));
phasesContainer.setBackground(new Color(0, 0, 0, 0));
Float ratio = new Float(1);
Float ratio = (float) 1;
JPanel empty1 = new JPanel();
empty1.setBackground(new Color(0, 0, 0, 0));
phasesContainer.add(empty1, ratio);
@ -1307,6 +1324,15 @@ public final class GamePanel extends javax.swing.JPanel {
for (MouseListener ml :this.btnSwitchHands.getMouseListeners()) {
this.btnSwitchHands.removeMouseListener(ml);
}
for (MouseListener ml :this.jPhases.getMouseListeners()) {
this.jPhases.removeMouseListener(ml);
}
for (String name : hoverButtons.keySet()) {
HoverButton hoverButton = hoverButtons.get(name);
for (MouseListener ml :hoverButton.getMouseListeners()) {
hoverButton.removeMouseListener(ml);
}
}
for (ActionListener al :this.btnPlay.getActionListeners()) {
this.btnPlay.removeActionListener(al);
}
@ -1359,7 +1385,13 @@ public final class GamePanel extends javax.swing.JPanel {
private void btnUntilEndOfTurnActionPerformed(java.awt.event.ActionEvent evt) {
if (feedbackPanel != null && FeedbackMode.SELECT.equals(feedbackPanel.getMode())) {
session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_OPPONENTS_TURN_END_STEP, gameId);
session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_TURN_END_STEP, gameId);
}
}
private void btnUntilNextMainPhaseActionPerformed(java.awt.event.ActionEvent evt) {
if (feedbackPanel != null && FeedbackMode.SELECT.equals(feedbackPanel.getMode())) {
session.sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE, gameId);
}
}
@ -1375,7 +1407,13 @@ public final class GamePanel extends javax.swing.JPanel {
}
}
private void btnSwitchHandActionPerformed(java.awt.event.ActionEvent evt) {
private void mouseClickPhaseBar(MouseEvent evt) {
if (evt.getButton() == MouseEvent.BUTTON1) { // Left button
PreferencesDialog.main(new String[]{PreferencesDialog.OPEN_PHASES_TAB});
}
}
private void btnSwitchHandActionPerformed(java.awt.event.ActionEvent evt) {
String[] choices = handCards.keySet().toArray(new String[0]);
String newChosenHandKey = (String) JOptionPane.showInputDialog(
@ -1439,7 +1477,7 @@ public final class GamePanel extends javax.swing.JPanel {
abilityPicker.setVisible(false);
}
private void createPhaseButton(String name) {
private void createPhaseButton(String name, MouseAdapter mouseAdapter) {
if (hoverButtons == null) {
hoverButtons = new LinkedHashMap<>();
}
@ -1447,6 +1485,7 @@ public final class GamePanel extends javax.swing.JPanel {
HoverButton button = new HoverButton("", ImageManagerImpl.getInstance().getPhaseImage(name), rect);
button.setToolTipText(name.replaceAll("_", " "));
button.setPreferredSize(new Dimension(36, 36));
button.addMouseListener(mouseAdapter);
hoverButtons.put(name, button);
}

View file

@ -167,17 +167,27 @@ public class PlayAreaPanel extends javax.swing.JPanel {
}
});
menuItem = new JMenuItem("F5 - Skip phases until opponent's end step (stop on stack/attack/block)");
menuItem = new JMenuItem("F5 - Skip phases until next end step (stop on stack/attack/block)");
popupMenu.add(menuItem);
// Skip to next end step of turn (F5)
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
gamePanel.getSession().sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_OPPONENTS_TURN_END_STEP, gameId);
gamePanel.getSession().sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_TURN_END_STEP, gameId);
}
});
menuItem = new JMenuItem("F7 - Skip phases until begin of next main phase (stop on stack/attack/block)");
popupMenu.add(menuItem);
// Skip to next main phase (F7)
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
gamePanel.getSession().sendPlayerAction(PlayerAction.PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE, gameId);
}
});
menuItem = new JMenuItem("F9 - Skip everything until own next turn (stop on attack/block)");
popupMenu.add(menuItem);

View file

@ -72,7 +72,7 @@ public class CallbackClientImpl implements CallbackClient {
private static final Logger logger = Logger.getLogger(CallbackClientImpl.class);
private final MageFrame frame;
private int messageId = 0;
private int gameInformMessageId = 0;
// private int gameInformMessageId = 0;
public CallbackClientImpl(MageFrame frame) {
this.frame = frame;
@ -292,16 +292,20 @@ public class CallbackClientImpl implements CallbackClient {
JOptionPane.showMessageDialog(null, messageData.get(1), messageData.get(0), JOptionPane.WARNING_MESSAGE);
} break;
case "gameInform":
if (callback.getMessageId() > gameInformMessageId) {
// if (callback.getMessageId() > gameInformMessageId) {
{
GameClientMessage message = (GameClientMessage) callback.getData();
GamePanel panel = MageFrame.getGame(callback.getObjectId());
if (panel != null) {
panel.inform(message.getMessage(), message.getGameView(), callback.getMessageId());
}
} else {
logger.warn(new StringBuilder("message out of sequence - ignoring").append("MessageId = ").append(callback.getMessageId()).append(" method = ").append(callback.getMethod()));
//logger.warn("message out of sequence - ignoring");
} gameInformMessageId = messageId;
}
// no longer needed because phase skip handling on server side now
// } else {
// logger.warn(new StringBuilder("message out of sequence - ignoring").append("MessageId = ").append(callback.getMessageId()).append(" method = ").append(callback.getMethod()));
// //logger.warn("message out of sequence - ignoring");
// }
// gameInformMessageId = messageId;
break;
case "gameInformPersonal":
{
@ -347,14 +351,18 @@ public class CallbackClientImpl implements CallbackClient {
DraftPanel panel = MageFrame.getDraft(callback.getObjectId());
if (panel != null) {
panel.updateDraft((DraftView) callback.getData());
} break;
}
break;
}
case "draftInform":
if (callback.getMessageId() > messageId) {
// if (callback.getMessageId() > messageId) {
{
DraftClientMessage message = (DraftClientMessage) callback.getData();
} else {
logger.warn("message out of sequence - ignoring");
} break;
}
// } else {
// logger.warn("message out of sequence - ignoring");
// }
// break;
case "draftInit":
{
DraftClientMessage message = (DraftClientMessage) callback.getData();
@ -387,9 +395,10 @@ public class CallbackClientImpl implements CallbackClient {
.append("<br/>Turn mousewheel down (ALT-s) - enlarge original/alternate image of card the mousepointer hovers over")
.append("<br/><b>F2</b> - Confirm \"Ok\", \"Yes\" or \"Done\" button")
.append("<br/><b>F4</b> - Skip current turn but stop on declare attackers/blockers and something on the stack")
.append("<br/><b>F5</b> - Skip to next end step of opponent's turn but stop on declare attackers/blockers and something on the stack")
.append("<br/><b>F5</b> - Skip to next end step but stop on declare attackers/blockers and something on the stack")
.append("<br/><b>F7</b> - Skip to next main phase but stop on declare attackers/blockers and something on the stack")
.append("<br/><b>F9</b> - Skip everything until your next turn")
.append("<br/><b>F3</b> - Undo F4/F5/F9").toString(),
.append("<br/><b>F3</b> - Undo F4/F5/F6/F9").toString(),
null, MessageType.USER_INFO, ChatMessage.MessageColor.BLUE);
break;
case TOURNAMENT:

View file

@ -444,24 +444,55 @@ public class HumanPlayer extends PlayerImpl {
public boolean priority(Game game) {
passed = false;
if (!abort) {
boolean dontCheckPassStep = false;
if (passedAllTurns) {
pass(game);
return false;
}
if (passedTurn && game.getStack().isEmpty()) {
if (game.getStack().isEmpty()) {
if (passedTurn) {
pass(game);
return false;
}
if (passedUntilNextMain) {
if (game.getTurn().getStepType().equals(PhaseStep.POSTCOMBAT_MAIN) || game.getTurn().getStepType().equals(PhaseStep.PRECOMBAT_MAIN)) {
// it's a main phase
if (!skippedAtLeastOnce || (!playerId.equals(game.getActivePlayerId()) && !this.getUserData().getUserSkipPrioritySteps().isStopOnAllMainPhases())) {
skippedAtLeastOnce = true;
pass(game);
return false;
} else {
dontCheckPassStep = true;
passedUntilNextMain = false; // reset skip action
}
} else {
skippedAtLeastOnce = true;
pass(game);
return false;
}
}
if (passedUntilEndOfTurn) {
if (game.getTurn().getStepType().equals(PhaseStep.END_TURN)) {
// It's end of turn phase
if (!skippedAtLeastOnce || (playerId.equals(game.getActivePlayerId()) && !this.getUserData().getUserSkipPrioritySteps().isStopOnAllEndPhases())) {
skippedAtLeastOnce = true;
pass(game);
return false;
} else {
dontCheckPassStep = true;
passedUntilEndOfTurn = false;
}
} else {
skippedAtLeastOnce = true;
pass(game);
return false;
}
}
}
if (!dontCheckPassStep && checkPassStep(game)) {
pass(game);
return false;
}
if (passedUntilEndOfTurn && game.getStack().isEmpty() &&
(!game.getTurn().getStepType().equals(PhaseStep.END_TURN) || playerId.equals(game.getActivePlayerId()))) {
pass(game);
return false;
}
if (checkPassStep(game) && game.getStack().isEmpty()) {
pass(game);
return false;
}
updateGameStatePriority("priority", game);
game.firePriorityEvent(playerId);
waitForResponse(game);
@ -618,13 +649,13 @@ public class HumanPlayer extends PlayerImpl {
FilterCreatureForCombat filter = filterCreatureForCombat.copy();
filter.add(new ControllerIdPredicate(attackingPlayerId));
while (!abort) {
if (passedAllTurns /*|| passedTurn*/) {
if (passedAllTurns ||
(!getUserData().getUserSkipPrioritySteps().isStopOnDeclareAttackersDuringSkipAction() && (passedTurn || passedUntilEndOfTurn || passedUntilNextMain) )) {
return;
}
Map<String, Serializable> options = new HashMap<>();
List<UUID> possibleAttackers = new ArrayList<>();
for (Permanent possibleAttacker : game.getBattlefield().getActivePermanents(filter, attackingPlayerId, game)) {
if (possibleAttacker.canAttack(game)) {
possibleAttackers.add(possibleAttacker.getId());
@ -744,6 +775,9 @@ public class HumanPlayer extends PlayerImpl {
updateGameStatePriority("selectBlockers", game);
FilterCreatureForCombatBlock filter = filterCreatureForCombatBlock.copy();
filter.add(new ControllerIdPredicate(defendingPlayerId));
if (game.getBattlefield().count(filter, null, playerId, game) == 0 && !getUserData().getUserSkipPrioritySteps().isStopOnDeclareBlockerIfNoneAvailable()) {
return;
}
while (!abort) {
game.fireSelectEvent(playerId, "Select blockers");
waitForResponse(game);

View file

@ -521,7 +521,7 @@ public class TableController {
String creator = null;
StringBuilder opponent = new StringBuilder();
int activePlayers = 0;
for (Entry<UUID, UUID> entry: userPlayerMap.entrySet()) {
for (Entry<UUID, UUID> entry: userPlayerMap.entrySet()) { // no AI players
if (!match.getPlayer(entry.getValue()).hasQuit()) {
activePlayers++;
User user = UserManager.getInstance().getUser(entry.getKey());
@ -544,8 +544,7 @@ public class TableController {
}
opponent.append(user.getName());
}
}
else {
} else {
logger.error("Unable to find user: " + entry.getKey() + " playerId: " + entry.getValue());
MatchPlayer matchPlayer = match.getPlayer(entry.getValue());
if (matchPlayer != null && !matchPlayer.hasQuit()) {
@ -554,18 +553,19 @@ public class TableController {
}
}
}
if (activePlayers < 2) {
throw new MageException("Can't start game - Less than two players active - " +activePlayers);
}
// Append AI opponents to the log file
for (MatchPlayer mPlayer :match.getPlayers()) {
if (!mPlayer.getPlayer().isHuman()) {
activePlayers++;
if (opponent.length() > 0) {
opponent.append(" - ");
}
opponent.append(mPlayer.getName());
}
}
if (activePlayers < 2) {
throw new MageException("Can't start game - Less than two players active - " +activePlayers);
}
ServerMessagesUtil.getInstance().incGamesStarted();

View file

@ -34,7 +34,8 @@ package mage.constants;
*/
public enum PlayerAction {
PASS_PRIORITY_UNTIL_MY_NEXT_TURN,
PASS_PRIORITY_UNTIL_OPPONENTS_TURN_END_STEP,
PASS_PRIORITY_UNTIL_TURN_END_STEP,
PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE,
PASS_PRIORITY_UNTIL_NEXT_TURN,
PASS_PRIORITY_CANCEL_ALL_ACTIONS,
UNDO,

View file

@ -158,6 +158,8 @@ public abstract class PlayerImpl implements Player, Serializable {
protected boolean passed; // player passed priority
protected boolean passedTurn; // F4
protected boolean passedUntilEndOfTurn; // F5
protected boolean passedUntilNextMain; // F6
protected boolean skippedAtLeastOnce; // used to track if passed started in specific phase
/**
* This indicates that player passed all turns until his own turn starts (F9).
* Note! This differs from passedTurn as it doesn't care about spells and abilities in the stack and will pass them as well.
@ -289,6 +291,8 @@ public abstract class PlayerImpl implements Player, Serializable {
this.passedTurn = player.passedTurn;
this.passedUntilEndOfTurn = player.passedUntilEndOfTurn;
this.passedUntilNextMain = player.passedUntilNextMain;
this.skippedAtLeastOnce = player.skippedAtLeastOnce;
this.passedAllTurns = player.passedAllTurns;
this.priorityTimeLeft = player.getPriorityTimeLeft();
@ -398,6 +402,8 @@ public abstract class PlayerImpl implements Player, Serializable {
this.passed = false;
this.passedTurn = false;
this.passedUntilEndOfTurn = false;
this.passedUntilNextMain = false;
this.skippedAtLeastOnce = false;
this.passedAllTurns = false;
this.canGainLife = true;
this.canLoseLife = true;
@ -545,9 +551,6 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public void endOfTurn(Game game) {
this.passedTurn = false;
if (!game.getActivePlayerId().equals(playerId)) {
this.passedUntilEndOfTurn = false;
}
}
@Override
@ -1634,24 +1637,41 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public void sendPlayerAction(PlayerAction passPriorityAction, Game game) {
switch(passPriorityAction) {
case PASS_PRIORITY_UNTIL_MY_NEXT_TURN:
passedTurn = true;
case PASS_PRIORITY_UNTIL_MY_NEXT_TURN: // F9
passedUntilNextMain = false;
passedUntilEndOfTurn = false;
passedTurn = false;
passedAllTurns = true;
this.skip();
break;
case PASS_PRIORITY_UNTIL_OPPONENTS_TURN_END_STEP:
case PASS_PRIORITY_UNTIL_TURN_END_STEP: // F5
passedUntilNextMain = false;
passedTurn = false;
passedAllTurns = false;
passedUntilEndOfTurn = true;
skippedAtLeastOnce = !game.getTurn().getStepType().equals(PhaseStep.END_TURN);
this.skip();
break;
case PASS_PRIORITY_UNTIL_NEXT_TURN:
case PASS_PRIORITY_UNTIL_NEXT_TURN: // F4
passedUntilNextMain = false;
passedAllTurns = false;
passedUntilEndOfTurn = false;
passedTurn = true;
this.skip();
break;
case PASS_PRIORITY_UNTIL_NEXT_MAIN_PHASE: //F7
passedAllTurns = false;
passedTurn = false;
passedUntilEndOfTurn = false;
passedUntilNextMain = true;
skippedAtLeastOnce = !(game.getTurn().getStepType().equals(PhaseStep.POSTCOMBAT_MAIN) || game.getTurn().getStepType().equals(PhaseStep.PRECOMBAT_MAIN));
this.skip();
break;
case PASS_PRIORITY_CANCEL_ALL_ACTIONS:
passedAllTurns = false;
passedTurn = false;
passedUntilEndOfTurn = false;
break;
passedUntilEndOfTurn = false;
passedUntilNextMain = false;
}
logger.trace("PASS Priority: " + passPriorityAction.toString());
}
@ -2032,10 +2052,9 @@ public abstract class PlayerImpl implements Player, Serializable {
playable.add(ability);
}
}
if (ability instanceof AlternativeSourceCosts) {
// something missing here
int test = 6;
}
// if (ability instanceof AlternativeSourceCosts) {
//
// }
}
}
}

View file

@ -27,8 +27,6 @@
*/
package mage.players.net;
import mage.players.net.SkipPrioritySteps;
/**
*
* @author LevelX2
@ -38,6 +36,11 @@ public class UserSkipPrioritySteps {
SkipPrioritySteps yourTurn;
SkipPrioritySteps opponentTurn;
boolean stopOnDeclareAttackersDuringSkipAction;
boolean stopOnDeclareBlockerIfNoneAvailable;
boolean stopOnAllMainPhases;
boolean stopOnAllEndPhases;
public UserSkipPrioritySteps() {
yourTurn = new SkipPrioritySteps();
opponentTurn = new SkipPrioritySteps();
@ -51,4 +54,36 @@ public class UserSkipPrioritySteps {
return opponentTurn;
}
public boolean isStopOnDeclareBlockerIfNoneAvailable() {
return stopOnDeclareBlockerIfNoneAvailable;
}
public void setStopOnDeclareBlockerIfNoneAvailable(boolean stopOnDeclareBlockerIfNoneAvailable) {
this.stopOnDeclareBlockerIfNoneAvailable = stopOnDeclareBlockerIfNoneAvailable;
}
public boolean isStopOnDeclareAttackersDuringSkipAction() {
return stopOnDeclareAttackersDuringSkipAction;
}
public void setStopOnDeclareAttackersDuringSkipActions(boolean stopOnDeclareAttackersDuringSkipActions) {
this.stopOnDeclareAttackersDuringSkipAction = stopOnDeclareAttackersDuringSkipActions;
}
public boolean isStopOnAllMainPhases() {
return stopOnAllMainPhases;
}
public void setStopOnAllMainPhases(boolean stopOnAllMainPhases) {
this.stopOnAllMainPhases = stopOnAllMainPhases;
}
public boolean isStopOnAllEndPhases() {
return stopOnAllEndPhases;
}
public void setStopOnAllEndPhases(boolean stopOnAllEndPhases) {
this.stopOnAllEndPhases = stopOnAllEndPhases;
}
}