38f1ddb...178a853: v0.8.9.1, removed content folder

This commit is contained in:
Joonas Rikkonen
2019-03-18 19:46:58 +02:00
parent 38f1ddb6fe
commit 6c0679c297
1054 changed files with 151673 additions and 144931 deletions
@@ -1,61 +1,32 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Linq;
namespace Barotrauma
{
public class GUIFrame : GUIComponent
{
public GUIFrame(Rectangle rect, string style = "", GUIComponent parent = null)
: this(rect, null, (Alignment.Left | Alignment.Top), style, parent)
{
public GUIFrame(RectTransform rectT, string style = "", Color? color = null) : base(style, rectT)
{
}
public GUIFrame(Rectangle rect, Color color, string style = "", GUIComponent parent = null)
: this(rect, color, (Alignment.Left | Alignment.Top), style, parent)
{
}
public GUIFrame(Rectangle rect, Color? color, Alignment alignment, string style = "", GUIComponent parent = null)
: base(style)
{
this.rect = rect;
this.alignment = alignment;
if (color != null) this.color = (Color)color;
if (parent != null)
if (color.HasValue)
{
parent.AddChild(this);
this.color = color.Value;
}
else
{
UpdateDimensions();
}
//if (style != null) ApplyStyle(style);
}
public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
protected override void Draw(SpriteBatch spriteBatch)
{
if (!Visible) return;
Color currColor = color;
if (state == ComponentState.Selected) currColor = selectedColor;
if (state == ComponentState.Hover) currColor = hoverColor;
if (sprites == null || !sprites.Any()) GUI.DrawRectangle(spriteBatch, rect, currColor * (currColor.A/255.0f), true);
Color currColor = GetCurrentColor(state);
if (sprites == null || !sprites.Any()) GUI.DrawRectangle(spriteBatch, Rect, currColor * (currColor.A/255.0f), true);
base.Draw(spriteBatch);
if (OutlineColor != Color.Transparent)
{
GUI.DrawRectangle(spriteBatch, rect, OutlineColor * (OutlineColor.A/255.0f), false);
GUI.DrawRectangle(spriteBatch, Rect, OutlineColor * (OutlineColor.A/255.0f), false);
}
DrawChildren(spriteBatch);
}
}
}