Mark old conditions as obsolete and add migration
This commit is contained in:
parent
19f1934de0
commit
d8ee7430bb
|
@ -40,17 +40,20 @@ namespace HudSwap {
|
||||||
public Guid roleplayingLayout = Guid.Empty;
|
public Guid roleplayingLayout = Guid.Empty;
|
||||||
#pragma warning restore CA1051 // Do not declare visible instance fields
|
#pragma warning restore CA1051 // Do not declare visible instance fields
|
||||||
|
|
||||||
|
[Obsolete("Superceded by HudConditionMatches")]
|
||||||
public Dictionary<Status, Guid> StatusLayouts { get; } = new Dictionary<Status, Guid>();
|
public Dictionary<Status, Guid> StatusLayouts { get; } = new Dictionary<Status, Guid>();
|
||||||
|
[Obsolete("Superceded by HudConditionMatches")]
|
||||||
public Dictionary<string, Guid> JobLayouts { get; } = new Dictionary<string, Guid>();
|
public Dictionary<string, Guid> JobLayouts { get; } = new Dictionary<string, Guid>();
|
||||||
|
[Obsolete("Superceded by HudConditionMatches")]
|
||||||
public bool HighPriorityJobs { get; set; } = false;
|
public bool HighPriorityJobs { get; set; } = false;
|
||||||
|
[Obsolete("Superceded by HudConditionMatches")]
|
||||||
public bool JobsCombatOnly { get; set; } = false;
|
public bool JobsCombatOnly { get; set; } = false;
|
||||||
|
|
||||||
[Obsolete("Use Layouts2 instead")]
|
[Obsolete("Use Layouts2 instead")]
|
||||||
public Dictionary<Guid, Tuple<string, byte[]>> Layouts { get; } = new Dictionary<Guid, Tuple<string, byte[]>>();
|
public Dictionary<Guid, Tuple<string, byte[]>> Layouts { get; } = new Dictionary<Guid, Tuple<string, byte[]>>();
|
||||||
public Dictionary<Guid, Layout> Layouts2 { get; } = new Dictionary<Guid, Layout>();
|
public Dictionary<Guid, Layout> Layouts2 { get; } = new Dictionary<Guid, Layout>();
|
||||||
|
|
||||||
public List<HudConditionMatch> HudConditionMatches = new List<HudConditionMatch>();
|
public List<HudConditionMatch> HudConditionMatches { get; } = new List<HudConditionMatch>();
|
||||||
|
|
||||||
public void Initialize(DalamudPluginInterface pluginInterface) {
|
public void Initialize(DalamudPluginInterface pluginInterface) {
|
||||||
this.pi = pluginInterface;
|
this.pi = pluginInterface;
|
||||||
|
@ -106,6 +109,29 @@ namespace HudSwap {
|
||||||
}
|
}
|
||||||
this.Layouts.Clear();
|
this.Layouts.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.JobLayouts.Count != 0) {
|
||||||
|
foreach (var jobLayout in JobLayouts)
|
||||||
|
this.HudConditionMatches.Add(new HudConditionMatch() {
|
||||||
|
ClassJob = jobLayout.Key,
|
||||||
|
Status = JobsCombatOnly ? Status.InCombat : default,
|
||||||
|
LayoutId = jobLayout.Value
|
||||||
|
});
|
||||||
|
|
||||||
|
JobLayouts.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.StatusLayouts.Count != 0) {
|
||||||
|
foreach (var statusLayout in StatusLayouts) {
|
||||||
|
var match = new HudConditionMatch() {Status = statusLayout.Key, LayoutId = statusLayout.Value};
|
||||||
|
if (HighPriorityJobs)
|
||||||
|
this.HudConditionMatches.Add(match);
|
||||||
|
else
|
||||||
|
this.HudConditionMatches.Insert(0, match);
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusLayouts.Clear();
|
||||||
|
}
|
||||||
#pragma warning restore 618
|
#pragma warning restore 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,6 @@ namespace HudSwap {
|
||||||
private string renameName = "";
|
private string renameName = "";
|
||||||
private Guid selectedLayout = Guid.Empty;
|
private Guid selectedLayout = Guid.Empty;
|
||||||
|
|
||||||
private string jobFilter = "";
|
|
||||||
|
|
||||||
private int editingConditionIndex = -1;
|
private int editingConditionIndex = -1;
|
||||||
private HudConditionMatch editingCondition;
|
private HudConditionMatch editingCondition;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user