From 9dba0d2f4b296c851ca204ccfcf7b207ee0bd95a Mon Sep 17 00:00:00 2001 From: antopilo Date: Sun, 30 Mar 2025 20:00:29 -0400 Subject: [PATCH] Added OS API to display message boxes --- Nuake/Source/Nuake/Core/OS.cpp | 7 +++++++ Nuake/Source/Nuake/Core/OS.h | 1 + 2 files changed, 8 insertions(+) diff --git a/Nuake/Source/Nuake/Core/OS.cpp b/Nuake/Source/Nuake/Core/OS.cpp index 84241424..d36eaf62 100644 --- a/Nuake/Source/Nuake/Core/OS.cpp +++ b/Nuake/Source/Nuake/Core/OS.cpp @@ -50,6 +50,13 @@ namespace Nuake { return static_cast(std::chrono::system_clock::now().time_since_epoch().count()); } + void OS::ShowMessageBox(const std::string& title, const std::string& message) + { +#ifdef NK_WIN + ::MessageBoxA(nullptr, message.c_str(), title.c_str(), MB_OK); +#endif + } + void OS::OpenIn(const std::string& filePath) { #ifdef NK_WIN diff --git a/Nuake/Source/Nuake/Core/OS.h b/Nuake/Source/Nuake/Core/OS.h index 527bd93b..29861ed0 100644 --- a/Nuake/Source/Nuake/Core/OS.h +++ b/Nuake/Source/Nuake/Core/OS.h @@ -11,6 +11,7 @@ namespace Nuake static void CopyToClipboard(const std::string& value); static std::string GetFromClipboard(); static int GetTime(); + static void ShowMessageBox(const std::string& title, const std::string& message); static void OpenIn(const std::string& filePath); static void ExecuteCommand(const std::string& command); static int RenameFile(const Ref& file, const std::string& newName);