Skip to content

Commit

Permalink
added options to list Upgrade Gui
Browse files Browse the repository at this point in the history
  • Loading branch information
megadoxs committed Feb 29, 2024
1 parent 97f8508 commit 558c210
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/GUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,24 @@ private class listUpgradeGUI extends JFrame{
JLabel price = new JLabel("Price");
add(price, gbc);

gbc.insets = new Insets(5, 30, 5, 5);
gbc.gridx = 9;
JLabel options = new JLabel("Options");
options.setFont(new Font(options.getFont().getName(), Font.PLAIN, 20));
add(options, gbc);

gbc.gridy++;
JButton addUpgrade = new JButton("Add Upgrade");
addUpgrade.setMargin(new Insets(0, 0, 0, 0));
addUpgrade addUpgradeListener = new addUpgrade();
addUpgrade.addActionListener(addUpgradeListener);
add(addUpgrade, gbc);

gbc.gridy++;
JButton seeUpgrade = new JButton("See Building's upgrades");
seeUpgrade.setMargin(new Insets(0, 0, 0, 0));
add(seeUpgrade, gbc);

applyEdit = new BetterButton[GUI.this.buildings.length];
cancelEdit = new BetterButton[GUI.this.buildings.length];

Expand Down Expand Up @@ -804,20 +822,23 @@ private void updateUpgrades(){
//delete button
gbc.insets = new Insets(5, 2, 5, 2);
delUpgrade[i] = new BetterButton("delete", i);
delUpgrade[i].setMargin(new Insets(0, 0, 0, 0));
add(delUpgrade[i], gbc);
delUpgrade delUpgradeListener = new delUpgrade();
delUpgrade[i].addActionListener(delUpgradeListener);
gbc.gridx++;

//apply button
editUpgrade[i] = new BetterButton("edit", i);
editUpgrade[i].setMargin(new Insets(0, 0, 0, 0));
add(editUpgrade[i], gbc);
editUpgrade editUpgradeListener = new editUpgrade();
editUpgrade[i].addActionListener(editUpgradeListener);
gbc.gridx++;

//apply button
buyUpgrade[i] = new BetterButton("buy", i);
buyUpgrade[i].setMargin(new Insets(0, 0, 0, 0));
add(buyUpgrade[i], gbc);
buyUpgrade buyUpgradeListener = new buyUpgrade();
buyUpgrade[i].addActionListener(buyUpgradeListener);
Expand Down Expand Up @@ -866,11 +887,14 @@ public void actionPerformed(ActionEvent evt) {

gbc.gridx = 6;
cancelEdit[id] = new BetterButton("Cancel", id);
cancelEdit[id].setMargin(new Insets(0, 0, 0, 0));
cancelEdit cancelEditListener = new cancelEdit();
cancelEdit[id].addActionListener(cancelEditListener);
add(cancelEdit[id], gbc);

gbc.gridx++;
applyEdit[id] = new BetterButton("Apply", id);
applyEdit[id].setMargin(new Insets(0, 0, 0, 0));
applyEdit applyEditListener = new applyEdit();
applyEdit[id].addActionListener(applyEditListener);
add(applyEdit[id], gbc);
Expand Down

0 comments on commit 558c210

Please sign in to comment.