Added timer to small layout (fixes #353). Added option to show player name on avatar permanently.

This commit is contained in:
LevelX2 2013-10-26 13:01:04 +02:00
parent 203dd13b44
commit 18d8d3a753
5 changed files with 166 additions and 86 deletions

View file

@ -23,6 +23,7 @@ public class HoverButton extends JPanel implements MouseListener {
private Rectangle imageSize;
private Rectangle buttonSize;
private String text;
private boolean textAlwaysVisible = false;
private int textOffsetY = 0;
private int textOffsetButtonY = 2;
private int textOffsetX = -1;
@ -77,7 +78,7 @@ public class HoverButton extends JPanel implements MouseListener {
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
if (isEnabled()) {
if (isHovered) {
if (isHovered || textAlwaysVisible) {
g.drawImage(hoverImage, 0, 0, imageSize.width, imageSize.height, this);
if (text != null) {
if (textColor != null) {
@ -271,4 +272,9 @@ public class HoverButton extends JPanel implements MouseListener {
public void setTopText(String topText) {
this.topText = topText;
}
public void setTextAlwaysVisible(boolean textAlwaysVisible) {
this.textAlwaysVisible = textAlwaysVisible;
}
}