mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- Added icon functionality for Quest opponents (just put a ~100x~100 sized jpeg of the opponent's name (minus the number) in /res/pics/icons, e.g. "Bart Simpson 3"
would use a "Bart Simpson.jpg" filename).
This commit is contained in:
@@ -23,7 +23,6 @@ public interface Constant {
|
||||
|
||||
public static final int[] width = new int[1];
|
||||
public static final int[] height = new int[1];
|
||||
|
||||
}
|
||||
|
||||
public interface GameType {
|
||||
@@ -134,6 +133,8 @@ public interface Constant {
|
||||
|
||||
public static final int[] humanLife = new int[1];
|
||||
public static final int[] computerLife = new int[1];
|
||||
|
||||
public static final String[] oppIconName = new String[1];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ import java.util.Observer;
|
||||
|
||||
import javax.swing.Action;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
import javax.swing.JDialog;
|
||||
@@ -497,6 +498,15 @@ public class GuiDisplay3 extends JFrame implements CardContainer, Display, NewCo
|
||||
});
|
||||
AllZone.Computer_Life.updateObservers();
|
||||
|
||||
if (AllZone.QuestData != null) {
|
||||
File base = ForgeProps.getFile(IMAGE_ICON);
|
||||
File file = new File(base, Constant.Quest.oppIconName[0]);
|
||||
ImageIcon icon = new ImageIcon(file.toString());
|
||||
|
||||
oppIconLabel.setIcon(icon);
|
||||
|
||||
}
|
||||
|
||||
oppPCLabel.setText("Poison Counters: " + AllZone.Computer_PoisonCounter.getPoisonCounters());
|
||||
AllZone.Computer_PoisonCounter.addObserver(new Observer() {
|
||||
public void update(Observable a, Object b) {
|
||||
@@ -854,6 +864,7 @@ public class GuiDisplay3 extends JFrame implements CardContainer, Display, NewCo
|
||||
oppPanel.setBorder(new TitledBorder(new EtchedBorder(), ForgeProps.getLocalized(COMPUTER_TITLE)));
|
||||
oppPanel.setLayout(new BorderLayout());
|
||||
oppPanel.add(oppNumbersPanel, BorderLayout.WEST);
|
||||
oppPanel.add(oppIconLabel, BorderLayout.CENTER);
|
||||
oppPanel.add(oppLifeLabel, BorderLayout.EAST);
|
||||
oppPanel.add(oppPCLabel, BorderLayout.AFTER_LAST_LINE);
|
||||
pane.add(new ExternalPanel(oppPanel), "compy");
|
||||
@@ -1017,6 +1028,7 @@ public class GuiDisplay3 extends JFrame implements CardContainer, Display, NewCo
|
||||
JPanel playerHandPanel = new JPanel();
|
||||
JPanel cdPanel = new JPanel();
|
||||
JLabel oppLifeLabel = new JLabel();
|
||||
JLabel oppIconLabel = new JLabel();
|
||||
JLabel playerLifeLabel = new JLabel();
|
||||
JLabel oppPCLabel = new JLabel();
|
||||
JLabel playerPCLabel = new JLabel();
|
||||
|
||||
@@ -618,6 +618,12 @@ public class Gui_Quest extends JFrame implements NewConstants{
|
||||
Constant.Runtime.HumanDeck[0] = human;
|
||||
Constant.Runtime.ComputerDeck[0] = computer;
|
||||
|
||||
String oppIconName = getOpponent();
|
||||
oppIconName = oppIconName.substring(0, oppIconName.length()-1).trim() + ".jpg";
|
||||
System.out.println(oppIconName);
|
||||
|
||||
Constant.Quest.oppIconName[0] = oppIconName;
|
||||
|
||||
//smoothLandCheckBox.isSelected() - for the AI
|
||||
|
||||
//DO NOT CHANGE THIS ORDER, GuiDisplay needs to be created before cards are added
|
||||
|
||||
Reference in New Issue
Block a user