mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-17 21:17:44 +01:00
Fix equip changes not working on designs, rudimentary revert button for players, add beta options to NPC and Monsters
This commit is contained in:
parent
fb909aaf87
commit
31cf5dffcc
11 changed files with 486 additions and 59 deletions
31
Glamourer/Designs/RevertableDesigns.cs
Normal file
31
Glamourer/Designs/RevertableDesigns.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using System.Collections.Generic;
|
||||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
|
||||
namespace Glamourer.Designs
|
||||
{
|
||||
public class RevertableDesigns
|
||||
{
|
||||
public readonly Dictionary<string, CharacterSave> Saves = new();
|
||||
|
||||
public bool Add(Character actor)
|
||||
{
|
||||
var name = actor.Name.ToString();
|
||||
if (Saves.TryGetValue(name, out var save))
|
||||
return false;
|
||||
|
||||
save = new CharacterSave();
|
||||
save.LoadCharacter(actor);
|
||||
Saves[name] = save;
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Revert(Character actor)
|
||||
{
|
||||
if (!Saves.TryGetValue(actor.Name.ToString(), out var save))
|
||||
return false;
|
||||
|
||||
save.Apply(actor);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue