Skip to content

Commit

Permalink
Alt://Rundown 4 update
Browse files Browse the repository at this point in the history
  • Loading branch information
AuriRex committed Apr 27, 2023
1 parent d82cd50 commit d1fcbae
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
6 changes: 6 additions & 0 deletions TheArchive.Core/ArchiveMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ public static void OnApplicationStart(IArchiveLogger logger, HarmonyLib.Harmony
CurrentRundown = BuildDB.GetCurrentRundownID(BuildDB.BuildNumber);
ArchiveLogger.Msg(ConsoleColor.DarkMagenta, $"Current game revision determined to be {BuildDB.BuildNumber}! ({CurrentRundown})");

if (RundownFlags.Latest.ToString() == nameof(RundownFlags.Latest))
{
for(int i = 0; i < 5; i++)
ArchiveLogger.Warning($"{nameof(RundownFlags)} enum is missaligned again!! >:I");
}

CurrentBuildInfo = new GameBuildInfo
{
BuildNumber = BuildDB.BuildNumber,
Expand Down
1 change: 1 addition & 0 deletions TheArchive.Core/Core/BuildDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static int BuildNumber
{ 31994, RundownID.RundownSeven },
{ 32283, RundownID.RundownAltOne },
{ 32416, RundownID.RundownAltTwo },
{ 32577, RundownID.RundownAltThree },
};

public static RundownID GetCurrentRundownID(int buildNumber)
Expand Down
4 changes: 4 additions & 0 deletions TheArchive.Core/Core/FeaturesAPI/Feature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ internal static void SetupIs()
Is.A2OrLater = BuildInfo.Rundown.IsIncludedIn(RundownFlags.RundownAltTwo.ToLatest());
Is.A3 = BuildInfo.Rundown.IsIncludedIn(RundownFlags.RundownAltThree);
Is.A3OrLater = BuildInfo.Rundown.IsIncludedIn(RundownFlags.RundownAltThree.ToLatest());
Is.A4 = BuildInfo.Rundown.IsIncludedIn(RundownFlags.RundownAltFour);
Is.A4OrLater = BuildInfo.Rundown.IsIncludedIn(RundownFlags.RundownAltFour.ToLatest());
}

/// <summary>
Expand Down Expand Up @@ -296,6 +298,8 @@ public static class Is
public static bool A2OrLater { get; internal set; }
public static bool A3 { get; internal set; }
public static bool A3OrLater { get; internal set; }
public static bool A4 { get; internal set; }
public static bool A4OrLater { get; internal set; }
}


Expand Down
11 changes: 7 additions & 4 deletions TheArchive.Core/Utilities/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public ValueAttribute(object value)
/// </summary>
public enum RundownID : int
{
Latest = RundownAltThree,
Latest = RundownAltFour,

RundownUnitialized = -1,
RundownUnknown,
Expand All @@ -364,11 +364,14 @@ public enum RundownID : int
RundownAltOne,
RundownAltTwo,
RundownAltThree,
RundownAltFour,
}

[Flags]
public enum RundownFlags : int
{
Latest = RundownAltFour,

None = 0,
RundownOne = 1 << 0,
RundownTwo = 1 << 1,
Expand All @@ -380,11 +383,11 @@ public enum RundownFlags : int
RundownAltOne = 1 << 7,
RundownAltTwo = 1 << 8,
RundownAltThree = 1 << 9,

RundownAltFour = 1 << 10,

All = RundownOne | RundownTwo | RundownThree | RundownFour | RundownFive | RundownSix | RundownSeven
| RundownAltOne | RundownAltTwo | RundownAltThree,
| RundownAltOne | RundownAltTwo | RundownAltThree | RundownAltFour,

Latest = RundownAltThree,
#warning TODO: Latest as external constant because alias behave weird with ToString() depending on the amount of enum entries
}

Expand Down

0 comments on commit d1fcbae

Please sign in to comment.