mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Added start button and logo to image sprites in each skin, and updated FSkin and home screen code to match.
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 212 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 194 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 213 KiB |
@@ -50,7 +50,6 @@ public class HomeTopLevel extends FPanel {
|
|||||||
private FButton btnDraft, btnConstructed, btnSealed, btnQuest, btnSettings, btnUtilities, btnExit, btnDeckEditor;
|
private FButton btnDraft, btnConstructed, btnSealed, btnQuest, btnSettings, btnUtilities, btnExit, btnDeckEditor;
|
||||||
private FSkin skin;
|
private FSkin skin;
|
||||||
private String constraints;
|
private String constraints;
|
||||||
private String imgDirAddress;
|
|
||||||
private ControlHomeUI control;
|
private ControlHomeUI control;
|
||||||
|
|
||||||
private ViewConstructed constructed;
|
private ViewConstructed constructed;
|
||||||
@@ -66,7 +65,6 @@ public class HomeTopLevel extends FPanel {
|
|||||||
public HomeTopLevel() {
|
public HomeTopLevel() {
|
||||||
super();
|
super();
|
||||||
skin = AllZone.getSkin();
|
skin = AllZone.getSkin();
|
||||||
imgDirAddress = "res/images/ui/HomeScreen/default_600/";
|
|
||||||
|
|
||||||
constructed = new ViewConstructed(this);
|
constructed = new ViewConstructed(this);
|
||||||
sealed = new ViewSealed(this);
|
sealed = new ViewSealed(this);
|
||||||
@@ -146,7 +144,7 @@ public class HomeTopLevel extends FPanel {
|
|||||||
add(pnlMenu, "w 36%!, h 96%!, gap 2% 2% 2% 2%");
|
add(pnlMenu, "w 36%!, h 96%!, gap 2% 2% 2% 2%");
|
||||||
add(pnlContent, "w 58%!, h 96%!, gap 0% 2% 2% 2%");
|
add(pnlContent, "w 58%!, h 96%!, gap 0% 2% 2% 2%");
|
||||||
|
|
||||||
JLabel lblIcon = new JLabel(new ImageIcon(imgDirAddress + "Main_logo.png"));
|
JLabel lblIcon = new JLabel(new ImageIcon(skin.getImage("image.logo")));
|
||||||
pnlMenu.add(lblIcon, "ax center");
|
pnlMenu.add(lblIcon, "ax center");
|
||||||
|
|
||||||
constraints = "w 80%!, gapleft 10%, gaptop 1%, gapbottom 1%, h 40px!";
|
constraints = "w 80%!, gapleft 10%, gaptop 1%, gapbottom 1%, h 40px!";
|
||||||
@@ -225,26 +223,6 @@ public class HomeTopLevel extends FPanel {
|
|||||||
pnlContent.repaint();
|
pnlContent.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return String */
|
|
||||||
public String getImgDirAddress() {
|
|
||||||
return imgDirAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return ImageIcon */
|
|
||||||
public ImageIcon getStartButtonDown() {
|
|
||||||
return new ImageIcon(imgDirAddress + "btnStart_Down.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return ImageIcon */
|
|
||||||
public ImageIcon getStartButtonOver() {
|
|
||||||
return new ImageIcon(imgDirAddress + "btnStart_Over.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return ImageIcon */
|
|
||||||
public ImageIcon getStartButtonUp() {
|
|
||||||
return new ImageIcon(imgDirAddress + "btnStart_Up.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return ControlConstructed */
|
/** @return ControlConstructed */
|
||||||
public ControlConstructed getConstructedController() {
|
public ControlConstructed getConstructedController() {
|
||||||
return constructed.getController();
|
return constructed.getController();
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package forge.view.home;
|
package forge.view.home;
|
||||||
|
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
|
|
||||||
|
import forge.AllZone;
|
||||||
|
import forge.view.toolbox.FSkin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Write javadoc for this type.
|
* TODO: Write javadoc for this type.
|
||||||
*
|
*
|
||||||
@@ -13,13 +17,18 @@ public class StartButton extends JButton {
|
|||||||
*/
|
*/
|
||||||
public StartButton(HomeTopLevel v0) {
|
public StartButton(HomeTopLevel v0) {
|
||||||
super();
|
super();
|
||||||
|
final FSkin skin = AllZone.getSkin();
|
||||||
setRolloverEnabled(true);
|
setRolloverEnabled(true);
|
||||||
setPressedIcon(v0.getStartButtonDown());
|
setRolloverIcon(new ImageIcon(skin.getImage("button.startDOWN")));
|
||||||
setRolloverIcon(v0.getStartButtonOver());
|
|
||||||
setIcon(v0.getStartButtonUp());
|
|
||||||
setOpaque(false);
|
setOpaque(false);
|
||||||
|
setIcon(new ImageIcon(skin.getImage("button.startUP")));
|
||||||
setContentAreaFilled(false);
|
setContentAreaFilled(false);
|
||||||
setBorder(null);
|
setBorder(null);
|
||||||
setBorderPainted(false);
|
setBorderPainted(false);
|
||||||
|
|
||||||
|
// For some reason, setPressedIcon doesn't work (probably related to thread safety).
|
||||||
|
// So, the "down" image is used for the "over" state. Perhaps later can
|
||||||
|
// change back. Doublestrike 12-01-11.
|
||||||
|
//setPressedIcon(new ImageIcon(skin.getImage("button.startDOWN")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,6 +160,12 @@ public class FSkin {
|
|||||||
this.setIcon("dock.concede", image.getSubimage(80, 80, 80, 80));
|
this.setIcon("dock.concede", image.getSubimage(80, 80, 80, 80));
|
||||||
this.setIcon("dock.decklist", image.getSubimage(80, 160, 80, 80));
|
this.setIcon("dock.decklist", image.getSubimage(80, 160, 80, 80));
|
||||||
|
|
||||||
|
this.setImage("image.logo", image.getSubimage(280, 240, 200, 200));
|
||||||
|
|
||||||
|
this.setImage("button.startUP", image.getSubimage(0, 240, 160, 80));
|
||||||
|
this.setImage("button.startOVER", image.getSubimage(0, 320, 160, 80));
|
||||||
|
this.setImage("button.startDOWN", image.getSubimage(0, 400, 160, 80));
|
||||||
|
|
||||||
this.setImage("button.upLEFT", image.getSubimage(360, 0, 40, 40));
|
this.setImage("button.upLEFT", image.getSubimage(360, 0, 40, 40));
|
||||||
this.setImage("button.upCENTER", image.getSubimage(400, 0, 1, 40));
|
this.setImage("button.upCENTER", image.getSubimage(400, 0, 1, 40));
|
||||||
this.setImage("button.upRIGHT", image.getSubimage(440, 0, 40, 40));
|
this.setImage("button.upRIGHT", image.getSubimage(440, 0, 40, 40));
|
||||||
|
|||||||
Reference in New Issue
Block a user