mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 20:11:59 -08:00
Added timer to small layout (fixes #353). Added option to show player name on avatar permanently.
This commit is contained in:
parent
203dd13b44
commit
18d8d3a753
5 changed files with 166 additions and 86 deletions
|
|
@ -23,6 +23,7 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
private Rectangle imageSize;
|
||||
private Rectangle buttonSize;
|
||||
private String text;
|
||||
private boolean textAlwaysVisible = false;
|
||||
private int textOffsetY = 0;
|
||||
private int textOffsetButtonY = 2;
|
||||
private int textOffsetX = -1;
|
||||
|
|
@ -77,7 +78,7 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
public void paintComponent(Graphics g) {
|
||||
Graphics2D g2d = (Graphics2D) g;
|
||||
if (isEnabled()) {
|
||||
if (isHovered) {
|
||||
if (isHovered || textAlwaysVisible) {
|
||||
g.drawImage(hoverImage, 0, 0, imageSize.width, imageSize.height, this);
|
||||
if (text != null) {
|
||||
if (textColor != null) {
|
||||
|
|
@ -271,4 +272,9 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
public void setTopText(String topText) {
|
||||
this.topText = topText;
|
||||
}
|
||||
|
||||
public void setTextAlwaysVisible(boolean textAlwaysVisible) {
|
||||
this.textAlwaysVisible = textAlwaysVisible;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@
|
|||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="main_hand" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="main_battlefield" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="main_gamelog" alignment="1" pref="574" max="32767" attributes="0"/>
|
||||
<Component id="main_card" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="main_game" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="main_gamelog" alignment="1" pref="533" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
|
@ -80,22 +80,22 @@
|
|||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="main_hand" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="main_card" min="-2" pref="68" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="main_battlefield" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="main_game" min="-2" pref="68" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="main_gamelog" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="171" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="188" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="main_hand">
|
||||
<Container class="javax.swing.JPanel" name="main_card">
|
||||
<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="Hand">
|
||||
<TitledBorder title="Card">
|
||||
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
|
|
@ -103,26 +103,16 @@
|
|||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AccessibilityProperties>
|
||||
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Game panel"/>
|
||||
</AccessibilityProperties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JCheckBox" name="showToolTipsInAnyZone">
|
||||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" value="Show tooltips"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="showToolTipsInAnyZoneActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="Center"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="displayBigCardsInHand">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Use big images (for high resolution screens)"/>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="displayBigCardsInHandActionPerformed"/>
|
||||
|
|
@ -133,13 +123,31 @@
|
|||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="showToolTipsInAnyZone">
|
||||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" value="Show card tooltips while hoovering with the mouse pointer over a card"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||
<Color id="Standardcursor"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="showToolTipsInAnyZoneActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="Center"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="main_battlefield">
|
||||
<Container class="javax.swing.JPanel" name="main_game">
|
||||
<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="Battlefield">
|
||||
<TitledBorder title="Game">
|
||||
<Border PropertyName="innerBorder" info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
|
||||
<EtchetBorder/>
|
||||
</Border>
|
||||
|
|
@ -167,6 +175,21 @@
|
|||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="javax.swing.JCheckBox" name="showPlayerNamesPermanently">
|
||||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" value="Show player names on avatar permanently"/>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="showPlayerNamesPermanentlyActionPerformed"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||
<BorderConstraints direction="Last"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="main_gamelog">
|
||||
|
|
@ -181,9 +204,6 @@
|
|||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AccessibilityProperties>
|
||||
<Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Game log"/>
|
||||
</AccessibilityProperties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||
<SubComponents>
|
||||
|
|
@ -1128,7 +1148,7 @@
|
|||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="131" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="135" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
public static final String KEY_SHOW_TOOLTIPS_ANY_ZONE = "showTooltipsInAnyZone";
|
||||
public static final String KEY_HAND_USE_BIG_CARDS = "handUseBigCards";
|
||||
public static final String KEY_PERMANENTS_IN_ONE_PILE = "nonLandPermanentsInOnePile";
|
||||
public static final String KEY_SHOW_PLAYER_NAMES_PERMANENTLY = "showPlayerNamesPermanently";
|
||||
public static final String KEY_GAME_LOG_AUTO_SAVE = "gameLogAutoSave";
|
||||
|
||||
public static final String KEY_CARD_IMAGES_USE_DEFAULT = "cardImagesUseDefault";
|
||||
|
|
@ -244,11 +245,12 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
tabsPanel = new javax.swing.JTabbedPane();
|
||||
tabMain = new javax.swing.JPanel();
|
||||
main_hand = new javax.swing.JPanel();
|
||||
showToolTipsInAnyZone = new javax.swing.JCheckBox();
|
||||
main_card = new javax.swing.JPanel();
|
||||
displayBigCardsInHand = new javax.swing.JCheckBox();
|
||||
main_battlefield = new javax.swing.JPanel();
|
||||
showToolTipsInAnyZone = new javax.swing.JCheckBox();
|
||||
main_game = new javax.swing.JPanel();
|
||||
nonLandPermanentsInOnePile = new javax.swing.JCheckBox();
|
||||
showPlayerNamesPermanently = new javax.swing.JCheckBox();
|
||||
main_gamelog = new javax.swing.JPanel();
|
||||
cbGameLogAutoSave = new javax.swing.JCheckBox();
|
||||
tabPhases = new javax.swing.JPanel();
|
||||
|
|
@ -339,28 +341,31 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setTitle("Preferences");
|
||||
|
||||
main_hand.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Hand"));
|
||||
main_hand.setLayout(new java.awt.BorderLayout());
|
||||
|
||||
showToolTipsInAnyZone.setSelected(true);
|
||||
showToolTipsInAnyZone.setText("Show tooltips");
|
||||
showToolTipsInAnyZone.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
showToolTipsInAnyZoneActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
main_hand.add(showToolTipsInAnyZone, java.awt.BorderLayout.CENTER);
|
||||
main_card.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Card"));
|
||||
main_card.setLayout(new java.awt.BorderLayout());
|
||||
|
||||
displayBigCardsInHand.setText("Use big images (for high resolution screens)");
|
||||
displayBigCardsInHand.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
displayBigCardsInHand.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
displayBigCardsInHandActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
main_hand.add(displayBigCardsInHand, java.awt.BorderLayout.PAGE_START);
|
||||
main_card.add(displayBigCardsInHand, java.awt.BorderLayout.PAGE_START);
|
||||
|
||||
main_battlefield.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Battlefield"));
|
||||
main_battlefield.setLayout(new java.awt.BorderLayout());
|
||||
showToolTipsInAnyZone.setSelected(true);
|
||||
showToolTipsInAnyZone.setText("Show card tooltips while hoovering with the mouse pointer over a card");
|
||||
showToolTipsInAnyZone.setToolTipText("");
|
||||
showToolTipsInAnyZone.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
||||
showToolTipsInAnyZone.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
showToolTipsInAnyZoneActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
main_card.add(showToolTipsInAnyZone, java.awt.BorderLayout.CENTER);
|
||||
|
||||
main_game.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Game"));
|
||||
main_game.setLayout(new java.awt.BorderLayout());
|
||||
|
||||
nonLandPermanentsInOnePile.setSelected(true);
|
||||
nonLandPermanentsInOnePile.setLabel("Put non-land permanents in one pile");
|
||||
|
|
@ -369,9 +374,19 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
nonLandPermanentsInOnePileActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
main_battlefield.add(nonLandPermanentsInOnePile, java.awt.BorderLayout.CENTER);
|
||||
main_game.add(nonLandPermanentsInOnePile, java.awt.BorderLayout.CENTER);
|
||||
nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile");
|
||||
|
||||
showPlayerNamesPermanently.setSelected(true);
|
||||
showPlayerNamesPermanently.setText("Show player names on avatar permanently");
|
||||
showPlayerNamesPermanently.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
showPlayerNamesPermanently.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
showPlayerNamesPermanentlyActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
main_game.add(showPlayerNamesPermanently, java.awt.BorderLayout.PAGE_END);
|
||||
|
||||
main_gamelog.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Game log"));
|
||||
main_gamelog.setLayout(new java.awt.BorderLayout());
|
||||
|
||||
|
|
@ -391,24 +406,24 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
.addGroup(tabMainLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(tabMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(main_hand, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(main_battlefield, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(main_gamelog, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 574, Short.MAX_VALUE))
|
||||
.addComponent(main_card, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(main_game, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(main_gamelog, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 533, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
tabMainLayout.setVerticalGroup(
|
||||
tabMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(tabMainLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(main_hand, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(main_card, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(main_battlefield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(main_gamelog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(171, Short.MAX_VALUE))
|
||||
.addContainerGap(188, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
main_gamelog.getAccessibleContext().setAccessibleName("Game log");
|
||||
main_card.getAccessibleContext().setAccessibleName("Game panel");
|
||||
|
||||
tabsPanel.addTab("Main", tabMain);
|
||||
|
||||
|
|
@ -1161,7 +1176,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(131, Short.MAX_VALUE))
|
||||
.addContainerGap(135, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel9Layout.setVerticalGroup(
|
||||
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
|
@ -1227,7 +1242,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(tabsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 562, Short.MAX_VALUE)
|
||||
.addComponent(tabsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 562, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(saveButton)
|
||||
|
|
@ -1256,6 +1271,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
save(prefs, dialog.showToolTipsInAnyZone, KEY_SHOW_TOOLTIPS_ANY_ZONE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.displayBigCardsInHand, KEY_HAND_USE_BIG_CARDS, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.nonLandPermanentsInOnePile, KEY_PERMANENTS_IN_ONE_PILE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.showPlayerNamesPermanently, KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true", "false", UPDATE_CACHE_POLICY);
|
||||
save(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true", "false", UPDATE_CACHE_POLICY);
|
||||
|
||||
// Phases
|
||||
|
|
@ -1321,12 +1337,6 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
dialog.setVisible(false);
|
||||
}//GEN-LAST:event_exitButtonActionPerformed
|
||||
|
||||
private void showToolTipsInAnyZoneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showToolTipsInAnyZoneActionPerformed
|
||||
}//GEN-LAST:event_showToolTipsInAnyZoneActionPerformed
|
||||
|
||||
private void displayBigCardsInHandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayBigCardsInHandActionPerformed
|
||||
}//GEN-LAST:event_displayBigCardsInHandActionPerformed
|
||||
|
||||
private void cbUseDefaultImageFolderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbUseDefaultImageFolderActionPerformed
|
||||
if (cbUseDefaultImageFolder.isSelected()) {
|
||||
useDefaultPath();
|
||||
|
|
@ -1367,9 +1377,6 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private void txtProxyPortkeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtProxyPortkeyTyped
|
||||
}//GEN-LAST:event_txtProxyPortkeyTyped
|
||||
|
||||
private void nonLandPermanentsInOnePileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nonLandPermanentsInOnePileActionPerformed
|
||||
}//GEN-LAST:event_nonLandPermanentsInOnePileActionPerformed
|
||||
|
||||
private void rememberPswdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rememberPswdActionPerformed
|
||||
}//GEN-LAST:event_rememberPswdActionPerformed
|
||||
|
||||
|
|
@ -1506,6 +1513,22 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_cbGameLogAutoSaveActionPerformed
|
||||
|
||||
private void nonLandPermanentsInOnePileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nonLandPermanentsInOnePileActionPerformed
|
||||
|
||||
}//GEN-LAST:event_nonLandPermanentsInOnePileActionPerformed
|
||||
|
||||
private void showPlayerNamesPermanentlyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showPlayerNamesPermanentlyActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_showPlayerNamesPermanentlyActionPerformed
|
||||
|
||||
private void displayBigCardsInHandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayBigCardsInHandActionPerformed
|
||||
|
||||
}//GEN-LAST:event_displayBigCardsInHandActionPerformed
|
||||
|
||||
private void showToolTipsInAnyZoneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showToolTipsInAnyZoneActionPerformed
|
||||
|
||||
}//GEN-LAST:event_showToolTipsInAnyZoneActionPerformed
|
||||
|
||||
private void showProxySettings() {
|
||||
if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) {
|
||||
this.pnlProxy.setVisible(true);
|
||||
|
|
@ -1588,6 +1611,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
load(prefs, dialog.displayBigCardsInHand, KEY_HAND_USE_BIG_CARDS, "true");
|
||||
load(prefs, dialog.showToolTipsInAnyZone, KEY_SHOW_TOOLTIPS_ANY_ZONE, "true");
|
||||
load(prefs, dialog.nonLandPermanentsInOnePile, KEY_PERMANENTS_IN_ONE_PILE, "true");
|
||||
load(prefs, dialog.showPlayerNamesPermanently, KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true");
|
||||
load(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true");
|
||||
}
|
||||
|
||||
|
|
@ -1944,14 +1968,15 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private javax.swing.JLabel lblProxyServer;
|
||||
private javax.swing.JLabel lblProxyType;
|
||||
private javax.swing.JLabel lblProxyUserName;
|
||||
private javax.swing.JPanel main_battlefield;
|
||||
private javax.swing.JPanel main_card;
|
||||
private javax.swing.JPanel main_game;
|
||||
private javax.swing.JPanel main_gamelog;
|
||||
private javax.swing.JPanel main_hand;
|
||||
private javax.swing.JCheckBox nonLandPermanentsInOnePile;
|
||||
private javax.swing.JPanel pnlProxy;
|
||||
private javax.swing.JPanel pnlProxySettings;
|
||||
private javax.swing.JCheckBox rememberPswd;
|
||||
private javax.swing.JButton saveButton;
|
||||
private javax.swing.JCheckBox showPlayerNamesPermanently;
|
||||
private javax.swing.JCheckBox showToolTipsInAnyZone;
|
||||
private javax.swing.JPanel sounds_backgroundMusic;
|
||||
private javax.swing.JPanel sounds_clips;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,28 @@
|
|||
|
||||
package mage.client.game;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Image;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.GroupLayout;
|
||||
import javax.swing.GroupLayout.Alignment;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.LayoutStyle.ComponentPlacement;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.LineBorder;
|
||||
import mage.MageException;
|
||||
import mage.cards.MageCard;
|
||||
import mage.cards.action.ActionCallback;
|
||||
|
|
@ -59,19 +81,6 @@ import mage.view.ManaPoolView;
|
|||
import mage.view.PlayerView;
|
||||
import org.mage.card.arcane.ManaSymbols;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.GroupLayout.Alignment;
|
||||
import javax.swing.LayoutStyle.ComponentPlacement;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.LineBorder;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Enhanced player pane.
|
||||
*
|
||||
|
|
@ -93,7 +102,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
|
||||
private static final int PANEL_WIDTH = 94;
|
||||
private static final int PANEL_HEIGHT = 242;
|
||||
private static final int PANEL_HEIGHT_SMALL = 190;
|
||||
private static final int PANEL_HEIGHT_SMALL = 212;
|
||||
|
||||
private static final Border greenBorder = new LineBorder(Color.green, 3);
|
||||
private static final Border redBorder = new LineBorder(Color.red, 2);
|
||||
|
|
@ -135,6 +144,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
int priorityTimeValue = pt.getCount();
|
||||
String text = getPriorityTimeLeftString(priorityTimeValue);
|
||||
PlayerPanelExt.this.avatar.setTopText(text);
|
||||
PlayerPanelExt.this.timerLabel.setText(text);
|
||||
PlayerPanelExt.this.avatar.repaint();
|
||||
}
|
||||
});
|
||||
|
|
@ -210,9 +220,10 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
this.avatar.setText(player.getName());
|
||||
if (this.timer != null) {
|
||||
if (player.getPriorityTimeLeft() != Integer.MAX_VALUE) {
|
||||
String priorityTimeValue = getPriorityTimeLeftString(player);
|
||||
this.timer.setCount(player.getPriorityTimeLeft());
|
||||
this.avatar.setTopText(priorityTimeValue);
|
||||
String priorityTimeValue = getPriorityTimeLeftString(player);
|
||||
this.timer.setCount(player.getPriorityTimeLeft());
|
||||
this.avatar.setTopText(priorityTimeValue);
|
||||
this.timerLabel.setText(priorityTimeValue);
|
||||
}
|
||||
if (player.hasPriority()) {
|
||||
this.timer.resume();
|
||||
|
|
@ -288,6 +299,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
panelBackground = new MageRoundPane();
|
||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT));
|
||||
Rectangle r = new Rectangle(80, 80);
|
||||
timerLabel = new JLabel();
|
||||
lifeLabel = new JLabel();
|
||||
handLabel = new JLabel();
|
||||
poisonLabel = new JLabel();
|
||||
|
|
@ -307,6 +319,10 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
|
||||
BufferedImage resized = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB), r);
|
||||
avatar = new HoverButton("player", resized, resized, resized, r);
|
||||
String showPlayerNamePermanently = MageFrame.getPreferences().get(PreferencesDialog.KEY_SHOW_PLAYER_NAMES_PERMANENTLY, "true");
|
||||
if (showPlayerNamePermanently.equals("true")) {
|
||||
avatar.setTextAlwaysVisible(true);
|
||||
}
|
||||
avatar.setTextOffsetButtonY(10);
|
||||
avatar.setObserver(new Command() {
|
||||
@Override
|
||||
|
|
@ -314,6 +330,12 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
session.sendPlayerUUID(gameId, playerId);
|
||||
}
|
||||
});
|
||||
// timer area /small layout)
|
||||
timerLabel.setToolTipText("Time left");
|
||||
timerLabel.setSize(80,12);
|
||||
timerLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
|
||||
// life area
|
||||
r = new Rectangle(18, 18);
|
||||
lifeLabel.setToolTipText("Life");
|
||||
Image imageLife = ImageHelper.getImageFromResources("/info/life.png");
|
||||
|
|
@ -321,6 +343,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
life = new ImagePanel(resizedLife, ImagePanel.ACTUAL);
|
||||
life.setToolTipText("Life");
|
||||
life.setOpaque(false);
|
||||
// hand area
|
||||
r = new Rectangle(18, 18);
|
||||
handLabel.setToolTipText("Hand");
|
||||
Image imageHand = ImageHelper.getImageFromResources("/info/hand.png");
|
||||
|
|
@ -451,6 +474,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
manaCountLabelX.setText("0");
|
||||
manaLabels.put("X", manaCountLabelX);
|
||||
GroupLayout gl_panelBackground = new GroupLayout(panelBackground);
|
||||
|
||||
gl_panelBackground.setHorizontalGroup(
|
||||
gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
|
|
@ -527,6 +551,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
.addGap(6)
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addComponent(btnPlayer, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(timerLabel, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(avatar, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE))
|
||||
.addGap(14))
|
||||
|
||||
|
|
@ -542,7 +567,8 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
.addComponent(avatar, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addComponent(btnPlayer)
|
||||
.addPreferredGap(ComponentPlacement.RELATED)
|
||||
.addComponent(timerLabel)
|
||||
.addGap(1)
|
||||
.addGroup(gl_panelBackground.createParallelGroup(Alignment.LEADING)
|
||||
.addGroup(gl_panelBackground.createSequentialGroup()
|
||||
.addGap(1)
|
||||
|
|
@ -631,12 +657,14 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
if (smallMode) {
|
||||
avatar.setVisible(false);
|
||||
btnPlayer.setVisible(true);
|
||||
timerLabel.setVisible(true);
|
||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL));
|
||||
panelBackground.setBounds(0, 0, PANEL_WIDTH - 2, PANEL_HEIGHT_SMALL);
|
||||
}
|
||||
else {
|
||||
avatar.setVisible(true);
|
||||
btnPlayer.setVisible(false);
|
||||
timerLabel.setVisible(false);
|
||||
panelBackground.setPreferredSize(new Dimension(PANEL_WIDTH - 2, PANEL_HEIGHT));
|
||||
panelBackground.setBounds(0, 0, PANEL_WIDTH - 2, PANEL_HEIGHT);
|
||||
}
|
||||
|
|
@ -675,6 +703,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
private JButton cheat;
|
||||
private MageRoundPane panelBackground;
|
||||
|
||||
private JLabel timerLabel;
|
||||
private JLabel lifeLabel;
|
||||
private JLabel handLabel;
|
||||
private JLabel libraryLabel;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public class NewPlayerPanel extends javax.swing.JPanel {
|
|||
this.txtPlayerName.setText(Config.defaultComputerName);
|
||||
}
|
||||
if (cbLevel.getModel().getSize() > 0) {
|
||||
cbLevel.setSelectedIndex(cbLevel.getModel().getSize()-1);
|
||||
cbLevel.setSelectedIndex((int) cbLevel.getModel().getSize()/2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue