Skip to content

Commit

Permalink
add digital to mass modification panel
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Dec 13, 2024
1 parent 0939618 commit a6f603f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 13 deletions.
8 changes: 8 additions & 0 deletions src/main/java/org/magic/game/actions/library/DrawActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public DrawActions() {
@Override
public void actionPerformed(ActionEvent e) {
try {


if(GamePanelGUI.getInstance().getPlayer()==null)
{
MTG.notifyError("Game is not started");
return;
}

GamePanelGUI.getInstance().getPlayer().drawCard(1);
GamePanelGUI.getInstance().getLblHandCount().setText(String.valueOf(GamePanelGUI.getInstance().getPlayer().getHand().size()));
GamePanelGUI.getInstance().getLblLibraryCount().setText(String.valueOf(GamePanelGUI.getInstance().getPlayer().getLibrary().size()));
Expand Down
40 changes: 29 additions & 11 deletions src/main/java/org/magic/gui/StockPanelGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public class StockPanelGUI extends MTGUIComponent {
private String[] selections = new String[] { "", MTGControler.getInstance().getLangService().get("NEW"),MTGControler.getInstance().getLangService().get("UPDATED"),MTGControler.getInstance().getLangService().get("ALL") };
private File fileImport;
private JButton btnDuplicate;
private JComboBox<Boolean> cboDigital;

@Override
public ImageIcon getIcon() {
Expand Down Expand Up @@ -500,7 +501,8 @@ else if (String.valueOf(cboSelections.getSelectedItem()).equals(selections[3]))
s.setCondition((EnumCondition) cboQuality.getSelectedItem());
if (cboCollection.getSelectedItem() != null)
s.setMagicCollection((MTGCollection) cboCollection.getSelectedItem());

if(cboDigital.getSelectedItem()!=null)
s.setDigital((Boolean) cboDigital.getSelectedItem());
}
model.fireTableDataChanged();
}
Expand Down Expand Up @@ -752,41 +754,57 @@ private void initGUI() {
gbccboAltered.gridx = 1;
gbccboAltered.gridy = 6;
rightPanel.add(cboAltered, gbccboAltered);


var gbclblDigital = new GridBagConstraints();
gbclblDigital.anchor = GridBagConstraints.EAST;
gbclblDigital.insets = new Insets(0, 0, 5, 5);
gbclblDigital.gridx = 0;
gbclblDigital.gridy = 7;
rightPanel.add(new JLangLabel("DIGITAL",true), gbclblDigital);

cboDigital = UITools.createCombobox(values);
var gbccboDigital = new GridBagConstraints();
gbccboDigital.insets = new Insets(0, 0, 5, 0);
gbccboDigital.fill = GridBagConstraints.HORIZONTAL;
gbccboDigital.gridx = 1;
gbccboDigital.gridy = 7;
rightPanel.add(cboDigital, gbccboDigital);


var gbclblQuality = new GridBagConstraints();
gbclblQuality.anchor = GridBagConstraints.EAST;
gbclblQuality.insets = new Insets(0, 0, 5, 5);
gbclblQuality.gridx = 0;
gbclblQuality.gridy = 7;
gbclblQuality.gridy = 8;
rightPanel.add(new JLangLabel("QUALITY",true), gbclblQuality);

cboQuality = UITools.createCombobox(Lists.asList(null,EnumCondition.values()));
var gbccboQuality = new GridBagConstraints();
gbccboQuality.insets = new Insets(0, 0, 5, 0);
gbccboQuality.fill = GridBagConstraints.HORIZONTAL;
gbccboQuality.gridx = 1;
gbccboQuality.gridy = 7;
gbccboQuality.gridy = 8;
rightPanel.add(cboQuality, gbccboQuality);

var gbclblCollection = new GridBagConstraints();
gbclblCollection.anchor = GridBagConstraints.EAST;
gbclblCollection.insets = new Insets(0, 0, 5, 5);
gbclblCollection.gridx = 0;
gbclblCollection.gridy = 8;
gbclblCollection.gridy = 9;
rightPanel.add(new JLangLabel("COLLECTION",true), gbclblCollection);

cboCollection = UITools.createComboboxCollection();
var gbccboCollection = new GridBagConstraints();
gbccboCollection.insets = new Insets(0, 0, 5, 0);
gbccboCollection.fill = GridBagConstraints.HORIZONTAL;
gbccboCollection.gridx = 1;
gbccboCollection.gridy = 8;
gbccboCollection.gridy = 9;
rightPanel.add(cboCollection, gbccboCollection);

var gbclblComment = new GridBagConstraints();
gbclblComment.insets = new Insets(0, 0, 5, 5);
gbclblComment.gridx = 0;
gbclblComment.gridy = 9;
gbclblComment.gridy = 10;
rightPanel.add(new JLangLabel("COMMENT",true), gbclblComment);

textPane = new JTextPane();
Expand All @@ -796,7 +814,7 @@ private void initGUI() {
gbctextPane.gridheight = 3;
gbctextPane.fill = GridBagConstraints.BOTH;
gbctextPane.gridx = 0;
gbctextPane.gridy = 10;
gbctextPane.gridy = 11;
rightPanel.add(textPane, gbctextPane);


Expand All @@ -805,19 +823,19 @@ private void initGUI() {
var gbcbtnApplyModification = new GridBagConstraints();
gbcbtnApplyModification.gridwidth = 2;
gbcbtnApplyModification.gridx = 0;
gbcbtnApplyModification.gridy = 13;
gbcbtnApplyModification.gridy = 14;
rightPanel.add(btnApplyModification, gbcbtnApplyModification);

var gbcSep = new GridBagConstraints();
gbcSep.gridwidth = 2;
gbcSep.gridx = 0;
gbcSep.gridy = 14;
gbcSep.gridy = 15;
rightPanel.add(new JSeparator(), gbcSep);

var gbcSepFoil = new GridBagConstraints();
gbcSepFoil.gridwidth = 2;
gbcSepFoil.gridx = 0;
gbcSepFoil.gridy = 15;
gbcSepFoil.gridy = 16;
rightPanel.add(chkboxForceFoil, gbcSepFoil);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private MTGDeckSniffer getSelectedSniffer()
public DeckSnifferDialog() {

importedDeck = new MTGDeck();
setSize(new Dimension(600, 500));
setSize(new Dimension(577, 445));
setTitle(capitalize("DECKS_IMPORTER"));
setLocationRelativeTo(null);
setIconImage(MTGConstants.ICON_DECK.getImage());
Expand All @@ -75,7 +75,7 @@ public DeckSnifferDialog() {



btnConnect = new JButton(capitalize("OPEN"));
btnConnect = new JButton(MTGConstants.ICON_SEARCH);
cboFormats = UITools.createCombobox(getSelectedSniffer().listFilter());
var labCardFilter = new JLabel("With this card : ");
var btnCardImport = UITools.createBindableJButton("", MTGConstants.ICON_TAB_IMPORT, KeyEvent.VK_I, "WithCard");
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/data/sets_codeAliases.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@
"4BB"
],
"PMEI": [
"PJSC",
"PSPL",
"P30M",
"PH22",
Expand Down

0 comments on commit a6f603f

Please sign in to comment.