fix(notifier): ESC només confirma sobre el propi prompt de sortida

This commit is contained in:
2026-05-21 08:24:22 +02:00
parent 9a79fb9774
commit 4252f3327f
3 changed files with 24 additions and 10 deletions
+9 -1
View File
@@ -77,6 +77,7 @@ namespace System {
current_text_ = text;
current_color_ = text_color;
hold_remaining_s_ = duration_s;
current_is_exit_ = false;
const float TEXT_W = Graphics::VectorText::getTextWidth(text, TEXT_SCALE, TEXT_SPACING);
const float TEXT_H = Graphics::VectorText::getTextHeight(TEXT_SCALE);
@@ -100,7 +101,10 @@ namespace System {
void Notifier::notifyInfo(const std::string& text) { notify(text, COLOR_INFO, DURATION_INFO); }
void Notifier::notifyWarn(const std::string& text) { notify(text, COLOR_WARN, DURATION_WARN); }
void Notifier::notifyExit(const std::string& text) { notify(text, COLOR_EXIT, DURATION_EXIT); }
void Notifier::notifyExit(const std::string& text) {
notify(text, COLOR_EXIT, DURATION_EXIT);
current_is_exit_ = true; // notify() ho ha posat a false; restaurem.
}
void Notifier::update(float delta_time) {
switch (status_) {
@@ -183,4 +187,8 @@ namespace System {
return status_ == Status::ENTERING || status_ == Status::HOLDING;
}
auto Notifier::isExitPromptActive() const -> bool {
return isActiveWindow() && current_is_exit_;
}
} // namespace System