(9a7d83a40) Fullscreen bug workarounds
This commit is contained in:
@@ -121,7 +121,8 @@ namespace Barotrauma
|
||||
if (!hasRequiredContentPackages)
|
||||
{
|
||||
var msgBox = new GUIMessageBox(TextManager.Get("ContentPackageMismatch"),
|
||||
TextManager.GetWithVariable("ContentPackageMismatchWarning", "[requiredcontentpackages]", string.Join(", ", selectedSub.RequiredContentPackages)),
|
||||
TextManager.Get("ContentPackageMismatchWarning")
|
||||
.Replace("[requiredcontentpackages]", string.Join(", ", selectedSub.RequiredContentPackages)),
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("No") });
|
||||
|
||||
msgBox.Buttons[0].OnClicked = msgBox.Close;
|
||||
|
||||
@@ -636,7 +636,7 @@ namespace Barotrauma
|
||||
CanBeFocused = false
|
||||
};
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), container.RectTransform),
|
||||
TextManager.GetWithVariable("Reward", "[reward]", selectedMission.Reward.ToString()))
|
||||
TextManager.Get("Reward").Replace("[reward]", selectedMission.Reward.ToString()))
|
||||
{
|
||||
CanBeFocused = false
|
||||
};
|
||||
@@ -860,7 +860,8 @@ namespace Barotrauma
|
||||
|
||||
public string GetMoney()
|
||||
{
|
||||
return TextManager.GetWithVariable("PlayerCredits", "[credits]", (GameMain.GameSession == null) ? "0" : string.Format(CultureInfo.InvariantCulture, "{0:N0}", Campaign.Money));
|
||||
return TextManager.Get("PlayerCredits").Replace("[credits]",
|
||||
((GameMain.GameSession == null) ? "0" : string.Format(CultureInfo.InvariantCulture, "{0:N0}", Campaign.Money)));
|
||||
}
|
||||
|
||||
private bool SelectCharacter(GUIComponent component, object selection)
|
||||
@@ -901,7 +902,7 @@ namespace Barotrauma
|
||||
{
|
||||
var confirmDialog = new GUIMessageBox(
|
||||
TextManager.Get("FireWarningHeader"),
|
||||
TextManager.GetWithVariable("FireWarningText", "[charactername]", ((CharacterInfo)obj).Name),
|
||||
TextManager.Get("FireWarningText").Replace("[charactername]", ((CharacterInfo)obj).Name),
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("No") });
|
||||
confirmDialog.Buttons[0].UserData = (CharacterInfo)obj;
|
||||
confirmDialog.Buttons[0].OnClicked = FireCharacter;
|
||||
|
||||
@@ -8,31 +8,19 @@ namespace Barotrauma
|
||||
{
|
||||
private GUIListBox listBox;
|
||||
|
||||
private XElement configElement;
|
||||
|
||||
private float scrollSpeed;
|
||||
|
||||
private readonly float scrollSpeed;
|
||||
public CreditsPlayer(RectTransform rectT, string configFile) : base(null, rectT)
|
||||
{
|
||||
GameMain.Instance.OnResolutionChanged += () => { ClearChildren(); Load(); };
|
||||
|
||||
var doc = XMLExtensions.TryLoadXml(configFile);
|
||||
configElement = doc.Root;
|
||||
scrollSpeed = doc.Root.GetAttributeFloat("scrollspeed", 100.0f);
|
||||
int spacing = doc.Root.GetAttributeInt("spacing", 0);
|
||||
|
||||
Load();
|
||||
}
|
||||
|
||||
private void Load()
|
||||
{
|
||||
scrollSpeed = configElement.GetAttributeFloat("scrollspeed", 100.0f);
|
||||
int spacing = configElement.GetAttributeInt("spacing", 0);
|
||||
|
||||
listBox = new GUIListBox(new RectTransform(Vector2.One, RectTransform), style: null)
|
||||
listBox = new GUIListBox(new RectTransform(Vector2.One, rectT), style: null)
|
||||
{
|
||||
Spacing = spacing
|
||||
};
|
||||
|
||||
foreach (XElement subElement in configElement.Elements())
|
||||
foreach (XElement subElement in doc.Root.Elements())
|
||||
{
|
||||
switch (subElement.Name.ToString().ToLowerInvariant())
|
||||
{
|
||||
|
||||
@@ -277,7 +277,7 @@ namespace Barotrauma
|
||||
Stretch = true
|
||||
};
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.4f), commonnessContainer.RectTransform),
|
||||
TextManager.GetWithVariable("LevelEditorLevelObjCommonness", "[leveltype]", selectedParams.Name), textAlignment: Alignment.Center);
|
||||
TextManager.Get("LevelEditorLevelObjCommonness").Replace("[leveltype]", selectedParams.Name), textAlignment: Alignment.Center);
|
||||
new GUINumberInput(new RectTransform(new Vector2(0.5f, 0.4f), commonnessContainer.RectTransform), GUINumberInput.NumberType.Float)
|
||||
{
|
||||
MinValueFloat = 0,
|
||||
|
||||
@@ -199,6 +199,8 @@ namespace Barotrauma
|
||||
UserData = "noresults"
|
||||
};
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool RefreshJoinButtonState(GUIComponent component, object obj)
|
||||
@@ -469,15 +471,16 @@ namespace Barotrauma
|
||||
{
|
||||
string toolTip = "";
|
||||
if (serverInfo.GameVersion != GameMain.Version.ToString())
|
||||
toolTip = TextManager.GetWithVariable("ServerListIncompatibleVersion", "[version]", serverInfo.GameVersion);
|
||||
toolTip = TextManager.Get("ServerListIncompatibleVersion").Replace("[version]", serverInfo.GameVersion);
|
||||
|
||||
for (int i = 0; i < serverInfo.ContentPackageNames.Count; i++)
|
||||
{
|
||||
if (!GameMain.SelectedPackages.Any(cp => cp.MD5hash.Hash == serverInfo.ContentPackageHashes[i]))
|
||||
{
|
||||
if (toolTip != "") toolTip += "\n";
|
||||
toolTip += TextManager.GetWithVariables("ServerListIncompatibleContentPackage", new string[2] { "[contentpackage]", "[hash]" },
|
||||
new string[2] { serverInfo.ContentPackageNames[i], Md5Hash.GetShortHash(serverInfo.ContentPackageHashes[i]) });
|
||||
toolTip += TextManager.Get("ServerListIncompatibleContentPackage")
|
||||
.Replace("[contentpackage]", serverInfo.ContentPackageNames[i])
|
||||
.Replace("[hash]", Md5Hash.GetShortHash(serverInfo.ContentPackageHashes[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,7 +554,10 @@ namespace Barotrauma
|
||||
{
|
||||
case System.Net.HttpStatusCode.NotFound:
|
||||
new GUIMessageBox(TextManager.Get("MasterServerErrorLabel"),
|
||||
TextManager.GetWithVariable("MasterServerError404", "[masterserverurl]", NetConfig.MasterServerUrl));
|
||||
TextManager.Get("MasterServerError404")
|
||||
.Replace("[masterserverurl]", NetConfig.MasterServerUrl)
|
||||
.Replace("[statuscode]", masterServerResponse.StatusCode.ToString())
|
||||
.Replace("[statusdescription]", masterServerResponse.StatusDescription));
|
||||
break;
|
||||
case System.Net.HttpStatusCode.ServiceUnavailable:
|
||||
new GUIMessageBox(TextManager.Get("MasterServerErrorLabel"),
|
||||
|
||||
@@ -415,14 +415,14 @@ namespace Barotrauma
|
||||
{
|
||||
if (SteamManager.UpdateWorkshopItem(item, out string errorMsg))
|
||||
{
|
||||
new GUIMessageBox("", TextManager.GetWithVariable("WorkshopItemUpdated", "[itemname]", TextManager.EnsureUTF8(item.Title)));
|
||||
new GUIMessageBox("", TextManager.Get("WorkshopItemUpdated").Replace("[itemname]", TextManager.EnsureUTF8(item.Title)));
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugConsole.ThrowError(errorMsg);
|
||||
new GUIMessageBox(
|
||||
TextManager.Get("Error"),
|
||||
TextManager.GetWithVariables("WorkshopItemUpdateFailed", new string[2] { "[itemname]", "[errormessage]" }, new string[2] { TextManager.EnsureUTF8(item.Title), errorMsg }));
|
||||
TextManager.Get("WorkshopItemUpdateFailed").Replace("[itemname]", TextManager.EnsureUTF8(item.Title)).Replace("[errormessage]", errorMsg));
|
||||
}
|
||||
btn.Enabled = false;
|
||||
btn.Visible = false;
|
||||
@@ -733,7 +733,7 @@ namespace Barotrauma
|
||||
new GUIImage(new RectTransform(new Point(scoreContainer.Rect.Height), scoreContainer.RectTransform),
|
||||
i < starCount ? "GUIStarIconBright" : "GUIStarIconDark");
|
||||
}
|
||||
new GUITextBlock(new RectTransform(new Vector2(0.2f, 0.0f), scoreContainer.RectTransform), TextManager.GetWithVariable("WorkshopItemVotes", "[votecount]", (item.VotesUp + item.VotesDown).ToString()));
|
||||
new GUITextBlock(new RectTransform(new Vector2(0.2f, 0.0f), scoreContainer.RectTransform), TextManager.Get("WorkshopItemVotes").Replace("[votecount]", (item.VotesUp + item.VotesDown).ToString()));
|
||||
|
||||
//tags ------------------------------------
|
||||
var tagContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.05f), content.RectTransform), isHorizontal: true, childAnchor: Anchor.CenterLeft)
|
||||
@@ -857,7 +857,7 @@ namespace Barotrauma
|
||||
if (!item.Installed)
|
||||
{
|
||||
new GUIMessageBox(TextManager.Get("Error"),
|
||||
TextManager.GetWithVariable("WorkshopErrorInstallRequiredToEdit", "[itemname]", TextManager.EnsureUTF8(item.Title)));
|
||||
TextManager.Get("WorkshopErrorInstallRequiredToEdit").Replace("[itemname]", TextManager.EnsureUTF8(item.Title)));
|
||||
return;
|
||||
}
|
||||
SteamManager.CreateWorkshopItemStaging(item, out itemEditor, out itemContentPackage);
|
||||
@@ -967,7 +967,7 @@ namespace Barotrauma
|
||||
{
|
||||
try
|
||||
{
|
||||
Barotrauma.OpenFileDialog ofd = new Barotrauma.OpenFileDialog()
|
||||
OpenFileDialog ofd = new OpenFileDialog()
|
||||
{
|
||||
Multiselect = true,
|
||||
InitialDirectory = Path.GetFullPath(SteamManager.WorkshopItemStagingFolder),
|
||||
@@ -1025,8 +1025,9 @@ namespace Barotrauma
|
||||
{
|
||||
new GUIMessageBox(
|
||||
TextManager.Get("Error"),
|
||||
TextManager.GetWithVariables("ContentPackageCantMakeCorePackage", new string[2] { "[packagename]", "[missingfiletypes]" },
|
||||
new string[2] { itemContentPackage.Name, string.Join(", ", missingContentTypes) }, new bool[2] { false, true }));
|
||||
TextManager.Get("ContentPackageCantMakeCorePackage")
|
||||
.Replace("[packagename]", itemContentPackage.Name)
|
||||
.Replace("[missingfiletypes]", string.Join(", ", missingContentTypes)));
|
||||
tickbox.Selected = false;
|
||||
}
|
||||
else
|
||||
@@ -1077,7 +1078,7 @@ namespace Barotrauma
|
||||
{
|
||||
try
|
||||
{
|
||||
Barotrauma.OpenFileDialog ofd = new Barotrauma.OpenFileDialog()
|
||||
OpenFileDialog ofd = new OpenFileDialog()
|
||||
{
|
||||
InitialDirectory = Path.GetFullPath(SteamManager.WorkshopItemStagingFolder),
|
||||
Title = TextManager.Get("workshopitemaddfiles"),
|
||||
@@ -1153,7 +1154,7 @@ namespace Barotrauma
|
||||
OnClicked = (btn, userData) =>
|
||||
{
|
||||
if (itemEditor == null) { return false; }
|
||||
var deleteVerification = new GUIMessageBox("", TextManager.GetWithVariable("WorkshopItemDeleteVerification", "[itemname]", itemEditor.Title),
|
||||
var deleteVerification = new GUIMessageBox("", TextManager.Get("WorkshopItemDeleteVerification").Replace("[itemname]", itemEditor.Title),
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("No") });
|
||||
deleteVerification.Buttons[0].OnClicked = (yesBtn, userdata) =>
|
||||
{
|
||||
@@ -1355,7 +1356,7 @@ namespace Barotrauma
|
||||
string pleaseWaitText = TextManager.Get("WorkshopPublishPleaseWait");
|
||||
var msgBox = new GUIMessageBox(
|
||||
pleaseWaitText,
|
||||
TextManager.GetWithVariable("WorkshopPublishInProgress", "[itemname]", TextManager.EnsureUTF8(item.Title)),
|
||||
TextManager.Get("WorkshopPublishInProgress").Replace("[itemname]", TextManager.EnsureUTF8(item.Title)),
|
||||
new string[] { TextManager.Get("Cancel") });
|
||||
|
||||
msgBox.Buttons[0].OnClicked = (btn, userdata) =>
|
||||
@@ -1377,13 +1378,13 @@ namespace Barotrauma
|
||||
|
||||
if (string.IsNullOrEmpty(item.Error))
|
||||
{
|
||||
new GUIMessageBox("", TextManager.GetWithVariable("WorkshopItemPublished", "[itemname]", TextManager.EnsureUTF8(item.Title)));
|
||||
new GUIMessageBox("", TextManager.Get("WorkshopItemPublished").Replace("[itemname]", TextManager.EnsureUTF8(item.Title)));
|
||||
}
|
||||
else
|
||||
{
|
||||
new GUIMessageBox(
|
||||
TextManager.Get("Error"),
|
||||
TextManager.GetWithVariable("WorkshopItemPublishFailed", "[itemname]", TextManager.EnsureUTF8(item.Title)) + item.Error);
|
||||
TextManager.Get("WorkshopItemPublishFailed").Replace("[itemname]", TextManager.EnsureUTF8(item.Title)) + item.Error);
|
||||
}
|
||||
|
||||
createItemFrame.ClearChildren();
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (buoyancyVol / selectedVol < 1.0f)
|
||||
{
|
||||
retVal += " (" + TextManager.GetWithVariable("OptimalBallastLevel", "[value]", (buoyancyVol / selectedVol).ToString("0.000")) + ")";
|
||||
retVal += " (" + TextManager.Get("OptimalBallastLevel").Replace("[value]", (buoyancyVol / selectedVol).ToString("0.000")) + ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -572,7 +572,7 @@ namespace Barotrauma
|
||||
ItemAssemblyPrefab assemblyPrefab = userData as ItemAssemblyPrefab;
|
||||
var msgBox = new GUIMessageBox(
|
||||
TextManager.Get("DeleteDialogLabel"),
|
||||
TextManager.GetWithVariable("DeleteDialogQuestion", "[file]", assemblyPrefab.Name),
|
||||
TextManager.Get("DeleteDialogQuestion").Replace("[file]", assemblyPrefab.Name),
|
||||
new string[] { TextManager.Get("Yes"), TextManager.Get("Cancel") });
|
||||
msgBox.Buttons[0].OnClicked += (deleteBtn, userData2) =>
|
||||
{
|
||||
@@ -584,7 +584,7 @@ namespace Barotrauma
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError(TextManager.GetWithVariable("DeleteFileError", "[file]", assemblyPrefab.Name), e);
|
||||
DebugConsole.ThrowError(TextManager.Get("DeleteFileError").Replace("[file]", assemblyPrefab.Name), e);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
@@ -861,7 +861,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (nameBox.Text.Contains(illegalChar))
|
||||
{
|
||||
GUI.AddMessage(TextManager.GetWithVariable("SubNameIllegalCharsWarning", "[illegalchar]", illegalChar.ToString()), Color.Red);
|
||||
GUI.AddMessage(TextManager.Get("SubNameIllegalCharsWarning").Replace("[illegalchar]", illegalChar.ToString()), Color.Red);
|
||||
nameBox.Flash();
|
||||
return false;
|
||||
}
|
||||
@@ -907,7 +907,7 @@ namespace Barotrauma
|
||||
}
|
||||
Submarine.MainSub.CheckForErrors();
|
||||
|
||||
GUI.AddMessage(TextManager.GetWithVariable("SubSavedNotification", "[filepath]", Submarine.MainSub.FilePath), Color.Green);
|
||||
GUI.AddMessage(TextManager.Get("SubSavedNotification").Replace("[filepath]", Submarine.MainSub.FilePath), Color.Green);
|
||||
|
||||
Submarine.RefreshSavedSub(savePath);
|
||||
if (prevSavePath != null && prevSavePath != savePath)
|
||||
@@ -1074,7 +1074,7 @@ namespace Barotrauma
|
||||
{
|
||||
OnClicked = (btn, userdata) =>
|
||||
{
|
||||
Barotrauma.OpenFileDialog ofd = new Barotrauma.OpenFileDialog()
|
||||
OpenFileDialog ofd = new OpenFileDialog()
|
||||
{
|
||||
InitialDirectory = Path.GetFullPath(Submarine.SavePath),
|
||||
Filter = "PNG file|*.png",
|
||||
@@ -1259,7 +1259,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (nameBox.Text.Contains(illegalChar))
|
||||
{
|
||||
GUI.AddMessage(TextManager.GetWithVariable("ItemAssemblyNameIllegalCharsWarning", "[illegalchar]", illegalChar.ToString()), Color.Red);
|
||||
GUI.AddMessage(TextManager.Get("ItemAssemblyNameIllegalCharsWarning").Replace("[illegalchar]", illegalChar.ToString()), Color.Red);
|
||||
nameBox.Flash();
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user