-
Notifications
You must be signed in to change notification settings - Fork 0
/
HUD.cs
143 lines (115 loc) · 5.44 KB
/
HUD.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
using OpenTK;
using OpenTK.Graphics;
using StorybrewCommon.Scripting;
using StorybrewCommon.Storyboarding;
using System;
using static StorybrewCommon.Assets;
namespace StorybrewScripts
{
public class HUD : StoryboardObjectGenerator
{
StoryboardLayer l;
OsbSprite Disc;
public override void Generate() {
l = GetLayer("HUD");
DiscPlayer();
SpoilerWarning();
AcademyEmblem();
}
void DiscPlayer() {
var circle = l.CreateSprite(HUD_CIRCLE, OsbOrigin.Centre, new Vector2(-10, 404));
circle.Scale(-1000, .6);
circle.Fade(-1000, 100, 0, 1);
circle.Fade(AudioDuration - 1500, AudioDuration - 1000, 1, 0);
var disc = l.CreateSprite(HUD_DISC, OsbOrigin.Centre, new Vector2(-10, 404));
disc.Scale(-1000, .6);
disc.Rotate(-1000, AudioDuration, 0, 200);
disc.Fade(-1000, 100, 0, 1);
disc.Fade(AudioDuration - 1500, AudioDuration - 1000, 1, 0);
var line = l.CreateSprite(HUD_LINE, OsbOrigin.CentreLeft, new Vector2(-8, 381));
line.ScaleVec(OsbEasing.OutSine, -500, 2000, 0, 2, 16, 2);
line.Fade(-500, 0, 0, .8);
line.ScaleVec(AudioDuration - 3500, AudioDuration - 1800, 16, 2, 0, 2);
line.Fade(AudioDuration - 2500, AudioDuration - 1800, .8, 0);
// Pass to SpoilerWarning()
Disc = disc;
}
void SpoilerWarning() {
var spoiler = l.CreateSprite(HUD_SPOILER, OsbOrigin.Centre, new Vector2(-10, 404));
Action<int, int> spoilerShow = (start, end) => {
spoiler.Fade(OsbEasing.Out, start + 500, start + 1500, 0, 1);
Disc.Fade(OsbEasing.Out, start, start + 1000, 1, .4);
spoiler.Fade(end, end + 1000, 1, 0);
Disc.Fade(end + 500, end + 1500, .4, 1);
};
Action<int, Color4> spoilerColor = (time, color) =>
spoiler.Color(OsbEasing.Out, time, time + 1000, spoiler.ColorAt(time), color);
spoiler.Scale(72093, .5);
spoiler.Color(72093, Color4.Red);
spoilerShow(72093, 95394);
spoilerColor(76754, Color4.White);
spoilerShow(146657, 151317);
spoilerShow(206657, 244521);
spoilerColor(220055, Color4.Red);
spoilerColor(234035, Color4.White);
spoiler.Color(248016, Color4.Red);
spoilerShow(248016, 263161);
spoilerColor(260249, Color4.Black);
}
void AcademyEmblem() {
var abydos = l.CreateSprite(LOGO_ABYDOS, OsbOrigin.Centre, new Vector2(-10, 0));
var millenium = l.CreateSprite(LOGO_MILLENIUM, OsbOrigin.Centre, new Vector2(-10, 0));
var gehenna = l.CreateSprite(LOGO_GEHENNA, OsbOrigin.Centre, new Vector2(-10, 0));
var trinity = l.CreateSprite(LOGO_TRINITY, OsbOrigin.Centre, new Vector2(-10, 0));
var arius = l.CreateSprite(LOGO_ARIUS, OsbOrigin.Centre, new Vector2(-10, 0));
Action<OsbSprite, int, int> iconShow = (sprite, start, end) => {
if (sprite.ScaleAt(start).X != .45) sprite.Scale(start, .45);
sprite.MoveY(OsbEasing.OutCirc, start - 100, start + 300, 340, 355);
sprite.Fade(start - 100, start + 200, 0, 1);
sprite.Fade(end - 100, end + 200, 1, 0);
};
Action<OsbSprite, int> iconMoveUp = (sprite, time) => {
var ypos = sprite.PositionAt(time).Y;
sprite.MoveY(OsbEasing.OutCubic, time - 100, time + 500, ypos, ypos - 40);
};
Action<OsbSprite, int> iconMoveDown = (sprite, time) => {
var ypos = sprite.PositionAt(time).Y;
sprite.MoveY(OsbEasing.OutCubic, time - 100, time + 500, ypos, ypos + 40);
};
Action<OsbSprite, int> iconMoveDownSlow = (sprite, time) => {
var ypos = sprite.PositionAt(time).Y;
sprite.MoveY(OsbEasing.InOutCubic, time - 100, time + 1000, ypos, ypos + 40);
};
iconShow(abydos, 15006, 17336);
iconShow(abydos, 21996, 53453);
iconShow(abydos, 56948, 94229);
iconShow(millenium, 95394, 128016);
iconShow(gehenna, 131511, 145492);
iconShow(millenium, 145492, 150152);
iconShow(trinity, 169958, 206074);
iconShow(trinity, 207239, 215394);
iconShow(gehenna, 215394, 218598);
iconShow(trinity, 216268, 217725);
iconMoveUp(gehenna, 216268);
iconMoveDown(gehenna, 217725);
iconShow(trinity, 218598, 224132);
iconShow(gehenna, 220055, 222385);
iconMoveUp(trinity, 220055);
iconMoveDownSlow(trinity, 222385);
iconShow(arius, 224715, 227045);
iconShow(trinity, 227045, 227919);
iconShow(arius, 227919, 229375);
iconShow(trinity, 229375, 230249);
iconShow(gehenna, 230249, 231705);
iconShow(arius, 231705, 234035);
iconShow(trinity, 234035, 243356);
iconShow(gehenna, 238695, 243356);
iconMoveUp(trinity, 238695);
iconShow(abydos, 243356, 245686);
iconShow(trinity, 245686, 259666);
iconShow(arius, 255006, 261996);
iconMoveUp(trinity, 255006);
iconShow(abydos, 264326, 271317);
}
}
}