Gui window rework (#4307)

* Converted all GuiWindows to the new separate Begin/End format in current LUS except InputViewer, CheckTracker, ItemTracker and Modals.

* Setup Check, Entrance, Item trackers and Input Viewer to override `Draw()` to bypass the ImGui Begin and End, as they're not intended to go in the modern menu.

* Cleanup.
This commit is contained in:
Malkierian
2024-09-10 12:42:57 -07:00
committed by GitHub
parent 48663d74ac
commit b5037a0856
22 changed files with 754 additions and 807 deletions

View File

@@ -1006,6 +1006,15 @@ void ItemTrackerLoadFile() {
}
}
void ItemTrackerWindow::Draw() {
if (!IsVisible()) {
return;
}
DrawElement();
// Sync up the IsVisible flag if it was changed by ImGui
SyncVisibilityConsoleVariable();
}
void ItemTrackerWindow::DrawElement() {
UpdateVectors();
@@ -1122,13 +1131,6 @@ static const char* displayTypes[3] = { "Hidden", "Main Window", "Separate" };
static const char* extendedDisplayTypes[4] = { "Hidden", "Main Window", "Misc Window", "Separate" };
void ItemTrackerSettingsWindow::DrawElement() {
ImGui::SetNextWindowSize(ImVec2(733, 472), ImGuiCond_FirstUseEver);
if (!ImGui::Begin("Item Tracker Settings", &mIsVisible, ImGuiWindowFlags_NoFocusOnAppearing)) {
ImGui::End();
return;
}
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, { 8.0f, 8.0f });
ImGui::BeginTable("itemTrackerSettingsTable", 2, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV);
ImGui::TableSetupColumn("General settings", ImGuiTableColumnFlags_WidthStretch, 200.0f);
@@ -1255,8 +1257,6 @@ void ItemTrackerSettingsWindow::DrawElement() {
ImGui::PopStyleVar(1);
ImGui::EndTable();
ImGui::End();
}
void ItemTrackerWindow::InitElement() {