From 13e174defd3afd4e92a4933c47202d7341910168 Mon Sep 17 00:00:00 2001 From: Interkarma Date: Sun, 27 Nov 2022 11:45:05 +1000 Subject: [PATCH] Localize "would you like to travel to" prompt Requires full mapId value stored in MapSummary for localized location name key. --- .../Game/UserInterfaceWindows/DaggerfallTravelMapWindow.cs | 4 +++- Assets/Scripts/Utility/ContentReader.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Game/UserInterfaceWindows/DaggerfallTravelMapWindow.cs b/Assets/Scripts/Game/UserInterfaceWindows/DaggerfallTravelMapWindow.cs index 900edca6d5..9fe6e5c4e6 100644 --- a/Assets/Scripts/Game/UserInterfaceWindows/DaggerfallTravelMapWindow.cs +++ b/Assets/Scripts/Game/UserInterfaceWindows/DaggerfallTravelMapWindow.cs @@ -1638,7 +1638,9 @@ protected virtual void CreateConfirmationPopUp() TextFile.Token[] textTokens = DaggerfallUnity.Instance.TextProvider.GetRSCTokens(doYouWishToTravelToTextId); // Hack to set location name in text token for now - textTokens[2].text = textTokens[2].text.Replace("%tcn", GetLocationNameInCurrentRegion(locationSummary.MapIndex)); + textTokens[2].text = textTokens[2].text.Replace( + "%tcn", + TextManager.Instance.GetLocalizedLocationName(locationSummary.MapID, GetLocationNameInCurrentRegion(locationSummary.MapIndex))); DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this); messageBox.SetTextTokens(textTokens); diff --git a/Assets/Scripts/Utility/ContentReader.cs b/Assets/Scripts/Utility/ContentReader.cs index a13dc724e9..7f31bcef3e 100644 --- a/Assets/Scripts/Utility/ContentReader.cs +++ b/Assets/Scripts/Utility/ContentReader.cs @@ -38,7 +38,8 @@ public class ContentReader public struct MapSummary { - public int ID; + public int ID; // mapTable.MapId & 0x000fffff for dict key and matching with ExteriorData.MapId + public int MapID; // Full mapTable.MapId for matching with localization key public int RegionIndex; public int MapIndex; public DFRegion.LocationTypes LocationType; @@ -332,6 +333,7 @@ private void EnumerateMaps() // Get map summary DFRegion.RegionMapTable mapTable = dfRegion.MapTable[location]; summary.ID = mapTable.MapId & 0x000fffff; + summary.MapID = mapTable.MapId; summary.RegionIndex = region; summary.MapIndex = location; summary.LocationType = mapTable.LocationType;