Skip to content

Commit

Permalink
Update info.json
Browse files Browse the repository at this point in the history
Update notificaiton text in case localization is missing
  • Loading branch information
Osmodium committed Jan 10, 2024
1 parent 9fa7c41 commit 334ccea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SpeechMod/Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"AssemblyName": "W40KRTSpeechMod.dll",
"EntryMethod": "SpeechMod.Main.Load",
"HomePage": "https://www.nexusmods.com/warhammer40kroguetrader/mods/75",
"Version": "0.9.0"
"Version": "0.9.1"
}
12 changes: 9 additions & 3 deletions SpeechMod/Keybinds/PlaybackStop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using Kingmaker.Code.UI.MVVM.VM.WarningNotification;
using Kingmaker.Localization;
using SpeechMod.Configuration.Settings;
#if DEBUG
using UnityEngine;
#endif

namespace SpeechMod.Keybinds;

Expand All @@ -27,7 +30,10 @@ private static class Patches
[HarmonyPostfix]
private static void Add(CommonPCView __instance)
{
__instance!.AddDisposable(Game.Instance!.Keyboard!.Bind(BIND_NAME, delegate { StopPlayback(__instance); }));
#if DEBUG
Debug.Log($"{nameof(CommonPCView)}_{nameof(CommonPCView.BindViewImplementation)}_Postfix");
#endif
__instance?.AddDisposable(Game.Instance!.Keyboard!.Bind(BIND_NAME, delegate { StopPlayback(__instance); }));
}

private static void StopPlayback(CommonPCView instance)
Expand All @@ -38,10 +44,10 @@ private static void StopPlayback(CommonPCView instance)
if (instance != null && instance.m_WarningsTextView != null)
{
if (!LocalizationManager.Instance!.CurrentPack!.TryGetText("osmodium.speechmod.feature.playback.stop.notification", out string text, false))
text = "Stopping Playback!";
text = "SpeechMod: Playback stopped!";

if (Main.Settings!.ShowNotificationOnPlaybackStop)
instance?.m_WarningsTextView?.Show(text, WarningNotificationFormat.Common);
instance.m_WarningsTextView?.Show(text, WarningNotificationFormat.Common);
}

Main.Speech?.Stop();
Expand Down

0 comments on commit 334ccea

Please sign in to comment.