Skip to content

Commit dfe13b1

Browse files
committed
Fix load, hovering and remove hooking into various decoration labels
1 parent ea325e6 commit dfe13b1

File tree

7 files changed

+19
-21
lines changed

7 files changed

+19
-21
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
By [Osmodium](https://github.com/Osmodium)
33

44
## This mod is made for Warhammer 40K: Rogue Trader and introduces TTS (TextToSpeech) in most places.
5-
Version: 0.9.0
5+
Version: 0.9.2
66

77
**Disclaimer: UNDER DEVELOPMENT**
88

@@ -119,7 +119,7 @@ In the main menu view, a welcome message is shown, this can be played back by ho
119119

120120
### Settings
121121

122-
New keybind setting in the game menu under "Sound"
122+
New keybind setting in the game menu under "Sound" to stop playback.
123123
![Assign keybind(s) to stopping of playback](https://dashvoid.com/speechmod/w40krt/4_Keybinding.png)
124124

125125
If enabled in the mod-settings, a notification will be shown when stopping the playback through use of the keybind.

SpeechMod.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test", "Test\Test.csproj",
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solutionfiles", "Solutionfiles", "{504859E5-17AA-4CD4-BD1C-40BCAFCF4E5F}"
1111
ProjectSection(SolutionItems) = preProject
12+
README.md = README.md
1213
Todo.txt = Todo.txt
1314
EndProjectSection
1415
EndProject

SpeechMod/Info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"AssemblyName": "W40KRTSpeechMod.dll",
88
"EntryMethod": "SpeechMod.Main.Load",
99
"HomePage": "https://www.nexusmods.com/warhammer40kroguetrader/mods/75",
10-
"Version": "0.9.1"
10+
"Version": "0.9.2"
1111
}

SpeechMod/Patches/TooltipEngine_Patch.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Collections.Generic;
88
using System.Linq;
99
using Kingmaker.Code.UI.MVVM.View.Tooltip.Bricks;
10+
using Kingmaker.Utility;
1011
using Owlcat.Runtime.UI.Controls.Button;
1112
using TMPro;
1213
using UnityEngine;
@@ -79,9 +80,13 @@ private static bool ApplyFilter(Transform transform)
7980
if (string.IsNullOrWhiteSpace(transform.name))
8081
return false;
8182

82-
return !(transform.name.Trim().Equals("bracket", StringComparison.InvariantCultureIgnoreCase)
83+
return !(transform.GetGameObjectPath().Contains("ComparativeTooltipPCView")
84+
|| transform.name.Trim().Equals("bracket", StringComparison.InvariantCultureIgnoreCase)
8385
|| transform.name.Trim().Equals("Acronim", StringComparison.InvariantCultureIgnoreCase)
8486
|| transform.name.Trim().Equals("decortext", StringComparison.InvariantCultureIgnoreCase)
87+
|| transform.name.Trim().Equals("Text (TMP) (1)", StringComparison.InvariantCultureIgnoreCase)
88+
|| transform.name.Trim().Equals("Text (TMP) (2)", StringComparison.InvariantCultureIgnoreCase)
89+
|| transform.GetGameObjectPath()!.Contains("/LeftBlock (1)/Empty/Text (TMP)")
8590
|| transform.parent?.GetComponent<OwlcatButton>() != null);
8691
}
8792
}

SpeechMod/PhoneticDictionary.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@
5555
"technomat": "techno-mat",
5656
"mechanised": "mechanized",
5757
"heretech": "herree-tech",
58-
"xenotech": "xeenotech"
58+
"xenotech": "xeenotech",
59+
"sceptical": "skeptical"
5960
}

SpeechMod/SpeechMod.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343
<HintPath>$(RogueTraderInstallDir)\WH40KRT_Data\Managed\Owlcat.Runtime.UniRx.dll</HintPath>
4444
<Private>False</Private>
4545
</Reference>
46-
<Reference Include="RogueTrader.GameCore">
47-
<HintPath>$(RogueTraderInstallDir)\WH40KRT_Data\Managed\RogueTrader.GameCore.dll</HintPath>
48-
<Private>False</Private>
49-
</Reference>
5046
<Reference Include="UniRx">
5147
<HintPath>$(RogueTraderInstallDir)\WH40KRT_Data\Managed\UniRx.dll</HintPath>
5248
<Private>False</Private>

SpeechMod/Unity/Extensions/Hooks.cs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,14 @@ public static void HookupTextToSpeech(this TextMeshProUGUI textMeshPro, bool for
8989
return;
9090
}
9191

92-
var skipEventAssignment = false;
93-
9492
var defaultValues = textMeshProTransform.GetComponent<TextMeshProValues>();
9593
if (defaultValues == null)
9694
{
9795
defaultValues = textMeshProTransform.gameObject?.AddComponent<TextMeshProValues>();
98-
defaultValues!.FontStyles = textMeshPro.fontStyle;
99-
defaultValues.Color = textMeshPro.color;
100-
defaultValues.ExtraPadding = textMeshPro.extraPadding;
10196
}
10297
else
103-
skipEventAssignment = true;
104-
105-
if (skipEventAssignment)
10698
{
107-
#if DEBUG
108-
//Debug.Log("Skipping event assignment!");
109-
#endif
99+
// Skip event assignment since it should already be hooked up
110100
return;
111101
}
112102

@@ -115,13 +105,18 @@ public static void HookupTextToSpeech(this TextMeshProUGUI textMeshPro, bool for
115105
textMeshPro.OnPointerEnterAsObservable().Subscribe(
116106
_ =>
117107
{
108+
defaultValues = textMeshProTransform.gameObject?.AddComponent<TextMeshProValues>();
109+
defaultValues!.FontStyles = textMeshPro.fontStyle;
110+
defaultValues.Color = textMeshPro.color;
111+
defaultValues.ExtraPadding = textMeshPro.extraPadding;
112+
118113
if (Main.Settings!.FontStyleOnHover)
119114
{
120115
for (int i = 0; i < Main.Settings.FontStyles!.Length; i++)
121116
{
122117
if (Main.Settings.FontStyles[i])
123118
{
124-
textMeshPro.fontStyle |= (FontStyles)Enum.Parse(typeof(FontStyles), Main.FontStyleNames![i]!, true);
119+
textMeshPro.fontStyle ^= (FontStyles)Enum.Parse(typeof(FontStyles), Main.FontStyleNames![i]!, true);
125120
}
126121
}
127122
textMeshPro.extraPadding = false;

0 commit comments

Comments
 (0)