mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-14 20:54:17 +01:00
avoid static where reasonable
This commit is contained in:
parent
62a58663ff
commit
9ba9e049fb
2 changed files with 6 additions and 5 deletions
|
|
@ -16,15 +16,16 @@ namespace Glamourer.Api
|
||||||
{
|
{
|
||||||
public const string LabelProviderGetCharacterCustomization = "Glamourer.GetCharacterCustomization";
|
public const string LabelProviderGetCharacterCustomization = "Glamourer.GetCharacterCustomization";
|
||||||
public const string LabelProviderApplyCharacterCustomization = "Glamourer.ApplyCharacterCustomization";
|
public const string LabelProviderApplyCharacterCustomization = "Glamourer.ApplyCharacterCustomization";
|
||||||
|
private readonly ClientState clientState;
|
||||||
private readonly ObjectTable objectTable;
|
private readonly ObjectTable objectTable;
|
||||||
private readonly DalamudPluginInterface pi;
|
private readonly DalamudPluginInterface pi;
|
||||||
|
|
||||||
internal ICallGateProvider<string>? ProviderGetCharacterCustomization;
|
internal ICallGateProvider<string>? ProviderGetCharacterCustomization;
|
||||||
internal ICallGateProvider<string, string, object>? ProviderApplyCharacterCustomization;
|
internal ICallGateProvider<string, string, object>? ProviderApplyCharacterCustomization;
|
||||||
|
|
||||||
public GlamourerIpc(ObjectTable objectTable, DalamudPluginInterface pi)
|
public GlamourerIpc(ClientState clientState, ObjectTable objectTable, DalamudPluginInterface pi)
|
||||||
{
|
{
|
||||||
|
this.clientState = clientState;
|
||||||
this.objectTable = objectTable;
|
this.objectTable = objectTable;
|
||||||
this.pi = pi;
|
this.pi = pi;
|
||||||
|
|
||||||
|
|
@ -82,7 +83,7 @@ namespace Glamourer.Api
|
||||||
private string GetCharacterCustomization()
|
private string GetCharacterCustomization()
|
||||||
{
|
{
|
||||||
CharacterSave save = new CharacterSave();
|
CharacterSave save = new CharacterSave();
|
||||||
save.LoadCharacter((Character)Glamourer.GetPlayer("self")!);
|
save.LoadCharacter(clientState.LocalPlayer!);
|
||||||
return save.ToBase64();
|
return save.ToBase64();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Glamourer
|
||||||
Designs = new DesignManager();
|
Designs = new DesignManager();
|
||||||
Penumbra = new PenumbraAttach(Config.AttachToPenumbra);
|
Penumbra = new PenumbraAttach(Config.AttachToPenumbra);
|
||||||
PlayerWatcher = PlayerWatchFactory.Create(Dalamud.Framework, Dalamud.ClientState, Dalamud.Objects);
|
PlayerWatcher = PlayerWatchFactory.Create(Dalamud.Framework, Dalamud.ClientState, Dalamud.Objects);
|
||||||
GlamourerIpc = new(Dalamud.Objects, pluginInterface);
|
GlamourerIpc = new GlamourerIpc(Dalamud.ClientState, Dalamud.Objects, Dalamud.PluginInterface);
|
||||||
if (!Config.ApplyFixedDesigns)
|
if (!Config.ApplyFixedDesigns)
|
||||||
PlayerWatcher.Disable();
|
PlayerWatcher.Disable();
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Glamourer
|
||||||
public void OnGlamourer(string command, string arguments)
|
public void OnGlamourer(string command, string arguments)
|
||||||
=> _interface.ToggleVisibility();
|
=> _interface.ToggleVisibility();
|
||||||
|
|
||||||
public static GameObject? GetPlayer(string name)
|
private static GameObject? GetPlayer(string name)
|
||||||
{
|
{
|
||||||
var lowerName = name.ToLowerInvariant();
|
var lowerName = name.ToLowerInvariant();
|
||||||
return lowerName switch
|
return lowerName switch
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue