v0.1.2: Asynchronous master server connections, largefont, traitor mode ends when traitor dies or sub reaches end of level

This commit is contained in:
Regalis
2015-08-14 01:59:41 +03:00
parent 5771bc7e02
commit bc4ea098f7
23 changed files with 377 additions and 98 deletions

View File

@@ -20,7 +20,7 @@ namespace Subsurface
public static GUIStyle style;
static Texture2D t;
public static SpriteFont Font, SmallFont;
public static SpriteFont Font, SmallFont, LargeFont;
private static GraphicsDevice graphicsDevice;

View File

@@ -27,6 +27,14 @@ namespace Subsurface
private bool enabled;
public GUIComponent Selected
{
get
{
return selected;
}
}
public object SelectedData
{
get

View File

@@ -76,9 +76,10 @@ namespace Subsurface
}
public GUITextBlock(Rectangle rect, string text, GUIStyle style, Alignment alignment = Alignment.TopLeft, Alignment textAlignment = Alignment.TopLeft, GUIComponent parent = null, bool wrap = false)
public GUITextBlock(Rectangle rect, string text, GUIStyle style, Alignment alignment = Alignment.TopLeft, Alignment textAlignment = Alignment.TopLeft, GUIComponent parent = null, bool wrap = false, SpriteFont font =null)
: this (rect, text, null, null, alignment, textAlignment, style, parent, wrap)
{
this.Font = font == null ? GUI.Font : font;
}
public GUITextBlock(Rectangle rect, string text, Color? color, Color? textColor, Alignment textAlignment = Alignment.Left, GUIStyle style = null, GUIComponent parent = null, bool wrap = false)

View File

@@ -25,6 +25,12 @@ namespace Subsurface
}
}
public bool Enabled
{
get;
set;
}
public GUITickBox(Rectangle rect, string label, Alignment alignment, GUIComponent parent)
: base(null)
{
@@ -36,12 +42,16 @@ namespace Subsurface
box.SelectedColor = Color.DarkGray;
text = new GUITextBlock(new Rectangle(rect.X + 40, rect.Y, 200, 30), label, Color.Transparent, Color.White, Alignment.TopLeft, null, this);
Enabled = true;
}
public override void Update(float deltaTime)
{
base.Update(deltaTime);
if (!Enabled) return;
if (box.Rect.Contains(PlayerInput.GetMouseState.Position))
{
box.State = ComponentState.Hover;