(d9829ac) v0.9.4.0

This commit is contained in:
Regalis
2019-10-24 18:05:42 +02:00
parent 9aa12bcac2
commit b39922a074
319 changed files with 12516 additions and 6815 deletions
@@ -22,6 +22,8 @@ namespace Barotrauma
private readonly Point MinSupportedResolution = new Point(1024, 540);
private bool contentPackageSelectionDirty;
private GUIFrame settingsFrame;
private GUIButton applyButton;
@@ -122,18 +124,28 @@ namespace Barotrauma
}
if (!contentPackage.IsCompatible())
{
tickBox.TextColor = Color.Red;
tickBox.Enabled = false;
tickBox.ToolTip = TextManager.GetWithVariables(contentPackage.GameVersion <= new Version(0, 0, 0, 0) ? "IncompatibleContentPackageUnknownVersion" : "IncompatibleContentPackage",
tickBox.TextColor = Color.Red * 0.6f;
tickBox.ToolTip = tickBox.TextBlock.ToolTip =
TextManager.GetWithVariables(contentPackage.GameVersion <= new Version(0, 0, 0, 0) ? "IncompatibleContentPackageUnknownVersion" : "IncompatibleContentPackage",
new string[3] { "[packagename]", "[packageversion]", "[gameversion]" }, new string[3] { contentPackage.Name, contentPackage.GameVersion.ToString(), GameMain.Version.ToString() });
}
else if (contentPackage.CorePackage && !contentPackage.ContainsRequiredCorePackageFiles(out List<ContentType> missingContentTypes))
{
tickBox.TextColor = Color.Red;
tickBox.Enabled = false;
tickBox.ToolTip = TextManager.GetWithVariables("ContentPackageMissingCoreFiles", new string[2] { "[packagename]", "[missingfiletypes]" },
tickBox.TextColor = Color.Red * 0.6f;
tickBox.ToolTip = tickBox.TextBlock.ToolTip =
TextManager.GetWithVariables("ContentPackageMissingCoreFiles", new string[2] { "[packagename]", "[missingfiletypes]" },
new string[2] { contentPackage.Name, string.Join(", ", missingContentTypes) }, new bool[2] { false, true });
}
else if (contentPackage.Invalid)
{
tickBox.Enabled = false;
tickBox.TextColor = Color.Red * 0.6f;
tickBox.ToolTip = tickBox.TextBlock.ToolTip =
TextManager.GetWithVariable("InvalidContentPackage", "[packagename]", contentPackage.Name) +
"\n" + string.Join("\n", contentPackage.ErrorMessages);
}
}
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.045f), generalLayoutGroup.RectTransform), TextManager.Get("Language"));
@@ -147,12 +159,28 @@ namespace Barotrauma
languageDD.OnSelected = (guiComponent, obj) =>
{
string newLanguage = obj as string;
if (newLanguage == Language) return true;
if (newLanguage == Language) { return true; }
string prevLanguage = Language;
Language = newLanguage;
UnsavedSettings = true;
var msgBox = new GUIMessageBox(TextManager.Get("RestartRequiredLabel"), TextManager.Get("RestartRequiredLanguage"));
var msgBox = new GUIMessageBox(
TextManager.Get("RestartRequiredLabel"),
TextManager.Get("RestartRequiredLanguage"),
buttons: new string[] { TextManager.Get("Cancel"), TextManager.Get("OK") });
msgBox.Buttons[0].OnClicked += (btn, userdata) =>
{
Language = prevLanguage;
languageDD.SelectItem(Language);
msgBox.Close();
return true;
}; msgBox.Buttons[1].OnClicked += (btn, userdata) =>
{
ApplySettings();
GameMain.Instance.Exit();
return true;
};
return true;
};
@@ -586,7 +614,7 @@ namespace Barotrauma
BarScroll = (float)Math.Sqrt(MathUtils.InverseLerp(0.2f, 5.0f, MicrophoneVolume)),
OnMoved = (scrollBar, scroll) =>
{
MicrophoneVolume = MathHelper.Lerp(0.2f, 5.0f, scroll * scroll);
MicrophoneVolume = MathHelper.Lerp(0.2f, 10.0f, scroll * scroll);
MicrophoneVolume = (float)Math.Round(MicrophoneVolume, 1);
ChangeSliderText(scrollBar, MicrophoneVolume);
scrollBar.Step = 0.05f;
@@ -630,7 +658,7 @@ namespace Barotrauma
noiseGateSlider.Frame.Visible = false;
noiseGateSlider.Step = 0.01f;
noiseGateSlider.Range = new Vector2(-100.0f, 0.0f);
noiseGateSlider.BarScroll = MathUtils.InverseLerp(-1.0f, 0.0f, NoiseGateThreshold);
noiseGateSlider.BarScroll = MathUtils.InverseLerp(-100.0f, 0.0f, NoiseGateThreshold);
noiseGateSlider.BarScroll *= noiseGateSlider.BarScroll;
noiseGateSlider.OnMoved = (GUIScrollBar scrollBar, float barScroll) =>
{
@@ -976,14 +1004,15 @@ namespace Barotrauma
private bool SelectContentPackage(GUITickBox tickBox)
{
contentPackageSelectionDirty = true;
var contentPackage = tickBox.UserData as ContentPackage;
if (contentPackage.CorePackage)
{
if (tickBox.Selected)
{
//make sure no other core packages are selected
SelectedContentPackages.RemoveWhere(cp => cp.CorePackage && cp != contentPackage);
SelectedContentPackages.Add(contentPackage);
SelectedContentPackages.RemoveAll(cp => cp.CorePackage && cp != contentPackage);
SelectContentPackage(contentPackage);
foreach (GUITickBox otherTickBox in tickBox.Parent.Children)
{
ContentPackage otherContentPackage = otherTickBox.UserData as ContentPackage;
@@ -1003,11 +1032,11 @@ namespace Barotrauma
{
if (tickBox.Selected)
{
SelectedContentPackages.Add(contentPackage);
SelectContentPackage(contentPackage);
}
else
{
SelectedContentPackages.Remove(contentPackage);
DeselectContentPackage(contentPackage);
}
}
if (contentPackage.GetFilesOfType(ContentType.Submarine).Any()) { Submarine.RefreshSavedSubs(); }
@@ -1128,7 +1157,10 @@ namespace Barotrauma
{
ApplySettings();
if (Screen.Selected != GameMain.MainMenuScreen) GUI.SettingsMenuOpen = false;
if (contentPackageSelectionDirty)
{
new GUIMessageBox(TextManager.Get("RestartRequiredLabel"), TextManager.Get("RestartRequiredGeneric"));
}
return true;
}
}