mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Implement GetDesignListExtended.
This commit is contained in:
parent
c7d1620c1e
commit
9a684c9ff5
4 changed files with 9 additions and 3 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5e5c867a095eecac0dd494b30a33298a65e46426
|
Subproject commit 2158bd4bbcb6cefe3ce48e6d8b32e134cbee9a91
|
||||||
|
|
@ -6,11 +6,16 @@ using OtterGui.Services;
|
||||||
|
|
||||||
namespace Glamourer.Api;
|
namespace Glamourer.Api;
|
||||||
|
|
||||||
public class DesignsApi(ApiHelpers helpers, DesignManager designs, StateManager stateManager) : IGlamourerApiDesigns, IApiService
|
public class DesignsApi(ApiHelpers helpers, DesignManager designs, StateManager stateManager, DesignFileSystem fileSystem, DesignColors color)
|
||||||
|
: IGlamourerApiDesigns, IApiService
|
||||||
{
|
{
|
||||||
public Dictionary<Guid, string> GetDesignList()
|
public Dictionary<Guid, string> GetDesignList()
|
||||||
=> designs.Designs.ToDictionary(d => d.Identifier, d => d.Name.Text);
|
=> designs.Designs.ToDictionary(d => d.Identifier, d => d.Name.Text);
|
||||||
|
|
||||||
|
public Dictionary<Guid, (string DisplayName, string FullPath, uint DisplayColor, bool ShownInQdb)> GetDesignListExtended()
|
||||||
|
=> designs.Designs.ToDictionary(d => d.Identifier,
|
||||||
|
d => (d.Name.Text, fileSystem.FindLeaf(d, out var leaf) ? leaf.FullName() : d.Name.Text, color.GetColor(d), d.QuickDesign));
|
||||||
|
|
||||||
public GlamourerApiEc ApplyDesign(Guid designId, int objectIndex, uint key, ApplyFlag flags)
|
public GlamourerApiEc ApplyDesign(Guid designId, int objectIndex, uint key, ApplyFlag flags)
|
||||||
{
|
{
|
||||||
var args = ApiHelpers.Args("Design", designId, "Index", objectIndex, "Key", key, "Flags", flags);
|
var args = ApiHelpers.Args("Design", designId, "Index", objectIndex, "Key", key, "Flags", flags);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ namespace Glamourer.Api;
|
||||||
public class GlamourerApi(DesignsApi designs, StateApi state, ItemsApi items) : IGlamourerApi, IApiService
|
public class GlamourerApi(DesignsApi designs, StateApi state, ItemsApi items) : IGlamourerApi, IApiService
|
||||||
{
|
{
|
||||||
public const int CurrentApiVersionMajor = 1;
|
public const int CurrentApiVersionMajor = 1;
|
||||||
public const int CurrentApiVersionMinor = 4;
|
public const int CurrentApiVersionMinor = 5;
|
||||||
|
|
||||||
public (int Major, int Minor) ApiVersion
|
public (int Major, int Minor) ApiVersion
|
||||||
=> (CurrentApiVersionMajor, CurrentApiVersionMinor);
|
=> (CurrentApiVersionMajor, CurrentApiVersionMinor);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ public sealed class IpcProviders : IDisposable, IApiService
|
||||||
IpcSubscribers.ApiVersion.Provider(pi, api),
|
IpcSubscribers.ApiVersion.Provider(pi, api),
|
||||||
|
|
||||||
IpcSubscribers.GetDesignList.Provider(pi, api.Designs),
|
IpcSubscribers.GetDesignList.Provider(pi, api.Designs),
|
||||||
|
IpcSubscribers.GetDesignListExtended.Provider(pi, api.Designs),
|
||||||
IpcSubscribers.ApplyDesign.Provider(pi, api.Designs),
|
IpcSubscribers.ApplyDesign.Provider(pi, api.Designs),
|
||||||
IpcSubscribers.ApplyDesignName.Provider(pi, api.Designs),
|
IpcSubscribers.ApplyDesignName.Provider(pi, api.Designs),
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue