Message Dialog library (#767)

* system/MsgDialog: types & basic text display

* system/MsgDialog: User message dialog

* system/MsgDialog: RAII for MsgDialog ui

* system/MsgDialog: Progress bar dialog

* system/MsgDialog: System message texts

* system/MsgDialog: copy all ui state to local memory

handles when game release memory before close
extracted all UI code to it's own file
use single window instead of creating new one every single dialogOpen

* system/MsgDialog: debug logging
This commit is contained in:
Vinicius Rangel 2024-09-08 17:27:50 -03:00 committed by GitHub
parent 035cb3eeaa
commit 446d8c4ff1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 716 additions and 153 deletions

27
src/imgui/imgui_std.h Normal file
View file

@ -0,0 +1,27 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <imgui.h>
#include "imgui_internal.h"
namespace ImGui {
inline void CentralizeWindow() {
const auto display_size = GetIO().DisplaySize;
SetNextWindowPos(display_size / 2.0f, ImGuiCond_Always, {0.5f});
}
inline void KeepNavHighlight() {
GetCurrentContext()->NavDisableHighlight = false;
}
inline void SetItemCurrentNavFocus() {
const auto ctx = GetCurrentContext();
SetFocusID(ctx->LastItemData.ID, ctx->CurrentWindow);
ctx->NavInitResult.Clear();
}
} // namespace ImGui