mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Merge pull request #1140 from Infiziert90/master
This commit is contained in:
commit
15ea80d21a
3 changed files with 67 additions and 1 deletions
|
|
@ -266,6 +266,15 @@ internal class DalamudInterface : IDisposable, IServiceType
|
||||||
this.pluginWindow.BringToFront();
|
this.pluginWindow.BringToFront();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opens the <see cref="PluginInstallerWindow"/> on the plugin installed.
|
||||||
|
/// </summary>
|
||||||
|
public void OpenPluginInstallerPluginInstalled()
|
||||||
|
{
|
||||||
|
this.pluginWindow.OpenInstalledPlugins();
|
||||||
|
this.pluginWindow.BringToFront();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Opens the <see cref="PluginInstallerWindow"/> on the plugin changelogs.
|
/// Opens the <see cref="PluginInstallerWindow"/> on the plugin changelogs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -432,6 +441,15 @@ internal class DalamudInterface : IDisposable, IServiceType
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the current search text for the plugin installer.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="text">The search term.</param>
|
||||||
|
public void SetPluginInstallerSearchText(string text)
|
||||||
|
{
|
||||||
|
this.pluginWindow.SetSearchText(text);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Toggle the screen darkening effect used for the credits.
|
/// Toggle the screen darkening effect used for the credits.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
private bool hasDevPlugins = false;
|
private bool hasDevPlugins = false;
|
||||||
|
|
||||||
private string searchText = string.Empty;
|
private string searchText = string.Empty;
|
||||||
|
private bool isSearchTextPrefilled = false;
|
||||||
|
|
||||||
private PluginSortKind sortKind = PluginSortKind.Alphabetical;
|
private PluginSortKind sortKind = PluginSortKind.Alphabetical;
|
||||||
private string filterText = Locs.SortBy_Alphabetical;
|
private string filterText = Locs.SortBy_Alphabetical;
|
||||||
|
|
@ -202,7 +203,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
_ = pluginManager.ReloadPluginMastersAsync();
|
_ = pluginManager.ReloadPluginMastersAsync();
|
||||||
|
|
||||||
this.searchText = string.Empty;
|
if (!this.isSearchTextPrefilled) this.searchText = string.Empty;
|
||||||
this.sortKind = PluginSortKind.Alphabetical;
|
this.sortKind = PluginSortKind.Alphabetical;
|
||||||
this.filterText = Locs.SortBy_Alphabetical;
|
this.filterText = Locs.SortBy_Alphabetical;
|
||||||
|
|
||||||
|
|
@ -218,6 +219,12 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
public override void OnClose()
|
public override void OnClose()
|
||||||
{
|
{
|
||||||
Service<DalamudConfiguration>.Get().QueueSave();
|
Service<DalamudConfiguration>.Get().QueueSave();
|
||||||
|
|
||||||
|
if (this.isSearchTextPrefilled)
|
||||||
|
{
|
||||||
|
this.isSearchTextPrefilled = false;
|
||||||
|
this.searchText = string.Empty;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|
@ -244,6 +251,18 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
this.imageCache.ClearIconCache();
|
this.imageCache.ClearIconCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Open the window on the plugin changelogs.
|
||||||
|
/// </summary>
|
||||||
|
public void OpenInstalledPlugins()
|
||||||
|
{
|
||||||
|
// Installed group
|
||||||
|
this.categoryManager.CurrentGroupIdx = 1;
|
||||||
|
// All category
|
||||||
|
this.categoryManager.CurrentCategoryIdx = 0;
|
||||||
|
this.IsOpen = true;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Open the window on the plugin changelogs.
|
/// Open the window on the plugin changelogs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -256,6 +275,16 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
this.IsOpen = true;
|
this.IsOpen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the current search text and marks it as prefilled.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="text">The search term.</param>
|
||||||
|
public void SetSearchText(string text)
|
||||||
|
{
|
||||||
|
this.isSearchTextPrefilled = true;
|
||||||
|
this.searchText = text;
|
||||||
|
}
|
||||||
|
|
||||||
private void DrawProgressOverlay()
|
private void DrawProgressOverlay()
|
||||||
{
|
{
|
||||||
var pluginManager = Service<PluginManager>.Get();
|
var pluginManager = Service<PluginManager>.Get();
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ using Dalamud.Game.Text.SeStringHandling;
|
||||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
|
using Dalamud.Interface.Internal.Windows.PluginInstaller;
|
||||||
using Dalamud.Plugin.Internal;
|
using Dalamud.Plugin.Internal;
|
||||||
using Dalamud.Plugin.Internal.Types;
|
using Dalamud.Plugin.Internal.Types;
|
||||||
using Dalamud.Plugin.Ipc;
|
using Dalamud.Plugin.Ipc;
|
||||||
|
|
@ -194,6 +195,24 @@ public sealed class DalamudPluginInterface : IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> PluginInternalNames => Service<PluginManager>.Get().InstalledPlugins.Select(p => p.Manifest.InternalName).ToList();
|
public List<string> PluginInternalNames => Service<PluginManager>.Get().InstalledPlugins.Select(p => p.Manifest.InternalName).ToList();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opens the <see cref="PluginInstallerWindow"/> with the plugin name set as search target.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Returns false if the DalamudInterface was null.</returns>
|
||||||
|
public bool OpenPluginInstaller()
|
||||||
|
{
|
||||||
|
var dalamudInterface = Service<DalamudInterface>.GetNullable(); // Can be null during boot
|
||||||
|
if (dalamudInterface == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
dalamudInterface.OpenPluginInstallerPluginInstalled();
|
||||||
|
dalamudInterface.SetPluginInstallerSearchText(this.pluginName);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#region IPC
|
#region IPC
|
||||||
|
|
||||||
/// <inheritdoc cref="DataShare.GetOrCreateData{T}"/>
|
/// <inheritdoc cref="DataShare.GetOrCreateData{T}"/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue