using System; using System.Numerics; using Dalamud.Bindings.ImGui; using LLib.ImGui; namespace Questionable.Windows; internal abstract class ThemedWindow : LWindow { private sealed class ThemeScope(int colors, int styles) : IDisposable { private bool _disposed; public void Dispose() { int num = ((!_disposed) ? (-1959803182) : (-1959803178)); while (true) { int num2 = num; int num3 = -1959803180; int num4 = num2; int num5 = num4 + num3; int num6 = num4 & num3; switch (num5 - (num6 + num6)) { case 4: num = -1959803178; break; case 2: return; case 1: _206A_206C_202B_200C_206C_200C_202B_200F_202D_200E_202C_200B_206C_202D_200D_202D_202C_202E_202E_206E_202D_206C_200F_202E_206D_202D_206B_200C_202B_200D_206E_200E_202E_202D_200E_202E_200F_202A_202D_202B_202E(styles); num = -1959803180; break; case 5: _202C_202E_206B_206D_202A_202C_200F_206E_206C_206A_202E_202E_202A_206B_202D_202E_200D_202C_206C_200D_206D_202A_200B_200D_202D_206E_202B_200B_206E_202B_202E_206B_206F_202D_202D_202B_206B_202E_200C_206A_202E(colors); num = -1959803177; break; case 0: num = ((colors <= 0) ? (-1959803177) : (-1959803183)); break; case 3: return; case 6: _disposed = true; num = ((styles <= 0) ? (-1959803180) : (-1959803179)); break; } } } void IDisposable.Dispose() { //ILSpy generated this explicit interface implementation from .override directive in Dispose this.Dispose(); } static void _206A_206C_202B_200C_206C_200C_202B_200F_202D_200E_202C_200B_206C_202D_200D_202D_202C_202E_202E_206E_202D_206C_200F_202E_206D_202D_206B_200C_202B_200D_206E_200E_202E_202D_200E_202E_200F_202A_202D_202B_202E(int P_0) { ImGui.PopStyleVar(P_0); } static void _202C_202E_206B_206D_202A_202C_200F_206E_206C_206A_202E_202E_202A_206B_202D_202E_200D_202C_206C_200D_206D_202A_200B_200D_202D_206E_202B_200B_206E_202B_202E_206B_206F_202D_202D_202B_206B_202E_200C_206A_202E(int P_0) { ImGui.PopStyleColor(P_0); } } private IDisposable? _theme; protected ThemedWindow(string windowName, ImGuiWindowFlags flags = ImGuiWindowFlags.None, bool forceMainWindow = false) : base(windowName, flags, forceMainWindow) { } public override void PreDraw() { _206D_200B_206C_206B_200B_206B_206B_202E_200B_206B_202C_202D_206D_202D_206C_206F_206F_206D_200E_206E_200E_200C_202A_202B_206F_206B_200F_202B_206E_200E_206C_206D_200F_206D_202A_206C_206A_200D_200F_200C_202E(); _theme = PushTheme(); } public override void PostDraw() { IDisposable? theme = _theme; if (theme != null) { _200F_206E_206B_206C_206C_206D_206A_200D_206D_200C_206A_206A_200C_202E_202D_202C_200B_202D_200B_206D_200D_206E_206E_206C_202D_202B_206C_200F_206C_200B_206D_202B_206B_200C_206B_202E_202D_206C_206D_206B_202E(theme); } _theme = null; _206D_202B_202D_202E_206A_206F_200B_206F_206B_200C_206A_206A_200F_200B_202D_200E_202C_200F_200E_200C_202B_200E_202D_206C_206C_206D_206E_200F_206A_202E_206E_206C_200E_200F_206E_200C_206F_206D_206D_200E_202E(); } public static IDisposable PushTheme() { int colors = 0; int styles = 0; C(ImGuiCol.WindowBg, new Vector4(0.08f, 0.06f, 0.12f, 0.94f)); C(ImGuiCol.ChildBg, new Vector4(0.1f, 0.08f, 0.14f, 0f)); C(ImGuiCol.PopupBg, new Vector4(0.1f, 0.08f, 0.14f, 0.94f)); C(ImGuiCol.Border, new Vector4(0.55f, 0.45f, 0.75f, 0.3f)); C(ImGuiCol.BorderShadow, new Vector4(0f, 0f, 0f, 0f)); C(ImGuiCol.TitleBg, new Vector4(0.12f, 0.08f, 0.18f, 1f)); C(ImGuiCol.TitleBgActive, new Vector4(0.2f, 0.15f, 0.3f, 1f)); C(ImGuiCol.TitleBgCollapsed, new Vector4(0.08f, 0.05f, 0.12f, 0.75f)); C(ImGuiCol.Text, new Vector4(0.95f, 0.95f, 1f, 1f)); C(ImGuiCol.TextDisabled, new Vector4(0.5f, 0.45f, 0.6f, 1f)); C(ImGuiCol.FrameBg, new Vector4(0.25f, 0.2f, 0.35f, 0.7f)); C(ImGuiCol.FrameBgHovered, new Vector4(0.35f, 0.28f, 0.48f, 0.8f)); C(ImGuiCol.FrameBgActive, new Vector4(0.45f, 0.35f, 0.6f, 0.9f)); C(ImGuiCol.ScrollbarBg, new Vector4(0.1f, 0.08f, 0.14f, 0.53f)); C(ImGuiCol.ScrollbarGrab, new Vector4(0.55f, 0.45f, 0.75f, 0.4f)); C(ImGuiCol.ScrollbarGrabHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.6f)); C(ImGuiCol.ScrollbarGrabActive, new Vector4(0.75f, 0.55f, 0.95f, 0.8f)); C(ImGuiCol.Button, new Vector4(0.35f, 0.3f, 0.55f, 0.65f)); C(ImGuiCol.ButtonHovered, new Vector4(0.5f, 0.42f, 0.78f, 0.8f)); C(ImGuiCol.ButtonActive, new Vector4(0.6f, 0.5f, 0.9f, 0.95f)); C(ImGuiCol.Header, new Vector4(0.2f, 0.18f, 0.28f, 0.6f)); C(ImGuiCol.HeaderHovered, new Vector4(0.3f, 0.25f, 0.4f, 0.8f)); C(ImGuiCol.HeaderActive, new Vector4(0.25f, 0.22f, 0.35f, 1f)); C(ImGuiCol.Separator, new Vector4(0.55f, 0.45f, 0.75f, 0.3f)); C(ImGuiCol.SeparatorHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.6f)); C(ImGuiCol.SeparatorActive, new Vector4(0.75f, 0.55f, 0.95f, 0.8f)); C(ImGuiCol.Tab, new Vector4(0.18f, 0.15f, 0.25f, 0.7f)); C(ImGuiCol.TabHovered, new Vector4(0.45f, 0.35f, 0.65f, 0.8f)); C(ImGuiCol.TabActive, new Vector4(0.35f, 0.28f, 0.5f, 1f)); C(ImGuiCol.CheckMark, new Vector4(0.85f, 0.75f, 1f, 1f)); C(ImGuiCol.SliderGrab, new Vector4(0.65f, 0.55f, 0.85f, 0.9f)); C(ImGuiCol.SliderGrabActive, new Vector4(0.75f, 0.55f, 0.95f, 1f)); C(ImGuiCol.ResizeGrip, new Vector4(0.55f, 0.45f, 0.75f, 0.2f)); C(ImGuiCol.ResizeGripHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.67f)); C(ImGuiCol.ResizeGripActive, new Vector4(0.75f, 0.55f, 0.95f, 0.95f)); C(ImGuiCol.TableHeaderBg, new Vector4(0.15f, 0.12f, 0.22f, 1f)); C(ImGuiCol.TableBorderStrong, new Vector4(0.55f, 0.45f, 0.75f, 0.3f)); C(ImGuiCol.TableBorderLight, new Vector4(0.55f, 0.45f, 0.75f, 0.15f)); C(ImGuiCol.TableRowBg, new Vector4(0f, 0f, 0f, 0f)); C(ImGuiCol.TableRowBgAlt, new Vector4(0.15f, 0.12f, 0.2f, 0.3f)); C(ImGuiCol.TextSelectedBg, new Vector4(0.55f, 0.45f, 0.75f, 0.35f)); C(ImGuiCol.NavHighlight, new Vector4(0.75f, 0.55f, 0.95f, 1f)); C(ImGuiCol.MenuBarBg, new Vector4(0.12f, 0.1f, 0.18f, 1f)); S(ImGuiStyleVar.FrameRounding, 4f); S(ImGuiStyleVar.ChildRounding, 4f); S(ImGuiStyleVar.PopupRounding, 4f); S(ImGuiStyleVar.ScrollbarRounding, 6f); S(ImGuiStyleVar.GrabRounding, 3f); S(ImGuiStyleVar.TabRounding, 4f); return new ThemeScope(colors, styles); void C(ImGuiCol col, Vector4 color) { _202E_200D_200C_200E_202B_206C_206C_206A_206A_206D_200C_206B_200C_206B_200D_206B_200B_202B_206B_200D_206D_202B_206D_206C_200C_202E_202B_206F_200D_206F_202A_200C_206F_206B_206C_202B_202E_200F_206E_206E_202E(col, color); int num = colors; int num2 = 1; int num3 = num; colors = (num3 | num2) + (num3 & num2); } void S(ImGuiStyleVar var, float val) { _206B_206A_202D_206B_206E_206B_200C_200C_202E_200D_202A_206C_200B_202B_206D_206C_206F_200B_206A_202B_206C_206B_202A_200F_200D_202B_200C_206E_200D_200F_206D_202D_202E_200B_200D_206B_202B_206A_206E_206A_202E(var, val); int num = styles; int num2 = 1; int num3 = num; int num4 = num3 ^ num2; int num5 = num3 & num2; styles = num4 + (num5 + num5); } } void _206D_200B_206C_206B_200B_206B_206B_202E_200B_206B_202C_202D_206D_202D_206C_206F_206F_206D_200E_206E_200E_200C_202A_202B_206F_206B_200F_202B_206E_200E_206C_206D_200F_206D_202A_206C_206A_200D_200F_200C_202E() { base.PreDraw(); } static void _200F_206E_206B_206C_206C_206D_206A_200D_206D_200C_206A_206A_200C_202E_202D_202C_200B_202D_200B_206D_200D_206E_206E_206C_202D_202B_206C_200F_206C_200B_206D_202B_206B_200C_206B_202E_202D_206C_206D_206B_202E(IDisposable P_0) { P_0.Dispose(); } void _206D_202B_202D_202E_206A_206F_200B_206F_206B_200C_206A_206A_200F_200B_202D_200E_202C_200F_200E_200C_202B_200E_202D_206C_206C_206D_206E_200F_206A_202E_206E_206C_200E_200F_206E_200C_206F_206D_206D_200E_202E() { base.PostDraw(); } static void _202E_200D_200C_200E_202B_206C_206C_206A_206A_206D_200C_206B_200C_206B_200D_206B_200B_202B_206B_200D_206D_202B_206D_206C_200C_202E_202B_206F_200D_206F_202A_200C_206F_206B_206C_202B_202E_200F_206E_206E_202E(ImGuiCol P_0, Vector4 P_1) { ImGui.PushStyleColor(P_0, P_1); } static void _206B_206A_202D_206B_206E_206B_200C_200C_202E_200D_202A_206C_200B_202B_206D_206C_206F_200B_206A_202B_206C_206B_202A_200F_200D_202B_200C_206E_200D_200F_206D_202D_202E_200B_200D_206B_202B_206A_206E_206A_202E(ImGuiStyleVar P_0, float P_1) { ImGui.PushStyleVar(P_0, P_1); } }