RenderInfo amb tres estats (off/dalt/baix), temps de joc i persistència; ombra, mono-dígits i easing compartits (v0.14.0)
This commit is contained in:
1 parent
46a578fd86
commit
6f3fafbfff
17 files changed
+376
-97
No files matched your search
@@ -19,7 +19,10 @@ namespace GlobalInputs {
|
||||
namespace {
|
||||
|
||||
// Finestra per a confirmar l'eixida amb una segona pulsació d'Escape.
|
||||
constexpr float EXIT_WINDOW_S = 1.5F;
|
||||
// La lliguem a la durada de la notificació EXIT perquè el missatge i
|
||||
// la confirmació expiren alhora — si no, l'usuari podria veure el
|
||||
// text però ja no ser dins del rang de confirmació (o al revés).
|
||||
constexpr float EXIT_WINDOW_S = static_cast<float>(Notification::EXIT.time_ms) / 1000.0F;
|
||||
constexpr int MIN_ZOOM = 1;
|
||||
constexpr int MAX_ZOOM = 6;
|
||||
|
||||
@@ -134,8 +137,12 @@ namespace GlobalInputs {
|
||||
notifyLocale(mode_key);
|
||||
}
|
||||
|
||||
void onToggleRenderInfo() {
|
||||
RenderInfo::get().toggle();
|
||||
void onCycleRenderInfo() {
|
||||
RenderInfo::cyclePosition();
|
||||
}
|
||||
|
||||
void onToggleRenderTime() {
|
||||
RenderInfo::toggleShowTime();
|
||||
}
|
||||
|
||||
void onExit() {
|
||||
@@ -144,12 +151,7 @@ namespace GlobalInputs {
|
||||
return;
|
||||
}
|
||||
exit_window_s = EXIT_WINDOW_S;
|
||||
// La notificació dura el doble de la finestra; si l'usuari no
|
||||
// prem una segona volta abans del timeout, es desarmarà sol.
|
||||
Notifier::get().notify(Locale::get().text("input.press_again_exit"),
|
||||
Notification::DEFAULT.text_color,
|
||||
Notification::DEFAULT.bg_color,
|
||||
static_cast<int>(EXIT_WINDOW_S * 1000.0F));
|
||||
Notifier::get().notify(Locale::get().text("input.press_again_exit"), Notification::EXIT);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -177,7 +179,9 @@ namespace GlobalInputs {
|
||||
} else if (SC == KeyConfig::get().scancode("next_scaling_mode")) {
|
||||
onNextScalingMode();
|
||||
} else if (SC == KeyConfig::get().scancode("toggle_render_info")) {
|
||||
onToggleRenderInfo();
|
||||
onCycleRenderInfo();
|
||||
} else if (SC == KeyConfig::get().scancode("toggle_render_time")) {
|
||||
onToggleRenderTime();
|
||||
} else if (SC == KeyConfig::get().scancode("exit")) {
|
||||
onExit();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user