-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMain.cs
67 lines (53 loc) · 1.72 KB
/
Main.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
using MelonLoader;
using ScoreOverlay;
using System.Reflection;
using TMPro;
using UnityEngine;
[assembly: AssemblyVersion(ScoreOverlayMod.VERSION)]
[assembly: AssemblyFileVersion(ScoreOverlayMod.VERSION)]
[assembly: MelonGame("Harmonix Music Systems, Inc.", "Audica")]
[assembly: MelonInfo(typeof(ScoreOverlayMod), "Score Overlay", ScoreOverlayMod.VERSION, "octo", "https://github.com/octoberU/ScoreOverlay")]
[assembly: MelonOptionalDependencies("SongBrowser")]
namespace ScoreOverlay
{
public class ScoreOverlayMod : MelonMod
{
public const string VERSION = "2.0.4";
public ScoreKeeper scoreKeeper;
public static UI ui;
static int score = 0;
static int streak = 0;
public override void OnApplicationStart()
{
ui = new UI();
Config.RegisterConfig();
}
public override void OnLevelWasInitialized(int level)
{
if (level == 1) ui.Initialize();
}
public override void OnModSettingsApplied()
{
Config.OnModSettingsApplied();
ui.OnModSettingsApplied();
}
public override void OnUpdate()
{
if (scoreKeeper != null)
{
if (scoreKeeper.mScore != score || scoreKeeper.mStreak != streak)
{
score = scoreKeeper.mScore;
streak = scoreKeeper.mStreak;
ui.UpdateDisplay(score, streak);
ui.UpdateHighscore(score, scoreKeeper.mHighScore);
}
}
else scoreKeeper = ScoreKeeper.I;
}
public static void ResetTracker()
{
score = streak = 0;
}
}
}