summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/view')
-rw-r--r--src/jrummikub/view/impl/GameListPanel.java18
-rw-r--r--src/jrummikub/view/impl/SettingsPanel.java2
2 files changed, 16 insertions, 4 deletions
diff --git a/src/jrummikub/view/impl/GameListPanel.java b/src/jrummikub/view/impl/GameListPanel.java
index d22dc02..7324559 100644
--- a/src/jrummikub/view/impl/GameListPanel.java
+++ b/src/jrummikub/view/impl/GameListPanel.java
@@ -21,6 +21,8 @@ import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
+import jrummikub.model.PlayerSettings;
+import jrummikub.model.PlayerSettings.Type;
import jrummikub.util.Event;
import jrummikub.util.Event1;
import jrummikub.util.GameData;
@@ -188,13 +190,21 @@ class GameListPanel extends JPanel implements IGameListPanel {
int index, boolean isSelected, boolean cellHasFocus) {
String host = "", playerCount = "";
- if (value instanceof GameData && ((GameData)value).getGameSettings() != null) {
+ if (value instanceof GameData
+ && ((GameData) value).getGameSettings() != null) {
GameData gameData = (GameData) value;
host = gameData.getHost();
- /*playerCount = gameData.getCurrentPlayerCount() + "/"
- + gameData.getMaxPlayerCount();*/
- playerCount = String.valueOf(gameData.getGameSettings().getPlayerList().size());
+ int total = gameData.getGameSettings().getPlayerList().size();
+ int occupied = total;
+
+ for (PlayerSettings player : gameData.getGameSettings().getPlayerList()) {
+ if (player.getType() == Type.VACANT) {
+ occupied--;
+ }
+ }
+
+ playerCount = occupied + "/" + total;
} else {
host = String.valueOf(value);
}
diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java
index 60fe20c..8ec9d3e 100644
--- a/src/jrummikub/view/impl/SettingsPanel.java
+++ b/src/jrummikub/view/impl/SettingsPanel.java
@@ -275,6 +275,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
@Override
public void enableStartGameButton(boolean enable) {
startButton.setEnabled(enable);
+ offerButton.setEnabled(enable);
}
@Override
@@ -861,6 +862,7 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
case HUMAN:
return "Mensch";
case NETWORK:
+ case VACANT:
return "Netzwerk";
}