mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Fix Migration Issue
This commit is contained in:
parent
ebab6e28c9
commit
bbbc7e9ada
2 changed files with 11 additions and 10 deletions
|
|
@ -14,7 +14,7 @@ namespace Glamourer.Automation;
|
|||
public class FixedDesignMigrator
|
||||
{
|
||||
private readonly JobService _jobs;
|
||||
private Dictionary<string, (bool, List<(string, JobGroup)>)>? _migratedData;
|
||||
private List<(string Name, bool Enabled, List<(string, JobGroup)> Data)>? _migratedData;
|
||||
|
||||
public FixedDesignMigrator(JobService jobs)
|
||||
=> _jobs = jobs;
|
||||
|
|
@ -26,13 +26,13 @@ public class FixedDesignMigrator
|
|||
|
||||
foreach (var data in _migratedData)
|
||||
{
|
||||
var enabled = data.Value.Item1;
|
||||
var name = data.Key + (data.Value.Item1 ? " (Enabled)" : " (Disabled)");
|
||||
if (autoManager.Any(d => name == data.Key))
|
||||
var enabled = data.Enabled;
|
||||
var name = data.Name + (enabled ? " (Enabled)" : " (Disabled)");
|
||||
if (autoManager.Any(d => name == d.Name))
|
||||
continue;
|
||||
|
||||
var id = ActorIdentifier.Invalid;
|
||||
if (ByteString.FromString(data.Key, out var byteString, false))
|
||||
if (ByteString.FromString(data.Name, out var byteString, false))
|
||||
{
|
||||
id = actors.AwaitedService.CreatePlayer(byteString, ushort.MaxValue);
|
||||
if (!id.IsValid)
|
||||
|
|
@ -46,7 +46,7 @@ public class FixedDesignMigrator
|
|||
enabled = false;
|
||||
if (!id.IsValid)
|
||||
{
|
||||
Glamourer.Chat.NotificationMessage($"Could not migrate fixed design {data.Key}.", "Error", NotificationType.Error);
|
||||
Glamourer.Chat.NotificationMessage($"Could not migrate fixed design {data.Name}.", "Error", NotificationType.Error);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ public class FixedDesignMigrator
|
|||
autoManager.AddDesignSet(name, id);
|
||||
autoManager.SetState(autoManager.Count - 1, enabled);
|
||||
var set = autoManager[^1];
|
||||
foreach (var design in data.Value.Item2)
|
||||
foreach (var design in data.Data)
|
||||
{
|
||||
if (!designFileSystem.Find(design.Item1, out var child) || child is not DesignFileSystem.Leaf leaf)
|
||||
{
|
||||
|
|
@ -106,6 +106,7 @@ public class FixedDesignMigrator
|
|||
}
|
||||
|
||||
_migratedData = list.GroupBy(t => (t.Name, t.Enabled))
|
||||
.ToDictionary(kvp => kvp.Key.Name, kvp => (kvp.Key.Enabled, kvp.Select(k => (k.Path, k.Group)).ToList()));
|
||||
.Select(kvp => (kvp.Key.Name, kvp.Key.Enabled, kvp.Select(k => (k.Path, k.Group)).ToList()))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ public class UnlockTable : Table<EquipItem>, IDisposable
|
|||
return;
|
||||
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted(time == DateTimeOffset.MinValue ? "Always" : time.ToString("g"));
|
||||
ImGui.TextUnformatted(time == DateTimeOffset.MinValue ? "Always" : time.LocalDateTime.ToString("g"));
|
||||
}
|
||||
|
||||
public override int Compare(EquipItem lhs, EquipItem rhs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue