(f2b1c4b73) Merge branch 'dev' of github.com:Regalis11/Barotrauma-development into dev

This commit is contained in:
Joonas Rikkonen
2019-06-15 19:45:32 +03:00
parent b64d3d17ac
commit 4b6a753947
5 changed files with 27 additions and 7 deletions

View File

@@ -590,7 +590,7 @@ namespace Barotrauma.Steam
}
else
{
DebugConsole.ThrowError("Publishing workshop item " + item.Title + " failed. " + item.Error);
DebugConsole.NewMessage("Publishing workshop item " + item.Title + " failed. " + item.Error, Microsoft.Xna.Framework.Color.Red);
}
SaveUtil.ClearFolder(WorkshopItemStagingFolder);

View File

@@ -748,7 +748,7 @@ namespace Barotrauma
for (int i = 0; i < item.Tags.Length && i < 5; i++)
{
if (string.IsNullOrEmpty(item.Tags[i])) { continue; }
string tag = TextManager.Get("Workshop.ContentTag." + item.Tags[i], true);
string tag = TextManager.Get("Workshop.ContentTag." + item.Tags[i].Replace(" ", ""), true);
if (string.IsNullOrEmpty(tag)) { tag = item.Tags[i].CapitaliseFirstInvariant(); }
tags.Add(tag);
}
@@ -1386,9 +1386,20 @@ namespace Barotrauma
}
else
{
new GUIMessageBox(
TextManager.Get("Error"),
TextManager.GetWithVariable("WorkshopItemPublishFailed", "[itemname]", TextManager.EnsureUTF8(item.Title)) + item.Error);
string errorMsg = item.ErrorCode.HasValue ?
TextManager.Get("WorkshopPublishError." + item.ErrorCode.Value.ToString(), returnNull: true) :
null;
if (errorMsg == null)
{
new GUIMessageBox(
TextManager.Get("Error"),
TextManager.GetWithVariable("WorkshopItemPublishFailed", "[itemname]", TextManager.EnsureUTF8(item.Title)) + item.Error);
}
else
{
new GUIMessageBox(TextManager.Get("Error"), errorMsg);
}
}
createItemFrame.ClearChildren();

View File

@@ -21,7 +21,11 @@ namespace Barotrauma.Steam
{ "monster", 8 },
{ "art", 8 },
{ "mission", 8 },
{ "environment", 5 }
{ "event set", 8 },
{ "total conversion", 5 },
{ "environment", 5 },
{ "item assembly", 5 },
{ "language", 5 }
};
private List<string> popularTags = new List<string>();

View File

@@ -24,6 +24,7 @@ namespace Facepunch.Steamworks
public bool Publishing { get; internal set; }
public ItemType? Type { get; set; }
public string Error { get; internal set; } = null;
public SteamNative.Result? ErrorCode { get; internal set; } = null;
public string ChangeNote { get; set; } = "";
public uint WorkshopUploadAppId { get; set; }
public string MetaData { get; set; } = null;
@@ -99,6 +100,7 @@ namespace Facepunch.Steamworks
Publishing = true;
Error = null;
ErrorCode = null;
if ( Id == 0 )
{
@@ -129,12 +131,14 @@ namespace Facepunch.Steamworks
if ( obj.Result == SteamNative.Result.OK && !Failed )
{
Error = null;
ErrorCode = null;
Id = obj.PublishedFileId;
PublishChanges();
return;
}
Error = $"Error creating new file: {obj.Result} ({obj.PublishedFileId})";
ErrorCode = obj.Result;
Publishing = false;
OnChangesSubmitted?.Invoke( (Result) obj.Result );
@@ -221,6 +225,7 @@ namespace Facepunch.Steamworks
NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement;
Publishing = false;
ErrorCode = obj.Result;
Error = obj.Result != SteamNative.Result.OK
? $"Error publishing changes: {obj.Result} ({NeedToAgreeToWorkshopLegal})"
: null;

View File

@@ -20,7 +20,7 @@ namespace SteamNative
//
// EResult
//
internal enum Result : int
public enum Result : int
{
OK = 1,
Fail = 2,