Skip to content

Commit

Permalink
Localize "would you like to travel to" prompt
Browse files Browse the repository at this point in the history
Requires full mapId value stored in MapSummary for localized location name key.
  • Loading branch information
Interkarma committed Nov 27, 2022
1 parent e52571e commit 13e174d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/Utility/ContentReader.cs
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 13e174d

Please sign in to comment.