mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Use EquipItem in item management and add filters to changed item types.
This commit is contained in:
parent
5fcb07487e
commit
d9c5c053cf
19 changed files with 641 additions and 375 deletions
|
|
@ -2,7 +2,6 @@ using System;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Dalamud.Plugin;
|
||||
using ImGuiNET;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
|
|
@ -21,6 +20,8 @@ using Penumbra.Interop.Services;
|
|||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.UI.Tabs;
|
||||
using ChangedItemClick = Penumbra.Communication.ChangedItemClick;
|
||||
using ChangedItemHover = Penumbra.Communication.ChangedItemHover;
|
||||
|
||||
namespace Penumbra;
|
||||
|
||||
|
|
@ -50,16 +51,17 @@ public class Penumbra : IDalamudPlugin
|
|||
public Penumbra(DalamudPluginInterface pluginInterface)
|
||||
{
|
||||
try
|
||||
{
|
||||
{
|
||||
var startTimer = new StartTracker();
|
||||
using var timer = startTimer.Measure(StartTimeType.Total);
|
||||
using var timer = startTimer.Measure(StartTimeType.Total);
|
||||
_services = ServiceManager.CreateProvider(this, pluginInterface, Log, startTimer);
|
||||
ChatService = _services.GetRequiredService<ChatService>();
|
||||
_validityChecker = _services.GetRequiredService<ValidityChecker>();
|
||||
var startup = _services.GetRequiredService<DalamudServices>().GetDalamudConfig(DalamudServices.WaitingForPluginsOption, out bool s)
|
||||
? s.ToString()
|
||||
: "Unknown";
|
||||
Log.Information($"Loading Penumbra Version {_validityChecker.Version}, Commit #{_validityChecker.CommitHash} with Waiting For Plugins: {startup}...");
|
||||
Log.Information(
|
||||
$"Loading Penumbra Version {_validityChecker.Version}, Commit #{_validityChecker.CommitHash} with Waiting For Plugins: {startup}...");
|
||||
_services.GetRequiredService<BackupService>(); // Initialize because not required anywhere else.
|
||||
_config = _services.GetRequiredService<Configuration>();
|
||||
_characterUtility = _services.GetRequiredService<CharacterUtility>();
|
||||
|
|
@ -72,7 +74,7 @@ public class Penumbra : IDalamudPlugin
|
|||
_redrawService = _services.GetRequiredService<RedrawService>();
|
||||
_communicatorService = _services.GetRequiredService<CommunicatorService>();
|
||||
_services.GetRequiredService<ResourceService>(); // Initialize because not required anywhere else.
|
||||
_services.GetRequiredService<ModCacheManager>(); // Initialize because not required anywhere else.
|
||||
_services.GetRequiredService<ModCacheManager>(); // Initialize because not required anywhere else.
|
||||
_collectionManager.Caches.CreateNecessaryCaches();
|
||||
using (var t = _services.GetRequiredService<StartTracker>().Measure(StartTimeType.PathResolver))
|
||||
{
|
||||
|
|
@ -91,8 +93,8 @@ public class Penumbra : IDalamudPlugin
|
|||
if (_characterUtility.Ready)
|
||||
_residentResources.Reload();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error($"Error constructing Penumbra, Disposing again:\n{ex}");
|
||||
Dispose();
|
||||
throw;
|
||||
|
|
@ -104,16 +106,17 @@ public class Penumbra : IDalamudPlugin
|
|||
using var timer = _services.GetRequiredService<StartTracker>().Measure(StartTimeType.Api);
|
||||
var api = _services.GetRequiredService<IPenumbraApi>();
|
||||
_services.GetRequiredService<PenumbraIpcProviders>();
|
||||
api.ChangedItemTooltip += it =>
|
||||
_communicatorService.ChangedItemHover.Subscribe(it =>
|
||||
{
|
||||
if (it is Item)
|
||||
ImGui.TextUnformatted("Left Click to create an item link in chat.");
|
||||
};
|
||||
api.ChangedItemClicked += (button, it) =>
|
||||
}, ChangedItemHover.Priority.Link);
|
||||
|
||||
_communicatorService.ChangedItemClick.Subscribe((button, it) =>
|
||||
{
|
||||
if (button == MouseButton.Left && it is Item item)
|
||||
ChatService.LinkItem(item);
|
||||
};
|
||||
}, ChangedItemClick.Priority.Link);
|
||||
}
|
||||
|
||||
private void SetupInterface()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue