Merge branch 'master' of https://github.com/Regalis11/Barotrauma.git into Regalis11-master
This commit is contained in:
@@ -7,14 +7,10 @@ namespace Barotrauma
|
||||
{
|
||||
protected readonly GUIComponent newGameContainer, loadGameContainer;
|
||||
|
||||
protected GUIListBox subList;
|
||||
protected GUIListBox saveList;
|
||||
protected List<GUITickBox> subTickBoxes;
|
||||
|
||||
protected GUITextBox saveNameBox, seedBox;
|
||||
|
||||
protected GUILayoutGroup subPreviewContainer;
|
||||
|
||||
protected GUIButton loadGameButton;
|
||||
|
||||
public Action<SubmarineInfo, string, string, CampaignSettings> StartNewGame;
|
||||
|
||||
+69
-204
@@ -7,6 +7,7 @@ using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using System.Globalization;
|
||||
using Barotrauma.Extensions;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -14,55 +15,79 @@ namespace Barotrauma
|
||||
{
|
||||
private GUIButton deleteMpSaveButton;
|
||||
|
||||
public MultiPlayerCampaignSetupUI(GUIComponent newGameContainer, GUIComponent loadGameContainer, IEnumerable<SubmarineInfo> submarines, IEnumerable<string> saveFiles = null)
|
||||
public MultiPlayerCampaignSetupUI(GUIComponent newGameContainer, GUIComponent loadGameContainer, IEnumerable<string> saveFiles = null)
|
||||
: base(newGameContainer, loadGameContainer)
|
||||
{
|
||||
var columnContainer = new GUILayoutGroup(new RectTransform(Vector2.One, newGameContainer.RectTransform), isHorizontal: true)
|
||||
var verticalLayout = new GUILayoutGroup(new RectTransform(Vector2.One, newGameContainer.RectTransform), isHorizontal: false)
|
||||
{
|
||||
Stretch = true,
|
||||
RelativeSpacing = 0.0f
|
||||
};
|
||||
|
||||
var leftColumn = new GUILayoutGroup(new RectTransform(Vector2.One, columnContainer.RectTransform))
|
||||
{
|
||||
Stretch = true,
|
||||
RelativeSpacing = 0.015f
|
||||
};
|
||||
|
||||
var rightColumn = new GUILayoutGroup(new RectTransform(Vector2.Zero, columnContainer.RectTransform))
|
||||
{
|
||||
Stretch = true,
|
||||
RelativeSpacing = 0.015f
|
||||
};
|
||||
|
||||
columnContainer.Recalculate();
|
||||
|
||||
// New game left side
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.02f), leftColumn.RectTransform) { MinSize = new Point(0, 20) }, TextManager.Get("SaveName"), font: GUI.SubHeadingFont);
|
||||
saveNameBox = new GUITextBox(new RectTransform(new Vector2(1.0f, 0.05f), leftColumn.RectTransform) { MinSize = new Point(0, 20) }, string.Empty)
|
||||
// New game
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.03f), verticalLayout.RectTransform) { MinSize = new Point(0, 20) }, TextManager.Get("SaveName"), font: GUI.SubHeadingFont, textAlignment: Alignment.BottomLeft);
|
||||
saveNameBox = new GUITextBox(new RectTransform(new Vector2(1.0f, 0.03f), verticalLayout.RectTransform) { MinSize = new Point(0, 20) }, string.Empty)
|
||||
{
|
||||
textFilterFunction = (string str) => { return ToolBox.RemoveInvalidFileNameChars(str); }
|
||||
};
|
||||
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.02f), leftColumn.RectTransform) { MinSize = new Point(0, 20) }, TextManager.Get("MapSeed"), font: GUI.SubHeadingFont);
|
||||
seedBox = new GUITextBox(new RectTransform(new Vector2(1.0f, 0.05f), leftColumn.RectTransform) { MinSize = new Point(0, 20) }, ToolBox.RandomSeed(8));
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.03f), verticalLayout.RectTransform) { MinSize = new Point(0, 20) }, TextManager.Get("MapSeed"), font: GUI.SubHeadingFont, textAlignment: Alignment.BottomLeft);
|
||||
seedBox = new GUITextBox(new RectTransform(new Vector2(1.0f, 0.03f), verticalLayout.RectTransform) { MinSize = new Point(0, 20) }, ToolBox.RandomSeed(8));
|
||||
|
||||
// Spacing to fix the multiplayer campaign setup layout
|
||||
CreateMultiplayerCampaignSubList(leftColumn.RectTransform);
|
||||
|
||||
//spacing
|
||||
//new GUIFrame(new RectTransform(new Vector2(1.0f, 0.25f), leftColumn.RectTransform), style: null);
|
||||
|
||||
// New game right side
|
||||
subPreviewContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 1.0f), rightColumn.RectTransform))
|
||||
GUIFrame radiationBoxContainer
|
||||
= new GUIFrame(new RectTransform(new Vector2(1.0f, 0.05f), verticalLayout.RectTransform), style: null);
|
||||
GUITickBox radiationEnabledTickBox = null;
|
||||
if (MapGenerationParams.Instance.RadiationParams != null)
|
||||
{
|
||||
Stretch = true
|
||||
radiationEnabledTickBox = new GUITickBox(new RectTransform(new Vector2(1.0f, 0.5f), radiationBoxContainer.RectTransform, Anchor.Center), TextManager.Get("CampaignOption.EnableRadiation"), font: GUI.Style.Font)
|
||||
{
|
||||
Selected = true,
|
||||
OnSelected = box => true
|
||||
};
|
||||
}
|
||||
|
||||
var maxMissionCountSettingHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.05f), verticalLayout.RectTransform), isHorizontal: true, childAnchor: Anchor.CenterLeft) { Stretch = true };
|
||||
var maxMissionCountDescription = new GUITextBlock(new RectTransform(new Vector2(0.7f, 0.0f), maxMissionCountSettingHolder.RectTransform), TextManager.Get("maxmissioncount", fallBackTag: "missions"), wrap: true)
|
||||
{
|
||||
ToolTip = TextManager.Get("maxmissioncounttooltip")
|
||||
};
|
||||
int maxMissionCount = GameMain.NetworkMember.ServerSettings.MaxMissionCount;
|
||||
var maxMissionCountContainer = new GUILayoutGroup(new RectTransform(new Vector2(0.5f, 1.0f), maxMissionCountSettingHolder.RectTransform), isHorizontal: true, childAnchor: Anchor.CenterLeft) { RelativeSpacing = 0.05f, Stretch = true };
|
||||
var maxMissionCountButtons = new GUIButton[2];
|
||||
maxMissionCountButtons[0]
|
||||
= new GUIButton(new RectTransform(new Vector2(0.15f, 1.0f), maxMissionCountContainer.RectTransform),
|
||||
style: "GUIButtonToggleLeft");
|
||||
var maxMissionCountText = new GUITextBlock(new RectTransform(new Vector2(0.7f, 1.0f), maxMissionCountContainer.RectTransform), "0", textAlignment: Alignment.Center, style: "GUITextBox");
|
||||
|
||||
var buttonContainer = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.12f),
|
||||
leftColumn.RectTransform) { MaxSize = new Point(int.MaxValue, 60) }, childAnchor: Anchor.BottomRight, isHorizontal: true);
|
||||
void updateMissionCountText()
|
||||
{
|
||||
maxMissionCount = MathHelper.Clamp(maxMissionCount,
|
||||
CampaignSettings.MinMissionCountLimit,
|
||||
CampaignSettings.MaxMissionCountLimit);
|
||||
maxMissionCountText.Text = maxMissionCount.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
maxMissionCountButtons[1]
|
||||
= new GUIButton(new RectTransform(new Vector2(0.15f, 1.0f), maxMissionCountContainer.RectTransform),
|
||||
style: "GUIButtonToggleRight");
|
||||
maxMissionCountButtons[0].OnClicked = (button, o) =>
|
||||
{
|
||||
maxMissionCount--;
|
||||
updateMissionCountText();
|
||||
return false;
|
||||
};
|
||||
maxMissionCountButtons[1].OnClicked = (button, o) =>
|
||||
{
|
||||
maxMissionCount++;
|
||||
updateMissionCountText();
|
||||
return false;
|
||||
};
|
||||
updateMissionCountText();
|
||||
maxMissionCountSettingHolder.Children.ForEach(c => c.ToolTip = maxMissionCountSettingHolder.ToolTip);
|
||||
|
||||
StartButton = new GUIButton(new RectTransform(new Vector2(0.4f, 1f), buttonContainer.RectTransform, Anchor.BottomRight) { MaxSize = new Point(350, 60) }, TextManager.Get("StartCampaignButton"))
|
||||
var buttonContainer = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.04f),
|
||||
verticalLayout.RectTransform) { MaxSize = new Point(int.MaxValue, 60) }, childAnchor: Anchor.BottomRight, isHorizontal: true);
|
||||
|
||||
StartButton = new GUIButton(new RectTransform(new Vector2(0.4f, 1f), buttonContainer.RectTransform, Anchor.BottomRight), TextManager.Get("StartCampaignButton"))
|
||||
{
|
||||
OnClicked = (GUIButton btn, object userData) =>
|
||||
{
|
||||
@@ -85,20 +110,19 @@ namespace Barotrauma
|
||||
|
||||
if (string.IsNullOrEmpty(selectedSub.MD5Hash.Hash))
|
||||
{
|
||||
((GUITextBlock)subList.SelectedComponent).TextColor = Color.DarkRed * 0.8f;
|
||||
subList.SelectedComponent.CanBeFocused = false;
|
||||
subList.Deselect();
|
||||
new GUIMessageBox(TextManager.Get("error"), TextManager.Get("nohashsubmarineselected"));
|
||||
return false;
|
||||
}
|
||||
|
||||
string savePath = SaveUtil.CreateSavePath(SaveUtil.SaveType.Multiplayer, saveNameBox.Text);
|
||||
bool hasRequiredContentPackages = selectedSub.RequiredContentPackagesInstalled;
|
||||
|
||||
CampaignSettings settings = new CampaignSettings();
|
||||
CampaignSettings settings = new CampaignSettings
|
||||
{
|
||||
RadiationEnabled = radiationEnabledTickBox?.Selected ?? GameMain.NetworkMember.ServerSettings.RadiationEnabled,
|
||||
MaxMissionCount = maxMissionCount
|
||||
};
|
||||
|
||||
settings.RadiationEnabled = GameMain.NetLobbyScreen.IsRadiationEnabled();
|
||||
settings.MaxMissionCount = GameMain.NetLobbyScreen.GetMaxMissionCount();
|
||||
|
||||
if (selectedSub.HasTag(SubmarineTag.Shuttle) || !hasRequiredContentPackages)
|
||||
{
|
||||
if (!hasRequiredContentPackages)
|
||||
@@ -148,7 +172,9 @@ namespace Barotrauma
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
StartButton.RectTransform.MaxSize = RectTransform.MaxPoint;
|
||||
StartButton.Children.ForEach(c => c.RectTransform.MaxSize = RectTransform.MaxPoint);
|
||||
|
||||
InitialMoneyText = new GUITextBlock(new RectTransform(new Vector2(0.6f, 1f), buttonContainer.RectTransform), "", font: GUI.Style.SmallFont, textColor: GUI.Style.Green)
|
||||
{
|
||||
TextGetter = () =>
|
||||
@@ -163,115 +189,12 @@ namespace Barotrauma
|
||||
}
|
||||
};
|
||||
|
||||
columnContainer.Recalculate();
|
||||
leftColumn.Recalculate();
|
||||
rightColumn.Recalculate();
|
||||
verticalLayout.Recalculate();
|
||||
|
||||
if (submarines != null) { UpdateSubList(submarines); }
|
||||
UpdateLoadMenu(saveFiles);
|
||||
}
|
||||
|
||||
private void CreateMultiplayerCampaignSubList(RectTransform parent)
|
||||
{
|
||||
GUILayoutGroup subHolder = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.725f), parent))
|
||||
{
|
||||
RelativeSpacing = 0.005f,
|
||||
Stretch = true
|
||||
};
|
||||
|
||||
var subLabel = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.055f), subHolder.RectTransform) { MinSize = new Point(0, 25) }, TextManager.Get("purchasablesubmarines", fallBackTag: "workshoplabelsubmarines"), font: GUI.SubHeadingFont);
|
||||
|
||||
var filterContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.05f), subHolder.RectTransform), isHorizontal: true)
|
||||
{
|
||||
Stretch = true
|
||||
};
|
||||
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) =>
|
||||
{
|
||||
foreach (GUIComponent child in subList.Content.Children)
|
||||
{
|
||||
if (!(child.UserData is SubmarineInfo sub)) { continue; }
|
||||
child.Visible = string.IsNullOrEmpty(text) ? true : sub.DisplayName.ToLower().Contains(text.ToLower());
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
subList = new GUIListBox(new RectTransform(Vector2.One, subHolder.RectTransform));
|
||||
subTickBoxes = new List<GUITickBox>();
|
||||
|
||||
for (int i = 0; i < GameMain.Client.ServerSubmarines.Count; i++)
|
||||
{
|
||||
SubmarineInfo sub = GameMain.Client.ServerSubmarines[i];
|
||||
|
||||
if (!sub.IsCampaignCompatible) continue;
|
||||
|
||||
var frame = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.2f), subList.Content.RectTransform) { MinSize = new Point(0, 20) },
|
||||
style: "ListBoxElement")
|
||||
{
|
||||
ToolTip = sub.Description,
|
||||
UserData = sub
|
||||
};
|
||||
|
||||
int buttonSize = (int)(frame.Rect.Height * 0.8f);
|
||||
|
||||
GUITickBox tickBox = new GUITickBox(new RectTransform(new Vector2(0.8f, 1.0f), frame.RectTransform, Anchor.CenterLeft), ToolBox.LimitString(sub.DisplayName, GUI.Font, subList.Content.Rect.Width - 65))
|
||||
{
|
||||
UserData = sub,
|
||||
OnSelected = (GUITickBox box) =>
|
||||
{
|
||||
GameMain.Client.RequestCampaignSub(box.UserData as SubmarineInfo, box.Selected);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
subTickBoxes.Add(tickBox);
|
||||
tickBox.Selected = GameMain.NetLobbyScreen.CampaignSubmarines.Contains(sub);
|
||||
|
||||
frame.RectTransform.MinSize = new Point(0, tickBox.RectTransform.MinSize.Y);
|
||||
|
||||
var subTextBlock = tickBox.TextBlock;
|
||||
|
||||
var matchingSub = SubmarineInfo.SavedSubmarines.FirstOrDefault(s => s.Name == sub.Name && s.MD5Hash?.Hash == sub.MD5Hash?.Hash);
|
||||
if (matchingSub == null) matchingSub = SubmarineInfo.SavedSubmarines.FirstOrDefault(s => s.Name == sub.Name);
|
||||
|
||||
if (matchingSub == null)
|
||||
{
|
||||
subTextBlock.TextColor = new Color(subTextBlock.TextColor, 0.5f);
|
||||
frame.ToolTip = TextManager.Get("SubNotFound");
|
||||
}
|
||||
else if (matchingSub?.MD5Hash == null || matchingSub.MD5Hash?.Hash != sub.MD5Hash?.Hash)
|
||||
{
|
||||
subTextBlock.TextColor = new Color(subTextBlock.TextColor, 0.5f);
|
||||
frame.ToolTip = TextManager.Get("SubDoesntMatch");
|
||||
}
|
||||
|
||||
if (!sub.RequiredContentPackagesInstalled)
|
||||
{
|
||||
subTextBlock.TextColor = Color.Lerp(subTextBlock.TextColor, Color.DarkRed, 0.5f);
|
||||
frame.ToolTip = TextManager.Get("ContentPackageMismatch") + "\n\n" + frame.RawToolTip;
|
||||
}
|
||||
|
||||
var classText = new GUITextBlock(new RectTransform(new Vector2(0.5f, 1.0f), frame.RectTransform, Anchor.CenterRight),
|
||||
TextManager.Get($"submarineclass.{sub.SubmarineClass}"), textAlignment: Alignment.CenterRight, font: GUI.SmallFont)
|
||||
{
|
||||
TextColor = subTextBlock.TextColor * 0.8f,
|
||||
ToolTip = subTextBlock.RawToolTip
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshMultiplayerCampaignSubUI(List<SubmarineInfo> campaignSubs)
|
||||
{
|
||||
for (int i = 0; i < subTickBoxes.Count; i++)
|
||||
{
|
||||
subTickBoxes[i].Selected = campaignSubs.Contains(subTickBoxes[i].UserData as SubmarineInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<object> WaitForCampaignSetup()
|
||||
private IEnumerable<CoroutineStatus> WaitForCampaignSetup()
|
||||
{
|
||||
GUI.SetCursorWaiting();
|
||||
string headerText = TextManager.Get("CampaignStartingPleaseWait");
|
||||
@@ -298,64 +221,6 @@ namespace Barotrauma
|
||||
yield return CoroutineStatus.Success;
|
||||
}
|
||||
|
||||
public void UpdateSubList(IEnumerable<SubmarineInfo> submarines)
|
||||
{
|
||||
List<SubmarineInfo> subsToShow;
|
||||
string downloadFolder = Path.GetFullPath(SaveUtil.SubmarineDownloadFolder);
|
||||
subsToShow = submarines.Where(s => s.IsCampaignCompatibleIgnoreClass && Path.GetDirectoryName(Path.GetFullPath(s.FilePath)) != downloadFolder).ToList();
|
||||
|
||||
subsToShow.Sort((s1, s2) =>
|
||||
{
|
||||
int p1 = s1.Price > CampaignMode.InitialMoney ? 10 : 0;
|
||||
int p2 = s2.Price > CampaignMode.InitialMoney ? 10 : 0;
|
||||
return p1.CompareTo(p2) * 100 + s1.Name.CompareTo(s2.Name);
|
||||
});
|
||||
|
||||
subList.ClearChildren();
|
||||
|
||||
foreach (SubmarineInfo sub in subsToShow)
|
||||
{
|
||||
var textBlock = new GUITextBlock(
|
||||
new RectTransform(new Vector2(1, 0.1f), subList.Content.RectTransform) { MinSize = new Point(0, 30) },
|
||||
ToolBox.LimitString(sub.DisplayName, GUI.Font, subList.Rect.Width - 65), style: "ListBoxElement")
|
||||
{
|
||||
ToolTip = sub.Description,
|
||||
UserData = sub
|
||||
};
|
||||
|
||||
if (!sub.RequiredContentPackagesInstalled)
|
||||
{
|
||||
textBlock.TextColor = Color.Lerp(textBlock.TextColor, Color.DarkRed, .5f);
|
||||
textBlock.ToolTip = TextManager.Get("ContentPackageMismatch") + "\n\n" + textBlock.RawToolTip;
|
||||
}
|
||||
|
||||
var priceText = new GUITextBlock(new RectTransform(new Vector2(0.5f, 1.0f), textBlock.RectTransform, Anchor.CenterRight),
|
||||
TextManager.GetWithVariable("currencyformat", "[credits]", string.Format(CultureInfo.InvariantCulture, "{0:N0}", sub.Price)), textAlignment: Alignment.CenterRight, font: GUI.SmallFont)
|
||||
{
|
||||
TextColor = sub.Price > CampaignMode.InitialMoney ? GUI.Style.Red : textBlock.TextColor * 0.8f,
|
||||
ToolTip = textBlock.ToolTip
|
||||
};
|
||||
#if !DEBUG
|
||||
if (!GameMain.DebugDraw)
|
||||
{
|
||||
if (sub.Price > CampaignMode.InitialMoney || !sub.IsCampaignCompatible)
|
||||
{
|
||||
textBlock.CanBeFocused = false;
|
||||
textBlock.TextColor *= 0.5f;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (SubmarineInfo.SavedSubmarines.Any())
|
||||
{
|
||||
var validSubs = subsToShow.Where(s => s.IsCampaignCompatible && s.Price <= CampaignMode.InitialMoney).ToList();
|
||||
if (validSubs.Count > 0)
|
||||
{
|
||||
subList.Select(validSubs[Rand.Int(validSubs.Count)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> prevSaveFiles;
|
||||
public void UpdateLoadMenu(IEnumerable<string> saveFiles = null)
|
||||
{
|
||||
|
||||
+6
-1
@@ -12,6 +12,10 @@ namespace Barotrauma
|
||||
{
|
||||
class SinglePlayerCampaignSetupUI : CampaignSetupUI
|
||||
{
|
||||
private GUIListBox subList;
|
||||
|
||||
protected GUILayoutGroup subPreviewContainer;
|
||||
|
||||
public CharacterInfo.AppearanceCustomizationMenu[] CharacterMenus { get; private set; }
|
||||
|
||||
private GUIButton nextButton;
|
||||
@@ -38,7 +42,7 @@ namespace Barotrauma
|
||||
pageContainer.BarScroll = targetScroll;
|
||||
}
|
||||
|
||||
for (int i=0; i<CharacterMenus.Length; i++)
|
||||
for (int i = 0; i < CharacterMenus.Length; i++)
|
||||
{
|
||||
CharacterMenus[i]?.Update();
|
||||
}
|
||||
@@ -77,6 +81,7 @@ namespace Barotrauma
|
||||
{
|
||||
ScrollBarEnabled = false,
|
||||
ScrollBarVisible = false,
|
||||
AllowArrowKeyScroll = false,
|
||||
HoverCursor = CursorState.Default
|
||||
};
|
||||
|
||||
|
||||
+44
-5
@@ -705,7 +705,7 @@ namespace Barotrauma.CharacterEditor
|
||||
{
|
||||
string errorMsg = "Attempted to modify the state of the physics simulation while a time step was running.";
|
||||
DebugConsole.ThrowError(errorMsg, e);
|
||||
GameAnalyticsManager.AddErrorEventOnce("CharacterEditorScreen.Update:WorldLockedException" + e.Message, GameAnalyticsSDK.Net.EGAErrorSeverity.Critical, errorMsg);
|
||||
GameAnalyticsManager.AddErrorEventOnce("CharacterEditorScreen.Update:WorldLockedException" + e.Message, GameAnalyticsManager.ErrorSeverity.Critical, errorMsg);
|
||||
}
|
||||
}
|
||||
// Camera
|
||||
@@ -1802,9 +1802,11 @@ namespace Barotrauma.CharacterEditor
|
||||
{
|
||||
case AnimationType.Walk:
|
||||
case AnimationType.Run:
|
||||
case AnimationType.Crouch:
|
||||
if (!ragdollParams.CanWalk) { continue; }
|
||||
break;
|
||||
case AnimationType.Crouch:
|
||||
if (!ragdollParams.CanWalk || !isHumanoid) { continue; }
|
||||
break;
|
||||
case AnimationType.SwimSlow:
|
||||
case AnimationType.SwimFast:
|
||||
break;
|
||||
@@ -2690,7 +2692,15 @@ namespace Barotrauma.CharacterEditor
|
||||
characterDropDown.SelectItem(currentCharacterConfig);
|
||||
characterDropDown.OnSelected = (component, data) =>
|
||||
{
|
||||
SpawnCharacter((string)data);
|
||||
string configFile = (string)data;
|
||||
try
|
||||
{
|
||||
SpawnCharacter(configFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
HandleSpawnException(configFile, e);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
if (currentCharacterConfig == CharacterPrefab.HumanConfigFile)
|
||||
@@ -2719,19 +2729,48 @@ namespace Barotrauma.CharacterEditor
|
||||
prevCharacterButton.TextBlock.AutoScaleHorizontal = true;
|
||||
prevCharacterButton.OnClicked += (b, obj) =>
|
||||
{
|
||||
SpawnCharacter(GetPreviousConfigFile());
|
||||
string configFile = GetPreviousConfigFile();
|
||||
try
|
||||
{
|
||||
SpawnCharacter(configFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
HandleSpawnException(configFile, e);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
var nextCharacterButton = new GUIButton(new RectTransform(new Vector2(0.5f, 1.0f), charButtons.RectTransform, Anchor.TopRight), GetCharacterEditorTranslation("NextCharacter"));
|
||||
prevCharacterButton.TextBlock.AutoScaleHorizontal = true;
|
||||
nextCharacterButton.OnClicked += (b, obj) =>
|
||||
{
|
||||
SpawnCharacter(GetNextConfigFile());
|
||||
string configFile = GetNextConfigFile();
|
||||
try
|
||||
{
|
||||
SpawnCharacter(configFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
HandleSpawnException(configFile, e);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
charButtons.RectTransform.MinSize = new Point(0, prevCharacterButton.RectTransform.MinSize.Y);
|
||||
characterPanelToggle = new ToggleButton(new RectTransform(new Vector2(0.08f, 1), characterSelectionPanel.RectTransform, Anchor.CenterLeft, Pivot.CenterRight), Direction.Right);
|
||||
characterSelectionPanel.RectTransform.MinSize = new Point(0, (int)(content.RectTransform.Children.Sum(c => c.MinSize.Y) * 1.2f));
|
||||
|
||||
void HandleSpawnException(string configFile, Exception e)
|
||||
{
|
||||
if (configFile != CharacterPrefab.HumanConfigFile)
|
||||
{
|
||||
DebugConsole.ThrowError($"Failed to spawn the character \"{configFile}\".", e);
|
||||
SpawnCharacter(CharacterPrefab.HumanConfigFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Failed to spawn the character \"{configFile}\".", innerException: e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CreateFileEditPanel()
|
||||
|
||||
@@ -143,9 +143,33 @@ namespace Barotrauma
|
||||
|
||||
editorContainer = new GUIListBox(new RectTransform(new Vector2(1.0f, 1.0f), paddedRightPanel.RectTransform));
|
||||
|
||||
var seedContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.02f), paddedRightPanel.RectTransform), isHorizontal: true);
|
||||
new GUITextBlock(new RectTransform(new Vector2(0.5f, 1.0f), seedContainer.RectTransform), TextManager.Get("leveleditor.levelseed"));
|
||||
seedBox = new GUITextBox(new RectTransform(new Vector2(0.5f, 1.0f), seedContainer.RectTransform), ToolBox.RandomSeed(8));
|
||||
var seedContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.04f), paddedRightPanel.RectTransform), isHorizontal: true, childAnchor: Anchor.CenterLeft);
|
||||
Vector2 randomizeButtonRelativeSize = GetRandomizeButtonRelativeSize();
|
||||
Vector2 elementRelativeSize = GetSeedElementRelativeSize();
|
||||
var seedLabel = new GUITextBlock(new RectTransform(elementRelativeSize, seedContainer.RectTransform), TextManager.Get("leveleditor.levelseed"));
|
||||
seedBox = new GUITextBox(new RectTransform(elementRelativeSize, seedContainer.RectTransform), GetLevelSeed());
|
||||
var seedButton = new GUIButton(new RectTransform(randomizeButtonRelativeSize, seedContainer.RectTransform), style: "RandomizeButton")
|
||||
{
|
||||
OnClicked = (button, userData) =>
|
||||
{
|
||||
if(seedBox == null) { return false; }
|
||||
seedBox.Text = GetLevelSeed();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
seedContainer.RectTransform.SizeChanged += () =>
|
||||
{
|
||||
Vector2 randomizeButtonRelativeSize = GetRandomizeButtonRelativeSize();
|
||||
Vector2 elementRelativeSize = GetSeedElementRelativeSize();
|
||||
seedLabel.RectTransform.RelativeSize = elementRelativeSize;
|
||||
seedBox.RectTransform.RelativeSize = elementRelativeSize;
|
||||
seedButton.RectTransform.RelativeSize = randomizeButtonRelativeSize;
|
||||
};
|
||||
Vector2 GetRandomizeButtonRelativeSize() => 0.2f * seedContainer.Rect.Width > seedContainer.Rect.Height ?
|
||||
new Vector2(Math.Min((float)seedContainer.Rect.Height / seedContainer.Rect.Width, 0.2f), 1.0f) :
|
||||
new Vector2(0.15f, Math.Min((0.2f * seedContainer.Rect.Width) / seedContainer.Rect.Height, 1.0f));
|
||||
Vector2 GetSeedElementRelativeSize() => new Vector2(0.5f * (1.0f - randomizeButtonRelativeSize.X), 1.0f);
|
||||
static string GetLevelSeed() => ToolBox.RandomSeed(8);
|
||||
|
||||
mirrorLevel = new GUITickBox(new RectTransform(new Vector2(1.0f, 0.02f), paddedRightPanel.RectTransform), TextManager.Get("mirrorentityx"));
|
||||
|
||||
|
||||
@@ -742,7 +742,7 @@ namespace Barotrauma
|
||||
return true;
|
||||
}
|
||||
|
||||
private IEnumerable<object> SelectScreenWithWaitCursor(Screen screen)
|
||||
private IEnumerable<CoroutineStatus> SelectScreenWithWaitCursor(Screen screen)
|
||||
{
|
||||
GUI.SetCursorWaiting();
|
||||
//tiny delay to get the cursor to render
|
||||
@@ -782,7 +782,7 @@ namespace Barotrauma
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void QuickStart(bool fixedSeed = false, string sub = null)
|
||||
public void QuickStart(bool fixedSeed = false, string sub = null, float difficulty = 40, LevelGenerationParams levelGenerationParams = null)
|
||||
{
|
||||
if (fixedSeed)
|
||||
{
|
||||
@@ -795,9 +795,7 @@ namespace Barotrauma
|
||||
if (!string.IsNullOrEmpty(subName))
|
||||
{
|
||||
DebugConsole.NewMessage($"Loading the predefined quick start sub \"{subName}\"", Color.White);
|
||||
selectedSub = SubmarineInfo.SavedSubmarines.FirstOrDefault(s =>
|
||||
s.Name.ToLower() == subName.ToLower());
|
||||
|
||||
selectedSub = SubmarineInfo.SavedSubmarines.FirstOrDefault(s => s.Name.ToLowerInvariant() == subName.ToLowerInvariant());
|
||||
if (selectedSub == null)
|
||||
{
|
||||
DebugConsole.NewMessage($"Cannot find a sub that matches the name \"{subName}\".", Color.Red);
|
||||
@@ -814,7 +812,7 @@ namespace Barotrauma
|
||||
GameModePreset.DevSandbox,
|
||||
missionPrefabs: null);
|
||||
//(gamesession.GameMode as SinglePlayerCampaign).GenerateMap(ToolBox.RandomSeed(8));
|
||||
gamesession.StartRound(fixedSeed ? "abcd" : ToolBox.RandomSeed(8), difficulty: 40);
|
||||
gamesession.StartRound(fixedSeed ? "abcd" : ToolBox.RandomSeed(8), difficulty, levelGenerationParams);
|
||||
GameMain.GameScreen.Select();
|
||||
// TODO: modding support
|
||||
string[] jobIdentifiers = new string[] { "captain", "engineer", "mechanic", "securityofficer", "medicaldoctor" };
|
||||
@@ -953,7 +951,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<object> WaitForSubmarineHashCalculations(GUIMessageBox messageBox)
|
||||
private IEnumerable<CoroutineStatus> WaitForSubmarineHashCalculations(GUIMessageBox messageBox)
|
||||
{
|
||||
string originalText = messageBox.Text.Text;
|
||||
int doneCount = 0;
|
||||
@@ -1118,17 +1116,23 @@ namespace Barotrauma
|
||||
|
||||
GUI.Draw(Cam, spriteBatch);
|
||||
|
||||
#if !UNSTABLE
|
||||
string versionString = "Barotrauma v" + GameMain.Version + " (" + AssemblyInfo.BuildString + ", branch " + AssemblyInfo.GitBranch + ", revision " + AssemblyInfo.GitRevision + ")";
|
||||
GUI.SmallFont.DrawString(spriteBatch, versionString, new Vector2(HUDLayoutSettings.Padding, GameMain.GraphicsHeight - GUI.SmallFont.MeasureString(versionString).Y - HUDLayoutSettings.Padding * 0.75f), Color.White * 0.7f);
|
||||
#endif
|
||||
|
||||
if (selectedTab != Tab.Credits)
|
||||
{
|
||||
#if !UNSTABLE
|
||||
string versionString = "Barotrauma v" + GameMain.Version + " (" + AssemblyInfo.BuildString + ", branch " + AssemblyInfo.GitBranch + ", revision " + AssemblyInfo.GitRevision + ")";
|
||||
GUI.SmallFont.DrawString(spriteBatch, versionString, new Vector2(HUDLayoutSettings.Padding, GameMain.GraphicsHeight - GUI.SmallFont.MeasureString(versionString).Y - HUDLayoutSettings.Padding * 0.75f), Color.White * 0.7f);
|
||||
#endif
|
||||
string gameAnalyticsStatus = TextManager.Get($"GameAnalyticsStatus.{GameAnalyticsManager.UserConsented}");
|
||||
Vector2 textSize = GUI.SmallFont.MeasureString(gameAnalyticsStatus).ToPoint().ToVector2();
|
||||
GUI.SmallFont.DrawString(spriteBatch, gameAnalyticsStatus, new Vector2(HUDLayoutSettings.Padding, GameMain.GraphicsHeight - GUI.SmallFont.LineHeight * 2 - HUDLayoutSettings.Padding * 0.75f), Color.White * 0.7f);
|
||||
|
||||
|
||||
Vector2 textPos = new Vector2(GameMain.GraphicsWidth - HUDLayoutSettings.Padding, GameMain.GraphicsHeight - HUDLayoutSettings.Padding * 0.75f);
|
||||
for (int i = legalCrap.Length - 1; i >= 0; i--)
|
||||
{
|
||||
Vector2 textSize = GUI.SmallFont.MeasureString(legalCrap[i]);
|
||||
textSize = new Vector2((int)textSize.X, (int)textSize.Y);
|
||||
textSize = GUI.SmallFont.MeasureString(legalCrap[i])
|
||||
.ToPoint().ToVector2();
|
||||
bool mouseOn = i == 0 &&
|
||||
PlayerInput.MousePosition.X > textPos.X - textSize.X && PlayerInput.MousePosition.X < textPos.X &&
|
||||
PlayerInput.MousePosition.Y > textPos.Y - textSize.Y && PlayerInput.MousePosition.Y < textPos.Y;
|
||||
@@ -1184,8 +1188,8 @@ namespace Barotrauma
|
||||
DebugConsole.ThrowError("Copying the file \"" + selectedSub.FilePath + "\" failed. The file may have been deleted or in use by another process. Try again or select another submarine.", e);
|
||||
GameAnalyticsManager.AddErrorEventOnce(
|
||||
"MainMenuScreen.StartGame:IOException" + selectedSub.Name,
|
||||
GameAnalyticsSDK.Net.EGAErrorSeverity.Error,
|
||||
"Copying the file \"" + selectedSub.FilePath + "\" failed.\n" + e.Message + "\n" + Environment.StackTrace.CleanupStackTrace());
|
||||
GameAnalyticsManager.ErrorSeverity.Error,
|
||||
"Copying a submarine file failed. " + e.Message + "\n" + Environment.StackTrace.CleanupStackTrace());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1509,13 +1513,13 @@ namespace Barotrauma
|
||||
#if DEBUG
|
||||
DebugConsole.ThrowError("Fetching remote content to the main menu failed.", e);
|
||||
#endif
|
||||
GameAnalyticsManager.AddErrorEventOnce("MainMenuScreen.FetchRemoteContent:Exception", GameAnalyticsSDK.Net.EGAErrorSeverity.Error,
|
||||
GameAnalyticsManager.AddErrorEventOnce("MainMenuScreen.FetchRemoteContent:Exception", GameAnalyticsManager.ErrorSeverity.Error,
|
||||
"Fetching remote content to the main menu failed. " + e.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<object> WairForRemoteContentReceived()
|
||||
private IEnumerable<CoroutineStatus> WairForRemoteContentReceived()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
@@ -1552,7 +1556,7 @@ namespace Barotrauma
|
||||
#if DEBUG
|
||||
DebugConsole.ThrowError("Reading received remote main menu content failed.", e);
|
||||
#endif
|
||||
GameAnalyticsManager.AddErrorEventOnce("MainMenuScreen.WairForRemoteContentReceived:Exception", GameAnalyticsSDK.Net.EGAErrorSeverity.Error,
|
||||
GameAnalyticsManager.AddErrorEventOnce("MainMenuScreen.WairForRemoteContentReceived:Exception", GameAnalyticsManager.ErrorSeverity.Error,
|
||||
"Reading received remote main menu content failed. " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -43,7 +43,7 @@ namespace Barotrauma
|
||||
CoroutineManager.StartCoroutine(UpdateColorFade(from, to, duration));
|
||||
}
|
||||
|
||||
private IEnumerable<object> UpdateColorFade(Color from, Color to, float duration)
|
||||
private IEnumerable<CoroutineStatus> UpdateColorFade(Color from, Color to, float duration)
|
||||
{
|
||||
while (Selected != this)
|
||||
{
|
||||
|
||||
@@ -578,6 +578,7 @@ namespace Barotrauma
|
||||
RecalculateHolder();
|
||||
}
|
||||
serverInfo.CreatePreviewWindow(serverPreview.Content);
|
||||
serverPreview.ForceLayoutRecalculation();
|
||||
btn.Children.ForEach(c => c.SpriteEffects = serverPreviewContainer.Visible ? SpriteEffects.None : SpriteEffects.FlipHorizontally);
|
||||
}
|
||||
return true;
|
||||
@@ -1715,7 +1716,7 @@ namespace Barotrauma
|
||||
CoroutineManager.StartCoroutine(WaitForRefresh());
|
||||
}
|
||||
|
||||
private IEnumerable<object> WaitForRefresh()
|
||||
private IEnumerable<CoroutineStatus> WaitForRefresh()
|
||||
{
|
||||
waitingForRefresh = true;
|
||||
if (refreshDisableTimer > DateTime.Now)
|
||||
@@ -2058,7 +2059,7 @@ namespace Barotrauma
|
||||
FilterServers();
|
||||
}
|
||||
|
||||
private IEnumerable<object> EstimateLobbyPing(ServerInfo serverInfo, GUITextBlock serverPingText)
|
||||
private IEnumerable<CoroutineStatus> EstimateLobbyPing(ServerInfo serverInfo, GUITextBlock serverPingText)
|
||||
{
|
||||
while (!steamPingInfoReady)
|
||||
{
|
||||
@@ -2096,7 +2097,7 @@ namespace Barotrauma
|
||||
waitingForRefresh = false;
|
||||
}
|
||||
|
||||
private IEnumerable<object> SendMasterServerRequest()
|
||||
private IEnumerable<CoroutineStatus> SendMasterServerRequest()
|
||||
{
|
||||
RestClient client = null;
|
||||
try
|
||||
@@ -2271,7 +2272,7 @@ namespace Barotrauma
|
||||
return true;
|
||||
}
|
||||
|
||||
private IEnumerable<object> ConnectToServer(string endpoint, string serverName)
|
||||
private IEnumerable<CoroutineStatus> ConnectToServer(string endpoint, string serverName)
|
||||
{
|
||||
string serverIP = null;
|
||||
UInt64 serverSteamID = SteamManager.SteamIDStringToUInt64(endpoint);
|
||||
@@ -2375,10 +2376,9 @@ namespace Barotrauma
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string errorMsg = "Failed to ping a server (" + ip + ") - " + (ex?.InnerException?.Message ?? ex.Message);
|
||||
GameAnalyticsManager.AddErrorEventOnce("ServerListScreen.PingServer:PingException" + ip, GameAnalyticsSDK.Net.EGAErrorSeverity.Warning, errorMsg);
|
||||
GameAnalyticsManager.AddErrorEventOnce("ServerListScreen.PingServer:PingException" + ip, GameAnalyticsManager.ErrorSeverity.Warning, "Failed to ping a server - " + (ex?.InnerException?.Message ?? ex.Message));
|
||||
#if DEBUG
|
||||
DebugConsole.NewMessage(errorMsg, Color.Red);
|
||||
DebugConsole.NewMessage("Failed to ping a server (" + ip + ") - " + (ex?.InnerException?.Message ?? ex.Message), Color.Red);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace Barotrauma
|
||||
|
||||
float subscribePollAdditionalWait = 0.0f;
|
||||
|
||||
private IEnumerable<object> PollSubscribedItems()
|
||||
private IEnumerable<CoroutineStatus> PollSubscribedItems()
|
||||
{
|
||||
if (!SteamManager.IsInitialized) { yield return CoroutineStatus.Success; }
|
||||
|
||||
@@ -364,7 +364,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<object> RefreshDownloadState()
|
||||
public IEnumerable<CoroutineStatus> RefreshDownloadState()
|
||||
{
|
||||
bool isDownloading = true;
|
||||
while (true)
|
||||
@@ -824,14 +824,13 @@ namespace Barotrauma
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
string errorMsg = "Failed to save workshop item preview image to \"" + previewImagePath + "\".";
|
||||
GameAnalyticsManager.AddErrorEventOnce("SteamWorkshopScreen.OnItemPreviewDownloaded:WriteAllBytesFailed" + previewImagePath,
|
||||
GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg + "\n" + e.Message);
|
||||
GameAnalyticsManager.ErrorSeverity.Error, "Failed to save workshop item preview image.\n" + e.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<object> WaitForItemPreviewDownloaded(Steamworks.Ugc.Item? item, GUIListBox listBox, string previewImagePath)
|
||||
private IEnumerable<CoroutineStatus> WaitForItemPreviewDownloaded(Steamworks.Ugc.Item? item, GUIListBox listBox, string previewImagePath)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
@@ -1195,7 +1194,7 @@ namespace Barotrauma
|
||||
{
|
||||
string errorMsg = "Failed to edit workshop item (content package null)\n" + Environment.StackTrace.CleanupStackTrace();
|
||||
DebugConsole.ThrowError(errorMsg);
|
||||
GameAnalyticsManager.AddErrorEventOnce("SteamWorkshopScreen.ShowCreateItemFrame:ContentPackageNull", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
|
||||
GameAnalyticsManager.AddErrorEventOnce("SteamWorkshopScreen.ShowCreateItemFrame:ContentPackageNull", GameAnalyticsManager.ErrorSeverity.Error, errorMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1835,7 +1834,7 @@ namespace Barotrauma
|
||||
|
||||
}
|
||||
|
||||
private IEnumerable<object> WaitForPublish(SteamManager.WorkshopPublishStatus workshopPublishStatus)
|
||||
private IEnumerable<CoroutineStatus> WaitForPublish(SteamManager.WorkshopPublishStatus workshopPublishStatus)
|
||||
{
|
||||
var item = workshopPublishStatus.Item;
|
||||
var coroutine = workshopPublishStatus.Coroutine;
|
||||
|
||||
@@ -369,11 +369,20 @@ namespace Barotrauma
|
||||
{
|
||||
ToolTip = TextManager.Get("AddSubToolTip")
|
||||
};
|
||||
|
||||
List<(string Name, SubmarineInfo Sub)> subs = new List<(string Name, SubmarineInfo Sub)>();
|
||||
|
||||
foreach (SubmarineInfo sub in SubmarineInfo.SavedSubmarines)
|
||||
{
|
||||
if (sub.Type != SubmarineType.Player) { continue; }
|
||||
linkedSubBox.AddItem(sub.Name, sub);
|
||||
subs.Add((sub.Name, sub));
|
||||
}
|
||||
|
||||
foreach (var (name, sub) in subs.OrderBy(tuple => tuple.Name))
|
||||
{
|
||||
linkedSubBox.AddItem(name, sub);
|
||||
}
|
||||
|
||||
linkedSubBox.OnSelected += SelectLinkedSub;
|
||||
linkedSubBox.OnDropped += (component, obj) =>
|
||||
{
|
||||
@@ -1220,11 +1229,19 @@ namespace Barotrauma
|
||||
|
||||
string downloadFolder = Path.GetFullPath(SaveUtil.SubmarineDownloadFolder);
|
||||
linkedSubBox.ClearChildren();
|
||||
|
||||
List<(string Name, SubmarineInfo Sub)> subs = new List<(string Name, SubmarineInfo Sub)>();
|
||||
|
||||
foreach (SubmarineInfo sub in SubmarineInfo.SavedSubmarines)
|
||||
{
|
||||
if (sub.Type != SubmarineType.Player) { continue; }
|
||||
if (Path.GetDirectoryName(Path.GetFullPath(sub.FilePath)) == downloadFolder) { continue; }
|
||||
linkedSubBox.AddItem(sub.Name, sub);
|
||||
subs.Add((sub.Name, sub));
|
||||
}
|
||||
|
||||
foreach (var (subName, sub) in subs.OrderBy(tuple => tuple.Name))
|
||||
{
|
||||
linkedSubBox.AddItem(subName, sub);
|
||||
}
|
||||
|
||||
cam.UpdateTransform();
|
||||
@@ -1294,7 +1311,7 @@ namespace Barotrauma
|
||||
/// </summary>
|
||||
/// <see cref="AutoSave"/>
|
||||
/// <returns></returns>
|
||||
private static IEnumerable<object> AutoSaveCoroutine()
|
||||
private static IEnumerable<CoroutineStatus> AutoSaveCoroutine()
|
||||
{
|
||||
DateTime target = DateTime.Now.AddMinutes(GameSettings.AutoSaveIntervalSeconds);
|
||||
DateTime tempTarget = DateTime.Now;
|
||||
@@ -1998,14 +2015,21 @@ namespace Barotrauma
|
||||
var gapPositionDropDown = new GUIDropDown(new RectTransform(new Vector2(0.5f, 1f), gapPositionGroup.RectTransform),
|
||||
text: "", selectMultiple: true);
|
||||
|
||||
Submarine.MainSub.Info?.OutpostModuleInfo?.DetermineGapPositions(Submarine.MainSub);
|
||||
foreach (var gapPos in Enum.GetValues(typeof(OutpostModuleInfo.GapPosition)))
|
||||
var outpostModuleInfo = Submarine.MainSub.Info?.OutpostModuleInfo;
|
||||
if (outpostModuleInfo != null)
|
||||
{
|
||||
if ((OutpostModuleInfo.GapPosition)gapPos == OutpostModuleInfo.GapPosition.None) { continue; }
|
||||
gapPositionDropDown.AddItem(TextManager.Capitalize(gapPos.ToString()), gapPos);
|
||||
if (Submarine.MainSub.Info?.OutpostModuleInfo?.GapPositions.HasFlag((OutpostModuleInfo.GapPosition)gapPos) ?? false)
|
||||
if (outpostModuleInfo.GapPositions == OutpostModuleInfo.GapPosition.None)
|
||||
{
|
||||
gapPositionDropDown.SelectItem(gapPos);
|
||||
outpostModuleInfo.DetermineGapPositions(Submarine.MainSub);
|
||||
}
|
||||
foreach (var gapPos in Enum.GetValues(typeof(OutpostModuleInfo.GapPosition)))
|
||||
{
|
||||
if ((OutpostModuleInfo.GapPosition)gapPos == OutpostModuleInfo.GapPosition.None) { continue; }
|
||||
gapPositionDropDown.AddItem(TextManager.Capitalize(gapPos.ToString()), gapPos);
|
||||
if (outpostModuleInfo.GapPositions.HasFlag((OutpostModuleInfo.GapPosition)gapPos))
|
||||
{
|
||||
gapPositionDropDown.SelectItem(gapPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4774,7 +4798,7 @@ namespace Barotrauma
|
||||
|
||||
if (dummyCharacter != null)
|
||||
{
|
||||
dummyCharacter.AnimController.FindHull(dummyCharacter.CursorWorldPosition, false);
|
||||
dummyCharacter.AnimController.FindHull(dummyCharacter.CursorWorldPosition, setSubmarine: false);
|
||||
|
||||
foreach (Item item in dummyCharacter.Inventory.AllItems)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user