Skip to content

Commit

Permalink
Cleanup: Assorted
Browse files Browse the repository at this point in the history
* Separate the HUD into it's own class / folders
  • Loading branch information
leezer3 committed Jul 24, 2018
1 parent 8c424a0 commit 259016f
Show file tree
Hide file tree
Showing 14 changed files with 717 additions and 466 deletions.
55 changes: 55 additions & 0 deletions source/OpenBVE/Graphics/HUD/HUD.Element.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using OpenBveApi.Colors;
using OpenBveApi.Math;

namespace OpenBve
{
internal static partial class HUD
{
internal class Element
{
internal string Subject;
internal Vector2 Position;
internal Vector2 Alignment;
internal Image TopLeft;
internal Image TopMiddle;
internal Image TopRight;
internal Image CenterLeft;
internal Image CenterMiddle;
internal Image CenterRight;
internal Image BottomLeft;
internal Image BottomMiddle;
internal Image BottomRight;
internal Color32 BackgroundColor;
internal Color32 OverlayColor;
internal Color32 TextColor;
internal Vector2 TextPosition;
internal Vector2 TextAlignment;
internal Fonts.OpenGlFont Font;
internal bool TextShadow;
internal string Text;
internal float Value1;
internal float Value2;
internal Transition Transition;
internal Vector2 TransitionVector;
internal double TransitionState;
internal Element()
{
this.Subject = null;
this.Position = new Vector2();
this.Alignment = new Vector2(-1, -1);
this.BackgroundColor = new Color32(255, 255, 255, 255);
this.OverlayColor = new Color32(255, 255, 255, 255);
this.TextColor = new Color32(255, 255, 255, 255);
this.TextPosition = new Vector2();
this.TextAlignment = new Vector2(-1, 0);
this.Font = Fonts.VerySmallFont;
this.TextShadow = true;
this.Text = null;
this.Value1 = 0.0f;
this.Value2 = 0.0f;
this.Transition = Transition.None;
this.TransitionState = 1.0;
}
}
}
}
11 changes: 11 additions & 0 deletions source/OpenBVE/Graphics/HUD/HUD.Image.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace OpenBve
{
internal static partial class HUD
{
internal struct Image
{
internal Textures.Texture BackgroundTexture;
internal Textures.Texture OverlayTexture;
}
}
}
16 changes: 16 additions & 0 deletions source/OpenBVE/Graphics/HUD/HUD.Transitions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;

namespace OpenBve
{
internal static partial class HUD
{
[Flags]
internal enum Transition
{
None = 0,
Move = 1,
Fade = 2,
MoveAndFade = 3
}
}
}
Loading

0 comments on commit 259016f

Please sign in to comment.