Skip to content

Commit 259016f

Browse files
committed
Cleanup: Assorted
* Separate the HUD into it's own class / folders
1 parent 8c424a0 commit 259016f

14 files changed

+717
-466
lines changed
+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using OpenBveApi.Colors;
2+
using OpenBveApi.Math;
3+
4+
namespace OpenBve
5+
{
6+
internal static partial class HUD
7+
{
8+
internal class Element
9+
{
10+
internal string Subject;
11+
internal Vector2 Position;
12+
internal Vector2 Alignment;
13+
internal Image TopLeft;
14+
internal Image TopMiddle;
15+
internal Image TopRight;
16+
internal Image CenterLeft;
17+
internal Image CenterMiddle;
18+
internal Image CenterRight;
19+
internal Image BottomLeft;
20+
internal Image BottomMiddle;
21+
internal Image BottomRight;
22+
internal Color32 BackgroundColor;
23+
internal Color32 OverlayColor;
24+
internal Color32 TextColor;
25+
internal Vector2 TextPosition;
26+
internal Vector2 TextAlignment;
27+
internal Fonts.OpenGlFont Font;
28+
internal bool TextShadow;
29+
internal string Text;
30+
internal float Value1;
31+
internal float Value2;
32+
internal Transition Transition;
33+
internal Vector2 TransitionVector;
34+
internal double TransitionState;
35+
internal Element()
36+
{
37+
this.Subject = null;
38+
this.Position = new Vector2();
39+
this.Alignment = new Vector2(-1, -1);
40+
this.BackgroundColor = new Color32(255, 255, 255, 255);
41+
this.OverlayColor = new Color32(255, 255, 255, 255);
42+
this.TextColor = new Color32(255, 255, 255, 255);
43+
this.TextPosition = new Vector2();
44+
this.TextAlignment = new Vector2(-1, 0);
45+
this.Font = Fonts.VerySmallFont;
46+
this.TextShadow = true;
47+
this.Text = null;
48+
this.Value1 = 0.0f;
49+
this.Value2 = 0.0f;
50+
this.Transition = Transition.None;
51+
this.TransitionState = 1.0;
52+
}
53+
}
54+
}
55+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace OpenBve
2+
{
3+
internal static partial class HUD
4+
{
5+
internal struct Image
6+
{
7+
internal Textures.Texture BackgroundTexture;
8+
internal Textures.Texture OverlayTexture;
9+
}
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
3+
namespace OpenBve
4+
{
5+
internal static partial class HUD
6+
{
7+
[Flags]
8+
internal enum Transition
9+
{
10+
None = 0,
11+
Move = 1,
12+
Fade = 2,
13+
MoveAndFade = 3
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)