first commit

This commit is contained in:
Holly McFarland 2024-04-02 20:45:43 -04:00
commit a815d097f2
4 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>LevelStatsAlwaysOpen</AssemblyName>
<Description>My first plugin</Description>
<Version>1.0.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="UnityEngine.Modules" Version="2019.4.40" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>lib\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>lib\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>lib\UnityEngine.CoreModule.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

25
LevelStatsAlwaysOpen.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LevelStatsAlwaysOpen", "LevelStatsAlwaysOpen.csproj", "{421E7D0A-D413-4DA3-879C-DB3877A7D155}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{421E7D0A-D413-4DA3-879C-DB3877A7D155}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{421E7D0A-D413-4DA3-879C-DB3877A7D155}.Debug|Any CPU.Build.0 = Debug|Any CPU
{421E7D0A-D413-4DA3-879C-DB3877A7D155}.Release|Any CPU.ActiveCfg = Release|Any CPU
{421E7D0A-D413-4DA3-879C-DB3877A7D155}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94DE0ADB-C0FF-4087-9A5D-3839197939BB}
EndGlobalSection
EndGlobal

6
NuGet.Config Normal file
View File

@ -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>

37
Plugin.cs Normal file
View File

@ -0,0 +1,37 @@
using BepInEx;
using HarmonyLib;
using UnityEngine;
namespace LevelStatsAlwaysOpen
{
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
public class Plugin : BaseUnityPlugin
{
private void Awake()
{
// Plugin startup logic
Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded!");
Logger.LogInfo("Initializing HarmonyLib...");
Harmony harmony = new Harmony(PluginInfo.PLUGIN_GUID);
harmony.PatchAll();
}
}
[HarmonyPatch(typeof(LevelStatsEnabler), "Start")]
public class LevelStatsEnabler_Start_Patch()
{
public static void Postfix(GameObject ___levelStats)
{
___levelStats.SetActive(true);
}
}
[HarmonyPatch(typeof(LevelStatsEnabler), "Update")]
public class LevelStatsEnabler_Update_Patch()
{
public static bool Prefix()
{
return false;
}
}
}