only change to mouse after click
This commit is contained in:
parent
6845e5ef4f
commit
a84258c3f6
|
@ -18,7 +18,7 @@
|
||||||
<label class="config-option__title">Rumble Strength</label>
|
<label class="config-option__title">Rumble Strength</label>
|
||||||
<div class="config-option__list config-option__list">
|
<div class="config-option__list config-option__list">
|
||||||
<label class="config-option__range-label">{{rumble_strength}}</label>
|
<label class="config-option__range-label">{{rumble_strength}}</label>
|
||||||
<input id="rumble_strength_input" type="range" min="0" max="100" style="flex:1;margin: 0dp;nav-up:auto;nav-down:auto;" data-value="rumble_strength"/>
|
<input class="nav-vert" id="rumble_strength_input" type="range" min="0" max="100" style="flex: 1; margin: 0dp;" data-value="rumble_strength"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -27,6 +27,21 @@ body
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.nav-vert {
|
||||||
|
@extend %nav-vert;
|
||||||
|
}
|
||||||
|
.nav-horiz {
|
||||||
|
@extend %nav-horiz;
|
||||||
|
}
|
||||||
|
.nav-dir {
|
||||||
|
@extend %nav-dir;
|
||||||
|
}
|
||||||
|
.nav-foc {
|
||||||
|
@extend %nav-foc;
|
||||||
|
}
|
||||||
|
.nav-all {
|
||||||
|
@extend %nav-all;
|
||||||
|
}
|
||||||
|
|
||||||
*, *:before, *:after {
|
*, *:before, *:after {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
|
@ -1,11 +1,19 @@
|
||||||
|
|
||||||
%nav-dir {
|
%nav-vert {
|
||||||
nav-up: auto;
|
nav-up: auto;
|
||||||
nav-down: auto;
|
nav-down: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
%nav-horiz {
|
||||||
nav-right: auto;
|
nav-right: auto;
|
||||||
nav-left: auto;
|
nav-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%nav-dir {
|
||||||
|
@extend %nav-vert;
|
||||||
|
@extend %nav-horiz;
|
||||||
|
}
|
||||||
|
|
||||||
%nav-foc {
|
%nav-foc {
|
||||||
focus: auto;
|
focus: auto;
|
||||||
tab-index: auto;
|
tab-index: auto;
|
||||||
|
|
|
@ -771,9 +771,9 @@ struct UIContext {
|
||||||
std::unordered_map<recomp::Menu, Rml::ElementDocument*> documents;
|
std::unordered_map<recomp::Menu, Rml::ElementDocument*> documents;
|
||||||
Rml::ElementDocument* current_document;
|
Rml::ElementDocument* current_document;
|
||||||
Rml::Element* prev_focused;
|
Rml::Element* prev_focused;
|
||||||
bool mouse_is_active = true;
|
|
||||||
bool mouse_is_active_changed = false;
|
bool mouse_is_active_changed = false;
|
||||||
public:
|
public:
|
||||||
|
bool mouse_is_active = false;
|
||||||
std::unique_ptr<SystemInterface_SDL> system_interface;
|
std::unique_ptr<SystemInterface_SDL> system_interface;
|
||||||
std::unique_ptr<RmlRenderInterface_RT64> render_interface;
|
std::unique_ptr<RmlRenderInterface_RT64> render_interface;
|
||||||
std::unique_ptr<Rml::FontEngineInterface> font_interface;
|
std::unique_ptr<Rml::FontEngineInterface> font_interface;
|
||||||
|
@ -811,6 +811,8 @@ struct UIContext {
|
||||||
current_document = nullptr;
|
current_document = nullptr;
|
||||||
}
|
}
|
||||||
prev_focused = nullptr;
|
prev_focused = nullptr;
|
||||||
|
mouse_is_active = false;
|
||||||
|
mouse_is_active_changed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void swap_config_menu(recomp::ConfigSubmenu submenu) {
|
void swap_config_menu(recomp::ConfigSubmenu submenu) {
|
||||||
|
@ -821,6 +823,8 @@ struct UIContext {
|
||||||
if (config_tabset != nullptr) {
|
if (config_tabset != nullptr) {
|
||||||
config_tabset->SetActiveTab(static_cast<int>(submenu));
|
config_tabset->SetActiveTab(static_cast<int>(submenu));
|
||||||
prev_focused = nullptr;
|
prev_focused = nullptr;
|
||||||
|
mouse_is_active = false;
|
||||||
|
mouse_is_active_changed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -851,6 +855,8 @@ struct UIContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
prev_focused = nullptr;
|
prev_focused = nullptr;
|
||||||
|
mouse_is_active = false;
|
||||||
|
mouse_is_active_changed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void make_event_listeners() {
|
void make_event_listeners() {
|
||||||
|
@ -1100,6 +1106,11 @@ void draw_hook(RT64::RenderCommandList* command_list, RT64::RenderFramebuffer* s
|
||||||
// Implement some additional behavior for specific events on top of what RmlUi normally does with them.
|
// Implement some additional behavior for specific events on top of what RmlUi normally does with them.
|
||||||
switch (cur_event.type) {
|
switch (cur_event.type) {
|
||||||
case SDL_EventType::SDL_MOUSEMOTION:
|
case SDL_EventType::SDL_MOUSEMOTION:
|
||||||
|
if (!ui_context->rml.mouse_is_active) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// fallthrough
|
||||||
|
case SDL_EventType::SDL_MOUSEBUTTONDOWN:
|
||||||
mouse_moved = true;
|
mouse_moved = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue