feat: mark selected options in dropdowns
This commit is contained in:
parent
c02ac42e9e
commit
358bbe491c
|
@ -713,7 +713,7 @@ namespace HUD_Manager {
|
||||||
var currentScale = $"{element.Scale * 100}%";
|
var currentScale = $"{element.Scale * 100}%";
|
||||||
if (ImGui.BeginCombo($"##scale-{kind}", currentScale)) {
|
if (ImGui.BeginCombo($"##scale-{kind}", currentScale)) {
|
||||||
foreach (var scale in ScaleOptions) {
|
foreach (var scale in ScaleOptions) {
|
||||||
if (!ImGui.Selectable($"{scale * 100}%")) {
|
if (!ImGui.Selectable($"{scale * 100}%", Math.Abs(scale - element.Scale) < float.Epsilon)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -767,7 +767,7 @@ namespace HUD_Manager {
|
||||||
ImGui.PushItemWidth(-1);
|
ImGui.PushItemWidth(-1);
|
||||||
if (ImGui.BeginCombo($"##style-{kind}", statusOpts.Style.Name())) {
|
if (ImGui.BeginCombo($"##style-{kind}", statusOpts.Style.Name())) {
|
||||||
foreach (var style in (StatusStyle[]) Enum.GetValues(typeof(StatusStyle))) {
|
foreach (var style in (StatusStyle[]) Enum.GetValues(typeof(StatusStyle))) {
|
||||||
if (!ImGui.Selectable($"{style.Name()}##{kind}")) {
|
if (!ImGui.Selectable($"{style.Name()}##{kind}", style == statusOpts.Style)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -791,7 +791,7 @@ namespace HUD_Manager {
|
||||||
ImGui.PushItemWidth(-1);
|
ImGui.PushItemWidth(-1);
|
||||||
if (ImGui.BeginCombo($"##layout-{kind}", statusOpts.Layout.Name())) {
|
if (ImGui.BeginCombo($"##layout-{kind}", statusOpts.Layout.Name())) {
|
||||||
foreach (var sLayout in (StatusLayout[]) Enum.GetValues(typeof(StatusLayout))) {
|
foreach (var sLayout in (StatusLayout[]) Enum.GetValues(typeof(StatusLayout))) {
|
||||||
if (!ImGui.Selectable($"{sLayout.Name()}##{kind}")) {
|
if (!ImGui.Selectable($"{sLayout.Name()}##{kind}", sLayout == statusOpts.Layout)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,7 +811,7 @@ namespace HUD_Manager {
|
||||||
ImGui.PushItemWidth(-1);
|
ImGui.PushItemWidth(-1);
|
||||||
if (ImGui.BeginCombo($"##alignment-{kind}", statusOpts.Alignment.Name())) {
|
if (ImGui.BeginCombo($"##alignment-{kind}", statusOpts.Alignment.Name())) {
|
||||||
foreach (var alignment in (StatusAlignment[]) Enum.GetValues(typeof(StatusAlignment))) {
|
foreach (var alignment in (StatusAlignment[]) Enum.GetValues(typeof(StatusAlignment))) {
|
||||||
if (!ImGui.Selectable($"{alignment.Name()}##{kind}")) {
|
if (!ImGui.Selectable($"{alignment.Name()}##{kind}", alignment == statusOpts.Alignment)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -864,7 +864,7 @@ namespace HUD_Manager {
|
||||||
ImGui.PushItemWidth(-1);
|
ImGui.PushItemWidth(-1);
|
||||||
if (ImGui.BeginCombo($"##hotbar-layout-{kind}", hotbarOpts.Layout.Name())) {
|
if (ImGui.BeginCombo($"##hotbar-layout-{kind}", hotbarOpts.Layout.Name())) {
|
||||||
foreach (var hotbarLayout in (HotbarLayout[]) Enum.GetValues(typeof(HotbarLayout))) {
|
foreach (var hotbarLayout in (HotbarLayout[]) Enum.GetValues(typeof(HotbarLayout))) {
|
||||||
if (!ImGui.Selectable($"{hotbarLayout.Name()}##{kind}")) {
|
if (!ImGui.Selectable($"{hotbarLayout.Name()}##{kind}", hotbarLayout == hotbarOpts.Layout)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue