Skip to content

Commit c42a656

Browse files
committed
Update TextManager.cs and others
Suppressed the ProcessGrammar() into TextManager.cs that had unwanted side effects. Added one into CreateCharClassSelect.cs and one into DaggerfallCharacterSheetWindow.cs.
1 parent fd0c469 commit c42a656

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

Assets/Scripts/Game/TextManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
using DaggerfallWorkshop.Game.Entity;
2222
using UnityEngine.Localization.Tables;
2323
using DaggerfallWorkshop.Game.MagicAndEffects;
24-
using DaggerfallWorkshop.Localization;
2524

2625
namespace DaggerfallWorkshop.Game
2726
{
@@ -359,7 +358,7 @@ public string GetLocalizedText(string key, TextCollections collection = TextColl
359358
string localizedText;
360359
if (TryGetLocalizedText(GetRuntimeCollectionName(collection), key, out localizedText))
361360
{
362-
return GrammarManager.grammarProcessor.ProcessGrammar(localizedText);
361+
return localizedText;
363362
}
364363
else if (TryGetLocalizedText(GetDefaultCollectionName(collection), key, out localizedText))
365364
return localizedText;

Assets/Scripts/Game/UserInterfaceWindows/CreateCharClassSelect.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using DaggerfallWorkshop;
2020
using DaggerfallWorkshop.Game.UserInterface;
2121
using DaggerfallWorkshop.Game.Player;
22+
using DaggerfallWorkshop.Localization;
2223

2324
namespace DaggerfallWorkshop.Game.UserInterfaceWindows
2425
{
@@ -45,6 +46,7 @@ public CreateCharClassSelect(IUserInterfaceManager uiManager, DaggerfallBaseWind
4546

4647
protected override void Setup()
4748
{
49+
string careerName;
4850
base.Setup();
4951

5052
// Read all CLASS*.CFG files and add to listbox
@@ -55,7 +57,8 @@ protected override void Setup()
5557
{
5658
ClassFile classFile = new ClassFile(files[i]);
5759
classList.Add(classFile.Career);
58-
listBox.AddItem(TextManager.Instance.GetLocalizedText(classFile.Career.Name));
60+
careerName = TextManager.Instance.GetLocalizedText(classFile.Career.Name);
61+
listBox.AddItem(GrammarManager.grammarProcessor.ProcessGrammar(careerName));
5962
}
6063
}
6164
// Last option is for creating custom classes

Assets/Scripts/Game/UserInterfaceWindows/DaggerfallCharacterSheetWindow.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using DaggerfallWorkshop.Game.Entity;
1919
using DaggerfallWorkshop.Game.Formulas;
2020
using DaggerfallWorkshop.Game.Guilds;
21+
using DaggerfallWorkshop.Localization;
2122

2223
namespace DaggerfallWorkshop.Game.UserInterfaceWindows
2324
{
@@ -394,7 +395,7 @@ void UpdatePlayerValues()
394395

395396
// Update main labels
396397
nameLabel.Text = PlayerEntity.Name;
397-
raceLabel.Text = PlayerEntity.RaceTemplate.Name;
398+
raceLabel.Text = GrammarManager.grammarProcessor.ProcessGrammar(PlayerEntity.RaceTemplate.Name);
398399
classLabel.Text = PlayerEntity.Career.Name;
399400
levelLabel.Text = PlayerEntity.Level.ToString();
400401
goldLabel.Text = PlayerEntity.GetGoldAmount().ToString();

0 commit comments

Comments
 (0)