fix: only set layout when configuring if enabled

This commit is contained in:
Anna 2020-07-30 13:54:45 -04:00
parent bc2187144f
commit 3c49f8d3d0
1 changed files with 6 additions and 2 deletions

View File

@ -208,14 +208,18 @@ namespace HudSwap {
if (ImGui.Selectable("Not set")) {
layout = Guid.Empty;
this.plugin.config.Save();
this.statuses.SetHudLayout(player, true);
if (this.plugin.config.SwapsEnabled) {
this.statuses.SetHudLayout(player, true);
}
}
ImGui.Separator();
foreach (KeyValuePair<Guid, Tuple<string, byte[]>> entry in this.plugin.config.Layouts) {
if (ImGui.Selectable(entry.Value.Item1)) {
layout = entry.Key;
this.plugin.config.Save();
this.statuses.SetHudLayout(player, true);
if (this.plugin.config.SwapsEnabled) {
this.statuses.SetHudLayout(player, true);
}
}
}
ImGui.EndCombo();