fix: sort chat colours
This commit is contained in:
@@ -15,10 +15,26 @@ internal sealed class ChatColours : ISettingsTab {
|
|||||||
internal ChatColours(Configuration mutable, Plugin plugin) {
|
internal ChatColours(Configuration mutable, Plugin plugin) {
|
||||||
this.Mutable = mutable;
|
this.Mutable = mutable;
|
||||||
this.Plugin = plugin;
|
this.Plugin = plugin;
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
var sortable = ChatTypeExt.SortOrder
|
||||||
|
.SelectMany(entry => entry.Item2)
|
||||||
|
.Where(type => !type.IsGm())
|
||||||
|
.ToHashSet();
|
||||||
|
var total = Enum.GetValues<ChatType>().Where(type => !type.IsGm()).ToHashSet();
|
||||||
|
if (sortable.Count != total.Count) {
|
||||||
|
Dalamud.Logging.PluginLog.Warning($"There are {sortable.Count} sortable channels, but there are {total.Count} total channels.");
|
||||||
|
total.ExceptWith(sortable);
|
||||||
|
foreach (var missing in total) {
|
||||||
|
Dalamud.Logging.PluginLog.Log($"Missing {missing}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Draw() {
|
public void Draw() {
|
||||||
foreach (var type in Enum.GetValues<ChatType>()) {
|
foreach (var (_, types) in ChatTypeExt.SortOrder) {
|
||||||
|
foreach (var type in types) {
|
||||||
if (ImGuiUtil.IconButton(FontAwesomeIcon.UndoAlt, $"{type}", Language.Options_ChatColours_Reset)) {
|
if (ImGuiUtil.IconButton(FontAwesomeIcon.UndoAlt, $"{type}", Language.Options_ChatColours_Reset)) {
|
||||||
this.Mutable.ChatColours.Remove(type);
|
this.Mutable.ChatColours.Remove(type);
|
||||||
}
|
}
|
||||||
@@ -39,6 +55,7 @@ internal sealed class ChatColours : ISettingsTab {
|
|||||||
this.Mutable.ChatColours[type] = ColourUtil.Vector3ToRgba(vec);
|
this.Mutable.ChatColours[type] = ColourUtil.Vector3ToRgba(vec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.TreePop();
|
ImGui.TreePop();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user