(6f4bea467) Updated doors

This commit is contained in:
Joonas Rikkonen
2019-05-03 13:43:47 +03:00
parent aef95740d3
commit fb21005258
84 changed files with 1514 additions and 1136 deletions
+28 -71
View File
@@ -159,10 +159,14 @@ namespace Barotrauma
public GameMain()
{
#if !DEBUG && OSX
#if !DEBUG && OSX
// Use a separate path for content that's editable due to macOS's .app bundles crashing when edited during runtime
string macPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Library/Barotrauma");
Directory.SetCurrentDirectory(macPath);
#endif
Content.RootDirectory = macPath + "/Content";
#else
Content.RootDirectory = "Content";
#endif
GraphicsDeviceManager = new GraphicsDeviceManager(this);
@@ -174,58 +178,6 @@ namespace Barotrauma
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
GUI.KeyboardDispatcher = new EventInput.KeyboardDispatcher(Window);
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
PerformanceCounter = new PerformanceCounter();
@@ -569,11 +521,20 @@ namespace Barotrauma
}
/// <summary>
/// Returns the file paths of all files of the given type in the currently selected content packages.
/// Returns the file paths of all files of the given type in the content packages.
/// </summary>
public IEnumerable<string> GetFilesOfType(ContentType type)
/// <param name="type"></param>
/// <param name="searchAllContentPackages">If true, also returns files in content packages that are installed but not currently selected.</param>
public IEnumerable<string> GetFilesOfType(ContentType type, bool searchAllContentPackages = false)
{
return ContentPackage.GetFilesOfType(SelectedPackages, type);
if (searchAllContentPackages)
{
return ContentPackage.GetFilesOfType(ContentPackage.List, type);
}
else
{
return ContentPackage.GetFilesOfType(SelectedPackages, type);
}
}
/// <summary>
@@ -765,7 +726,7 @@ namespace Barotrauma
PerformanceCounter.DrawTimeGraph.Update(sw.ElapsedTicks / (float)TimeSpan.TicksPerMillisecond);
}
public void ShowCampaignDisclaimer()
public void ShowCampaignDisclaimer(Action onContinue)
{
var msgBox = new GUIMessageBox(TextManager.Get("CampaignDisclaimerTitle"), TextManager.Get("CampaignDisclaimerText"),
new string[] { TextManager.Get("CampaignRoadMapTitle"), TextManager.Get("OK") });
@@ -774,13 +735,15 @@ namespace Barotrauma
{
var roadMap = new GUIMessageBox(TextManager.Get("CampaignRoadMapTitle"), TextManager.Get("CampaignRoadMapText"),
new string[] { TextManager.Get("Back"), TextManager.Get("OK") });
roadMap.Buttons[0].OnClicked = (_, __) => { ShowCampaignDisclaimer(); return true; };
roadMap.Buttons[0].OnClicked += roadMap.Close;
roadMap.Buttons[0].OnClicked += (_, __) => { ShowCampaignDisclaimer(onContinue); return true; };
roadMap.Buttons[1].OnClicked += roadMap.Close;
roadMap.Buttons[1].OnClicked += (_, __) => { onContinue?.Invoke(); return true; };
return true;
};
msgBox.Buttons[0].OnClicked += msgBox.Close;
msgBox.Buttons[1].OnClicked += msgBox.Close;
msgBox.Buttons[1].OnClicked += (_, __) => { onContinue?.Invoke(); return true; };
Config.CampaignDisclaimerShown = true;
Config.SaveNewPlayerConfig();
@@ -790,12 +753,13 @@ namespace Barotrauma
{
var msgBox = new GUIMessageBox(TextManager.Get("EditorDisclaimerTitle"), TextManager.Get("EditorDisclaimerText"));
var linkHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.25f), msgBox.Content.RectTransform)) { Stretch = true, RelativeSpacing = 0.025f };
linkHolder.RectTransform.MaxSize = new Point(int.MaxValue, linkHolder.Rect.Height);
List<Pair<string, string>> links = new List<Pair<string, string>>()
{
new Pair<string, string>(TextManager.Get("EditorDisclaimerWikiLink"),TextManager.Get("EditorDisclaimerWikiUrl")),
new Pair<string, string>(TextManager.Get("EditorDisclaimerDiscordLink"),TextManager.Get("EditorDisclaimerDiscordUrl")),
new Pair<string, string>(TextManager.Get("EditorDisclaimerForumLink"),TextManager.Get("EditorDisclaimerForumUrl")),
};
{
new Pair<string, string>(TextManager.Get("EditorDisclaimerWikiLink"),TextManager.Get("EditorDisclaimerWikiUrl")),
new Pair<string, string>(TextManager.Get("EditorDisclaimerDiscordLink"),TextManager.Get("EditorDisclaimerDiscordUrl")),
new Pair<string, string>(TextManager.Get("EditorDisclaimerForumLink"),TextManager.Get("EditorDisclaimerForumUrl")),
};
foreach (var link in links)
{
new GUIButton(new RectTransform(new Vector2(1.0f, 0.2f), linkHolder.RectTransform), link.First, style: "MainMenuGUIButton", textAlignment: Alignment.Left)
@@ -815,13 +779,6 @@ namespace Barotrauma
Config.SaveNewPlayerConfig();
}
msgBox.Text.RectTransform.MaxSize = new Point(int.MaxValue, msgBox.Text.Rect.Height);
linkHolder.RectTransform.MaxSize = new Point(int.MaxValue, linkHolder.Rect.Height);
msgBox.RectTransform.MinSize = new Point(0, msgBox.Rect.Height + linkHolder.Rect.Height + msgBox.Buttons.First().Rect.Height * 8);
Config.EditorDisclaimerShown = true;
Config.SaveNewPlayerConfig();
}
// ToDo: Move texts/links to localization, when possible.
public void ShowBugReporter()
{