Build 0.18.0.0

This commit is contained in:
Markus Isberg
2022-05-13 00:55:52 +09:00
parent 15d18e6ff6
commit 7547a9b78a
218 changed files with 3881 additions and 2192 deletions
@@ -16,6 +16,8 @@ namespace Barotrauma.Steam
{
public static partial class Workshop
{
public const int MaxThumbnailSize = 1024 * 1024;
public static readonly ImmutableArray<Identifier> Tags = new []
{
"submarine",
@@ -177,7 +179,7 @@ namespace Barotrauma.Steam
DeletePublishStagingCopy();
Directory.CreateDirectory(PublishStagingDir);
await CopyDirectory(contentPackage.Dir, contentPackage.Name, Path.GetDirectoryName(contentPackage.Path)!, PublishStagingDir);
await CopyDirectory(contentPackage.Dir, contentPackage.Name, Path.GetDirectoryName(contentPackage.Path)!, PublishStagingDir, ShouldCorrectPaths.No);
//Load filelist.xml and write the hash into it so anyone downloading this mod knows what it should be
ModProject modProject = new ModProject(contentPackage)
@@ -218,7 +220,7 @@ namespace Barotrauma.Steam
throw new Exception($"{newPath} already exists");
}
await CopyDirectory(contentPackage.Dir, contentPackage.Name, Path.GetDirectoryName(contentPackage.Path)!, newPath);
await CopyDirectory(contentPackage.Dir, contentPackage.Name, Path.GetDirectoryName(contentPackage.Path)!, newPath, ShouldCorrectPaths.Yes);
ModProject modProject = new ModProject(contentPackage);
modProject.DiscardHashAndInstallTime();
@@ -197,6 +197,11 @@ namespace Barotrauma.Steam
FileSelection.OnFileSelected = (fn) =>
{
if (new FileInfo(fn).Length > SteamManager.Workshop.MaxThumbnailSize)
{
new GUIMessageBox(TextManager.Get("Error"), TextManager.Get("WorkshopItemPreviewImageTooLarge"));
return;
}
thumbnailPath = fn;
CreateLocalThumbnail(thumbnailPath, thumbnailContainer);
};
@@ -119,6 +119,11 @@ namespace Barotrauma.Steam
{
CanBeFocused = false
};
new GUICustomComponent(new RectTransform(Vector2.Zero, searchHolder.RectTransform), onUpdate:
(f, component) =>
{
searchTitle.RectTransform.NonScaledSize = searchBox.Frame.RectTransform.NonScaledSize;
});
searchBox.OnSelected += (sender, userdata) => { searchTitle.Visible = false; };
searchBox.OnDeselected += (sender, userdata) => { searchTitle.Visible = searchBox.Text.IsNullOrWhiteSpace(); };