Skip to content

Commit

Permalink
Added location to msg about pre-loaded Harmony
Browse files Browse the repository at this point in the history
  • Loading branch information
artifixer committed Jul 3, 2021
1 parent 0a773d7 commit d429e1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Bannerlord.Harmony/SubModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class SubModule : MBSubModuleBase
Expected {P_VERSION}, but got {E_VERSION}!
This is not recommended. Expect issues!";
private const string SErrorHarmonyLoadedFromAnotherPlace =
@"{=ASjx7sqkJs}0Harmony.dll was loaded from another location!
@"{=ASjx7sqkJs}0Harmony.dll was loaded from another location: {LOCATION}!
It may be caused by a custom launcher!
This is not recommended. Expect issues!";

Expand Down Expand Up @@ -130,7 +130,9 @@ private static void LoadHarmony()
if (string.IsNullOrEmpty(existingHarmony.Location) || Path.GetFullPath(providedHarmonyLocation) != Path.GetFullPath(existingHarmony.Location))
{
if (sb.Length != 0) sb.AppendLine();
sb.AppendLine(TextObjectHelper.Create(SErrorHarmonyLoadedFromAnotherPlace)?.ToString() ?? "ERROR");
var textObject = TextObjectHelper.Create(SErrorHarmonyLoadedFromAnotherPlace);
textObject?.SetTextVariable2("LOCATION", TextObjectHelper.Create(string.IsNullOrEmpty(existingHarmony.Location) ? string.Empty : Path.GetFullPath(existingHarmony.Location)));
sb.AppendLine(textObject?.ToString() ?? "ERROR");
}

if (providedHarmony.Version != existingHarmonyName.Version)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<string id="NxkNTUUV32" text="Bannerlord.Harmony is not first in loading order!\nThis is not recommended. Expect issues!" />
<string id="HSyaj6TjUG" text="0Harmony.dll file was not found!" />
<string id="Z4d2nSD38a" text="Loaded 0Harmony.dll version is wrong!\nExpected {P_VERSION}, but got {E_VERSION}!\nThis is not recommended. Expect issues!" />
<string id="ASjx7sqkJs" text="0Harmony.dll was loaded from another location!\nIt may be caused by a custom launcher!\nThis is not recommended. Expect issues!" />
<string id="ASjx7sqkJs" text="0Harmony.dll was loaded from another location: {LOCATION}!\nIt may be caused by a custom launcher!\nThis is not recommended. Expect issues!" />
</strings>
</base>

0 comments on commit d429e1a

Please sign in to comment.