make it work

This commit is contained in:
Chris Forbes
2010-07-10 15:54:09 +12:00
parent 2169f32a79
commit a372ba2080
5 changed files with 33 additions and 9 deletions

View File

@@ -16,12 +16,12 @@
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
namespace OpenRA.Widgets.Delegates
@@ -54,7 +54,19 @@ namespace OpenRA.Widgets.Delegates
disconnectButton.OnMouseUp = mi => {
Game.Disconnect();
return true;
};
var lockTeamsCheckbox = lobby.GetWidget("LOCKTEAMS_CHECKBOX") as CheckboxWidget;
lockTeamsCheckbox.IsVisible = () => true;
lockTeamsCheckbox.Checked = () => Game.LobbyInfo.GlobalSettings.LockTeams;
lockTeamsCheckbox.OnMouseDown = mi =>
{
if (Game.IsHost)
Game.IssueOrder(Order.Chat(
"/lockteams {0}".F(!Game.LobbyInfo.GlobalSettings.LockTeams)));
return true;
};
Game.LobbyInfoChanged += UpdatePlayerList;
}