mirror of
https://github.com/LBPUnion/UnionPatcher.git
synced 2025-08-01 13:48:41 +00:00
Merge pull request #11 from AShifter/master
Check input/output file names and input server URL
This commit is contained in:
commit
4c0f87ec78
1 changed files with 12 additions and 1 deletions
|
@ -10,7 +10,6 @@ namespace LBPUnion.UnionPatcher.Gui {
|
||||||
private readonly FilePicker filePicker;
|
private readonly FilePicker filePicker;
|
||||||
private readonly TextBox serverUrl;
|
private readonly TextBox serverUrl;
|
||||||
private readonly FilePicker outputFileName;
|
private readonly FilePicker outputFileName;
|
||||||
|
|
||||||
public Dialog CreateOkDialog(string title, string errorMessage) {
|
public Dialog CreateOkDialog(string title, string errorMessage) {
|
||||||
DynamicLayout layout = new();
|
DynamicLayout layout = new();
|
||||||
Button button;
|
Button button;
|
||||||
|
@ -86,6 +85,18 @@ namespace LBPUnion.UnionPatcher.Gui {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.filePicker.FilePath == this.outputFileName.FilePath)
|
||||||
|
{
|
||||||
|
this.CreateOkDialog("Form Error", "Input and output filename are the same! Please save the patched file with a different name so you have a backup of your the original EBOOT.ELF.").ShowModal();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Uri.TryCreate(this.serverUrl.Text, UriKind.Absolute, out _))
|
||||||
|
{
|
||||||
|
this.CreateOkDialog("Form Error", "Server URL is invalid! Please enter a valid URL.").ShowModal();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Patcher.PatchFile(this.filePicker.FilePath, this.serverUrl.Text, this.outputFileName.FilePath);
|
Patcher.PatchFile(this.filePicker.FilePath, this.serverUrl.Text, this.outputFileName.FilePath);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue