Respawn shuttle transport duration can be adjusted or set to unlimited (= shuttle won't leave after spawning), subs with the HideInMenus tag aren't shown in menus, respawn info msgs are shown to all players
This commit is contained in:
@@ -57,14 +57,14 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
|
||||
|
||||
[HasDefaultValue(120.0f, true)]
|
||||
[HasDefaultValue(300.0f, true)]
|
||||
public float RespawnInterval
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
[HasDefaultValue(60.0f, true)]
|
||||
[HasDefaultValue(180.0f, true)]
|
||||
public float MaxTransportTime
|
||||
{
|
||||
get;
|
||||
@@ -236,7 +236,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
settingsFrame = new GUIFrame(new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.Black * 0.5f);
|
||||
|
||||
GUIFrame innerFrame = new GUIFrame(new Rectangle(0, 0, 400, 420), null, Alignment.Center, GUI.Style, settingsFrame);
|
||||
GUIFrame innerFrame = new GUIFrame(new Rectangle(0, 0, 400, 430), null, Alignment.Center, GUI.Style, settingsFrame);
|
||||
innerFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, -5, 0, 20), "Settings", GUI.Style, innerFrame, GUI.LargeFont);
|
||||
@@ -361,14 +361,44 @@ namespace Barotrauma.Networking
|
||||
minRespawnSlider.BarScroll = MinRespawnRatio;
|
||||
minRespawnSlider.OnMoved = (GUIScrollBar scrollBar, float barScroll) =>
|
||||
{
|
||||
GUITextBlock voteText = scrollBar.UserData as GUITextBlock;
|
||||
GUITextBlock txt = scrollBar.UserData as GUITextBlock;
|
||||
|
||||
MinRespawnRatio = barScroll;
|
||||
voteText.Text = "Minimum players to respawn: " + (int)MathUtils.Round(MinRespawnRatio * 100.0f, 10.0f) + " %";
|
||||
txt.Text = "Minimum players to respawn: " + (int)MathUtils.Round(MinRespawnRatio * 100.0f, 10.0f) + " %";
|
||||
return true;
|
||||
};
|
||||
minRespawnSlider.OnMoved(minRespawnSlider, MinRespawnRatio);
|
||||
|
||||
y += 35;
|
||||
|
||||
var respawnDurationText = new GUITextBlock(new Rectangle(0, y, 200, 20), "Duration of respawn transport", GUI.Style, settingsTabs[0]);
|
||||
respawnDurationText.ToolTip = "The amount of time respawned players have to navigate the respawn shuttle to the main submarine. " +
|
||||
"After the duration expires, the shuttle will automatically head back out of the level.";
|
||||
|
||||
var respawnDurationSlider = new GUIScrollBar(new Rectangle(150, y + 22, 100, 10), GUI.Style, 0.1f, settingsTabs[0]);
|
||||
respawnDurationSlider.ToolTip = minRespawnText.ToolTip;
|
||||
respawnDurationSlider.UserData = respawnDurationText;
|
||||
respawnDurationSlider.Step = 0.1f;
|
||||
respawnDurationSlider.BarScroll = MinRespawnRatio;
|
||||
respawnDurationSlider.OnMoved = (GUIScrollBar scrollBar, float barScroll) =>
|
||||
{
|
||||
GUITextBlock txt = scrollBar.UserData as GUITextBlock;
|
||||
|
||||
if (barScroll == 1.0f)
|
||||
{
|
||||
MaxTransportTime = 0;
|
||||
txt.Text = "Duration of respawn transport: unlimited";
|
||||
}
|
||||
else
|
||||
{
|
||||
MaxTransportTime = barScroll * 600.0f + 60.0f;
|
||||
txt.Text = "Duration of respawn transport: " + ToolBox.SecondsToReadableTime(MaxTransportTime);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
respawnDurationSlider.OnMoved(respawnDurationSlider, (MaxTransportTime - 60.0f)/600.0f);
|
||||
|
||||
y += 40;
|
||||
|
||||
|
||||
|
||||
@@ -391,10 +391,9 @@ namespace Barotrauma.Networking
|
||||
string respawnInfo = "";
|
||||
|
||||
if (respawnManager.CurrentState == RespawnManager.State.Waiting &&
|
||||
respawnManager.CountdownStarted &&
|
||||
myCharacter != null && myCharacter.IsDead)
|
||||
respawnManager.CountdownStarted)
|
||||
{
|
||||
respawnInfo = respawnManager.RespawnTimer <= 0.0f ? "" : "Respawning in " + ToolBox.SecondsToReadableTime(respawnManager.RespawnTimer);
|
||||
respawnInfo = respawnManager.RespawnTimer <= 0.0f ? "" : "Respawn Shuttle dispatching in " + ToolBox.SecondsToReadableTime(respawnManager.RespawnTimer);
|
||||
|
||||
}
|
||||
else if (respawnManager.CurrentState == RespawnManager.State.Transporting)
|
||||
@@ -405,7 +404,7 @@ namespace Barotrauma.Networking
|
||||
if (!string.IsNullOrEmpty(respawnInfo))
|
||||
{
|
||||
GUI.DrawString(spriteBatch,
|
||||
new Vector2(GameMain.GraphicsWidth - 300.0f, 20),
|
||||
new Vector2(GameMain.GraphicsWidth - 400.0f, 20),
|
||||
respawnInfo, Color.White, null, 0, GUI.SmallFont);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,9 @@ namespace Barotrauma.Networking
|
||||
networkMember.AddChatMessage("The shuttle will automatically return back to the outpost. Please leave the shuttle immediately.", ChatMessageType.Server);
|
||||
}
|
||||
|
||||
//infinite transport time -> shuttle wont return
|
||||
if (maxTransportTime < 0.1f) return;
|
||||
|
||||
var server = networkMember as GameServer;
|
||||
if (server == null) return;
|
||||
|
||||
@@ -196,15 +199,6 @@ namespace Barotrauma.Networking
|
||||
shuttleReturnTimer = maxTransportTime;
|
||||
shuttleTransportTimer = maxTransportTime;
|
||||
}
|
||||
|
||||
//shuttleReturnTimer += deltaTime;
|
||||
//if (shuttleReturnTimer > 10.0f)
|
||||
//{
|
||||
// state = State.Returning;
|
||||
|
||||
// server.SendRespawnManagerMsg();
|
||||
// shuttleReturnTimer = 0.0f;
|
||||
//}
|
||||
}
|
||||
|
||||
private void UpdateReturning(float deltaTime)
|
||||
@@ -477,7 +471,7 @@ namespace Barotrauma.Networking
|
||||
CoroutineManager.StartCoroutine(ForceShuttleToPos(Level.Loaded.StartPosition - Vector2.UnitY * Level.ShaftHeight, 100.0f), "forcepos");
|
||||
break;
|
||||
case State.Waiting:
|
||||
CountdownStarted = true;
|
||||
CountdownStarted = inc.ReadBoolean();
|
||||
|
||||
ResetShuttle();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user