make it work
This commit is contained in:
@@ -24,7 +24,6 @@ using System.Drawing;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Traits;
|
|
||||||
using OpenRA.Widgets;
|
using OpenRA.Widgets;
|
||||||
|
|
||||||
namespace OpenRA
|
namespace OpenRA
|
||||||
|
|||||||
@@ -398,6 +398,19 @@ namespace OpenRA.Server
|
|||||||
SyncLobbyInfo();
|
SyncLobbyInfo();
|
||||||
return true;
|
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();
|
var cmdName = cmd.Split(' ').First();
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Drawing;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
namespace OpenRA.Widgets
|
namespace OpenRA.Widgets
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,12 +16,12 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
|
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Drawing;
|
||||||
using System.Drawing;
|
using System.Linq;
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
|
|
||||||
namespace OpenRA.Widgets.Delegates
|
namespace OpenRA.Widgets.Delegates
|
||||||
@@ -54,7 +54,19 @@ namespace OpenRA.Widgets.Delegates
|
|||||||
disconnectButton.OnMouseUp = mi => {
|
disconnectButton.OnMouseUp = mi => {
|
||||||
Game.Disconnect();
|
Game.Disconnect();
|
||||||
return true;
|
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;
|
Game.LobbyInfoChanged += UpdatePlayerList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -496,7 +496,7 @@ Container:
|
|||||||
Visible: true
|
Visible: true
|
||||||
X: PARENT_RIGHT-300
|
X: PARENT_RIGHT-300
|
||||||
Y: PARENT_BOTTOM-38
|
Y: PARENT_BOTTOM-38
|
||||||
Width: 100
|
Width: 80
|
||||||
Height: 20
|
Height: 20
|
||||||
Text: Lock Teams
|
Text: Lock Teams
|
||||||
Button@DISCONNECT_BUTTON:
|
Button@DISCONNECT_BUTTON:
|
||||||
|
|||||||
Reference in New Issue
Block a user