| 256 | } |
| 257 | |
| 258 | bool messageBoxUi() |
| 259 | { |
| 260 | bool finished = false; |
| 261 | |
| 262 | pushFont(FONT_SMALL); |
| 263 | if (ImGui::BeginPopupModal(s_msgBox.id, nullptr, ImGuiWindowFlags_AlwaysAutoResize)) |
| 264 | { |
| 265 | ImGuiStyle& style = ImGui::GetStyle(); |
| 266 | f32 textWidth = ImGui::CalcTextSize(s_msgBox.msg).x + style.FramePadding.x; |
| 267 | f32 buttonWidth = ImGui::CalcTextSize("OK").x; |
| 268 | |
| 269 | ImGui::Text("%s", s_msgBox.msg); |
| 270 | ImGui::Separator(); |
| 271 | |
| 272 | ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (textWidth - buttonWidth) * 0.5f); |
| 273 | if (ImGui::Button("OK")) |
| 274 | { |
| 275 | finished = true; |
| 276 | } |
| 277 | ImGui::EndPopup(); |
| 278 | } |
| 279 | popFont(); |
| 280 | return finished; |
| 281 | } |
| 282 | |
| 283 | bool isPopupOpen() |
| 284 | { |
no test coverage detected