Skip to content
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[English](CHANGELOG_EN.md) | 中文

## v1.8.3
Comment thread
BAKAOLC marked this conversation as resolved.

- 修复了音效播放逻辑,确保音效播放时包含正确的游戏对象引用

## v1.8.2

- 优化了 UI 组件的布局和初始化逻辑,使用 UIFactory 方法简化代码,提升可读性
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

English | [中文](CHANGELOG.md)

## v1.8.3

- Fixed audio playback logic to ensure correct game object references are included when playing sounds

## v1.8.2

- Optimized UI component layout and initialization logic, simplified code using UIFactory methods, improved readability
Expand Down
2 changes: 1 addition & 1 deletion DuckovCustomModel/Constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public static class Constant
{
public const string ModID = "DuckovCustomModel";
public const string ModName = "Duckov Custom Model";
public const string ModVersion = "1.8.2";
public const string ModVersion = "1.8.3";
public const string HarmonyId = "com.ritsukage.DuckovCustomModel";
}
}
4 changes: 2 additions & 2 deletions DuckovCustomModel/HarmonyPatches/AudioManagerPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static bool Prefix(
var soundPath = modelHandler.GetRandomSoundByTag(normalizedSoundKey);
if (string.IsNullOrEmpty(soundPath)) return true;

AudioManager.PostCustomSFX(soundPath);
AudioManager.PostCustomSFX(soundPath, gameObject);
__result = null;
return false;
}
Expand All @@ -70,7 +70,7 @@ private static bool Prefix(CharacterMainControl __instance)
var soundPath = modelHandler.GetRandomSoundByTag(SoundTags.Normal);
if (string.IsNullOrEmpty(soundPath)) return true;

AudioManager.PostCustomSFX(soundPath);
AudioManager.PostCustomSFX(soundPath, __instance.gameObject);
AIMainBrain.MakeSound(new()
{
fromCharacter = __instance,
Expand Down
2 changes: 1 addition & 1 deletion DuckovCustomModel/HarmonyPatches/ItemDisplayPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private static void ItemDisplay_OnTargetInspectionStateChanged_Postfix(Item item
var soundPath = modelHandler.GetRandomSoundByTag(soundTag);
if (string.IsNullOrEmpty(soundPath)) return;

AudioManager.PostCustomSFX(soundPath);
AudioManager.PostCustomSFX(soundPath, modelHandler.gameObject);
}

private static void OnItemDestroyed(Item item)
Expand Down
6 changes: 3 additions & 3 deletions DuckovCustomModel/MonoBehaviours/ModelHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ private void OnHurt(DamageInfo damageInfo)
var soundPath = GetRandomSoundByTag(SoundTags.TriggerOnHurt);
if (string.IsNullOrEmpty(soundPath)) return;

AudioManager.PostCustomSFX(soundPath);
AudioManager.PostCustomSFX(soundPath, gameObject);
}

private void OnDeath(DamageInfo damageInfo)
Expand All @@ -790,7 +790,7 @@ private void OnDeath(DamageInfo damageInfo)
var soundPath = GetRandomSoundByTag(SoundTags.TriggerOnDeath);
if (string.IsNullOrEmpty(soundPath)) return;

AudioManager.PostCustomSFX(soundPath);
AudioManager.PostCustomSFX(soundPath, gameObject);
}

private void InitializeCustomCharacterSubVisuals()
Expand Down Expand Up @@ -979,7 +979,7 @@ private void PlayIdleAudio()
var soundPath = GetRandomSoundByTag(SoundTags.Idle);
if (string.IsNullOrEmpty(soundPath)) return;

AudioManager.PostCustomSFX(soundPath);
AudioManager.PostCustomSFX(soundPath, gameObject);
}

private void ScheduleNextIdleAudio()
Expand Down