Added an option to respawn directly in the main sub
This commit is contained in:
@@ -528,12 +528,14 @@ namespace Barotrauma.Networking
|
||||
string subName = inc.ReadString();
|
||||
string subHash = inc.ReadString();
|
||||
|
||||
bool usingShuttle = inc.ReadBoolean();
|
||||
string shuttleName = inc.ReadString();
|
||||
string shuttleHash = inc.ReadString();
|
||||
|
||||
NetOutgoingMessage readyToStartMsg = client.CreateMessage();
|
||||
readyToStartMsg.Write((byte)ClientPacketHeader.RESPONSE_STARTGAME);
|
||||
|
||||
GameMain.NetLobbyScreen.UsingShuttle = usingShuttle;
|
||||
readyToStartMsg.Write(
|
||||
GameMain.NetLobbyScreen.TrySelectSub(subName, subHash, GameMain.NetLobbyScreen.SubList) &&
|
||||
GameMain.NetLobbyScreen.TrySelectSub(shuttleName, shuttleHash, GameMain.NetLobbyScreen.ShuttleList.ListBox));
|
||||
@@ -654,6 +656,7 @@ namespace Barotrauma.Networking
|
||||
string subName = inc.ReadString();
|
||||
string subHash = inc.ReadString();
|
||||
|
||||
bool usingShuttle = inc.ReadBoolean();
|
||||
string shuttleName = inc.ReadString();
|
||||
string shuttleHash = inc.ReadString();
|
||||
|
||||
@@ -697,6 +700,8 @@ namespace Barotrauma.Networking
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
GameMain.NetLobbyScreen.UsingShuttle = usingShuttle;
|
||||
|
||||
if (campaign == null)
|
||||
{
|
||||
if (!GameMain.NetLobbyScreen.TrySelectSub(subName, subHash, GameMain.NetLobbyScreen.SubList))
|
||||
@@ -723,7 +728,7 @@ namespace Barotrauma.Networking
|
||||
GameMain.GameSession.StartRound(campaign.Map.SelectedConnection.Level, true, false);
|
||||
}
|
||||
|
||||
if (respawnAllowed) respawnManager = new RespawnManager(this, GameMain.NetLobbyScreen.SelectedShuttle);
|
||||
if (respawnAllowed) respawnManager = new RespawnManager(this, GameMain.NetLobbyScreen.UsingShuttle ? GameMain.NetLobbyScreen.SelectedShuttle : null);
|
||||
|
||||
if (isTraitor)
|
||||
{
|
||||
@@ -842,6 +847,7 @@ namespace Barotrauma.Networking
|
||||
string selectSubName = inc.ReadString();
|
||||
string selectSubHash = inc.ReadString();
|
||||
|
||||
bool usingShuttle = inc.ReadBoolean();
|
||||
string selectShuttleName = inc.ReadString();
|
||||
string selectShuttleHash = inc.ReadString();
|
||||
|
||||
@@ -878,6 +884,8 @@ namespace Barotrauma.Networking
|
||||
GameMain.NetLobbyScreen.ServerName = serverName;
|
||||
GameMain.NetLobbyScreen.ServerMessage.Text = serverText;
|
||||
|
||||
GameMain.NetLobbyScreen.UsingShuttle = usingShuttle;
|
||||
|
||||
if (!allowSubVoting)
|
||||
{
|
||||
GameMain.NetLobbyScreen.TrySelectSub(selectSubName, selectSubHash, GameMain.NetLobbyScreen.SubList);
|
||||
|
||||
@@ -137,8 +137,8 @@ namespace Barotrauma.Networking
|
||||
if (respawnManager.CurrentState == RespawnManager.State.Waiting &&
|
||||
respawnManager.CountdownStarted)
|
||||
{
|
||||
respawnInfo = respawnManager.RespawnTimer <= 0.0f ? "" : "Respawn Shuttle dispatching in " + ToolBox.SecondsToReadableTime(respawnManager.RespawnTimer);
|
||||
|
||||
respawnInfo = respawnManager.UsingShuttle ? "Respawn Shuttle dispatching in " : "Respawning players in ";
|
||||
respawnInfo = respawnManager.RespawnTimer <= 0.0f ? "" : respawnInfo + ToolBox.SecondsToReadableTime(respawnManager.RespawnTimer);
|
||||
}
|
||||
else if (respawnManager.CurrentState == RespawnManager.State.Transporting)
|
||||
{
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace Barotrauma
|
||||
private GUITickBox autoRestartBox;
|
||||
|
||||
private GUIDropDown shuttleList;
|
||||
private GUITickBox shuttleTickBox;
|
||||
|
||||
private CampaignUI campaignUI;
|
||||
|
||||
@@ -77,6 +78,11 @@ namespace Barotrauma
|
||||
get { return shuttleList; }
|
||||
}
|
||||
|
||||
public GUITickBox ShuttleTickBox
|
||||
{
|
||||
get { return shuttleTickBox; }
|
||||
}
|
||||
|
||||
public GUIListBox ModeList
|
||||
{
|
||||
get { return modeList; }
|
||||
@@ -120,6 +126,12 @@ namespace Barotrauma
|
||||
get { return shuttleList.SelectedData as Submarine; }
|
||||
}
|
||||
|
||||
public bool UsingShuttle
|
||||
{
|
||||
get { return shuttleTickBox.Selected; }
|
||||
set { shuttleTickBox.Selected = value; if (GameMain.Client != null) shuttleTickBox.Enabled = false; }
|
||||
}
|
||||
|
||||
public GameModePreset SelectedMode
|
||||
{
|
||||
get { return modeList.SelectedData as GameModePreset; }
|
||||
@@ -245,9 +257,15 @@ namespace Barotrauma
|
||||
|
||||
//respawn shuttle ------------------------------------------------------------------
|
||||
|
||||
new GUITextBlock(new Rectangle(columnX, 110, 20, 20), "Respawn shuttle:", "", defaultModeContainer);
|
||||
shuttleTickBox = new GUITickBox(new Rectangle(columnX, 110, 20, 20), "Respawn shuttle:",Alignment.Left, defaultModeContainer);
|
||||
shuttleList = new GUIDropDown(new Rectangle(columnX, 140, 200, 20), "", "", defaultModeContainer);
|
||||
|
||||
shuttleTickBox.Selected = true;
|
||||
shuttleTickBox.OnSelected = (GUITickBox box) =>
|
||||
{
|
||||
shuttleList.Enabled = box.Selected;
|
||||
if (GameMain.Server != null) lastUpdateID++;
|
||||
return true;
|
||||
};
|
||||
|
||||
//gamemode ------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user