mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-29 11:59:21 +01:00
initial implementation of new auto-update UX
This commit is contained in:
parent
c926a13848
commit
8d18940108
17 changed files with 1115 additions and 229 deletions
|
|
@ -7,12 +7,12 @@ using Dalamud.Configuration.Internal;
|
|||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Interface.ImGuiNotification.Internal;
|
||||
using Dalamud.Interface.Internal.DesignSystem;
|
||||
using Dalamud.Interface.Internal.Notifications;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Plugin.Internal;
|
||||
using Dalamud.Plugin.Internal.Profiles;
|
||||
using Dalamud.Plugin.Internal.Types;
|
||||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
using Serilog;
|
||||
|
|
@ -300,39 +300,16 @@ internal class ProfileManagerWidget
|
|||
return;
|
||||
}
|
||||
|
||||
const string addPluginToProfilePopup = "###addPluginToProfile";
|
||||
var addPluginToProfilePopupId = ImGui.GetID(addPluginToProfilePopup);
|
||||
using (var popup = ImRaii.Popup(addPluginToProfilePopup))
|
||||
{
|
||||
if (popup.Success)
|
||||
var addPluginToProfilePopupId = DalamudComponents.DrawPluginPicker(
|
||||
"###addPluginToProfilePicker",
|
||||
ref this.pickerSearch,
|
||||
plugin =>
|
||||
{
|
||||
var width = ImGuiHelpers.GlobalScale * 300;
|
||||
|
||||
using var disabled = ImRaii.Disabled(profman.IsBusy);
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.InputTextWithHint("###pluginPickerSearch", Locs.SearchHint, ref this.pickerSearch, 255);
|
||||
|
||||
if (ImGui.BeginListBox("###pluginPicker", new Vector2(width, width - 80)))
|
||||
{
|
||||
// TODO: Plugin searching should be abstracted... installer and this should use the same search
|
||||
foreach (var plugin in pm.InstalledPlugins.Where(x => x.Manifest.SupportsProfiles &&
|
||||
(this.pickerSearch.IsNullOrWhitespace() || x.Manifest.Name.ToLowerInvariant().Contains(this.pickerSearch.ToLowerInvariant()))))
|
||||
{
|
||||
using var disabled2 =
|
||||
ImRaii.Disabled(profile.Plugins.Any(y => y.InternalName == plugin.Manifest.InternalName));
|
||||
|
||||
if (ImGui.Selectable($"{plugin.Manifest.Name}{(plugin is LocalDevPlugin ? "(dev plugin)" : string.Empty)}###selector{plugin.Manifest.InternalName}"))
|
||||
{
|
||||
Task.Run(() => profile.AddOrUpdateAsync(plugin.EffectiveWorkingPluginId, plugin.Manifest.InternalName, true, false))
|
||||
.ContinueWith(this.installer.DisplayErrorContinuation, Locs.ErrorCouldNotChangeState);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.EndListBox();
|
||||
}
|
||||
}
|
||||
}
|
||||
Task.Run(() => profile.AddOrUpdateAsync(plugin.EffectiveWorkingPluginId, plugin.Manifest.InternalName, true, false))
|
||||
.ContinueWith(this.installer.DisplayErrorContinuation, Locs.ErrorCouldNotChangeState);
|
||||
},
|
||||
plugin => !plugin.Manifest.SupportsProfiles ||
|
||||
profile.Plugins.Any(x => x.WorkingPluginId == plugin.EffectiveWorkingPluginId));
|
||||
|
||||
var didAny = false;
|
||||
|
||||
|
|
@ -603,8 +580,6 @@ internal class ProfileManagerWidget
|
|||
|
||||
public static string BackToOverview => Loc.Localize("ProfileManagerBackToOverview", "Back to overview");
|
||||
|
||||
public static string SearchHint => Loc.Localize("ProfileManagerSearchHint", "Search...");
|
||||
|
||||
public static string AddProfileHint => Loc.Localize("ProfileManagerAddProfileHint", "No collections! Add one!");
|
||||
|
||||
public static string CloneProfileHint => Loc.Localize("ProfileManagerCloneProfile", "Clone this collection");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue