Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBF: Automatically pull Version and AssemblyName into Main.cs #339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.vscode/tasks.json
TODO
.DS_Store
obj/
6 changes: 6 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="BepInEx" value="https://nuget.bepinex.dev/v3/index.json" />
</packageSources>
</configuration>
7 changes: 3 additions & 4 deletions TheOtherRoles/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@

namespace TheOtherRoles
{
[BepInPlugin(Id, "The Other Roles", VersionString)]
[BepInPlugin(Id, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInProcess("Among Us.exe")]
public class TheOtherRolesPlugin : BasePlugin
{
public const string Id = "me.eisbison.theotherroles";
public const string VersionString = "4.0.0";

public static System.Version Version = System.Version.Parse(VersionString);
public static string VersionString = PluginInfo.PLUGIN_VERSION;
public static System.Version Version = System.Version.Parse(PluginInfo.PLUGIN_VERSION);
internal static BepInEx.Logging.ManualLogSource Logger;

public Harmony Harmony { get; } = new Harmony(Id);
Expand Down
7 changes: 6 additions & 1 deletion TheOtherRoles/TheOtherRoles.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>TheOtherRoles</AssemblyName>
<Version>4.0.0</Version>
<Description>TheOtherRoles</Description>
<Authors>Eisbison</Authors>
Expand All @@ -24,6 +25,10 @@
<Reference Include="$(AmongUs)/BepInEx/unhollowed/*.dll" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Blood1.png" />
<None Remove="Resources\Blood2.png" />
Expand All @@ -32,6 +37,6 @@

<Target Name="CopyCustomContent" AfterTargets="AfterBuild">
<Message Text="Second occurrence" />
<Copy SourceFiles="$(ProjectDir)\bin\$(Configuration)\netstandard2.1\TheOtherRoles.dll" DestinationFolder="$(AmongUsLatest)/BepInEx/plugins/" />
<Copy SourceFiles="$(ProjectDir)\bin\$(Configuration)\netstandard2.1\$(AssemblyName).dll" DestinationFolder="$(AmongUsLatest)/BepInEx/plugins/" />
</Target>
</Project>