From 0ce1a87cbf912c1b426bcf19102528682cd44447 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 22 Mar 2024 17:40:51 +0100 Subject: [PATCH] fix: Toasts not printing their message to the console correctly --- .../ui/include/toasts/toast_notification.hpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/ui/include/toasts/toast_notification.hpp b/plugins/ui/include/toasts/toast_notification.hpp index ead7c5ebc..ab0a85a31 100644 --- a/plugins/ui/include/toasts/toast_notification.hpp +++ b/plugins/ui/include/toasts/toast_notification.hpp @@ -48,18 +48,24 @@ namespace hex::ui { } struct ToastInfo : impl::ToastNotification { - ToastInfo(std::string message) - : ToastNotification(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_LoggerInfo), ICON_VS_INFO, "hex.ui.common.info", std::move(message)) {} + explicit ToastInfo(std::string message) + : ToastNotification(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_LoggerInfo), ICON_VS_INFO, "hex.ui.common.info", message) { + log::info("{}", message); + } }; struct ToastWarning : impl::ToastNotification { - ToastWarning(std::string message) - : ToastNotification(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_LoggerWarning), ICON_VS_WARNING, "hex.ui.common.warning", std::move(message)) {} + explicit ToastWarning(std::string message) + : ToastNotification(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_LoggerWarning), ICON_VS_WARNING, "hex.ui.common.warning", message) { + log::warn("{}", message); + } }; struct ToastError : impl::ToastNotification { - ToastError(std::string message) - : ToastNotification(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_LoggerError), ICON_VS_ERROR, "hex.ui.common.error", std::move(message)) {} + explicit ToastError(std::string message) + : ToastNotification(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_LoggerError), ICON_VS_ERROR, "hex.ui.common.error", message) { + log::error("{}", message); + } }; }