diff --git a/MuzikaGromche/MuzikaGromche.csproj b/MuzikaGromche/MuzikaGromche.csproj
index 0f73454..f6a91f1 100644
--- a/MuzikaGromche/MuzikaGromche.csproj
+++ b/MuzikaGromche/MuzikaGromche.csproj
@@ -7,6 +7,7 @@
13.37.1337
true
latest
+ enable
$(NoWarn);CS0436
diff --git a/MuzikaGromche/Plugin.cs b/MuzikaGromche/Plugin.cs
index 9ca7814..10743a2 100644
--- a/MuzikaGromche/Plugin.cs
+++ b/MuzikaGromche/Plugin.cs
@@ -27,7 +27,7 @@ namespace MuzikaGromche
[LobbyCompatibility(CompatibilityLevel.Everyone, VersionStrictness.Patch)]
public class Plugin : BaseUnityPlugin
{
- internal new static Config Config { get; private set; } = null;
+ internal new static Config Config { get; private set; } = null!;
private static readonly string[] PwnLyricsVariants = [
"", "", "", // make sure the array has enough items to index it without checking
@@ -480,8 +480,8 @@ namespace MuzikaGromche
return tracks[trackId];
}
- public static Track CurrentTrack;
- public static BeatTimeState BeatTimeState;
+ public static Track? CurrentTrack;
+ public static BeatTimeState? BeatTimeState;
public static void SetLightColor(Color color)
{
@@ -624,16 +624,16 @@ namespace MuzikaGromche
public class Track
{
- public string Name;
+ public required string Name;
// Language of the track's lyrics.
- public Language Language;
+ public required Language Language;
// Whether this track has NSFW/explicit lyrics.
public bool IsExplicit = false;
// Wind-up time can and should be shorter than the Start audio track,
// so that the "pop" effect can be baked into the Start audio and kept away
// from the looped part. This also means that the light show starts before
// the looped track does, so we need to sync them up as soon as we enter the Loop.
- public float WindUpTimer;
+ public required float WindUpTimer;
// Estimated number of beats per minute. Not used for light show, but might come in handy.
public float Bpm => 60f / (LoadedLoop.length / Beats);
@@ -655,11 +655,11 @@ namespace MuzikaGromche
// WAV is OK, but takes a lot of space. Try OGGVORBIS instead.
public AudioType AudioType = AudioType.MPEG;
- public AudioClip LoadedStart;
- public AudioClip LoadedLoop;
+ public AudioClip LoadedStart = null!;
+ public AudioClip LoadedLoop = null!;
// How often this track should be chosen, relative to the sum of weights of all tracks.
- public SyncedEntry Weight;
+ public SyncedEntry Weight = null!;
public string FileNameStart => $"{Name}Start.{Ext}";
public string FileNameLoop => $"{Name}Loop.{Ext}";
@@ -743,7 +743,7 @@ namespace MuzikaGromche
// In such case, a random number chosen and updated once per loop
// is used to select an alternative.
// If the chosen alternative is an empty string, lyrics event shall be skipped.
- public string[] LyricsLines { get; private set; }
+ public string[] LyricsLines { get; private set; } = [];
public (float, string)[] Lyrics
{
set
@@ -989,7 +989,7 @@ namespace MuzikaGromche
private float loopOffsetBeat = float.NegativeInfinity;
- private static System.Random lyricsRandom = null;
+ private static System.Random lyricsRandom = null!;
private int lyricsRandomPerLoop;
@@ -1140,7 +1140,7 @@ namespace MuzikaGromche
return events;
}
- private SetLightsColorEvent GetColorEvent(BeatTimeSpan loopOffsetSpan, BeatTimestamp windUpOffsetTimestamp)
+ private SetLightsColorEvent? GetColorEvent(BeatTimeSpan loopOffsetSpan, BeatTimestamp windUpOffsetTimestamp)
{
if (FadeOut(loopOffsetSpan) is Color c1)
{
@@ -1403,26 +1403,26 @@ namespace MuzikaGromche
public class Config : SyncedConfig2
{
- public static ConfigEntry EnableColorAnimations { get; private set; }
+ public static ConfigEntry EnableColorAnimations { get; private set; } = null!;
- public static ConfigEntry DisplayLyrics { get; private set; }
+ public static ConfigEntry DisplayLyrics { get; private set; } = null!;
- public static ConfigEntry AudioOffset { get; private set; }
+ public static ConfigEntry AudioOffset { get; private set; } = null!;
- public static ConfigEntry SkipExplicitTracks { get; private set; }
+ public static ConfigEntry SkipExplicitTracks { get; private set; } = null!;
public static bool ShouldSkipWindingPhase { get; private set; } = false;
- public static Palette PaletteOverride { get; private set; } = null;
+ public static Palette? PaletteOverride { get; private set; } = null;
public static float? FadeOutBeatOverride { get; private set; } = null;
public static float? FadeOutDurationOverride { get; private set; } = null;
- public static float[] FlickerLightsTimeSeriesOverride { get; private set; } = null;
- public static float[] LyricsTimeSeriesOverride { get; private set; } = null;
+ public static float[]? FlickerLightsTimeSeriesOverride { get; private set; } = null;
+ public static float[]? LyricsTimeSeriesOverride { get; private set; } = null;
public static float? BeatsOffsetOverride { get; private set; } = null;
public static float? ColorTransitionInOverride { get; private set; } = null;
public static float? ColorTransitionOutOverride { get; private set; } = null;
- public static string ColorTransitionEasingOverride { get; private set; } = null;
+ public static string? ColorTransitionEasingOverride { get; private set; } = null;
public Config(ConfigFile configFile) : base(PluginInfo.PLUGIN_GUID)
{
@@ -1559,7 +1559,7 @@ namespace MuzikaGromche
const string section = "Palette";
const int maxCustomPaletteSize = 8;
// Declare and initialize early to avoid "Use of unassigned local variable"
- SyncedEntry customPaletteSizeSyncedEntry = null;
+ SyncedEntry customPaletteSizeSyncedEntry = null!;
var customPaletteSyncedEntries = new SyncedEntry[maxCustomPaletteSize];
var loadButton = new GenericButtonConfigItem(section, "Load Palette from the Current Track",
@@ -1623,16 +1623,16 @@ namespace MuzikaGromche
const string section = "Timings";
var colorTransitionRange = new AcceptableValueRange(0f, 1f);
// Declare and initialize early to avoid "Use of unassigned local variable"
- List<(Action