make it work
This commit is contained in:
@@ -24,7 +24,6 @@ using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA
|
||||
|
||||
@@ -398,6 +398,19 @@ namespace OpenRA.Server
|
||||
SyncLobbyInfo();
|
||||
return true;
|
||||
}},
|
||||
{ "lockteams",
|
||||
s =>
|
||||
{
|
||||
if (conn.PlayerIndex != 0)
|
||||
{
|
||||
SendChatTo( conn, "Only the host can set that option" );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool.TryParse(s, out lobbyInfo.GlobalSettings.LockTeams);
|
||||
SyncLobbyInfo();
|
||||
return true;
|
||||
}},
|
||||
};
|
||||
|
||||
var cmdName = cmd.Split(' ').First();
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Drawing;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenRA.Widgets
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -496,7 +496,7 @@ Container:
|
||||
Visible: true
|
||||
X: PARENT_RIGHT-300
|
||||
Y: PARENT_BOTTOM-38
|
||||
Width: 100
|
||||
Width: 80
|
||||
Height: 20
|
||||
Text: Lock Teams
|
||||
Button@DISCONNECT_BUTTON:
|
||||
|
||||
Reference in New Issue
Block a user