diff --git a/core/memory/memory.cpp b/core/memory/memory.cpp index a134ec00..26a0ebae 100644 --- a/core/memory/memory.cpp +++ b/core/memory/memory.cpp @@ -3700,7 +3700,7 @@ void read_sc_regh() void read_sc_regd() { - FrontendService::show_warning(L"read_sc_regd not supported by RCP", L"Error"); + FrontendService::show_dialog(L"read_sc_regd not supported by RCP", L"Core", FrontendService::DialogType::Error); stop = 1; } diff --git a/core/memory/savestates.cpp b/core/memory/savestates.cpp index ccfc1e38..ad815c64 100644 --- a/core/memory/savestates.cpp +++ b/core/memory/savestates.cpp @@ -755,9 +755,9 @@ namespace Savestates FrontendService::show_statusbar(std::format(L"Cancelled {}", job == Job::Save ? L"save" : L"load").c_str()); } else { - FrontendService::show_error(std::format(L"Failed to {} {} (error code {}).\nVerify that the savestate is valid and accessible.", - job == Job::Save ? L"save" : L"load", path.filename().wstring(), (int32_t)result).c_str(), - L"Savestate"); + const auto message = std::format(L"Failed to {} {} (error code {}).\nVerify that the savestate is valid and accessible.", + job == Job::Save ? L"save" : L"load", path.filename().wstring(), (int32_t)result); + FrontendService::show_dialog(message.c_str(), L"Savestate", FrontendService::DialogType::Error); } if (callback) diff --git a/core/memory/summercart.cpp b/core/memory/summercart.cpp index ff94bd3e..e013d956 100644 --- a/core/memory/summercart.cpp +++ b/core/memory/summercart.cpp @@ -84,7 +84,7 @@ static char* get_st_path(const char* filename) static int32_t sd_error(const wchar_t* text, const wchar_t* caption) { - FrontendService::show_error(text, caption); + FrontendService::show_dialog(text, caption, FrontendService::DialogType::Error); return -1; } diff --git a/core/r4300/Plugin.cpp b/core/r4300/Plugin.cpp index 89a8c2b8..2da4894a 100644 --- a/core/r4300/Plugin.cpp +++ b/core/r4300/Plugin.cpp @@ -419,7 +419,7 @@ void Plugin::config() auto initiateGFX = (INITIATEGFX)PlatformService::get_function_in_module((void*)m_module, "InitiateGFX"); if (initiateGFX && !initiateGFX(dummy_gfx_info)) { - FrontendService::show_information(L"Couldn't initialize video plugin."); + FrontendService::show_dialog(L"Couldn't initialize video plugin.", L"Core", FrontendService::DialogType::Information); } } @@ -440,7 +440,7 @@ void Plugin::config() auto initiateAudio = (INITIATEAUDIO)PlatformService::get_function_in_module((void*)m_module, "InitiateAudio"); if (initiateAudio && !initiateAudio(dummy_audio_info)) { - FrontendService::show_information(L"Couldn't initialize audio plugin."); + FrontendService::show_dialog(L"Couldn't initialize audio plugin.", L"Core", FrontendService::DialogType::Information); } } diff --git a/core/r4300/cop1_helpers.cpp b/core/r4300/cop1_helpers.cpp index b34b8c9f..7ea18cc5 100644 --- a/core/r4300/cop1_helpers.cpp +++ b/core/r4300/cop1_helpers.cpp @@ -14,7 +14,7 @@ double largest_denormal_double = 2.225073858507201e-308; // (1ULL << 52) - 1 void fail_float(const std::wstring& msg) { const auto buf = std::format(L"{}\nPC = {:#06x}", msg, interpcore ? interp_addr : PC->addr); - FrontendService::show_error(buf.c_str(), L"Floating Point Error"); + FrontendService::show_dialog(buf.c_str(), L"Core", FrontendService::DialogType::Error); core_Cause = 15 << 2; exception_general(); diff --git a/core/r4300/vcr.cpp b/core/r4300/vcr.cpp index 2ee28eb3..9d45e104 100644 --- a/core/r4300/vcr.cpp +++ b/core/r4300/vcr.cpp @@ -540,7 +540,7 @@ void vcr_create_n_frame_savestate(size_t frame) if (result != CoreResult::Ok) { - FrontendService::show_error(std::format(L"Failed to save seek savestate at frame {}.", frame).c_str(), L"VCR"); + FrontendService::show_dialog(std::format(L"Failed to save seek savestate at frame {}.", frame).c_str(), L"VCR", FrontendService::DialogType::Error); return; } @@ -565,7 +565,7 @@ void vcr_handle_starting_tasks(int32_t index, BUTTONS* input) if (result != CoreResult::Ok) { - FrontendService::show_error(L"Failed to reset the rom when initiating a from-start recording.\nRecording will be stopped.", L"VCR"); + FrontendService::show_dialog(L"Failed to reset the rom when initiating a from-start recording.\nRecording will be stopped.", L"VCR", FrontendService::DialogType::Error); VCR::stop_all(); return; } @@ -592,7 +592,7 @@ void vcr_handle_starting_tasks(int32_t index, BUTTONS* input) if (result != CoreResult::Ok) { - FrontendService::show_error(L"Failed to reset the rom when playing back a from-start movie.\nPlayback will be stopped.", L"VCR"); + FrontendService::show_dialog(L"Failed to reset the rom when playing back a from-start movie.\nPlayback will be stopped.", L"VCR", FrontendService::DialogType::Error); VCR::stop_all(); return; } @@ -667,7 +667,7 @@ void vcr_handle_recording(int32_t index, BUTTONS* input) if (result != CoreResult::Ok) { - FrontendService::show_error(L"Failed to reset the rom following a user-invoked reset."); + FrontendService::show_dialog(L"Failed to reset the rom following a user-invoked reset.", L"VCR", FrontendService::DialogType::Error); } }); } @@ -721,7 +721,7 @@ void vcr_handle_playback(int32_t index, BUTTONS* input) if (result != CoreResult::Ok) { - FrontendService::show_error(L"Failed to reset the rom following a movie-invoked reset.\nRecording will be stopped.", L"VCR"); + FrontendService::show_dialog(L"Failed to reset the rom following a movie-invoked reset.\nRecording will be stopped.", L"VCR", FrontendService::DialogType::Error); VCR::stop_all(); g_reset_pending = false; return; @@ -750,7 +750,7 @@ void vcr_stop_seek_if_needed() if (m_current_sample > seek_to_frame.value()) { g_core_logger->error("Seek frame exceeded without seek having been stopped. ({}/{})", m_current_sample, seek_to_frame.value()); - FrontendService::show_error(L"Seek frame exceeded without seek having been stopped!\nThis incident has been logged, please report this issue along with the log file.", L"VCR"); + FrontendService::show_dialog(L"Seek frame exceeded without seek having been stopped!\nThis incident has been logged, please report this issue along with the log file.", L"VCR", FrontendService::DialogType::Error); } if (m_current_sample >= seek_to_frame.value()) @@ -916,7 +916,7 @@ CoreResult VCR::start_record(std::filesystem::path path, uint16_t flags, std::st if (result != CoreResult::Ok) { - FrontendService::show_error(L"Failed to save savestate while starting recording.\nRecording will be stopped.", L"VCR"); + FrontendService::show_dialog(L"Failed to save savestate while starting recording.\nRecording will be stopped.", L"VCR", FrontendService::DialogType::Error); VCR::stop_all(); return; } @@ -950,7 +950,7 @@ CoreResult VCR::start_record(std::filesystem::path path, uint16_t flags, std::st if (result != CoreResult::Ok) { - FrontendService::show_error(L"Failed to load savestate while starting recording.\nRecording will be stopped.", L"VCR"); + FrontendService::show_dialog(L"Failed to load savestate while starting recording.\nRecording will be stopped.", L"VCR", FrontendService::DialogType::Error); VCR::stop_all(); return; } @@ -1197,7 +1197,7 @@ CoreResult VCR::start_playback(std::filesystem::path path) if (lstrlenW(dummy) > 0) { - FrontendService::show_warning(dummy, L"VCR"); + FrontendService::show_dialog(dummy, L"VCR", FrontendService::DialogType::Warning); } if (g_header.extended_version != 0) @@ -1219,7 +1219,7 @@ CoreResult VCR::start_playback(std::filesystem::path path) // Old movies filled with non-zero data in this section are suspicious, we'll warn the user. if (g_header.extended_flags.data != 0) { - FrontendService::show_warning(OLD_MOVIE_EXTENDED_SECTION_NONZERO_MESSAGE, L"VCR"); + FrontendService::show_dialog(OLD_MOVIE_EXTENDED_SECTION_NONZERO_MESSAGE, L"VCR", FrontendService::DialogType::Warning); } } @@ -1285,7 +1285,7 @@ CoreResult VCR::start_playback(std::filesystem::path path) if (result != CoreResult::Ok) { - FrontendService::show_error(L"Failed to load savestate while starting playback.\nRecording will be stopped.", L"VCR"); + FrontendService::show_dialog(L"Failed to load savestate while starting playback.\nRecording will be stopped.", L"VCR", FrontendService::DialogType::Error); VCR::stop_all(); return; } @@ -1443,7 +1443,7 @@ CoreResult vcr_begin_seek_impl(std::wstring str, bool pause_at_end, bool resume, { if (result != CoreResult::Ok) { - FrontendService::show_error(L"Failed to load seek savestate for seek operation.", L"VCR"); + FrontendService::show_dialog(L"Failed to load seek savestate for seek operation.", L"VCR", FrontendService::DialogType::Error); g_seek_savestate_loading = false; VCR::stop_seek(); } @@ -1474,7 +1474,7 @@ CoreResult vcr_begin_seek_impl(std::wstring str, bool pause_at_end, bool resume, if (g_config.seek_savestate_interval == 0) { // TODO: We can't backtrack using savestates, so we'd have to restart into recording mode while restoring the buffer, leave it for the next release... - FrontendService::show_error(L"The seek savestate interval can't be 0 when seeking backwards during recording.", L"VCR"); + FrontendService::show_dialog(L"The seek savestate interval can't be 0 when seeking backwards during recording.", L"VCR", FrontendService::DialogType::Error); return CoreResult::VCR_SeekSavestateIntervalZero; } @@ -1511,7 +1511,7 @@ CoreResult vcr_begin_seek_impl(std::wstring str, bool pause_at_end, bool resume, { if (result != CoreResult::Ok) { - FrontendService::show_error(L"Failed to load seek savestate for seek operation.", L"VCR"); + FrontendService::show_dialog(L"Failed to load seek savestate for seek operation.", L"VCR", FrontendService::DialogType::Error); g_seek_savestate_loading = false; VCR::stop_seek(); } diff --git a/shared/services/FrontendService.h b/shared/services/FrontendService.h index e41ed96c..1668b0da 100644 --- a/shared/services/FrontendService.h +++ b/shared/services/FrontendService.h @@ -43,29 +43,14 @@ namespace FrontendService */ bool show_ask_dialog(const wchar_t* str, const wchar_t* title = nullptr, bool warning = false, void* hwnd = nullptr); - /** - * \brief Shows the user a warning dialog - * \param str The dialog content - * \param title The dialog title - * \param hwnd The parent window - */ - void show_warning(const wchar_t* str, const wchar_t* title = nullptr, void* hwnd = nullptr); - - /** - * \brief Shows the user an error dialog - * \param str The dialog content - * \param title The dialog title - * \param hwnd The parent window - */ - void show_error(const wchar_t* str, const wchar_t* title = nullptr, void* hwnd = nullptr); - - /** - * \brief Shows the user an information dialog - * \param str The dialog content - * \param title The dialog title - * \param hwnd The parent window - */ - void show_information(const wchar_t* str, const wchar_t* title = nullptr, void* hwnd = nullptr); + /** + * \brief Shows the user a dialog. + * \param str The dialog content. + * \param title The dialog title. + * \param type The dialog tone. + * \param hwnd The parent window. + */ + void show_dialog(const wchar_t* str, const wchar_t* title = nullptr, DialogType type = DialogType::Warning, void* hwnd = nullptr); /** * \brief Shows text in the statusbar diff --git a/view/PlatformService.cpp b/view/PlatformService.cpp index faf473a2..e8118104 100644 --- a/view/PlatformService.cpp +++ b/view/PlatformService.cpp @@ -14,7 +14,7 @@ void PlatformService::free_library(void* module) { if (!FreeLibrary((HMODULE)module)) { - FrontendService::show_error(std::format(L"Failed to free library {:#06x}.", (unsigned long)module).c_str()); + FrontendService::show_dialog(std::format(L"Failed to free library {:#06x}.", (unsigned long)module).c_str(), L"Core", FrontendService::DialogType::Error); } } diff --git a/view/capture/EncodingManager.cpp b/view/capture/EncodingManager.cpp index 7c7a4098..842ec8a2 100644 --- a/view/capture/EncodingManager.cpp +++ b/view/capture/EncodingManager.cpp @@ -209,7 +209,7 @@ namespace EncodingManager { if (!MGECompositor::available() && !readScreen) { - FrontendService::show_error(L"The current video plugin has no readScreen implementation.\nPlugin capture is not possible.", L"Capture"); + FrontendService::show_dialog(L"The current video plugin has no readScreen implementation.\nPlugin capture is not possible.", L"Capture", FrontendService::DialogType::Error); stop_capture(); return; } @@ -225,7 +225,7 @@ namespace EncodingManager { if (!MGECompositor::available() && !readScreen) { - FrontendService::show_error(L"The current video plugin has no readScreen implementation.\nHybrid capture is not possible.", L"Capture"); + FrontendService::show_dialog(L"The current video plugin has no readScreen implementation.\nHybrid capture is not possible.", L"Capture", FrontendService::DialogType::Error); stop_capture(); return; } @@ -312,7 +312,7 @@ namespace EncodingManager if (!result) { - FrontendService::show_error(L"Failed to start encoding.\r\nVerify that the encoding parameters are valid and try again.", L"Capture"); + FrontendService::show_dialog(L"Failed to start encoding.\r\nVerify that the encoding parameters are valid and try again.", L"Capture", FrontendService::DialogType::Error); return false; } @@ -337,7 +337,7 @@ namespace EncodingManager if (!m_encoder->stop()) { - FrontendService::show_error(L"Failed to stop encoding.", L"Capture"); + FrontendService::show_dialog(L"Failed to stop encoding.", L"Capture", FrontendService::DialogType::Error); return false; } @@ -373,9 +373,9 @@ namespace EncodingManager return; } - FrontendService::show_error( + FrontendService::show_dialog( L"Failed to append frame to video.\nPerhaps you ran out of memory?", - L"Capture"); + L"Capture", FrontendService::DialogType::Error); stop_capture(); } @@ -399,9 +399,9 @@ namespace EncodingManager if (!m_encoder->append_audio(reinterpret_cast(buf), ai_len, m_audio_bitrate)) { - FrontendService::show_error( + FrontendService::show_dialog( L"Failed to append audio data.\nCapture will be stopped.", - L"Capture"); + L"Capture", FrontendService::DialogType::Error); stop_capture(); } } @@ -422,7 +422,7 @@ namespace EncodingManager if (m_capturing) { - FrontendService::show_error(L"Audio frequency changed during capture.\r\nThe capture will be stopped.", L"Capture"); + FrontendService::show_dialog(L"Audio frequency changed during capture.\r\nThe capture will be stopped.", L"Capture", FrontendService::DialogType::Error); stop_capture(); return; } diff --git a/view/capture/encoders/AVIEncoder.cpp b/view/capture/encoders/AVIEncoder.cpp index 627a8e32..c104764d 100644 --- a/view/capture/encoders/AVIEncoder.cpp +++ b/view/capture/encoders/AVIEncoder.cpp @@ -272,9 +272,7 @@ bool AVIEncoder::write_sound(uint8_t* buf, int len, const int min_write_size, co if (!ok) { - FrontendService::show_error( - L"Audio output failure!\nA call to addAudioData() (AVIStreamWrite) failed.\nPerhaps you ran out of memory?", - nullptr); + FrontendService::show_dialog(L"Audio output failure!\nA call to addAudioData() (AVIStreamWrite) failed.\nPerhaps you ran out of memory?", L"AVI Encoder", FrontendService::DialogType::Error); return false; } } @@ -289,7 +287,7 @@ bool AVIEncoder::write_sound(uint8_t* buf, int len, const int min_write_size, co if (static_cast(sound_buf_pos + len) > SOUND_BUF_SIZE * sizeof(char)) { - FrontendService::show_error(L"Sound buffer overflow!\nCapture will be stopped.", L"AVI Encoder"); + FrontendService::show_dialog(L"Sound buffer overflow!\nCapture will be stopped.", L"AVI Encoder", FrontendService::DialogType::Error); return false; } diff --git a/view/capture/encoders/FFmpegEncoder.cpp b/view/capture/encoders/FFmpegEncoder.cpp index 3396fe8d..e71ea573 100644 --- a/view/capture/encoders/FFmpegEncoder.cpp +++ b/view/capture/encoders/FFmpegEncoder.cpp @@ -79,7 +79,8 @@ bool FFmpegEncoder::start(Params params) &m_pi) ) { - FrontendService::show_error(std::format(L"Could not start ffmpeg process! Does ffmpeg exist on disk at '{}'?", g_config.ffmpeg_path).c_str()); + + FrontendService::show_dialog(std::format(L"Could not start ffmpeg process! Does ffmpeg exist on disk at '{}'?", g_config.ffmpeg_path).c_str(), L"FFmpeg Encoder", FrontendService::DialogType::Error); g_view_logger->info(L"CreateProcess failed ({}).", GetLastError()); CloseHandle(m_video_pipe); CloseHandle(m_audio_pipe); @@ -113,12 +114,12 @@ bool FFmpegEncoder::stop() if (!this->m_video_queue.empty() || !this->m_audio_queue.empty()) { - FrontendService::show_warning(std::format(L"Capture stopped with {} video, {} audio elements remaining in queue!\nThe capture might be corrupted.", this->m_video_queue.size(), this->m_audio_queue.size()).c_str()); + FrontendService::show_dialog(std::format(L"Capture stopped with {} video, {} audio elements remaining in queue!\nThe capture might be corrupted.", this->m_video_queue.size(), this->m_audio_queue.size()).c_str(), L"FFmpeg"); } if (m_dropped_frames > 0) { - FrontendService::show_warning(std::format(L"{} frames were dropped during capture to avoid out-of-memory errors.\nThe capture might contain empty frames.", m_dropped_frames).c_str()); + FrontendService::show_dialog(std::format(L"{} frames were dropped during capture to avoid out-of-memory errors.\nThe capture might contain empty frames.", m_dropped_frames).c_str(), L"FFmpeg"); } free(m_silence_buffer); diff --git a/view/gui/FrontendService.cpp b/view/gui/FrontendService.cpp index 87ec84a8..e9dce1e1 100644 --- a/view/gui/FrontendService.cpp +++ b/view/gui/FrontendService.cpp @@ -67,31 +67,32 @@ bool FrontendService::show_ask_dialog(const wchar_t* str, const wchar_t* title, return MessageBox(static_cast(hwnd ? hwnd : g_main_hwnd), str, title, MB_YESNO | (warning ? MB_ICONWARNING : MB_ICONQUESTION)) == IDYES; } -void FrontendService::show_warning(const wchar_t* str, const wchar_t* title, void* hwnd) +void FrontendService::show_dialog(const wchar_t* str, const wchar_t* title, DialogType type, void* hwnd) { - g_view_logger->warn(L"[FrontendService] show_warning: '{}'", str); - if (!g_config.silent_mode) - { - MessageBox(static_cast(hwnd ? hwnd : g_main_hwnd), str, title, MB_ICONWARNING); - } -} - -void FrontendService::show_error(const wchar_t* str, const wchar_t* title, void* hwnd) -{ - g_view_logger->error(L"[FrontendService] show_error: '{}'", str); - if (!g_config.silent_mode) - { - MessageBox(static_cast(hwnd ? hwnd : g_main_hwnd), str, title, MB_ICONERROR); - } -} - -void FrontendService::show_information(const wchar_t* str, const wchar_t* title, void* hwnd) -{ - g_view_logger->info(L"[FrontendService] show_information: '{}'", str); - if (!g_config.silent_mode) - { - MessageBox(static_cast(hwnd ? hwnd : g_main_hwnd), str, title, MB_OK | MB_ICONINFORMATION); - } + int icon = 0; + + switch (type) + { + case DialogType::Error: + g_view_logger->error(L"[FrontendService] {}", str); + icon = MB_ICONERROR; + break; + case DialogType::Warning: + g_view_logger->warn(L"[FrontendService] {}", str); + icon = MB_ICONWARNING; + break; + case DialogType::Information: + g_view_logger->info(L"[FrontendService] {}", str); + icon = MB_ICONINFORMATION; + break; + default: + assert(false); + } + + if (!g_config.silent_mode) + { + MessageBox(static_cast(hwnd ? hwnd : g_main_hwnd), str, title, icon); + } } void FrontendService::show_statusbar(const wchar_t* str) diff --git a/view/gui/Main.cpp b/view/gui/Main.cpp index f6c6b67f..3990d680 100644 --- a/view/gui/Main.cpp +++ b/view/gui/Main.cpp @@ -292,7 +292,7 @@ bool show_error_dialog_for_result(const CoreResult result, void* hwnd) if (!error.empty()) { const auto title = std::format(L"{} Error {}", module, static_cast(result)); - FrontendService::show_error(error.c_str(), title.c_str(), hwnd); + FrontendService::show_dialog(error.c_str(), title.c_str(), FrontendService::DialogType::Error); } return true; @@ -1478,7 +1478,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) break; case IDM_BENCHMARK_LUA_CALLBACK: { - FrontendService::show_information(L"Make sure the Lua script is running and the registered atreset body is empty."); + FrontendService::show_dialog(L"Make sure the Lua script is running and the registered atreset body is empty.", L"Benchmark Lua Callback", FrontendService::DialogType::Information); ScopeTimer timer("100,000,000x call_reset", g_view_logger); for (int i = 0; i < 100'000'000; ++i) { @@ -1493,7 +1493,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) case IDM_BENCHMARK_CORE_STOP: { auto fps = Core::stop_benchmark(); - FrontendService::show_information(std::format(L"FPS: {:2f}", fps).c_str()); + FrontendService::show_dialog(std::format(L"FPS: {:2f}", fps).c_str(), L"Benchmark Core", FrontendService::DialogType::Information); Messenger::broadcast(Messenger::Message::FastForwardNeedsUpdate, nullptr); break; } diff --git a/view/gui/features/Cheats.cpp b/view/gui/features/Cheats.cpp index 7ff134f2..346ceb0b 100644 --- a/view/gui/features/Cheats.cpp +++ b/view/gui/features/Cheats.cpp @@ -89,7 +89,7 @@ namespace Cheats if (!script.has_value()) { - FrontendService::show_error(L"Cheat code could not be compiled.\r\nVerify that the syntax is correct.", nullptr, hwnd); + FrontendService::show_dialog(L"Cheat code could not be compiled.\r\nVerify that the syntax is correct", L"Cheats", FrontendService::DialogType::Error); break; } diff --git a/view/gui/features/ConfigDialog.cpp b/view/gui/features/ConfigDialog.cpp index d30ad242..9eed8778 100644 --- a/view/gui/features/ConfigDialog.cpp +++ b/view/gui/features/ConfigDialog.cpp @@ -1655,7 +1655,7 @@ INT_PTR CALLBACK general_cfg(const HWND hwnd, const UINT message, const WPARAM w } } - FrontendService::show_information(str.c_str(), L"Information", hwnd); + FrontendService::show_dialog(str.c_str(), L"Information", FrontendService::DialogType::Information, hwnd); } if (offset == 4 && option_item.type == OptionsItem::Type::Hotkey) @@ -1684,7 +1684,7 @@ INT_PTR CALLBACK general_cfg(const HWND hwnd, const UINT message, const WPARAM w if (!can_all_be_changed) { - FrontendService::show_warning(L"Some settings can't be reset, as they are currently read-only. Try again with emulation stopped.\nNo changes have been made to the settings.", L"Reset all to default", hwnd); + FrontendService::show_dialog(L"Some settings can't be reset, as they are currently read-only. Try again with emulation stopped.\nNo changes have been made to the settings.", L"Reset all to default", FrontendService::DialogType::Warning, hwnd); goto destroy_menu; } diff --git a/view/lua/LuaConsole.cpp b/view/lua/LuaConsole.cpp index d2395b4e..85f993b1 100644 --- a/view/lua/LuaConsole.cpp +++ b/view/lua/LuaConsole.cpp @@ -63,7 +63,7 @@ int at_panic(lua_State* L) const auto message = string_to_wstring(lua_tostring(L, -1)); g_view_logger->info(L"Lua panic: {}", message); - FrontendService::show_error(message.c_str(), L"Lua"); + FrontendService::show_dialog(message.c_str(), L"Lua", FrontendService::DialogType::Error); return 0; } @@ -655,7 +655,7 @@ void LuaEnvironment::create_renderer() auto hr = CoInitialize(nullptr); if (hr != S_OK && hr != S_FALSE && hr != RPC_E_CHANGED_MODE) { - FrontendService::show_error(L"Failed to initialize COM.\r\nVerify that your system is up-to-date."); + FrontendService::show_dialog(L"Failed to initialize COM.\r\nVerify that your system is up-to-date.", L"Lua", FrontendService::DialogType::Error); return; } @@ -699,7 +699,7 @@ void LuaEnvironment::create_renderer() if (!presenter->init(d2d_overlay_hwnd)) { - FrontendService::show_error(L"Failed to initialize presenter.\r\nVerify that your system supports the selected presenter."); + FrontendService::show_dialog(L"Failed to initialize presenter.\r\nVerify that your system supports the selected presenter.", L"Lua", FrontendService::DialogType::Error); return; }