refactor(core/rendering): desacoplar Notifier de game/ui (COUP-01a)
core/rendering/notifier.hpp ja no inclou game/ui/notification_presets.hpp, i Notifier només exposa l'API crua notify(text, text_color, bg_color, time_ms). El helper de conveniència basat en Preset es trasllada com a funció lliure Notification::notify() a game/ui/notification_presets.hpp (direcció game → core, correcta). Els callers de global_inputs.cpp passen a usar el helper i afegeixen l'include explícit. Sota l'auditoria de core/rendering (docs/audit-core-rendering.md). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
9243db1b9f
commit
9434e4e87d
5 files changed
+27
-29
No files matched your search
@@ -67,14 +67,6 @@ void Notifier::render() {
|
||||
current_text_color_);
|
||||
}
|
||||
|
||||
void Notifier::notify(const std::string& text) {
|
||||
notify(text, Notification::DEFAULT);
|
||||
}
|
||||
|
||||
void Notifier::notify(const std::string& text, const Notification::Preset& preset) {
|
||||
notify(text, preset.text_color, preset.bg_color, preset.time_ms);
|
||||
}
|
||||
|
||||
void Notifier::notify(const std::string& text, Uint8 text_color, Uint8 bg_color, int time_ms) {
|
||||
// Política simple: la nova notificació reemplaça la que hi havia. Per
|
||||
// gestionar-ne una cua, canviar ací per una FIFO quan calga.
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "game/ui/notification_presets.hpp"
|
||||
|
||||
class Text;
|
||||
|
||||
// Popup transitori a dalt i centrat. Entra lliscant des de dalt, es queda
|
||||
@@ -15,10 +13,9 @@ class Text;
|
||||
// 8bithud i la paleta "ui" amb la resta d'overlays (carregades per RenderInfo
|
||||
// a l'arrencada; si Notifier::init() es crida primer, les carrega ell).
|
||||
//
|
||||
// Ús típic:
|
||||
// Notifier::get().notify("Text ràpid"); // preset DEFAULT
|
||||
// Notifier::get().notify("Text ràpid", miPreset); // preset custom
|
||||
// Notifier::get().notify("Urgent", 11, 3, 800); // colors i durada explícits
|
||||
// API crua: Notifier::get().notify(text, text_color, bg_color, time_ms).
|
||||
// Per a treballar amb presets del joc, vegeu Notification::notify() a
|
||||
// game/ui/notification_presets.hpp.
|
||||
class Notifier {
|
||||
public:
|
||||
static auto get() -> Notifier&;
|
||||
@@ -33,9 +30,6 @@ class Notifier {
|
||||
void update(int delta_ms);
|
||||
void render();
|
||||
|
||||
// Tres overloads; els dos simples deleguen al tercer.
|
||||
void notify(const std::string& text);
|
||||
void notify(const std::string& text, const Notification::Preset& preset);
|
||||
void notify(const std::string& text, Uint8 text_color, Uint8 bg_color, int time_ms);
|
||||
|
||||
static constexpr int PADDING_H = 6;
|
||||
|
||||
Reference in new issue
Block a user