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:
@@ -363,7 +363,7 @@ namespace Barotrauma
|
||||
new GUITextBlock(new Rectangle(0,y,150,20), "Name:", GUI.Style, saveFrame);
|
||||
y += 20;
|
||||
|
||||
nameBox = new GUITextBox(new Rectangle(5, y, 150, 20), GUI.Style, saveFrame);
|
||||
nameBox = new GUITextBox(new Rectangle(5, y, 250, 20), GUI.Style, saveFrame);
|
||||
nameBox.OnEnterPressed = ChangeSubName;
|
||||
nameBox.Text = GetSubName();
|
||||
|
||||
@@ -376,8 +376,7 @@ namespace Barotrauma
|
||||
Alignment.TopLeft, GUI.Style, saveFrame);
|
||||
descriptionBox.Wrap = true;
|
||||
descriptionBox.Text = Submarine.MainSub == null ? "" : Submarine.MainSub.Description;
|
||||
descriptionBox.OnSelected += ExpandDescriptionBox;
|
||||
descriptionBox.OnTextChanged = ChangeSubDescription;
|
||||
descriptionBox.OnEnterPressed = ChangeSubDescription;
|
||||
|
||||
y += descriptionBox.Rect.Height + 15;
|
||||
new GUITextBlock(new Rectangle(0, y, 150, 20), "Settings:", GUI.Style, saveFrame);
|
||||
@@ -675,7 +674,7 @@ namespace Barotrauma
|
||||
return frame;
|
||||
}
|
||||
|
||||
private bool SelectLinkedSub(GUIComponent selected)
|
||||
private bool SelectLinkedSub(GUIComponent selected, object userData)
|
||||
{
|
||||
var submarine = selected.UserData as Submarine;
|
||||
if (submarine == null) return false;
|
||||
@@ -747,7 +746,7 @@ namespace Barotrauma
|
||||
textBox.UserData = text;
|
||||
}
|
||||
|
||||
textBox.Rect = new Rectangle(textBox.Rect.Location, new Point(textBox.Rect.Width, 20));
|
||||
// textBox.Rect = new Rectangle(textBox.Rect.Location, new Point(textBox.Rect.Width, 20));
|
||||
|
||||
textBox.Text = ToolBox.LimitString(text, 15);
|
||||
|
||||
@@ -756,21 +755,7 @@ namespace Barotrauma
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void ExpandDescriptionBox(GUITextBox textBox, Keys key)
|
||||
{
|
||||
if (Submarine.MainSub != null)
|
||||
{
|
||||
textBox.Text = Submarine.MainSub.Description;
|
||||
}
|
||||
else if (textBox.UserData is string)
|
||||
{
|
||||
textBox.Text = (string)textBox.UserData;
|
||||
}
|
||||
|
||||
textBox.Rect = new Rectangle(textBox.Rect.Location, new Point(textBox.Rect.Width, 150));
|
||||
}
|
||||
|
||||
|
||||
private bool SelectPrefab(GUIComponent component, object obj)
|
||||
{
|
||||
AddPreviouslyUsed(obj as MapEntityPrefab);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Barotrauma.Networking;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using System.IO;
|
||||
|
||||
@@ -91,6 +92,8 @@ namespace Barotrauma
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), "Selected submarine:", null, null, Alignment.Left, GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||
mapList = new GUIListBox(new Rectangle(0, 30, 200, panelRect.Height-100), GUI.Style, menuTabs[(int)Tab.NewGame]);
|
||||
|
||||
var subsToShow = Submarine.SavedSubmarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus));
|
||||
|
||||
foreach (Submarine sub in Submarine.SavedSubmarines)
|
||||
{
|
||||
new GUITextBlock(
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace Barotrauma
|
||||
|
||||
new GUITextBlock(new Rectangle(columnX, 120, 20, 20), "Respawn shuttle:", GUI.Style, infoFrame);
|
||||
shuttleList = new GUIDropDown(new Rectangle(columnX, 150, 200, 20), "", GUI.Style, infoFrame);
|
||||
|
||||
|
||||
|
||||
//gamemode ------------------------------------------------------------------
|
||||
|
||||
@@ -345,7 +345,7 @@ namespace Barotrauma
|
||||
//GameMain.GameScreen.Cam.TargetPos = Vector2.Zero;
|
||||
|
||||
subList.Enabled = GameMain.Server != null || GameMain.NetworkMember.Voting.AllowSubVoting;
|
||||
shuttleList.Enabled = subList.Enabled;
|
||||
shuttleList.Enabled = subList.Enabled;
|
||||
playerList.Enabled = GameMain.Server != null;
|
||||
modeList.Enabled = GameMain.Server != null || GameMain.NetworkMember.Voting.AllowModeVoting;
|
||||
seedBox.Enabled = GameMain.Server != null;
|
||||
@@ -368,17 +368,21 @@ namespace Barotrauma
|
||||
|
||||
if (IsServer && GameMain.Server != null)
|
||||
{
|
||||
List<Submarine> subsToShow = Submarine.SavedSubmarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus)).ToList();
|
||||
|
||||
int prevSelectedSub = subList.SelectedIndex;
|
||||
UpdateSubList(subList, Submarine.SavedSubmarines);
|
||||
UpdateSubList(subList, subsToShow);
|
||||
|
||||
int prevSelectedShuttle = shuttleList.SelectedIndex;
|
||||
UpdateSubList(shuttleList, Submarine.SavedSubmarines);
|
||||
UpdateSubList(shuttleList, subsToShow);
|
||||
|
||||
modeList.OnSelected = VotableClicked;
|
||||
modeList.OnSelected = SelectMode;
|
||||
subList.OnSelected = VotableClicked;
|
||||
subList.OnSelected = SelectSub;
|
||||
|
||||
shuttleList.OnSelected = SelectSub;
|
||||
|
||||
traitorProbabilityButtons[0].OnClicked = ToggleTraitorsEnabled;
|
||||
traitorProbabilityButtons[1].OnClicked = ToggleTraitorsEnabled;
|
||||
|
||||
@@ -613,10 +617,10 @@ namespace Barotrauma
|
||||
{
|
||||
valueChanged = true;
|
||||
|
||||
var hash = (obj as Submarine).MD5Hash;
|
||||
var hash = obj is Submarine ? ((Submarine)obj).MD5Hash.Hash : "";
|
||||
|
||||
//hash will be null if opening the sub file failed -> don't select the sub
|
||||
if (string.IsNullOrWhiteSpace(hash.Hash))
|
||||
if (string.IsNullOrWhiteSpace(hash))
|
||||
{
|
||||
(component as GUITextBlock).TextColor = Color.DarkRed * 0.8f;
|
||||
component.CanBeFocused = false;
|
||||
|
||||
Reference in New Issue
Block a user