forked from External/mage
game timer: Add chess-style buffer time option (#10598)
* UI Changes * Add new buffer time options * Main functionality * Final implementation Also added player UI for when they are using their buffer time (timer turns green)
This commit is contained in:
parent
b7543af939
commit
519b3988be
24 changed files with 273 additions and 16 deletions
|
|
@ -57,6 +57,7 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
private Command observer = null;
|
||||
private Command onHover = null;
|
||||
private Color textColor = Color.white;
|
||||
private Color topTextColor = null;
|
||||
private final Rectangle centerTextArea = new Rectangle(5, 18, 75, 40);
|
||||
private Color centerTextColor = new Color(200, 210, 0, 200);
|
||||
private Color origCenterTextColor = new Color(200, 210, 0, 200);
|
||||
|
|
@ -152,7 +153,7 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
topTextOffsetX = calculateOffsetForTop(g2d, topText);
|
||||
g2d.setColor(textBGColor);
|
||||
g2d.drawString(topText, topTextOffsetX + 1, 14);
|
||||
g2d.setColor(textColor);
|
||||
g2d.setColor(topTextColor != null ? topTextColor : textColor);
|
||||
g2d.drawString(topText, topTextOffsetX, 13);
|
||||
}
|
||||
if (topTextImage != null) {
|
||||
|
|
@ -235,6 +236,15 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
this.textColor = textColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides textColor for the upper text if non-null.
|
||||
* If null, return back to textColor.
|
||||
* @param textColor
|
||||
*/
|
||||
public void setTopTextColor(Color textColor) {
|
||||
this.topTextColor = textColor;
|
||||
}
|
||||
|
||||
public void setOverlayImage(Image image) {
|
||||
this.overlayImage = image;
|
||||
this.overlayImageSize = new Dimension(image.getWidth(null), image.getHeight(null));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue