summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/view/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/view/impl')
-rw-r--r--src/jrummikub/view/impl/SettingsPanel.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/jrummikub/view/impl/SettingsPanel.java b/src/jrummikub/view/impl/SettingsPanel.java
index a96c5a7..02dfc10 100644
--- a/src/jrummikub/view/impl/SettingsPanel.java
+++ b/src/jrummikub/view/impl/SettingsPanel.java
@@ -41,6 +41,7 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import jrummikub.control.turn.TurnControlFactory;
+import jrummikub.control.turn.TurnControlFactory.Type;
import jrummikub.model.GameSettings;
import jrummikub.model.PlayerSettings;
import jrummikub.util.Event;
@@ -312,10 +313,12 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
nameField.setText(settings.getName());
}
// playerType.setSelectedIndex(0);
- playerType.setSelectedIndex(Arrays.binarySearch(
+ int index = Arrays.binarySearch(
TurnControlFactory.Type.values(),
- settings.getTurnControlType()));
-
+ settings.getTurnControlType());
+ if (index != playerType.getSelectedIndex()) {
+ playerType.setSelectedIndex(index);
+ }
colorButton.setIcon(ImageUtil.createColorIcon(settings.getColor(),
16, 2));
}
@@ -494,4 +497,9 @@ class SettingsPanel extends JPanel implements ISettingsPanel {
public void setJokerNumber(int jokerNumber) {
jokerNumberSpinner.setValue(jokerNumber);
}
+
+ @Override
+ public IEvent2<Integer, Type> getChangePlayerTypeEvent() {
+ return changePlayerTypeEvent;
+ }
}