Skip to content

Commit

Permalink
Merge pull request #151 from rankynbass/fix-manual-injection
Browse files Browse the repository at this point in the history
fix: only inject path if manual injection enabled
  • Loading branch information
Blooym authored Jun 10, 2024
2 parents 760790b + 5f44029 commit f734f3e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ public SettingsTabDalamud()
new NumericSettingsEntry("Injection Delay (ms)", "Choose how long to wait after the game has loaded before injecting.", () => Program.Config.DalamudLoadDelay, delay => Program.Config.DalamudLoadDelay = delay, 0, int.MaxValue, 1000),

enableManualInjection = new SettingsEntry<bool>("Enable Manual Injection", "Use a local build of Dalamud instead of the automatically provided one (For developers only!)", () => Program.Config.DalamudManualInjectionEnabled ?? false, (enabled) =>
{
Program.Config.DalamudManualInjectionEnabled = enabled;
{
Program.Config.DalamudManualInjectionEnabled = enabled;

if (!enabled)
{
Program.DalamudUpdater.RunnerOverride = null;
return;
}
if (!enabled)
{
Program.DalamudUpdater.RunnerOverride = null;
return;
}

if (Program.Config.DalamudManualInjectPath is not null &&
if (Program.Config.DalamudManualInjectPath is not null &&
Program.Config.DalamudManualInjectPath.Exists &&
Program.Config.DalamudManualInjectPath.GetFiles().FirstOrDefault(x => x.Name == Program.DALAMUD_INJECTOR_NAME) is not null)
{
Program.DalamudUpdater.RunnerOverride = new FileInfo(Path.Combine(Program.Config.DalamudManualInjectPath.FullName, Program.DALAMUD_INJECTOR_NAME));
{
Program.DalamudUpdater.RunnerOverride = new FileInfo(Path.Combine(Program.Config.DalamudManualInjectPath.FullName, Program.DALAMUD_INJECTOR_NAME));
}
}),

Expand Down
13 changes: 6 additions & 7 deletions src/XIVLauncher.Core/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,18 @@ private static void LoadConfig(Storage storage)
/// <returns>A <see cref="DalamudUpdater"/> instance.</returns>
private static DalamudUpdater CreateDalamudUpdater()
{
FileInfo runnerOverride = null;
if (Config.DalamudManualInjectPath is not null &&
Config.DalamudManualInjectPath.Exists &&
Config.DalamudManualInjectPath.GetFiles().FirstOrDefault(x => x.Name == DALAMUD_INJECTOR_NAME) is not null)
Config.DalamudManualInjectionEnabled == true &&
Config.DalamudManualInjectPath.Exists &&
Config.DalamudManualInjectPath.GetFiles().FirstOrDefault(x => x.Name == DALAMUD_INJECTOR_NAME) is not null)
{
return new DalamudUpdater(Config.DalamudManualInjectPath, storage.GetFolder("runtime"), storage.GetFolder("dalamudAssets"), storage.Root, null, null)
{
Overlay = DalamudLoadInfo,
RunnerOverride = new FileInfo(Path.Combine(Config.DalamudManualInjectPath.FullName, DALAMUD_INJECTOR_NAME))
};
runnerOverride = new FileInfo(Path.Combine(Config.DalamudManualInjectPath.FullName, DALAMUD_INJECTOR_NAME));
}
return new DalamudUpdater(storage.GetFolder("dalamud"), storage.GetFolder("runtime"), storage.GetFolder("dalamudAssets"), storage.Root, null, null)
{
Overlay = DalamudLoadInfo,
RunnerOverride = runnerOverride
};
}

Expand Down

0 comments on commit f734f3e

Please sign in to comment.