feat(menu): primera versió del menú de servei
This commit is contained in:
1 parent
e4a8b4cd3e
commit
350625dec0
21 files changed
+1477
-16
No files matched your search
@@ -13,6 +13,7 @@
|
||||
#include "core/rendering/screen.hpp"
|
||||
#include "core/system/event_buffer.hpp"
|
||||
#include "game/options.hpp"
|
||||
#include "game/options_apply.hpp"
|
||||
#include "utils/defaults.hpp"
|
||||
|
||||
namespace GlobalInputs {
|
||||
@@ -30,13 +31,6 @@ namespace GlobalInputs {
|
||||
float exit_window_s = 0.0F;
|
||||
bool quit_requested = false;
|
||||
|
||||
// Canvia uniforms i shader actiu sense recrear la finestra.
|
||||
void reapplyShader() {
|
||||
Screen::get().setActiveShader(Options::buildActiveShader());
|
||||
Screen::get().applyPostFXParams(Options::buildPostFXParams());
|
||||
Screen::get().applyCrtPiParams(Options::buildCrtPiParams());
|
||||
}
|
||||
|
||||
void notifyLocale(const std::string& key) {
|
||||
Notification::notify(Locale::get().text(key));
|
||||
}
|
||||
@@ -76,14 +70,14 @@ namespace GlobalInputs {
|
||||
void onToggleShader() {
|
||||
const bool NEW_ENABLED = !Options::video().shader.enabled;
|
||||
Options::setShaderEnabled(NEW_ENABLED);
|
||||
reapplyShader();
|
||||
OptionsApply::reapplyShader();
|
||||
notifyLocale(NEW_ENABLED ? "input.shader_on" : "input.shader_off");
|
||||
}
|
||||
|
||||
void onNextShader() {
|
||||
const std::string NEW_NAME = (Options::video().shader.current_shader == "crtpi") ? "postfx" : "crtpi";
|
||||
Options::setActiveShaderName(NEW_NAME);
|
||||
reapplyShader();
|
||||
OptionsApply::reapplyShader();
|
||||
Notification::notify(Locale::get().text("input.shader") + ": " + NEW_NAME);
|
||||
}
|
||||
|
||||
@@ -111,7 +105,7 @@ namespace GlobalInputs {
|
||||
new_preset = presets[idx].name;
|
||||
Options::setPostFXPreset(new_preset);
|
||||
}
|
||||
reapplyShader();
|
||||
OptionsApply::reapplyShader();
|
||||
Notification::notify(Locale::get().text("input.preset") + ": " + new_preset);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user