Strip failing patches - rely on UnityExplorer for audio method discovery
Removed all Harmony patches that were failing due to incorrect method names. Mod now loads without errors. GUI shows config sliders but no actual patches are applied. Use UnityExplorer (F5) to find actual audio methods, then create patches via Hook Manager.
This commit is contained in:
@@ -1 +1 @@
|
|||||||
610036
|
592616
|
||||||
1
.beads/dolt-server.activity
Normal file
1
.beads/dolt-server.activity
Normal file
@@ -0,0 +1 @@
|
|||||||
|
1774203036
|
||||||
1
.beads/dolt-server.port
Normal file
1
.beads/dolt-server.port
Normal file
@@ -0,0 +1 @@
|
|||||||
|
14107
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
|
||||||
@@ -9,98 +8,29 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
public class AudioMixerGUI : MonoBehaviour
|
public class AudioMixerGUI : MonoBehaviour
|
||||||
{
|
{
|
||||||
private bool isVisible = false;
|
private bool isVisible = false;
|
||||||
private bool showConsole = true;
|
|
||||||
private Vector2 scrollPosition;
|
private Vector2 scrollPosition;
|
||||||
private Vector2 consoleScrollPosition;
|
|
||||||
private float margin = 10f;
|
private float margin = 10f;
|
||||||
private float labelWidth = 140f;
|
private float labelWidth = 140f;
|
||||||
private float sliderWidth = 200f;
|
private float sliderWidth = 200f;
|
||||||
private float buttonHeight = 25f;
|
private float buttonHeight = 25f;
|
||||||
private float lineHeight = 30f;
|
private float lineHeight = 30f;
|
||||||
private float windowWidth = 450f;
|
private float windowWidth = 380f;
|
||||||
private float windowHeight = 580f;
|
private float windowHeight = 450f;
|
||||||
private Rect windowRect = new Rect(10, 10, 450, 580);
|
private Rect windowRect = new Rect(10, 10, 380, 450);
|
||||||
|
|
||||||
private const int MAX_CONSOLE_LINES = 100;
|
|
||||||
private List<string> consoleLines = new List<string>();
|
|
||||||
private string lastEventContext = "";
|
|
||||||
|
|
||||||
private string[] enemyCueNames = new string[]
|
|
||||||
{
|
|
||||||
"Enemy_Idle",
|
|
||||||
"Enemy_Alert",
|
|
||||||
"Enemy_Attack",
|
|
||||||
"Enemy_Chase",
|
|
||||||
"Enemy_Death",
|
|
||||||
"Enemy_Damage_Taken",
|
|
||||||
"Enemy_Special"
|
|
||||||
};
|
|
||||||
|
|
||||||
private string[] battleCueNames = new string[]
|
|
||||||
{
|
|
||||||
"Battle_Start",
|
|
||||||
"Battle_Victory",
|
|
||||||
"Player_Attack",
|
|
||||||
"Player_Dodge",
|
|
||||||
"Player_Block",
|
|
||||||
"Player_Critical"
|
|
||||||
};
|
|
||||||
|
|
||||||
private Type cachedVoiceManagerType;
|
|
||||||
private Type cachedCFVoiceType;
|
|
||||||
private bool typesCached = false;
|
|
||||||
private int cachedVoiceCount = -1;
|
|
||||||
private float lastVoiceCountUpdate = 0f;
|
|
||||||
private const float VOICE_COUNT_UPDATE_INTERVAL = 0.5f;
|
|
||||||
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
AddConsoleLine("AudioMixerGUI started");
|
|
||||||
AddConsoleLine("Press F1 to toggle GUI");
|
|
||||||
AddConsoleLine("Press F2 to close");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnDestroy()
|
|
||||||
{
|
|
||||||
RestoreCursorState();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (!isVisible)
|
|
||||||
{
|
|
||||||
if (Cursor.lockState != CursorLockMode.Locked)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (UnityEngine.Input.GetKeyDown(KeyCode.F1))
|
if (UnityEngine.Input.GetKeyDown(KeyCode.F1))
|
||||||
{
|
{
|
||||||
isVisible = !isVisible;
|
isVisible = !isVisible;
|
||||||
UpdateCursorState();
|
UpdateCursorState();
|
||||||
AddConsoleLine(isVisible ? "GUI Opened" : "GUI Closed");
|
Plugin.Log.LogDebug($"Audio Mixer GUI: {(isVisible ? "VISIBLE" : "HIDDEN")}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UnityEngine.Input.GetKeyDown(KeyCode.F2) && isVisible)
|
if (UnityEngine.Input.GetKeyDown(KeyCode.F2) && isVisible)
|
||||||
{
|
{
|
||||||
isVisible = false;
|
isVisible = false;
|
||||||
UpdateCursorState();
|
UpdateCursorState();
|
||||||
AddConsoleLine("GUI Closed");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Time.time - lastVoiceCountUpdate >= VOICE_COUNT_UPDATE_INTERVAL)
|
|
||||||
{
|
|
||||||
int newCount = GetCurrentVoiceCount();
|
|
||||||
if (newCount != cachedVoiceCount)
|
|
||||||
{
|
|
||||||
cachedVoiceCount = newCount;
|
|
||||||
if (cachedVoiceCount >= 0)
|
|
||||||
{
|
|
||||||
AddConsoleLine($"Voice Count: {cachedVoiceCount}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastVoiceCountUpdate = Time.time;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,39 +42,10 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
Cursor.visible = true;
|
Cursor.visible = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
RestoreCursorState();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RestoreCursorState()
|
|
||||||
{
|
{
|
||||||
Cursor.lockState = CursorLockMode.Locked;
|
Cursor.lockState = CursorLockMode.Locked;
|
||||||
Cursor.visible = false;
|
Cursor.visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddConsoleLine(string line)
|
|
||||||
{
|
|
||||||
if (!showConsole) return;
|
|
||||||
|
|
||||||
string timestamp = Time.time.ToString("F2");
|
|
||||||
consoleLines.Add($"[{timestamp}] {line}");
|
|
||||||
|
|
||||||
while (consoleLines.Count > MAX_CONSOLE_LINES)
|
|
||||||
{
|
|
||||||
consoleLines.RemoveAt(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CacheTypes()
|
|
||||||
{
|
|
||||||
if (typesCached) return;
|
|
||||||
|
|
||||||
cachedVoiceManagerType = FindTypeByName("FmodVoiceManager");
|
|
||||||
cachedCFVoiceType = FindTypeByName("CFVoiceEventUtility");
|
|
||||||
|
|
||||||
typesCached = true;
|
|
||||||
AddConsoleLine($"Types cached: VoiceManager={cachedVoiceManagerType?.Name}, CFVoice={cachedCFVoiceType?.Name}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGUI()
|
private void OnGUI()
|
||||||
@@ -161,116 +62,41 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
{
|
{
|
||||||
UnityEngine.GUI.DragWindow(new Rect(0, 0, windowWidth - 20, 25));
|
UnityEngine.GUI.DragWindow(new Rect(0, 0, windowWidth - 20, 25));
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
showConsole = GUILayout.Toggle(showConsole, "Show Console", GUILayout.Width(100));
|
|
||||||
GUILayout.FlexibleSpace();
|
|
||||||
if (GUILayout.Button("Clear Log", GUILayout.Width(70)))
|
|
||||||
{
|
|
||||||
consoleLines.Clear();
|
|
||||||
AddConsoleLine("Log cleared");
|
|
||||||
}
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
scrollPosition = GUILayout.BeginScrollView(scrollPosition);
|
scrollPosition = GUILayout.BeginScrollView(scrollPosition);
|
||||||
|
|
||||||
|
GUILayout.Space(margin);
|
||||||
|
|
||||||
DrawHeader();
|
DrawHeader();
|
||||||
GUILayout.Space(margin);
|
GUILayout.Space(margin);
|
||||||
|
|
||||||
DrawVoiceControls();
|
DrawConfigSliders();
|
||||||
GUILayout.Space(10);
|
GUILayout.Space(10);
|
||||||
|
|
||||||
DrawDuckingControls();
|
DrawInstructions();
|
||||||
GUILayout.Space(10);
|
GUILayout.Space(10);
|
||||||
|
|
||||||
DrawEnemyAudioControls();
|
DrawDebugButtons();
|
||||||
GUILayout.Space(10);
|
|
||||||
|
|
||||||
DrawEnemyCueTestButtons();
|
|
||||||
GUILayout.Space(10);
|
|
||||||
|
|
||||||
DrawBattleCueTestButtons();
|
|
||||||
GUILayout.Space(10);
|
|
||||||
|
|
||||||
DrawDebugControls();
|
|
||||||
GUILayout.Space(margin);
|
GUILayout.Space(margin);
|
||||||
|
|
||||||
GUILayout.EndScrollView();
|
GUILayout.EndScrollView();
|
||||||
|
|
||||||
if (showConsole)
|
|
||||||
{
|
|
||||||
DrawConsole();
|
|
||||||
}
|
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
GUILayout.Label($"v1.0.0 | F1: Toggle | F2: Close", GUILayout.Height(20));
|
GUILayout.Label($"v1.0.0 | F1: Toggle | F2: Close", GUILayout.Height(20));
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawConsole()
|
|
||||||
{
|
|
||||||
GUILayout.Box("CONSOLE LOG", GUILayout.Height(20));
|
|
||||||
|
|
||||||
consoleScrollPosition = GUILayout.BeginScrollView(consoleScrollPosition, GUILayout.Height(120));
|
|
||||||
|
|
||||||
GUIStyle logStyle = new GUIStyle(UnityEngine.GUI.skin.label)
|
|
||||||
{
|
|
||||||
fontSize = 10,
|
|
||||||
richText = true
|
|
||||||
};
|
|
||||||
|
|
||||||
Color normalColor = logStyle.normal.textColor;
|
|
||||||
Color warningColor = new Color(1f, 0.7f, 0.3f);
|
|
||||||
Color errorColor = new Color(1f, 0.4f, 0.4f);
|
|
||||||
Color infoColor = new Color(0.7f, 0.9f, 1f);
|
|
||||||
|
|
||||||
for (int i = 0; i < consoleLines.Count; i++)
|
|
||||||
{
|
|
||||||
string line = consoleLines[i];
|
|
||||||
GUIStyle lineStyle = new GUIStyle(logStyle);
|
|
||||||
|
|
||||||
if (line.Contains("[ERROR]") || line.Contains("Error"))
|
|
||||||
{
|
|
||||||
lineStyle.normal.textColor = errorColor;
|
|
||||||
}
|
|
||||||
else if (line.Contains("[WARN]") || line.Contains("Warning"))
|
|
||||||
{
|
|
||||||
lineStyle.normal.textColor = warningColor;
|
|
||||||
}
|
|
||||||
else if (line.Contains("[GUI]") || line.Contains("Triggered") || line.Contains("Testing"))
|
|
||||||
{
|
|
||||||
lineStyle.normal.textColor = infoColor;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lineStyle.normal.textColor = normalColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
GUILayout.Label(line, lineStyle);
|
|
||||||
}
|
|
||||||
|
|
||||||
GUILayout.EndScrollView();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawHeader()
|
private void DrawHeader()
|
||||||
{
|
{
|
||||||
GUILayout.BeginVertical("box");
|
GUILayout.BeginVertical("box");
|
||||||
GUILayout.Label("=== HOMURAHIME AUDIO MIXER ===", GUILayout.Height(25));
|
GUILayout.Label("=== HOMURAHIME AUDIO MIXER ===", GUILayout.Height(25));
|
||||||
|
GUILayout.Label("Configure audio parameters below", GUILayout.Height(20));
|
||||||
int voiceCount = GetCurrentVoiceCount();
|
|
||||||
string voiceStatus = voiceCount >= 0 ? $"{voiceCount}" : "N/A";
|
|
||||||
string voiceWarning = voiceCount >= ModConfig.MaxVoiceCount.Value * 0.9f ? " (HIGH!)" : "";
|
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
GUILayout.Label($"Voice Count: {voiceStatus} / {ModConfig.MaxVoiceCount.Value}{voiceWarning}", GUILayout.Height(20));
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
GUILayout.EndVertical();
|
GUILayout.EndVertical();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawVoiceControls()
|
private void DrawConfigSliders()
|
||||||
{
|
{
|
||||||
GUILayout.BeginVertical("box");
|
GUILayout.BeginVertical("box");
|
||||||
GUILayout.Label("VOICE MANAGER", GUILayout.Height(20));
|
GUILayout.Label("CONFIGURATION", GUILayout.Height(20));
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
GUILayout.Label("Max Voices:", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
GUILayout.Label("Max Voices:", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
||||||
@@ -280,20 +106,6 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
GUILayout.Label($"{ModConfig.MaxVoiceCount.Value}", GUILayout.Width(40));
|
GUILayout.Label($"{ModConfig.MaxVoiceCount.Value}", GUILayout.Width(40));
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
GUILayout.Label($"Voice Limit Fix: ", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
|
||||||
ModConfig.EnableVoiceLimitFix.Value = GUILayout.Toggle(
|
|
||||||
ModConfig.EnableVoiceLimitFix.Value, "Enabled");
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawDuckingControls()
|
|
||||||
{
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
GUILayout.Label("AUDIO DUCKING", GUILayout.Height(20));
|
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
GUILayout.Label("Duck Fade Time:", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
GUILayout.Label("Duck Fade Time:", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
||||||
ModConfig.DuckFadeTime.Value = GUILayout.HorizontalSlider(
|
ModConfig.DuckFadeTime.Value = GUILayout.HorizontalSlider(
|
||||||
@@ -310,20 +122,6 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
GUILayout.Label($"{ModConfig.DuckVolume.Value:F2}", GUILayout.Width(50));
|
GUILayout.Label($"{ModConfig.DuckVolume.Value:F2}", GUILayout.Width(50));
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
GUILayout.Label($"Ducking Fix: ", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
|
||||||
ModConfig.EnableDuckingFix.Value = GUILayout.Toggle(
|
|
||||||
ModConfig.EnableDuckingFix.Value, "Enabled");
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawEnemyAudioControls()
|
|
||||||
{
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
GUILayout.Label("ENEMY AUDIO INDICATORS", GUILayout.Height(20));
|
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
GUILayout.Label("Indicator Boost:", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
GUILayout.Label("Indicator Boost:", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
||||||
ModConfig.EnemyIndicatorBoost.Value = GUILayout.HorizontalSlider(
|
ModConfig.EnemyIndicatorBoost.Value = GUILayout.HorizontalSlider(
|
||||||
@@ -348,8 +146,37 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
GUILayout.Label($"{ModConfig.AttackSoundBoost.Value:F2}x", GUILayout.Width(50));
|
GUILayout.Label($"{ModConfig.AttackSoundBoost.Value:F2}x", GUILayout.Width(50));
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
GUILayout.EndVertical();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DrawInstructions()
|
||||||
|
{
|
||||||
|
GUILayout.BeginVertical("box");
|
||||||
|
GUILayout.Label("SETUP INSTRUCTIONS", GUILayout.Height(20));
|
||||||
|
|
||||||
|
GUILayout.Label("1. Press F5 to open UnityExplorer", GUILayout.Height(18));
|
||||||
|
GUILayout.Label("2. Go to Object Search tab", GUILayout.Height(18));
|
||||||
|
GUILayout.Label("3. Search for audio manager types:", GUILayout.Height(18));
|
||||||
|
GUILayout.Label(" - FmodVoiceManager", GUILayout.Height(18));
|
||||||
|
GUILayout.Label(" - CFVoiceEventUtility", GUILayout.Height(18));
|
||||||
|
GUILayout.Label(" - SnapshotManager", GUILayout.Height(18));
|
||||||
|
GUILayout.Label("4. Use Hook Manager for runtime patches", GUILayout.Height(18));
|
||||||
|
GUILayout.Label("5. Current patches: NOT LOADED", GUILayout.Height(18));
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
GUILayout.Label($"Enemy Audio: ", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
GUILayout.Label($"VoiceLimitFix: ", GUILayout.Width(100), GUILayout.Height(18));
|
||||||
|
ModConfig.EnableVoiceLimitFix.Value = GUILayout.Toggle(
|
||||||
|
ModConfig.EnableVoiceLimitFix.Value, "Enabled");
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Label($"DuckingFix: ", GUILayout.Width(100), GUILayout.Height(18));
|
||||||
|
ModConfig.EnableDuckingFix.Value = GUILayout.Toggle(
|
||||||
|
ModConfig.EnableDuckingFix.Value, "Enabled");
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Label($"EnemyAudio: ", GUILayout.Width(100), GUILayout.Height(18));
|
||||||
ModConfig.EnableEnemyAudioBoost.Value = GUILayout.Toggle(
|
ModConfig.EnableEnemyAudioBoost.Value = GUILayout.Toggle(
|
||||||
ModConfig.EnableEnemyAudioBoost.Value, "Enabled");
|
ModConfig.EnableEnemyAudioBoost.Value, "Enabled");
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
@@ -357,58 +184,10 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
GUILayout.EndVertical();
|
GUILayout.EndVertical();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawEnemyCueTestButtons()
|
private void DrawDebugButtons()
|
||||||
{
|
{
|
||||||
GUILayout.BeginVertical("box");
|
GUILayout.BeginVertical("box");
|
||||||
GUILayout.Label("TEST ENEMY CUES", GUILayout.Height(20));
|
GUILayout.Label("DEBUG", GUILayout.Height(20));
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
for (int i = 0; i < enemyCueNames.Length; i++)
|
|
||||||
{
|
|
||||||
string cueName = enemyCueNames[i];
|
|
||||||
if (GUILayout.Button(cueName, GUILayout.Height(buttonHeight)))
|
|
||||||
{
|
|
||||||
TestEnemyCue(cueName);
|
|
||||||
}
|
|
||||||
if ((i + 1) % 2 == 0) GUILayout.EndHorizontal();
|
|
||||||
if ((i + 1) % 2 != 0 && i < enemyCueNames.Length - 1) GUILayout.BeginHorizontal();
|
|
||||||
}
|
|
||||||
if (enemyCueNames.Length % 2 != 0) GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawBattleCueTestButtons()
|
|
||||||
{
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
GUILayout.Label("TEST BATTLE CUES", GUILayout.Height(20));
|
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
for (int i = 0; i < battleCueNames.Length; i++)
|
|
||||||
{
|
|
||||||
string cueName = battleCueNames[i];
|
|
||||||
if (GUILayout.Button(cueName, GUILayout.Height(buttonHeight)))
|
|
||||||
{
|
|
||||||
TestBattleCue(cueName);
|
|
||||||
}
|
|
||||||
if ((i + 1) % 2 == 0) GUILayout.EndHorizontal();
|
|
||||||
if ((i + 1) % 2 != 0 && i < battleCueNames.Length - 1) GUILayout.BeginHorizontal();
|
|
||||||
}
|
|
||||||
if (battleCueNames.Length % 2 != 0) GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
GUILayout.EndVertical();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawDebugControls()
|
|
||||||
{
|
|
||||||
GUILayout.BeginVertical("box");
|
|
||||||
GUILayout.Label("DEBUG OPTIONS", GUILayout.Height(20));
|
|
||||||
|
|
||||||
GUILayout.BeginHorizontal();
|
|
||||||
GUILayout.Label($"Debug Logging: ", GUILayout.Width(labelWidth), GUILayout.Height(lineHeight));
|
|
||||||
ModConfig.EnableDebugLogging.Value = GUILayout.Toggle(
|
|
||||||
ModConfig.EnableDebugLogging.Value, "Enabled");
|
|
||||||
GUILayout.EndHorizontal();
|
|
||||||
|
|
||||||
if (GUILayout.Button("Log Current Config", GUILayout.Height(buttonHeight)))
|
if (GUILayout.Button("Log Current Config", GUILayout.Height(buttonHeight)))
|
||||||
{
|
{
|
||||||
@@ -423,132 +202,8 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
GUILayout.EndVertical();
|
GUILayout.EndVertical();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int GetCurrentVoiceCount()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!typesCached) CacheTypes();
|
|
||||||
|
|
||||||
if (cachedVoiceManagerType != null)
|
|
||||||
{
|
|
||||||
var instance = AccessTools.Property(cachedVoiceManagerType, "Instance")?.GetValue(null);
|
|
||||||
if (instance != null)
|
|
||||||
{
|
|
||||||
var countProp = AccessTools.Property(cachedVoiceManagerType, "CountVoice");
|
|
||||||
if (countProp != null)
|
|
||||||
{
|
|
||||||
return (int)countProp.GetValue(instance);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Type FindTypeByName(string name)
|
|
||||||
{
|
|
||||||
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
foreach (var type in assembly.GetTypes())
|
|
||||||
{
|
|
||||||
if (type.Name.Contains(name))
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TestEnemyCue(string cueName)
|
|
||||||
{
|
|
||||||
AddConsoleLine($"[GUI] Testing enemy cue: {cueName}");
|
|
||||||
Plugin.Log.LogDebug($"[GUI] Testing enemy cue: {cueName}");
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!typesCached) CacheTypes();
|
|
||||||
|
|
||||||
if (cachedCFVoiceType != null)
|
|
||||||
{
|
|
||||||
var playMethod = AccessTools.Method(cachedCFVoiceType, "PlayCFVoice");
|
|
||||||
if (playMethod != null)
|
|
||||||
{
|
|
||||||
playMethod.Invoke(null, new object[] { cueName });
|
|
||||||
AddConsoleLine($"[GUI] Triggered: {cueName}");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AddConsoleLine($"[GUI] Method not found: PlayCFVoice");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AddConsoleLine($"[GUI] CFVoiceEventUtility not found");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
AddConsoleLine($"[GUI] Error: {ex.Message}");
|
|
||||||
Plugin.Log.LogWarning($"[GUI] Could not trigger enemy cue: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TestBattleCue(string cueName)
|
|
||||||
{
|
|
||||||
AddConsoleLine($"[GUI] Testing battle cue: {cueName}");
|
|
||||||
Plugin.Log.LogDebug($"[GUI] Testing battle cue: {cueName}");
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (!typesCached) CacheTypes();
|
|
||||||
|
|
||||||
if (cachedCFVoiceType != null)
|
|
||||||
{
|
|
||||||
var playMethod = AccessTools.Method(cachedCFVoiceType, "PlayCFVoice");
|
|
||||||
if (playMethod != null)
|
|
||||||
{
|
|
||||||
playMethod.Invoke(null, new object[] { cueName });
|
|
||||||
AddConsoleLine($"[GUI] Triggered: {cueName}");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AddConsoleLine($"[GUI] Method not found: PlayCFVoice");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AddConsoleLine($"[GUI] CFVoiceEventUtility not found");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
AddConsoleLine($"[GUI] Error: {ex.Message}");
|
|
||||||
Plugin.Log.LogWarning($"[GUI] Could not trigger battle cue: {ex.Message}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LogCurrentConfig()
|
private void LogCurrentConfig()
|
||||||
{
|
{
|
||||||
AddConsoleLine("=== CONFIG DUMP ===");
|
|
||||||
AddConsoleLine($"MaxVoiceCount: {ModConfig.MaxVoiceCount.Value}");
|
|
||||||
AddConsoleLine($"DuckFadeTime: {ModConfig.DuckFadeTime.Value}");
|
|
||||||
AddConsoleLine($"DuckVolume: {ModConfig.DuckVolume.Value}");
|
|
||||||
AddConsoleLine($"EnemyIndicatorBoost: {ModConfig.EnemyIndicatorBoost.Value}");
|
|
||||||
AddConsoleLine($"AlertSoundBoost: {ModConfig.AlertSoundBoost.Value}");
|
|
||||||
AddConsoleLine($"AttackSoundBoost: {ModConfig.AttackSoundBoost.Value}");
|
|
||||||
AddConsoleLine($"VoiceLimitFix: {ModConfig.EnableVoiceLimitFix.Value}");
|
|
||||||
AddConsoleLine($"DuckingFix: {ModConfig.EnableDuckingFix.Value}");
|
|
||||||
AddConsoleLine($"EnemyAudioBoost: {ModConfig.EnableEnemyAudioBoost.Value}");
|
|
||||||
AddConsoleLine($"DebugLogging: {ModConfig.EnableDebugLogging.Value}");
|
|
||||||
AddConsoleLine("===================");
|
|
||||||
|
|
||||||
Plugin.Log.LogInfo("=== CURRENT AUDIO MOD CONFIG ===");
|
Plugin.Log.LogInfo("=== CURRENT AUDIO MOD CONFIG ===");
|
||||||
Plugin.Log.LogInfo($"MaxVoiceCount: {ModConfig.MaxVoiceCount.Value}");
|
Plugin.Log.LogInfo($"MaxVoiceCount: {ModConfig.MaxVoiceCount.Value}");
|
||||||
Plugin.Log.LogInfo($"DuckFadeTime: {ModConfig.DuckFadeTime.Value}");
|
Plugin.Log.LogInfo($"DuckFadeTime: {ModConfig.DuckFadeTime.Value}");
|
||||||
@@ -556,10 +211,6 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
Plugin.Log.LogInfo($"EnemyIndicatorBoost: {ModConfig.EnemyIndicatorBoost.Value}");
|
Plugin.Log.LogInfo($"EnemyIndicatorBoost: {ModConfig.EnemyIndicatorBoost.Value}");
|
||||||
Plugin.Log.LogInfo($"AlertSoundBoost: {ModConfig.AlertSoundBoost.Value}");
|
Plugin.Log.LogInfo($"AlertSoundBoost: {ModConfig.AlertSoundBoost.Value}");
|
||||||
Plugin.Log.LogInfo($"AttackSoundBoost: {ModConfig.AttackSoundBoost.Value}");
|
Plugin.Log.LogInfo($"AttackSoundBoost: {ModConfig.AttackSoundBoost.Value}");
|
||||||
Plugin.Log.LogInfo($"EnableVoiceLimitFix: {ModConfig.EnableVoiceLimitFix.Value}");
|
|
||||||
Plugin.Log.LogInfo($"EnableDuckingFix: {ModConfig.EnableDuckingFix.Value}");
|
|
||||||
Plugin.Log.LogInfo($"EnableEnemyAudioBoost: {ModConfig.EnableEnemyAudioBoost.Value}");
|
|
||||||
Plugin.Log.LogInfo($"EnableDebugLogging: {ModConfig.EnableDebugLogging.Value}");
|
|
||||||
Plugin.Log.LogInfo("===============================");
|
Plugin.Log.LogInfo("===============================");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,12 +222,6 @@ namespace HomuraHimeAudioMod.GUI
|
|||||||
ModConfig.EnemyIndicatorBoost.Value = 1.2f;
|
ModConfig.EnemyIndicatorBoost.Value = 1.2f;
|
||||||
ModConfig.AlertSoundBoost.Value = 1.3f;
|
ModConfig.AlertSoundBoost.Value = 1.3f;
|
||||||
ModConfig.AttackSoundBoost.Value = 1.15f;
|
ModConfig.AttackSoundBoost.Value = 1.15f;
|
||||||
ModConfig.EnableVoiceLimitFix.Value = true;
|
|
||||||
ModConfig.EnableDuckingFix.Value = true;
|
|
||||||
ModConfig.EnableEnemyAudioBoost.Value = true;
|
|
||||||
ModConfig.EnableDebugLogging.Value = false;
|
|
||||||
|
|
||||||
AddConsoleLine("[GUI] Config reset to defaults");
|
|
||||||
Plugin.Log.LogInfo("[GUI] Config reset to defaults");
|
Plugin.Log.LogInfo("[GUI] Config reset to defaults");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,35 +29,13 @@ namespace HomuraHimeAudioMod
|
|||||||
|
|
||||||
harmony = new Harmony("com.homurahime.audiomod");
|
harmony = new Harmony("com.homurahime.audiomod");
|
||||||
|
|
||||||
ApplyPatches();
|
Log.LogInfo("No patches applied - use UnityExplorer (F5) to explore audio system");
|
||||||
|
Log.LogInfo("Then use Hook Manager to create runtime patches");
|
||||||
|
|
||||||
InitializeGUI();
|
InitializeGUI();
|
||||||
|
|
||||||
Log.LogInfo("HomuraHime Audio Mod initialized successfully");
|
Log.LogInfo("HomuraHime Audio Mod initialized");
|
||||||
Log.LogInfo("Press F1 to open Audio Mixer GUI");
|
Log.LogInfo("Press F1 for Audio Mixer GUI (basic controls only)");
|
||||||
}
|
|
||||||
|
|
||||||
private void ApplyPatches()
|
|
||||||
{
|
|
||||||
if (ModConfig.EnableVoiceLimitFix.Value || ModConfig.EnableDuckingFix.Value)
|
|
||||||
{
|
|
||||||
Log.LogInfo("Applying VoiceManager patches...");
|
|
||||||
Patches.VoiceManagerPatch.Apply(ref harmony);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ModConfig.EnableDuckingFix.Value)
|
|
||||||
{
|
|
||||||
Log.LogInfo("Applying AudioDucking patches...");
|
|
||||||
Patches.AudioDuckingPatch.Apply(ref harmony);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ModConfig.EnableEnemyAudioBoost.Value)
|
|
||||||
{
|
|
||||||
Log.LogInfo("Applying EnemyAudio patches...");
|
|
||||||
Patches.EnemyAudioPatch.Apply(ref harmony);
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.LogInfo("All patches applied successfully");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeGUI()
|
private void InitializeGUI()
|
||||||
@@ -65,11 +43,6 @@ namespace HomuraHimeAudioMod
|
|||||||
GameObject guiObject = new GameObject("HomuraHimeAudioMixer");
|
GameObject guiObject = new GameObject("HomuraHimeAudioMixer");
|
||||||
guiObject.AddComponent<GUI.AudioMixerGUI>();
|
guiObject.AddComponent<GUI.AudioMixerGUI>();
|
||||||
DontDestroyOnLoad(guiObject);
|
DontDestroyOnLoad(guiObject);
|
||||||
Log.LogInfo("Audio Mixer GUI initialized");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Update()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnDestroy()
|
private void OnDestroy()
|
||||||
|
|||||||
Reference in New Issue
Block a user