Fix build issues: csproj references, Unity modules, Harmony calls
- Fixed csproj to reference all Unity modules (Core, Audio, IMG, Input, TextRendering, UI) - Fixed AudioMixerGUI namespace conflicts (GUI.Window vs UnityEngine.GUI.Window) - Fixed Harmony UnpatchAll -> UnpatchSelf - Removed duplicate AssemblyInfo.cs - Build now succeeds and DLL deployed to BepInEx/plugins
This commit is contained in:
@@ -9,7 +9,7 @@ param(
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$ProjectDir = Split-Path -Parent $PSScriptRoot
|
||||
$ProjectDir = $PSScriptRoot
|
||||
$ProjectFile = Join-Path $ProjectDir "HomuraHimeAudioMod.csproj"
|
||||
$DefaultOutput = Join-Path $ProjectDir "bin\$Configuration\net48"
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace HomuraHimeAudioMod.GUI
|
||||
{
|
||||
public class AudioMixerGUI : MonoBehaviour
|
||||
{
|
||||
private static AudioMixerGUI instance;
|
||||
public static AudioMixerGUI Instance => instance;
|
||||
|
||||
private bool isVisible = false;
|
||||
private Vector2 scrollPosition;
|
||||
private float margin = 10f;
|
||||
@@ -18,6 +16,7 @@ namespace HomuraHimeAudioMod.GUI
|
||||
private float lineHeight = 30f;
|
||||
private float windowWidth = 380f;
|
||||
private float windowHeight = 520f;
|
||||
private Rect windowRect = new Rect(10, 10, 380, 520);
|
||||
|
||||
private string[] enemyCueNames = new string[]
|
||||
{
|
||||
@@ -40,34 +39,20 @@ namespace HomuraHimeAudioMod.GUI
|
||||
"Player_Critical"
|
||||
};
|
||||
|
||||
private Rect windowRect
|
||||
private void Start()
|
||||
{
|
||||
get => new Rect(margin, margin, windowWidth, windowHeight);
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
Plugin.Log.LogInfo("AudioMixerGUI initialized");
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
Plugin.Log.LogInfo("AudioMixerGUI started");
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.F1))
|
||||
if (UnityEngine.Input.GetKeyDown(KeyCode.F1))
|
||||
{
|
||||
isVisible = !isVisible;
|
||||
Plugin.Log.LogDebug($"Audio Mixer GUI: {(isVisible ? "VISIBLE" : "HIDDEN")}");
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.F2))
|
||||
if (UnityEngine.Input.GetKeyDown(KeyCode.F2))
|
||||
{
|
||||
isVisible = false;
|
||||
}
|
||||
@@ -77,44 +62,15 @@ namespace HomuraHimeAudioMod.GUI
|
||||
{
|
||||
if (!isVisible) return;
|
||||
|
||||
GUI.skin = CreateCustomSkin();
|
||||
|
||||
windowRect.x = Mathf.Clamp(windowRect.x, 0, Screen.width - windowWidth - 10);
|
||||
windowRect.y = Mathf.Clamp(windowRect.y, 0, Screen.height - windowHeight - 10);
|
||||
|
||||
windowRect = GUI.Window(0, windowRect, DrawMainWindow, "HomuraHime Audio Mixer (F1: Toggle | F2: Close)");
|
||||
}
|
||||
|
||||
private GUISkin CreateCustomSkin()
|
||||
{
|
||||
GUISkin skin = GUI.skin;
|
||||
|
||||
GUIStyle headerStyle = new GUIStyle(GUI.skin.label)
|
||||
{
|
||||
fontSize = 14,
|
||||
fontStyle = FontStyle.Bold,
|
||||
alignment = TextAnchor.MiddleCenter
|
||||
};
|
||||
|
||||
GUIStyle sectionStyle = new GUIStyle(GUI.skin.label)
|
||||
{
|
||||
fontSize = 12,
|
||||
fontStyle = FontStyle.Bold,
|
||||
normal = { textColor = new Color(0.9f, 0.7f, 0.3f) }
|
||||
};
|
||||
|
||||
GUIStyle buttonStyle = new GUIStyle(GUI.skin.button)
|
||||
{
|
||||
fontSize = 11,
|
||||
fontStyle = FontStyle.Normal
|
||||
};
|
||||
|
||||
return skin;
|
||||
windowRect = UnityEngine.GUI.Window(0, windowRect, DrawMainWindow, "HomuraHime Audio Mixer (F1: Toggle | F2: Close)");
|
||||
}
|
||||
|
||||
private void DrawMainWindow(int windowID)
|
||||
{
|
||||
GUI.DragWindow(new Rect(0, 0, windowWidth - 20, 25));
|
||||
UnityEngine.GUI.DragWindow(new Rect(0, 0, windowWidth - 20, 25));
|
||||
|
||||
scrollPosition = GUILayout.BeginScrollView(scrollPosition);
|
||||
|
||||
|
||||
@@ -10,34 +10,53 @@
|
||||
<Product>HomuraHime Audio Mod</Product>
|
||||
<Description>Audio improvements mod for HomuraHime - fixes glitches and improves enemy indicators</Description>
|
||||
<Copyright>Copyright 2026</Copyright>
|
||||
<GamePath>C:\apps\steam\steamapps\common\Homura Hime\HomuraHime_Data\Managed</GamePath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="Exists('$(GamePath)')">
|
||||
<DefineConstants>GAME_PATH_EXISTS</DefineConstants>
|
||||
<GamePath>C:\apps\steam\steamapps\common\Homura Hime</GamePath>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="0Harmony" Version="2.2.2">
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="Exists('$(GamePath)')">
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>$(GamePath)\..\BepInEx\core\BepInEx.dll</HintPath>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>$(GamePath)\BepInEx\core\0Harmony.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="FMODUnity">
|
||||
<HintPath>$(GamePath)\FMODUnity.dll</HintPath>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>$(GamePath)\BepInEx\core\BepInEx.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>$(GamePath)\HomuraHime_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>$(GamePath)\HomuraHime_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.AudioModule">
|
||||
<HintPath>$(GamePath)\UnityEngine.AudioModule.dll</HintPath>
|
||||
<HintPath>$(GamePath)\HomuraHime_Data\Managed\UnityEngine.AudioModule.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.IMGUIModule">
|
||||
<HintPath>$(GamePath)\HomuraHime_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.InputLegacyModule">
|
||||
<HintPath>$(GamePath)\HomuraHime_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TextRenderingModule">
|
||||
<HintPath>$(GamePath)\HomuraHime_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UI">
|
||||
<HintPath>$(GamePath)\HomuraHime_Data\Managed\UnityEngine.UI.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="FMODUnity">
|
||||
<HintPath>$(GamePath)\HomuraHime_Data\Managed\FMODUnity.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>$(GamePath)\Assembly-CSharp.dll</HintPath>
|
||||
<HintPath>$(GamePath)\HomuraHime_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -5,13 +5,9 @@ using UnityEngine;
|
||||
|
||||
namespace HomuraHimeAudioMod
|
||||
{
|
||||
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
||||
[BepInPlugin("com.homurahime.audiomod", "HomuraHime Audio Mod", "1.0.0")]
|
||||
public class Plugin : BaseUnityPlugin
|
||||
{
|
||||
public const string PLUGIN_GUID = "com.homurahime.audiomod";
|
||||
public const string PLUGIN_NAME = "HomuraHime Audio Mod";
|
||||
public const string PLUGIN_VERSION = "1.0.0";
|
||||
|
||||
private static Plugin instance;
|
||||
private static ManualLogSource logger;
|
||||
private Harmony harmony;
|
||||
@@ -25,13 +21,13 @@ namespace HomuraHimeAudioMod
|
||||
|
||||
ModConfig.Initialize(Config);
|
||||
|
||||
Log.LogInfo($"HomuraHime Audio Mod v{PluginInfo.PLUGIN_VERSION} initializing...");
|
||||
Log.LogInfo("HomuraHime Audio Mod v1.0.0 initializing...");
|
||||
Log.LogInfo($"Voice Limit Fix: {(ModConfig.EnableVoiceLimitFix.Value ? "ENABLED" : "DISABLED")}");
|
||||
Log.LogInfo($"Ducking Fix: {(ModConfig.EnableDuckingFix.Value ? "ENABLED" : "DISABLED")}");
|
||||
Log.LogInfo($"Enemy Audio Boost: {(ModConfig.EnableEnemyAudioBoost.Value ? "ENABLED" : "DISABLED")}");
|
||||
Log.LogInfo($"Max Voices: {ModConfig.MaxVoiceCount.Value}");
|
||||
|
||||
harmony = new Harmony(PluginInfo.PLUGIN_GUID);
|
||||
harmony = new Harmony("com.homurahime.audiomod");
|
||||
|
||||
ApplyPatches();
|
||||
|
||||
@@ -46,19 +42,19 @@ namespace HomuraHimeAudioMod
|
||||
if (ModConfig.EnableVoiceLimitFix.Value || ModConfig.EnableDuckingFix.Value)
|
||||
{
|
||||
Log.LogInfo("Applying VoiceManager patches...");
|
||||
VoiceManagerPatch.Apply(ref harmony);
|
||||
Patches.VoiceManagerPatch.Apply(ref harmony);
|
||||
}
|
||||
|
||||
if (ModConfig.EnableDuckingFix.Value)
|
||||
{
|
||||
Log.LogInfo("Applying AudioDucking patches...");
|
||||
AudioDuckingPatch.Apply(ref harmony);
|
||||
Patches.AudioDuckingPatch.Apply(ref harmony);
|
||||
}
|
||||
|
||||
if (ModConfig.EnableEnemyAudioBoost.Value)
|
||||
{
|
||||
Log.LogInfo("Applying EnemyAudio patches...");
|
||||
EnemyAudioPatch.Apply(ref harmony);
|
||||
Patches.EnemyAudioPatch.Apply(ref harmony);
|
||||
}
|
||||
|
||||
Log.LogInfo("All patches applied successfully");
|
||||
@@ -78,7 +74,7 @@ namespace HomuraHimeAudioMod
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
harmony?.UnpatchAll(PluginInfo.PLUGIN_GUID);
|
||||
harmony?.UnpatchSelf();
|
||||
Log.LogInfo("HomuraHime Audio Mod unloaded");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("HomuraHimeAudioMod")]
|
||||
[assembly: AssemblyDescription("Audio improvements mod for HomuraHime")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("HomuraHimeAudioMod")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2026")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Reference in New Issue
Block a user