private void BuildUI() { if (PluginInterface.ClientState.LocalPlayer == null) { return; } if (configLoadException != null || PluginConfig == null) { ImGui.PushStyleColor(ImGuiCol.TitleBg, 0x880000AA); ImGui.PushStyleColor(ImGuiCol.TitleBgActive, 0x880000FF); ImGui.Begin($"{Name} - 配置加载错误", ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize); ImGui.PopStyleColor(2); ImGui.Text($"{Name} 在加载配置时失败了。"); ImGui.Text($"继续操作可能会丢失部分关于 {Name} 插件的配置。"); ImGui.Text("请报告该错误。"); if (configLoadException != null) { var str = configLoadException.ToString(); ImGui.InputTextMultiline("###exceptionText", ref str, uint.MaxValue, new Vector2(-1, 80), ImGuiInputTextFlags.ReadOnly | ImGuiInputTextFlags.AutoSelectAll); } ImGui.Dummy(new Vector2(5)); if (ImGui.Button("重新加载")) { PluginConfig = null; configLoadException = null; LoadConfig(); } ImGui.SameLine(); ImGui.Dummy(new Vector2(15)); ImGui.SameLine(); ImGui.PushStyleColor(ImGuiCol.Button, 0x880000FF); ImGui.PushStyleColor(ImGuiCol.ButtonActive, 0x88000088); ImGui.PushStyleColor(ImGuiCol.ButtonHovered, 0x880000AA); if (ImGui.Button("清除配置")) { LoadConfig(true); configLoadException = null; } ImGui.PopStyleColor(3); ImGui.End(); } else { drawConfigWindow = drawConfigWindow && PluginConfig.DrawConfigUI(); if (!InPvP) { DrawDisplays(); } } }
private void BuildUI() { if (PluginInterface.ClientState.LocalPlayer == null) { return; } if (configLoadException != null || PluginConfig == null) { ImGui.PushStyleColor(ImGuiCol.TitleBg, 0x880000AA); ImGui.PushStyleColor(ImGuiCol.TitleBgActive, 0x880000FF); ImGui.Begin($"{Name} - Config Load Error", ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize); ImGui.PopStyleColor(2); ImGui.Text($"{Name} failed to load the config file."); ImGui.Text($"Continuing will result in a loss of any configs you have setup for {Name}."); ImGui.Text("Please report this error."); if (configLoadException != null) { var str = configLoadException.ToString(); ImGui.InputTextMultiline("###exceptionText", ref str, uint.MaxValue, new Vector2(-1, 80), ImGuiInputTextFlags.ReadOnly | ImGuiInputTextFlags.AutoSelectAll); } ImGui.Dummy(new Vector2(5)); if (ImGui.Button("Retry Load")) { PluginConfig = null; configLoadException = null; LoadConfig(); } ImGui.SameLine(); ImGui.Dummy(new Vector2(15)); ImGui.SameLine(); ImGui.PushStyleColor(ImGuiCol.Button, 0x880000FF); ImGui.PushStyleColor(ImGuiCol.ButtonActive, 0x88000088); ImGui.PushStyleColor(ImGuiCol.ButtonHovered, 0x880000AA); if (ImGui.Button("Clear Config")) { LoadConfig(true); configLoadException = null; } ImGui.PopStyleColor(3); ImGui.End(); } else { drawConfigWindow = drawConfigWindow && PluginConfig.DrawConfigUI(); if (!InPvP) { DrawDisplays(); } } }
private void BuildUI() { if (drawItemSearchWindow) { drawItemSearchWindow = itemSearchWindow != null && itemSearchWindow.Draw(); drawConfigWindow = drawItemSearchWindow && drawConfigWindow && PluginConfig.DrawConfigUI(); if (drawItemSearchWindow == false) { itemSearchWindow?.Dispose(); itemSearchWindow = null; drawConfigWindow = false; } } debugStopwatch.Restart(); if (PluginConfig.EnableFittingRoomSaves || PluginConfig.ShowItemID) { if (FittingRoomUI == null) { FittingRoomUI = new FittingRoomUI(this); } else { if (PluginConfig.EnableFittingRoomSaves) { FittingRoomUI?.Draw(); } } } #if DEBUG ImGui.BeginMainMenuBar(); if (ImGui.MenuItem("ItemSearch")) { itemSearchWindow?.Dispose(); itemSearchWindow = new ItemSearchWindow(this); drawItemSearchWindow = true; } ImGui.EndMainMenuBar(); #endif }