feat(notifier): entrada/eixida per temps amb easing, configurable a ui.yaml
This commit is contained in:
1 parent
f816e75cc0
commit
970fe2b4db
6 files changed
+68
-27
No files matched your search
@@ -20,9 +20,15 @@ class UiConfig {
|
||||
int kerning;
|
||||
};
|
||||
|
||||
// Signatura d'una funció d'easing: t ∈ [0, 1] → valor ∈ [0, 1].
|
||||
// Permet triar corbes des de data/ui.yaml per nom (cadena) i guardar
|
||||
// el punter a la corresponent funció de `utils/easing.hpp`.
|
||||
using CurveFn = auto (*)(float) -> float;
|
||||
|
||||
// Geometria del Notifier (popup superior). Carregada des de
|
||||
// data/ui.yaml secció `notifier:`; els valors per defecte vénen de
|
||||
// Defaults::UI::Notifier.
|
||||
// Defaults::UI::Notifier. El moviment és per temps (slide_ms) i no per
|
||||
// velocitat, perquè una caixa més gran no triga més a entrar/eixir.
|
||||
struct Notifier {
|
||||
int padding_h;
|
||||
int padding_top;
|
||||
@@ -30,7 +36,9 @@ class UiConfig {
|
||||
int line_gap;
|
||||
int margin_top;
|
||||
int border_px;
|
||||
float slide_speed;
|
||||
int slide_ms;
|
||||
CurveFn slide_in_curve;
|
||||
CurveFn slide_out_curve;
|
||||
};
|
||||
|
||||
static auto get() -> UiConfig&;
|
||||
@@ -64,11 +72,6 @@ class UiConfig {
|
||||
[[nodiscard]] auto roomText() const -> Uint8 { return room_text_; }
|
||||
[[nodiscard]] auto roomTextOutline() const -> Uint8 { return room_text_outline_; }
|
||||
|
||||
// Signatura d'una funció d'easing: t ∈ [0, 1] → valor ∈ [0, 1].
|
||||
// Permet triar corbes des de data/ui.yaml per nom (cadena) i guardar
|
||||
// el punter a la corresponent funció de `utils/easing.hpp`.
|
||||
using CurveFn = auto (*)(float) -> float;
|
||||
|
||||
// Timings (ms).
|
||||
[[nodiscard]] auto notificationMs() const -> int { return notification_ms_; }
|
||||
[[nodiscard]] auto exitMs() const -> int { return exit_ms_; }
|
||||
|
||||
Reference in new issue
Block a user