how long has this been broken? In party games, there is a "private" checkbox instead of a
"watchable" checkbox, but it was treating it like "watchable", even thought that makes no sense for party games (at present). As it turns out, party games are broken right now anyway, which is what I'm going to fix next. For now, we'll allow party games to use a "Private" checkbox, in case someone wants to play by themselves. Private party games won't be given a "join" button. This solution is wacky, as is noted in one of the comments. This will need to be re-visited in the future, most likely when we do the massive game lobby revamp. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@420 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -49,8 +49,10 @@ public class DefaultFlexTableConfigurator extends TableConfigurator
|
||||
public function DefaultFlexTableConfigurator (
|
||||
desiredPlayers :int, minPlayers :int = -1, maxPlayers :int = -1,
|
||||
allowWatchable :Boolean = true, playersXlate :String = "Players: ",
|
||||
watchableXlate :String = "Private: ")
|
||||
watchableXlate :String = "Watchable: ", privateXlate :String = "Private: ")
|
||||
{
|
||||
var partyGame :Boolean = minPlayers < 0 && maxPlayers < 0;
|
||||
|
||||
if (minPlayers < 0) {
|
||||
minPlayers = desiredPlayers;
|
||||
}
|
||||
@@ -74,7 +76,10 @@ public class DefaultFlexTableConfigurator extends TableConfigurator
|
||||
}
|
||||
|
||||
// create up the checkbox for private games, if applicable
|
||||
if (allowWatchable) {
|
||||
if (partyGame) {
|
||||
_privateCheck = new CheckBox();
|
||||
_privateCheck.selected = false;
|
||||
} else if (allowWatchable) {
|
||||
_watchableCheck = new CheckBox();
|
||||
// default to watchable, if the game allows it.
|
||||
_watchableCheck.selected = true;
|
||||
@@ -82,6 +87,7 @@ public class DefaultFlexTableConfigurator extends TableConfigurator
|
||||
|
||||
_playersXlate = playersXlate;
|
||||
_watchableXlate = watchableXlate;
|
||||
_privateXlate = privateXlate;
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -105,6 +111,11 @@ public class DefaultFlexTableConfigurator extends TableConfigurator
|
||||
watchableLabel.text = _watchableXlate;
|
||||
watchableLabel.styleName = "lobbyLabel";
|
||||
gconf.addControl(watchableLabel, _watchableCheck);
|
||||
} else if (_privateCheck != null) {
|
||||
var privateLabel :Label = new Label();
|
||||
privateLabel.text = _privateXlate;
|
||||
privateLabel.styleName = "lobbyLabel";
|
||||
gconf.addControl(privateLabel, _privateCheck);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,20 +133,27 @@ public class DefaultFlexTableConfigurator extends TableConfigurator
|
||||
if (_playerSlider != null) {
|
||||
_config.desiredPlayerCount = _playerSlider.value;
|
||||
}
|
||||
// TODO - it is wacky for the TableConfig.privateTable to mean two different things.
|
||||
// It should be extended to have separate privateTable and watchableTable options.
|
||||
if (_watchableCheck != null) {
|
||||
_config.privateTable = !_watchableCheck.selected;
|
||||
} else if (_privateCheck != null) {
|
||||
_config.privateTable = _privateCheck.selected;
|
||||
}
|
||||
}
|
||||
|
||||
/** A slider for configuring the number of players at the table. */
|
||||
protected var _playerSlider :HSlider;
|
||||
|
||||
/** A checkbox to allow the table creator to specify if the table is
|
||||
* private. */
|
||||
/** A checkbox to allow the table creator to specify if the table is watchable */
|
||||
protected var _watchableCheck :CheckBox;
|
||||
|
||||
/** A checkbox to allow the table creator to specifiy if the table is private */
|
||||
protected var _privateCheck :CheckBox;
|
||||
|
||||
/** Translation strings passed in by the caller */
|
||||
protected var _playersXlate :String;
|
||||
protected var _watchableXlate :String;
|
||||
protected var _privateXlate :String;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user