Skip to content

Commit

Permalink
Do not expand macros for quest letter tooltips
Browse files Browse the repository at this point in the history
Quest letter tooltip displays last two lines of letter as a QoL feature. It does this by reading letter text and injecting last two lines as the item's "long name", which is then set as tooltip.
In cases where world replacement data is used, text macro expansion can trigger a sequence of events where world data is reloaded causing massive performance dips just by opening the clothing & misc tab in inventory with quest letters in inventory. This is an unintended interaction between different systems.
This commit prevents expensive macro expansion just for quest letter tooltips. In majority of cases, the tooltip will not use macros in the last two lines anyway. And in cases where it does, seeing the %var macro is less of a problem than reloading entire chunks of the world as player moves mouse around inventory UI.
  • Loading branch information
Interkarma committed Oct 9, 2023
1 parent 244fce5 commit 319e5c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Assets/Scripts/Game/Items/ItemHelper.cs
Expand Up @@ -342,7 +342,7 @@ public string ResolveItemLongName(DaggerfallUnityItem item, bool differentiatePl
if (questItem.UsedMessageID >= 0)
{
Message msg = quest.GetMessage(questItem.UsedMessageID);
TextFile.Token[] tokens = msg.GetTextTokens();
TextFile.Token[] tokens = msg.GetTextTokens(expandMacros:false);
string signoff = "";
int lines = 0;
for (int i = tokens.Length-1; i >= 0; i--)
Expand Down

0 comments on commit 319e5c0

Please sign in to comment.