mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2024-12-27 13:11:48 +01:00
Apply graphics conf changes with F on kb or X/Start on cont (#11)
This commit is contained in:
parent
8a70b2313e
commit
d555f0c65b
@ -311,7 +311,7 @@
|
|||||||
id="apply_button"
|
id="apply_button"
|
||||||
style="nav-up:#hr_original"
|
style="nav-up:#hr_original"
|
||||||
>
|
>
|
||||||
<div class="button__label">Apply</div>
|
<div class="button__label">Apply <span class="prompt-font-sm">{{gfx_help__apply}}</span></div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -186,6 +186,7 @@ void recomp::set_cont_or_kb(bool cont_interacted) {
|
|||||||
cont_active = cont_interacted;
|
cont_active = cont_interacted;
|
||||||
nav_help_model_handle.DirtyVariable("nav_help__navigate");
|
nav_help_model_handle.DirtyVariable("nav_help__navigate");
|
||||||
nav_help_model_handle.DirtyVariable("nav_help__accept");
|
nav_help_model_handle.DirtyVariable("nav_help__accept");
|
||||||
|
graphics_model_handle.DirtyVariable("gfx_help__apply");
|
||||||
nav_help_model_handle.DirtyVariable("nav_help__exit");
|
nav_help_model_handle.DirtyVariable("nav_help__exit");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -439,8 +440,15 @@ public:
|
|||||||
recomp::register_event(listener, "config_keydown",
|
recomp::register_event(listener, "config_keydown",
|
||||||
[](const std::string& param, Rml::Event& event) {
|
[](const std::string& param, Rml::Event& event) {
|
||||||
if (!prompt_context.open && event.GetId() == Rml::EventId::Keydown) {
|
if (!prompt_context.open && event.GetId() == Rml::EventId::Keydown) {
|
||||||
if (event.GetParameter<Rml::Input::KeyIdentifier>("key_identifier", Rml::Input::KeyIdentifier::KI_UNKNOWN) == Rml::Input::KeyIdentifier::KI_ESCAPE) {
|
auto key = event.GetParameter<Rml::Input::KeyIdentifier>("key_identifier", Rml::Input::KeyIdentifier::KI_UNKNOWN);
|
||||||
|
switch (key) {
|
||||||
|
case Rml::Input::KeyIdentifier::KI_ESCAPE:
|
||||||
close_config_menu();
|
close_config_menu();
|
||||||
|
break;
|
||||||
|
case Rml::Input::KeyIdentifier::KI_F:
|
||||||
|
graphics_model_handle.DirtyVariable("options_changed");
|
||||||
|
apply_graphics_config();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -597,6 +605,14 @@ public:
|
|||||||
out = "";
|
out = "";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
constructor.BindFunc("gfx_help__apply", [](Rml::Variant& out) {
|
||||||
|
if (cont_active) {
|
||||||
|
out = PF_GAMEPAD_X " " PF_GAMEPAD_START;
|
||||||
|
} else {
|
||||||
|
out = PF_KEYBOARD_F;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
constructor.Bind("msaa2x_supported", &msaa2x_supported);
|
constructor.Bind("msaa2x_supported", &msaa2x_supported);
|
||||||
constructor.Bind("msaa4x_supported", &msaa4x_supported);
|
constructor.Bind("msaa4x_supported", &msaa4x_supported);
|
||||||
constructor.Bind("msaa8x_supported", &msaa8x_supported);
|
constructor.Bind("msaa8x_supported", &msaa8x_supported);
|
||||||
|
@ -1150,6 +1150,9 @@ int cont_button_to_key(SDL_ControllerButtonEvent& button) {
|
|||||||
return SDLK_RIGHT;
|
return SDLK_RIGHT;
|
||||||
case SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_A:
|
case SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_A:
|
||||||
return SDLK_RETURN;
|
return SDLK_RETURN;
|
||||||
|
case SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_X:
|
||||||
|
case SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_START:
|
||||||
|
return SDLK_f;
|
||||||
// Allows closing the menu
|
// Allows closing the menu
|
||||||
case SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_BACK:
|
case SDL_GameControllerButton::SDL_CONTROLLER_BUTTON_BACK:
|
||||||
return SDLK_ESCAPE;
|
return SDLK_ESCAPE;
|
||||||
|
Loading…
Reference in New Issue
Block a user