mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-25 04:11:42 -04:00
add severity to platformMessageBox
This commit is contained in:
parent
f6cde6a62f
commit
d81e1ba072
2 changed files with 17 additions and 3 deletions
loader/src
|
@ -170,7 +170,7 @@ namespace geode {
|
|||
bool platformConsoleOpen() const;
|
||||
void openPlatformConsole();
|
||||
void closePlatformConsole();
|
||||
void platformMessageBox(char const* title, std::string const& info);
|
||||
void platformMessageBox(char const* title, std::string const& info, Severity severity = Severity::Error);
|
||||
|
||||
bool verifyLoaderResources();
|
||||
void checkForLoaderUpdates();
|
||||
|
|
|
@ -25,8 +25,22 @@ std::string Loader::Impl::getGameVersion() {
|
|||
return m_gdVersion;
|
||||
}
|
||||
|
||||
void Loader::Impl::platformMessageBox(char const* title, std::string const& info) {
|
||||
MessageBoxA(nullptr, info.c_str(), title, MB_ICONERROR);
|
||||
void Loader::Impl::platformMessageBox(char const* title, std::string const& info, Severity severity) {
|
||||
unsigned int icon;
|
||||
switch (severity) {
|
||||
case Severity::Debug:
|
||||
case Severity::Info:
|
||||
case Severity::Notice:
|
||||
icon = MB_ICONINFORMATION;
|
||||
break;
|
||||
case Severity::Warning:
|
||||
icon = MB_ICONWARNING;
|
||||
break;
|
||||
default:
|
||||
icon = MB_ICONERROR;
|
||||
break;
|
||||
}
|
||||
MessageBoxA(nullptr, info.c_str(), title, icon);
|
||||
}
|
||||
|
||||
bool hasAnsiColorSupport = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue