mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
GUI: improved choose X or number dialog (added source ability and card hint support, added limits info);
game: choose X - added source ability info to game logs;
This commit is contained in:
parent
d97b034711
commit
d4a1e27a44
5 changed files with 124 additions and 99 deletions
|
|
@ -37,7 +37,7 @@ public class MageEditorPane extends JEditorPane {
|
|||
final HTMLDocument doc;
|
||||
|
||||
|
||||
MageEditorPane() {
|
||||
public MageEditorPane() {
|
||||
super();
|
||||
// merge with UI.setHTMLEditorKit
|
||||
this.setEditorKit(kit);
|
||||
|
|
|
|||
|
|
@ -22,10 +22,12 @@
|
|||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jScrollPane1" pref="183" max="32767" attributes="0"/>
|
||||
<Component id="scrollMessage" pref="183" max="32767" attributes="0"/>
|
||||
<Component id="panelCommands" alignment="1" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="spnAmount" min="-2" pref="74" max="-2" attributes="0"/>
|
||||
<Component id="editAmount" min="-2" pref="74" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="labelLimits" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
|
|
@ -37,9 +39,12 @@
|
|||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane1" pref="117" max="32767" attributes="0"/>
|
||||
<Component id="scrollMessage" pref="117" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spnAmount" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="editAmount" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="labelLimits" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="panelCommands" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
|
|
@ -48,7 +53,7 @@
|
|||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
<Container class="javax.swing.JScrollPane" name="scrollMessage">
|
||||
<Properties>
|
||||
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
|
|
@ -59,26 +64,28 @@
|
|||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTextPane" name="lblMessage">
|
||||
<Component class="mage.client.components.MageEditorPane" name="textMessage">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="text" type="java.lang.String" value="long text long text long text long text long text long text long text long text"/>
|
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="null	" type="code"/>
|
||||
</Property>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="opaque" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JSpinner" name="spnAmount">
|
||||
<Component class="javax.swing.JSpinner" name="editAmount">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
|
||||
<SpinnerModel initial="1" numberType="java.lang.Integer" stepSize="1" type="number"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="labelLimits">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="min 1, max 123"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="panelCommands">
|
||||
|
||||
<Layout>
|
||||
|
|
@ -86,9 +93,9 @@
|
|||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="btnOk" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonOk" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonCancel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
|
|
@ -98,8 +105,8 @@
|
|||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="btnOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
|
@ -107,23 +114,23 @@
|
|||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JButton" name="btnOk">
|
||||
<Component class="javax.swing.JButton" name="buttonOk">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Choose"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOkActionPerformed"/>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonOkActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="getRootPane().setDefaultButton(btnOk);"/>
|
||||
<AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="getRootPane().setDefaultButton(buttonOk);"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btnCancel">
|
||||
<Component class="javax.swing.JButton" name="buttonCancel">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Cancel"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCancelActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
|
|
|
|||
|
|
@ -5,30 +5,39 @@ import mage.client.MageFrame;
|
|||
import javax.swing.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Game GUI: choose number
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @author BetaSteward_at_googlemail.com, JayDi85
|
||||
*/
|
||||
public class PickNumberDialog extends MageDialog {
|
||||
|
||||
private boolean cancel;
|
||||
|
||||
/**
|
||||
* Creates new form PickNumberDialog
|
||||
*/
|
||||
public PickNumberDialog() {
|
||||
initComponents();
|
||||
|
||||
this.textMessage.enableHyperlinksAndCardPopups();
|
||||
this.setModal(true);
|
||||
}
|
||||
|
||||
public void showDialog(int min, int max, String message) {
|
||||
this.spnAmount.setModel(new SpinnerNumberModel(min, min, max, 1));
|
||||
this.lblMessage.setContentType("text/html");
|
||||
this.lblMessage.setText(message);
|
||||
this.btnOk.setVisible(true);
|
||||
this.btnCancel.setVisible(false);
|
||||
this.editAmount.setModel(new SpinnerNumberModel(min, min, max, 1));
|
||||
this.textMessage.setContentType("text/html");
|
||||
this.textMessage.setText(message);
|
||||
|
||||
List<String> limits = new ArrayList<>();
|
||||
if (min != Integer.MIN_VALUE) {
|
||||
limits.add("from " + min);
|
||||
}
|
||||
limits.add("to " + (max == Integer.MAX_VALUE ? "any" : max));
|
||||
this.labelLimits.setText(String.join(" ", limits));
|
||||
|
||||
this.buttonOk.setVisible(true);
|
||||
this.buttonCancel.setVisible(false);
|
||||
this.pack();
|
||||
|
||||
// window settings
|
||||
|
|
@ -39,11 +48,11 @@ public class PickNumberDialog extends MageDialog {
|
|||
MageFrame.getDesktop().add(this, JLayeredPane.PALETTE_LAYER);
|
||||
}
|
||||
|
||||
this.getRootPane().setDefaultButton(this.btnOk); // restore default button after root panel change (no need actually)
|
||||
this.getRootPane().setDefaultButton(this.buttonOk); // restore default button after root panel change (no need actually)
|
||||
|
||||
// enable spinner's enter key like text (one enter press instead two)
|
||||
// https://stackoverflow.com/questions/3873870/java-keylistener-not-firing-on-jspinner
|
||||
((JSpinner.DefaultEditor) this.spnAmount.getEditor()).getTextField().addKeyListener(new KeyListener() {
|
||||
((JSpinner.DefaultEditor) this.editAmount.getEditor()).getTextField().addKeyListener(new KeyListener() {
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
|
|
@ -52,7 +61,7 @@ public class PickNumberDialog extends MageDialog {
|
|||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||
btnOk.doClick();
|
||||
buttonOk.doClick();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -69,7 +78,7 @@ public class PickNumberDialog extends MageDialog {
|
|||
}
|
||||
|
||||
public int getAmount() {
|
||||
return ((Number) spnAmount.getValue()).intValue();
|
||||
return ((Number) editAmount.getValue()).intValue();
|
||||
}
|
||||
|
||||
public boolean isCancel() {
|
||||
|
|
@ -86,108 +95,115 @@ public class PickNumberDialog extends MageDialog {
|
|||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
lblMessage = new javax.swing.JTextPane();
|
||||
spnAmount = new javax.swing.JSpinner();
|
||||
scrollMessage = new javax.swing.JScrollPane();
|
||||
textMessage = new mage.client.components.MageEditorPane();
|
||||
editAmount = new javax.swing.JSpinner();
|
||||
labelLimits = new javax.swing.JLabel();
|
||||
panelCommands = new javax.swing.JPanel();
|
||||
btnOk = new javax.swing.JButton();
|
||||
btnCancel = new javax.swing.JButton();
|
||||
buttonOk = new javax.swing.JButton();
|
||||
buttonCancel = new javax.swing.JButton();
|
||||
|
||||
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
jScrollPane1.setFocusable(false);
|
||||
scrollMessage.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
scrollMessage.setFocusable(false);
|
||||
|
||||
lblMessage.setEditable(false);
|
||||
lblMessage.setText("long text long text long text long text long text long text long text long text");
|
||||
lblMessage.setCursor(null);
|
||||
lblMessage.setFocusable(false);
|
||||
lblMessage.setOpaque(false);
|
||||
jScrollPane1.setViewportView(lblMessage);
|
||||
textMessage.setEditable(false);
|
||||
textMessage.setText("long text long text long text long text long text long text long text long text");
|
||||
textMessage.setFocusable(false);
|
||||
textMessage.setOpaque(false);
|
||||
scrollMessage.setViewportView(textMessage);
|
||||
|
||||
spnAmount.setModel(new javax.swing.SpinnerNumberModel(1, null, null, 1));
|
||||
editAmount.setModel(new javax.swing.SpinnerNumberModel(1, null, null, 1));
|
||||
|
||||
btnOk.setText("Choose");
|
||||
btnOk.addActionListener(new java.awt.event.ActionListener() {
|
||||
labelLimits.setText("min 1, max 123");
|
||||
|
||||
buttonOk.setText("Choose");
|
||||
buttonOk.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
btnOkActionPerformed(evt);
|
||||
buttonOkActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
btnCancel.setText("Cancel");
|
||||
btnCancel.addActionListener(new java.awt.event.ActionListener() {
|
||||
buttonCancel.setText("Cancel");
|
||||
buttonCancel.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
btnCancelActionPerformed(evt);
|
||||
buttonCancelActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout panelCommandsLayout = new javax.swing.GroupLayout(panelCommands);
|
||||
panelCommands.setLayout(panelCommandsLayout);
|
||||
panelCommandsLayout.setHorizontalGroup(
|
||||
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelCommandsLayout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(btnOk)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnCancel)
|
||||
.addContainerGap())
|
||||
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelCommandsLayout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonOk)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonCancel)
|
||||
.addContainerGap())
|
||||
);
|
||||
panelCommandsLayout.setVerticalGroup(
|
||||
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelCommandsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(btnOk)
|
||||
.addComponent(btnCancel))
|
||||
.addContainerGap())
|
||||
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelCommandsLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonOk)
|
||||
.addComponent(buttonCancel))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
getRootPane().setDefaultButton(btnOk);
|
||||
getRootPane().setDefaultButton(buttonOk);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
|
||||
.addComponent(panelCommands, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(spnAmount, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(scrollMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
|
||||
.addComponent(panelCommands, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(editAmount, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(labelLimits)
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spnAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(panelCommands, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(scrollMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(editAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(labelLimits))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(panelCommands, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void btnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOkActionPerformed
|
||||
private void buttonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOkActionPerformed
|
||||
this.cancel = false;
|
||||
this.hideDialog();
|
||||
}//GEN-LAST:event_btnOkActionPerformed
|
||||
}//GEN-LAST:event_buttonOkActionPerformed
|
||||
|
||||
private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
|
||||
private void buttonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCancelActionPerformed
|
||||
this.cancel = true;
|
||||
this.hideDialog();
|
||||
}//GEN-LAST:event_btnCancelActionPerformed
|
||||
}//GEN-LAST:event_buttonCancelActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton btnCancel;
|
||||
private javax.swing.JButton btnOk;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JTextPane lblMessage;
|
||||
private javax.swing.JButton buttonCancel;
|
||||
private javax.swing.JButton buttonOk;
|
||||
private javax.swing.JSpinner editAmount;
|
||||
private javax.swing.JLabel labelLimits;
|
||||
private javax.swing.JPanel panelCommands;
|
||||
private javax.swing.JSpinner spnAmount;
|
||||
private javax.swing.JScrollPane scrollMessage;
|
||||
private mage.client.components.MageEditorPane textMessage;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1658,7 +1658,7 @@ public class HumanPlayer extends PlayerImpl {
|
|||
while (canRespond()) {
|
||||
prepareForResponse(game);
|
||||
if (!isExecutingMacro()) {
|
||||
game.fireGetAmountEvent(playerId, message + extraMessage, min, max);
|
||||
game.fireGetAmountEvent(playerId, message + extraMessage + CardUtil.getSourceLogName(game, ability), min, max);
|
||||
}
|
||||
waitForResponse(game);
|
||||
|
||||
|
|
|
|||
|
|
@ -401,7 +401,8 @@ public abstract class AbilityImpl implements Ability {
|
|||
}
|
||||
if (variableManaCost != null) {
|
||||
int xValue = getManaCostsToPay().getX();
|
||||
game.informPlayers(controller.getLogName() + " announces a value of " + xValue + " for " + variableManaCost.getText());
|
||||
game.informPlayers(controller.getLogName() + " announces a value of " + xValue + " for " + variableManaCost.getText()
|
||||
+ CardUtil.getSourceLogName(game, this));
|
||||
}
|
||||
activated = true;
|
||||
return true;
|
||||
|
|
@ -516,7 +517,8 @@ public abstract class AbilityImpl implements Ability {
|
|||
// - Spells with additional costs that include X won't be affected by Unbound Flourishing. X must be in the spell's mana cost.
|
||||
variableCost.setAmount(xValue, xValue, false);
|
||||
((Cost) variableCost).setPaid();
|
||||
String message = controller.getLogName() + " announces a value of " + xValue + " (" + variableCost.getActionText() + ')';
|
||||
String message = controller.getLogName() + " announces a value of " + xValue + " (" + variableCost.getActionText() + ')'
|
||||
+ CardUtil.getSourceLogName(game, this);
|
||||
announceString.append(message);
|
||||
setCostsTag("X",xValue);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue