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
@@ -2,11 +2,14 @@
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "core/rendering/notifier.hpp"
|
||||
|
||||
// Temes per a les notificacions de pantalla. Un "preset" captura els dos
|
||||
// colors (text i fons, índexs sobre la paleta "ui") i el temps de visibilitat
|
||||
// en mil·lisegons. Qualsevol component que cride Notifier::notify(text)
|
||||
// rebrà l'estil DEFAULT; si necessita un altre look, pot passar el preset per
|
||||
// nom o especificar els camps un a un.
|
||||
// en mil·lisegons. Per a llançar una notificació amb un preset concret,
|
||||
// cridar Notification::notify(text, preset); si s'omet, s'usa DEFAULT.
|
||||
namespace Notification {
|
||||
|
||||
struct Preset {
|
||||
@@ -34,4 +37,10 @@ namespace Notification {
|
||||
.time_ms = 4000,
|
||||
};
|
||||
|
||||
// Helper de conveniència: aplica un preset (per defecte DEFAULT) cridant
|
||||
// la API crua de Notifier. La direcció game → core és la correcta.
|
||||
inline void notify(const std::string& text, const Preset& preset = DEFAULT) {
|
||||
Notifier::get().notify(text, preset.text_color, preset.bg_color, preset.time_ms);
|
||||
}
|
||||
|
||||
} // namespace Notification
|
||||
Reference in new issue
Block a user