Just null check the styles
This commit is contained in:
@@ -87,6 +87,7 @@ internal sealed class About : ISettingsTab {
|
||||
ImGui.EndChild();
|
||||
}
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.PopTextWrapPos();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,5 +60,7 @@ internal sealed class ChatColours : ISettingsTab {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.Spacing();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,5 +126,7 @@ internal sealed class Database : ISettingsTab
|
||||
ImGui.PopTextWrapPos();
|
||||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
ImGui.Spacing();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,19 +101,26 @@ internal sealed class Display : ISettingsTab {
|
||||
|
||||
if (Mutable.OverrideStyle)
|
||||
{
|
||||
var currentStyle = Mutable.ChosenStyle.Equals("") ? StyleModel.GetConfiguredStyle().Name : Mutable.ChosenStyle;
|
||||
if (ImGui.BeginCombo(Language.Options_OverrideStyleDropdown_Name, currentStyle)) {
|
||||
foreach (var style in StyleModel.GetConfiguredStyles()) {
|
||||
if (ImGui.Selectable(style.Name, Mutable.ChosenStyle == style.Name)) {
|
||||
Mutable.ChosenStyle = style.Name;
|
||||
}
|
||||
}
|
||||
var styles = StyleModel.GetConfiguredStyles();
|
||||
if (styles != null)
|
||||
{
|
||||
var currentStyle = Mutable.ChosenStyle ?? Language.Options_OverrideStyle_NotSelected;
|
||||
if (ImGui.BeginCombo(Language.Options_OverrideStyleDropdown_Name, currentStyle))
|
||||
{
|
||||
foreach (var style in styles)
|
||||
if (ImGui.Selectable(style.Name, Mutable.ChosenStyle == style.Name))
|
||||
Mutable.ChosenStyle = style.Name;
|
||||
|
||||
ImGui.EndCombo();
|
||||
ImGui.EndCombo();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.TextUnformatted(Language.Options_OverrideStyle_NotAvailable);
|
||||
}
|
||||
}
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.PopTextWrapPos();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +113,7 @@ public class Fonts : ISettingsTab {
|
||||
ImGuiUtil.DragFloatVertical(Language.Options_SymbolsFontSize_Name, ref Mutable.SymbolsFontSize, speed, min, max, $"{Mutable.SymbolsFontSize:N1}");
|
||||
ImGuiUtil.HelpText(Language.Options_SymbolsFontSize_Description);
|
||||
|
||||
ImGui.Spacing();
|
||||
ImGui.PopTextWrapPos();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ internal sealed class Miscellaneous : ISettingsTab {
|
||||
|
||||
ImGui.Checkbox(Language.Options_SortAutoTranslate_Name, ref Mutable.SortAutoTranslate);
|
||||
ImGuiUtil.HelpText(Language.Options_SortAutoTranslate_Description);
|
||||
|
||||
ImGui.Spacing();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user