mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-27 19:09:18 +01:00
chore: prevent plugins from being installed twice for now if an assignment is missing
This commit is contained in:
parent
6e54c085fa
commit
8b85139e61
1 changed files with 14 additions and 7 deletions
|
|
@ -406,7 +406,7 @@ internal class ProfileManagerWidget
|
|||
foreach (var plugin in profile.Plugins.ToArray())
|
||||
{
|
||||
didAny = true;
|
||||
var pmPlugin = pm.InstalledPlugins.FirstOrDefault(x => x.Manifest.InternalName == plugin.InternalName);
|
||||
var pmPlugin = pm.InstalledPlugins.FirstOrDefault(x => x.Manifest.WorkingPluginId == plugin.WorkingPluginId);
|
||||
var btnOffset = 2;
|
||||
|
||||
if (pmPlugin != null)
|
||||
|
|
@ -437,26 +437,33 @@ internal class ProfileManagerWidget
|
|||
|
||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + (pluginLineHeight / 2) - (textHeight.Y / 2));
|
||||
ImGui.TextUnformatted(text);
|
||||
|
||||
var available =
|
||||
|
||||
var firstAvailableInstalled = pm.InstalledPlugins.FirstOrDefault(x => x.InternalName == plugin.InternalName);
|
||||
var installable =
|
||||
pm.AvailablePlugins.FirstOrDefault(
|
||||
x => x.InternalName == plugin.InternalName && !x.SourceRepo.IsThirdParty);
|
||||
if (available != null)
|
||||
|
||||
if (firstAvailableInstalled != null)
|
||||
{
|
||||
// TODO
|
||||
ImGui.Text("GOAT WAS TOO LAZY TO IMPLEMENT THIS");
|
||||
}
|
||||
else if (installable != null)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.SetCursorPosX(windowSize.X - (ImGuiHelpers.GlobalScale * 30 * 2) - 2);
|
||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + (pluginLineHeight / 2) - (ImGui.GetFrameHeight() / 2));
|
||||
btnOffset = 3;
|
||||
|
||||
if (ImGuiComponents.IconButton($"###installMissingPlugin{available.InternalName}", FontAwesomeIcon.Download))
|
||||
if (ImGuiComponents.IconButton($"###installMissingPlugin{installable.InternalName}", FontAwesomeIcon.Download))
|
||||
{
|
||||
this.installer.StartInstall(available, false);
|
||||
this.installer.StartInstall(installable, false);
|
||||
}
|
||||
|
||||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(Locs.InstallPlugin);
|
||||
}
|
||||
|
||||
|
||||
ImGui.SetCursorPos(before);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue