mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-21 23:17:43 +01:00
.
This commit is contained in:
parent
7710cfadfa
commit
2d6fd6015d
88 changed files with 2304 additions and 383 deletions
|
|
@ -9,7 +9,7 @@ using OtterGui.Log;
|
|||
|
||||
namespace Glamourer;
|
||||
|
||||
public partial class Glamourer : IDalamudPlugin
|
||||
public class Item : IDalamudPlugin
|
||||
{
|
||||
public string Name
|
||||
=> "Glamourer";
|
||||
|
|
@ -20,26 +20,22 @@ public partial class Glamourer : IDalamudPlugin
|
|||
Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "Unknown";
|
||||
|
||||
|
||||
public static readonly Logger Log = new();
|
||||
public static ChatService ChatService { get; private set; } = null!;
|
||||
private readonly ServiceProvider _services;
|
||||
public static readonly Logger Log = new();
|
||||
public static ChatService Chat { get; private set; } = null!;
|
||||
|
||||
public Glamourer(DalamudPluginInterface pluginInterface)
|
||||
|
||||
private readonly ServiceProvider _services;
|
||||
|
||||
public Item(DalamudPluginInterface pluginInterface)
|
||||
{
|
||||
try
|
||||
{
|
||||
_services = ServiceManager.CreateProvider(pluginInterface, Log);
|
||||
ChatService = _services.GetRequiredService<ChatService>();
|
||||
_services.GetRequiredService<BackupService>();
|
||||
_services.GetRequiredService<GlamourerWindowSystem>();
|
||||
_services.GetRequiredService<CommandService>();
|
||||
_services.GetRequiredService<GlamourerIpc>();
|
||||
_services.GetRequiredService<ChangeCustomizeService>();
|
||||
_services.GetRequiredService<JobService>();
|
||||
_services.GetRequiredService<UpdateSlotService>();
|
||||
_services.GetRequiredService<VisorService>();
|
||||
_services.GetRequiredService<WeaponService>();
|
||||
_services.GetRequiredService<RedrawManager>();
|
||||
_services = ServiceManager.CreateProvider(pluginInterface, Log);
|
||||
Chat = _services.GetRequiredService<ChatService>();
|
||||
_services.GetRequiredService<BackupService>(); // call backup service.
|
||||
_services.GetRequiredService<GlamourerWindowSystem>(); // initialize ui.
|
||||
_services.GetRequiredService<CommandService>(); // initialize commands.
|
||||
_services.GetRequiredService<VisorService>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -53,137 +49,4 @@ public partial class Glamourer : IDalamudPlugin
|
|||
{
|
||||
_services?.Dispose();
|
||||
}
|
||||
|
||||
//private static GameObject? GetPlayer(string name)
|
||||
//{
|
||||
// var lowerName = name.ToLowerInvariant();
|
||||
// return lowerName switch
|
||||
// {
|
||||
// "" => null,
|
||||
// "<me>" => Dalamud.Objects[Interface.GPoseObjectId] ?? Dalamud.ClientState.LocalPlayer,
|
||||
// "self" => Dalamud.Objects[Interface.GPoseObjectId] ?? Dalamud.ClientState.LocalPlayer,
|
||||
// "<t>" => Dalamud.Targets.Target,
|
||||
// "target" => Dalamud.Targets.Target,
|
||||
// "<f>" => Dalamud.Targets.FocusTarget,
|
||||
// "focus" => Dalamud.Targets.FocusTarget,
|
||||
// "<mo>" => Dalamud.Targets.MouseOverTarget,
|
||||
// "mouseover" => Dalamud.Targets.MouseOverTarget,
|
||||
// _ => Dalamud.Objects.LastOrDefault(
|
||||
// a => string.Equals(a.Name.ToString(), lowerName, StringComparison.InvariantCultureIgnoreCase)),
|
||||
// };
|
||||
//}
|
||||
//
|
||||
//public void CopyToClipboard(Character player)
|
||||
//{
|
||||
// var save = new CharacterSave();
|
||||
// save.LoadCharacter(player);
|
||||
// ImGui.SetClipboardText(save.ToBase64());
|
||||
//}
|
||||
//
|
||||
//public void ApplyCommand(Character player, string target)
|
||||
//{
|
||||
// CharacterSave? save = null;
|
||||
// if (target.ToLowerInvariant() == "clipboard")
|
||||
// try
|
||||
// {
|
||||
// save = CharacterSave.FromString(ImGui.GetClipboardText());
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// Dalamud.Chat.PrintError("Clipboard does not contain a valid customization string.");
|
||||
// }
|
||||
// else if (!Designs.FileSystem.Find(target, out var child) || child is not Design d)
|
||||
// Dalamud.Chat.PrintError("The given path to a saved design does not exist or does not point to a design.");
|
||||
// else
|
||||
// save = d.Data;
|
||||
//
|
||||
// save?.Apply(player);
|
||||
// Penumbra.UpdateCharacters(player);
|
||||
//}
|
||||
//
|
||||
//public void SaveCommand(Character player, string path)
|
||||
//{
|
||||
// var save = new CharacterSave();
|
||||
// save.LoadCharacter(player);
|
||||
// try
|
||||
// {
|
||||
// var (folder, name) = Designs.FileSystem.CreateAllFolders(path);
|
||||
// var design = new Design(folder, name) { Data = save };
|
||||
// folder.FindOrAddChild(design);
|
||||
// Designs.Designs.Add(design.FullName(), design.Data);
|
||||
// Designs.SaveToFile();
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// Dalamud.Chat.PrintError("Could not save file:");
|
||||
// Dalamud.Chat.PrintError($" {e.Message}");
|
||||
// }
|
||||
//}
|
||||
//
|
||||
public void OnGlamour(string command, string arguments)
|
||||
{
|
||||
//static void PrintHelp()
|
||||
//{
|
||||
// Dalamud.Chat.Print("Usage:");
|
||||
// Dalamud.Chat.Print($" {HelpString}");
|
||||
//}
|
||||
|
||||
//arguments = arguments.Trim();
|
||||
//if (!arguments.Any())
|
||||
//{
|
||||
// PrintHelp();
|
||||
// return;
|
||||
//}
|
||||
//
|
||||
//var split = arguments.Split(new[]
|
||||
//{
|
||||
// ',',
|
||||
//}, 3, StringSplitOptions.RemoveEmptyEntries);
|
||||
//
|
||||
//if (split.Length < 2)
|
||||
//{
|
||||
// PrintHelp();
|
||||
// return;
|
||||
//}
|
||||
//
|
||||
//var player = GetPlayer(split[1]) as Character;
|
||||
//if (player == null)
|
||||
//{
|
||||
// Dalamud.Chat.Print($"Could not find object for {split[1]} or it was not a Character.");
|
||||
// return;
|
||||
//}
|
||||
//
|
||||
//switch (split[0].ToLowerInvariant())
|
||||
//{
|
||||
// case "copy":
|
||||
// CopyToClipboard(player);
|
||||
// return;
|
||||
// case "apply":
|
||||
// {
|
||||
// if (split.Length < 3)
|
||||
// {
|
||||
// Dalamud.Chat.Print("Applying requires a name for the save to be applied or 'clipboard'.");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// ApplyCommand(player, split[2]);
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
// case "save":
|
||||
// {
|
||||
// if (split.Length < 3)
|
||||
// {
|
||||
// Dalamud.Chat.Print("Saving requires a name for the save.");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// SaveCommand(player, split[2]);
|
||||
// return;
|
||||
// }
|
||||
// default:
|
||||
// PrintHelp();
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue