Skip to content

Commit

Permalink
Merge pull request #1136 from shananas/master
Browse files Browse the repository at this point in the history
Move `panacea_settings.txt` file creation
  • Loading branch information
Vladabdf authored Jan 13, 2025
2 parents f7468ea + 3c33554 commit eec4506
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
10 changes: 5 additions & 5 deletions OpenKh.Patcher/PatcherProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,22 +291,22 @@ public void Patch(
{
if (Language != "jp")
{
if (!context.GetOriginalAssetPath(name).Contains(".a.fm") && !context.GetOriginalAssetPath(name).Contains("/jp/"))
if (!context.GetOriginalAssetPath(assetFile.Source[0].Name).Contains(".a.fm") && !context.GetOriginalAssetPath(assetFile.Source[0].Name).Contains("/jp/"))
{
Log.Warn("File not found: " + context.GetOriginalAssetPath(name) + " Skipping. \nPlease check your game extraction.");
Log.Warn("File not found: " + context.GetOriginalAssetPath(assetFile.Source[0].Name) + " Skipping. \nPlease check your game extraction.");
}
}
else
{
if (!globalFilePaths.Any(x => context.GetOriginalAssetPath(name).Contains(x)))
if (!globalFilePaths.Any(x => context.GetOriginalAssetPath(assetFile.Source[0].Name).Contains(x)))
{
Log.Warn("File not found: " + context.GetOriginalAssetPath(name) + " Skipping. \nPlease check your game extraction.");
Log.Warn("File not found: " + context.GetOriginalAssetPath(assetFile.Source[0].Name) + " Skipping. \nPlease check your game extraction.");
}
}
}
else
{
Log.Warn("File not found: " + context.GetOriginalAssetPath(name) + " Skipping. \nPlease check your game extraction.");
Log.Warn("File not found: " + context.GetOriginalAssetPath(assetFile.Source[0].Name) + " Skipping. \nPlease check your game extraction.");
}
}
else
Expand Down
4 changes: 2 additions & 2 deletions OpenKh.Tools.ModsManager/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<userSettings>
<OpenKh.Tools.ModsManager.WinSettings>
<setting name="Top" serializeAs="String">
<value>0</value>
<value>320</value>
</setting>
<setting name="Width" serializeAs="String">
<value>660</value>
Expand All @@ -17,7 +17,7 @@
<value>450</value>
</setting>
<setting name="Left" serializeAs="String">
<value>0</value>
<value>640</value>
</setting>
<setting name="Maximized" serializeAs="String">
<value>False</value>
Expand Down
24 changes: 1 addition & 23 deletions OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -492,29 +492,7 @@ await ModsService.InstallMod(name, isZipFile, isLuaFile, progress =>
ConfigurationService.PcReleaseLocationKH3D = dialog.ConfigPcReleaseLocationKH3D;
ConfigurationService.RegionId = dialog.ConfigRegionId;
ConfigurationService.PanaceaInstalled = dialog.ConfigPanaceaInstalled;
ConfigurationService.WizardVersionNumber = _wizardVersionNumber;

const int EpicGamesPC = 2;
if (ConfigurationService.GameEdition == EpicGamesPC &&
Directory.Exists(ConfigurationService.PcReleaseLocation))
{
File.WriteAllLines(Path.Combine(ConfigurationService.PcReleaseLocation, "panacea_settings.txt"),
new string[]
{
$"mod_path={ConfigurationService.GameModPath}",
$"show_console={false}",
});
}
if (ConfigurationService.GameEdition == EpicGamesPC &&
Directory.Exists(ConfigurationService.PcReleaseLocationKH3D))
{
File.WriteAllLines(Path.Combine(ConfigurationService.PcReleaseLocationKH3D, "panacea_settings.txt"),
new string[]
{
$"mod_path={ConfigurationService.GameModPath}",
$"show_console={false}",
});
}
ConfigurationService.WizardVersionNumber = _wizardVersionNumber;
if (ConfigurationService.GameEdition == 2)
{
PC = true;
Expand Down
22 changes: 22 additions & 0 deletions OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,24 @@ public SetupWizardViewModel()
File.Copy(PanaceaSourceLocation, PanaceaAlternateLocation, true);
File.Delete(PanaceaDestinationLocation);
}
if (Directory.Exists(ConfigurationService.PcReleaseLocation))
{
File.WriteAllLines(Path.Combine(ConfigurationService.PcReleaseLocation, "panacea_settings.txt"),
new string[]
{
$"mod_path={ConfigurationService.GameModPath}",
$"show_console={false}",
});
}
if (Directory.Exists(ConfigurationService.PcReleaseLocationKH3D))
{
File.WriteAllLines(Path.Combine(ConfigurationService.PcReleaseLocationKH3D, "panacea_settings.txt"),
new string[]
{
$"mod_path={ConfigurationService.GameModPath}",
$"show_console={false}",
});
}
try
{
File.Copy(Path.Combine(AppContext.BaseDirectory, "avcodec-vgmstream-59.dll"), Path.Combine(PanaceaDependenciesLocation, "avcodec-vgmstream-59.dll"), true);
Expand Down Expand Up @@ -926,6 +944,8 @@ public SetupWizardViewModel()
File.Delete(Path.Combine(PanaceaDependenciesLocation, "libspeex-1.dll"));
File.Delete(Path.Combine(PanaceaDependenciesLocation, "libvorbis.dll"));
File.Delete(Path.Combine(PanaceaDependenciesLocation, "swresample-vgmstream-4.dll"));
File.Delete(Path.Combine(ConfigurationService.PcReleaseLocation, "panacea_settings.txt"));
File.Delete(Path.Combine(ConfigurationService.PcReleaseLocationKH3D, "panacea_settings.txt"));
PanaceaInstalled = false;
return;
}
Expand Down Expand Up @@ -978,6 +998,8 @@ public SetupWizardViewModel()
File.Delete(Path.Combine(PanaceaDependenciesLocation, "libspeex-1.dll"));
File.Delete(Path.Combine(PanaceaDependenciesLocation, "libvorbis.dll"));
File.Delete(Path.Combine(PanaceaDependenciesLocation, "swresample-vgmstream-4.dll"));
File.Delete(Path.Combine(ConfigurationService.PcReleaseLocation, "panacea_settings.txt"));
File.Delete(Path.Combine(ConfigurationService.PcReleaseLocationKH3D, "panacea_settings.txt"));
}
OnPropertyChanged(nameof(IsLastPanaceaVersionInstalled));
OnPropertyChanged(nameof(PanaceaInstalledVisibility));
Expand Down
8 changes: 4 additions & 4 deletions OpenKh.Tools.ModsManager/WinSettings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions OpenKh.Tools.ModsManager/WinSettings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Profiles />
<Settings>
<Setting Name="Top" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
<Value Profile="(Default)">320</Value>
</Setting>
<Setting Name="Width" Type="System.Double" Scope="User">
<Value Profile="(Default)">660</Value>
Expand All @@ -12,7 +12,7 @@
<Value Profile="(Default)">450</Value>
</Setting>
<Setting Name="Left" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
<Value Profile="(Default)">640</Value>
</Setting>
<Setting Name="Maximized" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
Expand Down

0 comments on commit eec4506

Please sign in to comment.