From 5f89e8fade18fe09db34f14852ddca8293f7502f Mon Sep 17 00:00:00 2001 From: Alexander Yee Date: Sat, 7 Dec 2024 23:05:36 -0800 Subject: [PATCH] Fix ProgramFinishedException color. --- .../CommonFramework/Exceptions/ProgramFinishedException.h | 1 + .../Source/CommonFramework/Exceptions/ScreenshotException.cpp | 2 +- .../Source/CommonFramework/Exceptions/ScreenshotException.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/CommonFramework/Exceptions/ProgramFinishedException.h b/SerialPrograms/Source/CommonFramework/Exceptions/ProgramFinishedException.h index a2abad06c..a1b694615 100644 --- a/SerialPrograms/Source/CommonFramework/Exceptions/ProgramFinishedException.h +++ b/SerialPrograms/Source/CommonFramework/Exceptions/ProgramFinishedException.h @@ -51,6 +51,7 @@ class ProgramFinishedException : public ScreenshotException{ std::shared_ptr screenshot ); + virtual Color color() const override{ return COLOR_GREEN; } public: virtual void log(Logger& logger) const override; diff --git a/SerialPrograms/Source/CommonFramework/Exceptions/ScreenshotException.cpp b/SerialPrograms/Source/CommonFramework/Exceptions/ScreenshotException.cpp index 97d49b9b8..11af5cbfe 100644 --- a/SerialPrograms/Source/CommonFramework/Exceptions/ScreenshotException.cpp +++ b/SerialPrograms/Source/CommonFramework/Exceptions/ScreenshotException.cpp @@ -100,7 +100,7 @@ void ScreenshotException::send_notification(ProgramEnvironment& env, EventNotifi send_program_notification( env, notification, - COLOR_RED, + color(), name(), std::move(embeds), "", screenshot() diff --git a/SerialPrograms/Source/CommonFramework/Exceptions/ScreenshotException.h b/SerialPrograms/Source/CommonFramework/Exceptions/ScreenshotException.h index 2e41d0b6a..04eda6b2d 100644 --- a/SerialPrograms/Source/CommonFramework/Exceptions/ScreenshotException.h +++ b/SerialPrograms/Source/CommonFramework/Exceptions/ScreenshotException.h @@ -69,6 +69,7 @@ class ScreenshotException : public Exception{ virtual std::string message() const override{ return m_message; } ImageViewRGB32 screenshot() const; + virtual Color color() const{ return COLOR_RED; } virtual void send_notification(ProgramEnvironment& env, EventNotificationOption& notification) const; public: