(ee4193544) Modified: Reduced the health interface opening range mildly to prevent ragdoll flailing at or close to old max range

This commit is contained in:
Joonas Rikkonen
2019-06-15 19:45:11 +03:00
parent 6c72136fa9
commit b64d3d17ac
7 changed files with 9 additions and 29 deletions
@@ -216,7 +216,7 @@ namespace Barotrauma
Color.LightGreen, Color.Black, 2, GUI.SmallFont); Color.LightGreen, Color.Black, 2, GUI.SmallFont);
textPos.Y += offset.Y; textPos.Y += offset.Y;
} }
if (character.FocusedCharacter.CharacterHealth.UseHealthWindow) if (character.FocusedCharacter.CharacterHealth.UseHealthWindow && character.CanInteractWith(character.FocusedCharacter, 160f, false))
{ {
GUI.DrawString(spriteBatch, textPos, GetCachedHudText("HealHint", GameMain.Config.KeyBind(InputType.Health).ToString()), GUI.DrawString(spriteBatch, textPos, GetCachedHudText("HealHint", GameMain.Config.KeyBind(InputType.Health).ToString()),
Color.LightGreen, Color.Black, 2, GUI.SmallFont); Color.LightGreen, Color.Black, 2, GUI.SmallFont);
@@ -590,7 +590,7 @@ namespace Barotrauma.Steam
} }
else else
{ {
DebugConsole.NewMessage("Publishing workshop item " + item.Title + " failed. " + item.Error, Microsoft.Xna.Framework.Color.Red); DebugConsole.ThrowError("Publishing workshop item " + item.Title + " failed. " + item.Error);
} }
SaveUtil.ClearFolder(WorkshopItemStagingFolder); SaveUtil.ClearFolder(WorkshopItemStagingFolder);
@@ -748,7 +748,7 @@ namespace Barotrauma
for (int i = 0; i < item.Tags.Length && i < 5; i++) for (int i = 0; i < item.Tags.Length && i < 5; i++)
{ {
if (string.IsNullOrEmpty(item.Tags[i])) { continue; } if (string.IsNullOrEmpty(item.Tags[i])) { continue; }
string tag = TextManager.Get("Workshop.ContentTag." + item.Tags[i].Replace(" ", ""), true); string tag = TextManager.Get("Workshop.ContentTag." + item.Tags[i], true);
if (string.IsNullOrEmpty(tag)) { tag = item.Tags[i].CapitaliseFirstInvariant(); } if (string.IsNullOrEmpty(tag)) { tag = item.Tags[i].CapitaliseFirstInvariant(); }
tags.Add(tag); tags.Add(tag);
} }
@@ -1386,20 +1386,9 @@ namespace Barotrauma
} }
else else
{ {
string errorMsg = item.ErrorCode.HasValue ? new GUIMessageBox(
TextManager.Get("WorkshopPublishError." + item.ErrorCode.Value.ToString(), returnNull: true) : TextManager.Get("Error"),
null; TextManager.GetWithVariable("WorkshopItemPublishFailed", "[itemname]", TextManager.EnsureUTF8(item.Title)) + item.Error);
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(); createItemFrame.ClearChildren();
@@ -2355,7 +2355,7 @@ namespace Barotrauma
{ {
SelectCharacter(focusedCharacter); SelectCharacter(focusedCharacter);
} }
else if (focusedCharacter != null && IsKeyHit(InputType.Health) && focusedCharacter.CharacterHealth.UseHealthWindow) else if (focusedCharacter != null && IsKeyHit(InputType.Health) && focusedCharacter.CharacterHealth.UseHealthWindow && CanInteractWith(focusedCharacter, 160f, false))
{ {
if (focusedCharacter == SelectedCharacter) if (focusedCharacter == SelectedCharacter)
{ {
@@ -21,11 +21,7 @@ namespace Barotrauma.Steam
{ "monster", 8 }, { "monster", 8 },
{ "art", 8 }, { "art", 8 },
{ "mission", 8 }, { "mission", 8 },
{ "event set", 8 }, { "environment", 5 }
{ "total conversion", 5 },
{ "environment", 5 },
{ "item assembly", 5 },
{ "language", 5 }
}; };
private List<string> popularTags = new List<string>(); private List<string> popularTags = new List<string>();
@@ -24,7 +24,6 @@ namespace Facepunch.Steamworks
public bool Publishing { get; internal set; } public bool Publishing { get; internal set; }
public ItemType? Type { get; set; } public ItemType? Type { get; set; }
public string Error { get; internal set; } = null; public string Error { get; internal set; } = null;
public SteamNative.Result? ErrorCode { get; internal set; } = null;
public string ChangeNote { get; set; } = ""; public string ChangeNote { get; set; } = "";
public uint WorkshopUploadAppId { get; set; } public uint WorkshopUploadAppId { get; set; }
public string MetaData { get; set; } = null; public string MetaData { get; set; } = null;
@@ -100,7 +99,6 @@ namespace Facepunch.Steamworks
Publishing = true; Publishing = true;
Error = null; Error = null;
ErrorCode = null;
if ( Id == 0 ) if ( Id == 0 )
{ {
@@ -131,14 +129,12 @@ namespace Facepunch.Steamworks
if ( obj.Result == SteamNative.Result.OK && !Failed ) if ( obj.Result == SteamNative.Result.OK && !Failed )
{ {
Error = null; Error = null;
ErrorCode = null;
Id = obj.PublishedFileId; Id = obj.PublishedFileId;
PublishChanges(); PublishChanges();
return; return;
} }
Error = $"Error creating new file: {obj.Result} ({obj.PublishedFileId})"; Error = $"Error creating new file: {obj.Result} ({obj.PublishedFileId})";
ErrorCode = obj.Result;
Publishing = false; Publishing = false;
OnChangesSubmitted?.Invoke( (Result) obj.Result ); OnChangesSubmitted?.Invoke( (Result) obj.Result );
@@ -225,7 +221,6 @@ namespace Facepunch.Steamworks
NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement; NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement;
Publishing = false; Publishing = false;
ErrorCode = obj.Result;
Error = obj.Result != SteamNative.Result.OK Error = obj.Result != SteamNative.Result.OK
? $"Error publishing changes: {obj.Result} ({NeedToAgreeToWorkshopLegal})" ? $"Error publishing changes: {obj.Result} ({NeedToAgreeToWorkshopLegal})"
: null; : null;
@@ -20,7 +20,7 @@ namespace SteamNative
// //
// EResult // EResult
// //
public enum Result : int internal enum Result : int
{ {
OK = 1, OK = 1,
Fail = 2, Fail = 2,