Skip to content

Commit

Permalink
Fixed an issue with Success DialogBoxes not showing Version on Uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
HerpDerpinstine committed Nov 22, 2024
1 parent 2c7a9db commit 8ff998c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MelonLoader.Installer/Views/DetailsView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ private void OnOperationFinished(string? errorMessage, bool addedLocalBuild = fa
if (addedLocalBuild)
return;

bool isReinstall = false;
bool isInstall = true;
string operationType = Model.Game.MLInstalled ? "Installed" : "Uninstalled";
if (Model.Game.MLInstalled
&& (Model.Game.MLVersion != null)
&& (currentMLVersion != null))
{
var comp = Model.Game.MLVersion.CompareSortOrderTo(currentMLVersion);
isReinstall = comp == 0;
isInstall = comp == 0;
operationType = comp switch
{
> 0 => "Upgraded",
Expand All @@ -192,7 +192,7 @@ private void OnOperationFinished(string? errorMessage, bool addedLocalBuild = fa
};
}

DialogBox.ShowNotice("SUCCESS!", $"Successfully {operationType}{((!Model.Game.MLInstalled || isReinstall) ? string.Empty : " to")}\nMelonLoader{(Model.Game.MLInstalled ? $" v{Model.Game.MLVersion}" : string.Empty)}");
DialogBox.ShowNotice("SUCCESS!", $"Successfully {operationType}{((!Model.Game.MLInstalled || isInstall) ? string.Empty : " to")}\nMelonLoader v{(Model.Game.MLInstalled ? Model.Game.MLVersion : currentMLVersion)}");
}

private void OpenDirHandler(object sender, RoutedEventArgs args)
Expand Down

0 comments on commit 8ff998c

Please sign in to comment.