Resolved issue w/ invalid style
This commit is contained in:
@@ -101,19 +101,33 @@ public sealed class ChatLogWindow : Window, IUiComponent {
|
|||||||
|
|
||||||
public override void PreDraw()
|
public override void PreDraw()
|
||||||
{
|
{
|
||||||
if (Plugin.Config.OverrideStyle)
|
if (Plugin.Config.OverrideStyle && Plugin.Config.ChosenStyle != "")
|
||||||
{
|
{
|
||||||
var styles = StyleModel.GetConfiguredStyles();
|
var styles = StyleModel.GetConfiguredStyles();
|
||||||
styles?.First(style => style.Name.Equals(Plugin.Config.ChosenStyle)).Push();
|
try
|
||||||
|
{
|
||||||
|
styles?.First(style => style.Name.Equals(Plugin.Config.ChosenStyle)).Push();
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException e)
|
||||||
|
{
|
||||||
|
// Swallow the error - User does not have a valid style set
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PostDraw()
|
public override void PostDraw()
|
||||||
{
|
{
|
||||||
if (Plugin.Config.OverrideStyle)
|
if (Plugin.Config.OverrideStyle && Plugin.Config.ChosenStyle != "")
|
||||||
{
|
{
|
||||||
var styles = StyleModel.GetConfiguredStyles();
|
var styles = StyleModel.GetConfiguredStyles();
|
||||||
styles?.First(style => style.Name.Equals(Plugin.Config.ChosenStyle)).Pop();
|
try
|
||||||
|
{
|
||||||
|
styles?.First(style => style.Name.Equals(Plugin.Config.ChosenStyle)).Pop();
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException e)
|
||||||
|
{
|
||||||
|
// Swallow the error - User does not have a valid style set
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+18
-4
@@ -25,10 +25,17 @@ internal class Popout : Window
|
|||||||
|
|
||||||
public override void PreDraw()
|
public override void PreDraw()
|
||||||
{
|
{
|
||||||
if (ChatLogWindow.Plugin.Config.OverrideStyle)
|
if (ChatLogWindow.Plugin.Config.OverrideStyle && ChatLogWindow.Plugin.Config.ChosenStyle != "")
|
||||||
{
|
{
|
||||||
var styles = StyleModel.GetConfiguredStyles();
|
var styles = StyleModel.GetConfiguredStyles();
|
||||||
styles?.First(style => style.Name.Equals(ChatLogWindow.Plugin.Config.ChosenStyle)).Push();
|
try
|
||||||
|
{
|
||||||
|
styles?.First(style => style.Name.Equals(ChatLogWindow.Plugin.Config.ChosenStyle)).Push();
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException e)
|
||||||
|
{
|
||||||
|
// Swallow the error - User does not have a valid style set
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Flags = ImGuiWindowFlags.None;
|
Flags = ImGuiWindowFlags.None;
|
||||||
if (!ChatLogWindow.Plugin.Config.ShowPopOutTitleBar)
|
if (!ChatLogWindow.Plugin.Config.ShowPopOutTitleBar)
|
||||||
@@ -59,10 +66,17 @@ internal class Popout : Window
|
|||||||
{
|
{
|
||||||
|
|
||||||
ChatLogWindow.PopOutDocked[Idx] = ImGui.IsWindowDocked();
|
ChatLogWindow.PopOutDocked[Idx] = ImGui.IsWindowDocked();
|
||||||
if (ChatLogWindow.Plugin.Config.OverrideStyle)
|
if (ChatLogWindow.Plugin.Config.OverrideStyle && ChatLogWindow.Plugin.Config.ChosenStyle != "")
|
||||||
{
|
{
|
||||||
var styles = StyleModel.GetConfiguredStyles();
|
var styles = StyleModel.GetConfiguredStyles();
|
||||||
styles?.First(style => style.Name.Equals(ChatLogWindow.Plugin.Config.ChosenStyle)).Pop();
|
try
|
||||||
|
{
|
||||||
|
styles?.First(style => style.Name.Equals(ChatLogWindow.Plugin.Config.ChosenStyle)).Pop();
|
||||||
|
}
|
||||||
|
catch (InvalidOperationException e)
|
||||||
|
{
|
||||||
|
// Swallow the error - User does not have a valid style set
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user