[Jrisk-cvs] SF.net SVN: domination-code:[2587] Domination/sharedUI/src_mini_game_ui/ net/yura/domi
Brought to you by:
yuranet
|
From: <yu...@us...> - 2024-11-27 13:41:17
|
Revision: 2587
http://sourceforge.net/p/domination/code/2587
Author: yuranet
Date: 2024-11-27 13:41:15 +0000 (Wed, 27 Nov 2024)
Log Message:
-----------
do not overlap info with error
Modified Paths:
--------------
Domination/sharedUI/src_mini_game_ui/net/yura/domination/mobile/flashgui/GameWindow.java
Modified: Domination/sharedUI/src_mini_game_ui/net/yura/domination/mobile/flashgui/GameWindow.java
===================================================================
--- Domination/sharedUI/src_mini_game_ui/net/yura/domination/mobile/flashgui/GameWindow.java 2024-11-23 23:48:27 UTC (rev 2586)
+++ Domination/sharedUI/src_mini_game_ui/net/yura/domination/mobile/flashgui/GameWindow.java 2024-11-27 13:41:15 UTC (rev 2587)
@@ -248,20 +248,22 @@
}
@Override
public void paintComponent(Graphics2D g) {
- List<Player> players = myrisk.getGame().getPlayers();
- Player current = myrisk.getGame().getCurrentPlayer();
- g.setFont(font);
- final int x = font.getHeight();
- int y = font.getHeight();
- for (Player p : players) {
- g.setColor(p.getColor());
- String text = (p.getType() == Player.PLAYER_HUMAN ? "\ud83e\uddd1" : "\ud83e\udd16") + " " + p.getName() + " - " + p.getCards().size();
- g.drawString(text, x, y);
- if (p == current) {
- int offset = x + font.getWidth(text) + x / 2;
- MoveDialog.drawArrow(g, offset + (int)(x * 1.5), offset, y, y + x, ARROW_COLOR);
+ if (!isErrorShowing()) {
+ List<Player> players = myrisk.getGame().getPlayers();
+ Player current = myrisk.getGame().getCurrentPlayer();
+ g.setFont(font);
+ final int x = font.getHeight();
+ int y = font.getHeight();
+ for (Player p : players) {
+ g.setColor(p.getColor());
+ String text = (p.getType() == Player.PLAYER_HUMAN ? "\ud83e\uddd1" : "\ud83e\udd16") + " " + p.getName() + " - " + p.getCards().size();
+ g.drawString(text, x, y);
+ if (p == current) {
+ int offset = x + font.getWidth(text) + x / 2;
+ MoveDialog.drawArrow(g, offset + (int)(x * 1.5), offset, y, y + x, ARROW_COLOR);
+ }
+ y = y + x;
}
- y = y + x;
}
}
@@ -363,7 +365,7 @@
// ============================================ setup UI
boolean retry=false;
- boolean error = pp != scroll.getView();
+ boolean error = isErrorShowing();
if (!error) LoadingManager.showLoadingScreen(true);
@@ -444,6 +446,10 @@
setVisible(true);
}
+
+ private boolean isErrorShowing() {
+ return pp != scroll.getView();
+ }
@Override
public void setVisible(boolean b) {
|