(874c38a79) Show keybindings for use or shoot in the tooltips.

This commit is contained in:
Joonas Rikkonen
2019-04-04 11:08:33 +03:00
parent d4752bb6a0
commit 7eb03ea6b3
56 changed files with 587 additions and 850 deletions
@@ -103,9 +103,8 @@ namespace Barotrauma
partial void LoadTexture(ref Vector4 sourceVector, ref bool shouldReturn, bool premultiplyAlpha = true);
partial void CalculateSourceRect();
public Sprite(XElement element, string path = "", string file = "", bool? preMultiplyAlpha = null, bool lazyLoad = false)
public Sprite(XElement element, string path = "", string file = "")
{
this.lazyLoad = lazyLoad;
SourceElement = element;
if (file == "")
{
@@ -128,12 +127,8 @@ namespace Barotrauma
Name = SourceElement.GetAttributeString("name", null);
Vector4 sourceVector = SourceElement.GetAttributeVector4("sourcerect", Vector4.Zero);
preMultipliedAlpha = preMultiplyAlpha ?? SourceElement.GetAttributeBool("premultiplyalpha", true);
bool shouldReturn = false;
if (!lazyLoad)
{
LoadTexture(ref sourceVector, ref shouldReturn, preMultipliedAlpha);
}
LoadTexture(ref sourceVector, ref shouldReturn, SourceElement.GetAttributeBool("premultiplyalpha", true));
if (shouldReturn) return;
sourceRect = new Rectangle((int)sourceVector.X, (int)sourceVector.Y, (int)sourceVector.Z, (int)sourceVector.W);
size = SourceElement.GetAttributeVector2("size", Vector2.One);