1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Use SDL_ShowMessageBox's 'close' value for dummy UI context

This commit is contained in:
Michał Janiszewski
2022-08-04 18:38:51 +02:00
parent e146ca0853
commit a9fe4da279
4 changed files with 6 additions and 5 deletions

View File

@@ -640,7 +640,8 @@ public:
_platformUiContext->ShowMessageBox(_window, message);
}
int ShowMessageBox(const std::string& title, const std::string& message, const std::vector<std::string>& options) override
int32_t ShowMessageBox(
const std::string& title, const std::string& message, const std::vector<std::string>& options) override
{
auto message_box_button_data = std::make_unique<SDL_MessageBoxButtonData[]>(options.size());
for (size_t i = 0; i < options.size(); i++)

View File

@@ -2331,7 +2331,7 @@ int32_t scenario_save(u8string_view path, int32_t flags)
std::string report_bug_button = "Report bug, trigger an assert";
std::string skip_button = "Skip reporting, let me continue";
std::vector<std::string> buttons{ report_bug_button, skip_button };
std::vector<std::string> buttons{ std::move(report_bug_button), std::move(skip_button) };
int choice = uictx->ShowMessageBox(title, message, buttons);
if (choice == 0)

View File

@@ -90,9 +90,9 @@ namespace OpenRCT2::Ui
void ShowMessageBox(const std::string& /*message*/) override
{
}
int ShowMessageBox(const std::string&, const std::string&, const std::vector<std::string>&) override
int32_t ShowMessageBox(const std::string&, const std::string&, const std::vector<std::string>&) override
{
return 0;
return -1;
}
bool HasMenuSupport() override
{

View File

@@ -120,7 +120,7 @@ namespace OpenRCT2
virtual void TriggerResize() abstract;
virtual void ShowMessageBox(const std::string& message) abstract;
virtual int ShowMessageBox(
virtual int32_t ShowMessageBox(
const std::string& title, const std::string& message, const std::vector<std::string>& options) abstract;
virtual bool HasMenuSupport() abstract;