(f0d812055) v0.9.9.0
This commit is contained in:
@@ -21,7 +21,7 @@ namespace Barotrauma
|
||||
|
||||
private GUIButton loadGameButton, deleteMpSaveButton;
|
||||
|
||||
public Action<Submarine, string, string> StartNewGame;
|
||||
public Action<SubmarineInfo, string, string> StartNewGame;
|
||||
public Action<string> LoadGame;
|
||||
|
||||
public GUIButton StartButton
|
||||
@@ -32,7 +32,7 @@ namespace Barotrauma
|
||||
|
||||
private readonly bool isMultiplayer;
|
||||
|
||||
public CampaignSetupUI(bool isMultiplayer, GUIComponent newGameContainer, GUIComponent loadGameContainer, IEnumerable<Submarine> submarines, IEnumerable<string> saveFiles = null)
|
||||
public CampaignSetupUI(bool isMultiplayer, GUIComponent newGameContainer, GUIComponent loadGameContainer, IEnumerable<SubmarineInfo> submarines, IEnumerable<string> saveFiles = null)
|
||||
{
|
||||
this.isMultiplayer = isMultiplayer;
|
||||
this.newGameContainer = newGameContainer;
|
||||
@@ -81,6 +81,7 @@ namespace Barotrauma
|
||||
|
||||
var searchTitle = new GUITextBlock(new RectTransform(new Vector2(0.001f, 1.0f), filterContainer.RectTransform), TextManager.Get("serverlog.filter"), textAlignment: Alignment.CenterLeft, font: GUI.Font);
|
||||
var searchBox = new GUITextBox(new RectTransform(new Vector2(1.0f, 1.0f), filterContainer.RectTransform, Anchor.CenterRight), font: GUI.Font, createClearButton: true);
|
||||
filterContainer.RectTransform.MinSize = searchBox.RectTransform.MinSize;
|
||||
searchBox.OnSelected += (sender, userdata) => { searchTitle.Visible = false; };
|
||||
searchBox.OnDeselected += (sender, userdata) => { searchTitle.Visible = true; };
|
||||
searchBox.OnTextChanged += (textBox, text) => { FilterSubs(subList, text); return true; };
|
||||
@@ -115,12 +116,12 @@ namespace Barotrauma
|
||||
return false;
|
||||
}
|
||||
|
||||
Submarine selectedSub = null;
|
||||
SubmarineInfo selectedSub = null;
|
||||
|
||||
if (!isMultiplayer)
|
||||
{
|
||||
if (!(subList.SelectedData is Submarine)) { return false; }
|
||||
selectedSub = subList.SelectedData as Submarine;
|
||||
if (!(subList.SelectedData is SubmarineInfo)) { return false; }
|
||||
selectedSub = subList.SelectedData as SubmarineInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -226,7 +227,7 @@ namespace Barotrauma
|
||||
{
|
||||
foreach (GUIComponent child in subList.Content.Children)
|
||||
{
|
||||
var sub = child.UserData as Submarine;
|
||||
var sub = child.UserData as SubmarineInfo;
|
||||
if (sub == null) { return; }
|
||||
child.Visible = string.IsNullOrEmpty(filter) ? true : sub.DisplayName.ToLower().Contains(filter.ToLower());
|
||||
}
|
||||
@@ -238,7 +239,7 @@ namespace Barotrauma
|
||||
(subPreviewContainer.Parent as GUILayoutGroup)?.Recalculate();
|
||||
subPreviewContainer.ClearChildren();
|
||||
|
||||
Submarine sub = obj as Submarine;
|
||||
SubmarineInfo sub = obj as SubmarineInfo;
|
||||
if (sub == null) { return true; }
|
||||
|
||||
sub.CreatePreviewWindow(subPreviewContainer);
|
||||
@@ -278,7 +279,7 @@ namespace Barotrauma
|
||||
saveNameBox.Text = Path.GetFileNameWithoutExtension(savePath);
|
||||
}
|
||||
|
||||
public void UpdateSubList(IEnumerable<Submarine> submarines)
|
||||
public void UpdateSubList(IEnumerable<SubmarineInfo> submarines)
|
||||
{
|
||||
#if !DEBUG
|
||||
var subsToShow = submarines.Where(s => !s.HasTag(SubmarineTag.HideInMenus));
|
||||
@@ -288,7 +289,7 @@ namespace Barotrauma
|
||||
|
||||
subList.ClearChildren();
|
||||
|
||||
foreach (Submarine sub in subsToShow)
|
||||
foreach (SubmarineInfo sub in subsToShow)
|
||||
{
|
||||
var textBlock = new GUITextBlock(
|
||||
new RectTransform(new Vector2(1, 0.1f), subList.Content.RectTransform) { MinSize = new Point(0, 30) },
|
||||
@@ -319,7 +320,7 @@ namespace Barotrauma
|
||||
};
|
||||
}
|
||||
}
|
||||
if (Submarine.SavedSubmarines.Any())
|
||||
if (SubmarineInfo.SavedSubmarines.Any())
|
||||
{
|
||||
var nonShuttles = subsToShow.Where(s => !s.HasTag(SubmarineTag.Shuttle)).ToList();
|
||||
if (nonShuttles.Count > 0)
|
||||
|
||||
Reference in New Issue
Block a user