Skip to content

Commit

Permalink
Use ReactorCredits
Browse files Browse the repository at this point in the history
  • Loading branch information
js6pak committed Aug 22, 2024
1 parent e07ac49 commit a5b596f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 45 deletions.
5 changes: 3 additions & 2 deletions Submerged/Submerged.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>2024.8.11</Version>
<VersionPrefix>2024.8.11</VersionPrefix>
<VersionSuffix Condition="'$(Configuration)' == 'Debug'">dev</VersionSuffix>
<Authors>Submerged Team</Authors>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/SubmergedAmongUs/Submerged</RepositoryUrl>
Expand All @@ -19,7 +20,7 @@
<ItemGroup>
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2024.8.13" />
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.688" />
<PackageReference Include="Reactor" Version="2.2.1-ci.298" />
<PackageReference Include="Reactor" Version="2.3.1" />

<PackageReference Include="BepInEx.AutoPlugin" Version="1.1.0" PrivateAssets="all" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.1.0-rc.1" PrivateAssets="all" />
Expand Down
30 changes: 8 additions & 22 deletions Submerged/SubmergedPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System;
using BepInEx;
using BepInEx;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using System.Reflection;
using Reactor;
using Reactor.Localization;
using Reactor.Patches;
using Reactor.Utilities;
using Submerged.Debugging;
using Submerged.Enums;
using Submerged.Extensions;
using Submerged.IL2CPP;
using Submerged.Loading;
using Submerged.Localization;
Expand All @@ -20,20 +19,18 @@ namespace Submerged;
[BepInDependency(ReactorPlugin.Id)]
public sealed partial class SubmergedPlugin : BasePlugin
{
private static string _humanReadableVersion;

public SubmergedPlugin()
{
InteropPatches.Initialize();

Version version = Assembly.GetExecutingAssembly().GetName().Version!;
_humanReadableVersion = $"{version.Major}.{version.Minor}.{version.Build}";

if (IsDevBuild) _humanReadableVersion += "-dev";
}

public override void Load()
{
ReactorCredits.Register<SubmergedPlugin>(location =>
location == ReactorCredits.Location.MainMenu ||
ShipStatus.Instance.IsSubmerged() ||
(LobbyBehaviour.Instance && GameManager.Instance && GameManager.Instance.LogicOptions?.MapId == (byte) CustomMapTypes.Submerged));

Harmony.CreateAndPatchAll(GetType().Assembly, Id);

DebugMode.Initialize(this);
Expand All @@ -59,16 +56,5 @@ public override void Load()
CustomSystemTypes.Initialize();

LocalizationManager.Register(new SubmergedLocalizationProvider());

ReactorVersionShower.TextUpdated += text => text.text += $"\n{VersionText}";
}

private static bool IsDevBuild =>
#if DEBUG
true;
#else
false;
#endif

internal static string VersionText => $"{(IsDevBuild ? "<color=red>" : "")}Submerged v{_humanReadableVersion}{(IsDevBuild ? "</color>" : "")}";
}
21 changes: 0 additions & 21 deletions Submerged/UI/Patches/VersionShowerPatches.cs

This file was deleted.

0 comments on commit a5b596f

Please sign in to comment.