mirror of
https://github.com/BanjoRecomp/BanjoRecomp
synced 2026-05-28 07:54:59 -04:00
remove deprecated controls panel
This commit is contained in:
+2
-10
@@ -24,7 +24,6 @@
|
||||
}
|
||||
</style>
|
||||
<link type="text/template" href="config_menu/general.rml" />
|
||||
<link type="text/template" href="config_menu/controls.rml" />
|
||||
<link type="text/template" href="config_menu/graphics.rml" />
|
||||
<link type="text/template" href="config_menu/sound.rml" />
|
||||
<link type="text/template" href="config_menu/mods.rml" />
|
||||
@@ -47,8 +46,8 @@
|
||||
<div>Controls</div>
|
||||
<div class="tab__indicator"></div>
|
||||
</tab>
|
||||
<panel class="config" data-model="controls_model">
|
||||
<template src="config-menu__controls" />
|
||||
<panel class="config">
|
||||
<recomp-config-page-controls />
|
||||
</panel>
|
||||
<tab class="tab" id="tab_graphics">
|
||||
<div>Graphics</div>
|
||||
@@ -78,13 +77,6 @@
|
||||
<panel class="config" data-model="debug_model">
|
||||
<template src="config-menu__debug" />
|
||||
</panel>
|
||||
<tab class="tab" id="tab_controls2">
|
||||
<div>Controls new</div>
|
||||
<div class="tab__indicator"></div>
|
||||
</tab>
|
||||
<panel class="config">
|
||||
<recomp-config-page-controls />
|
||||
</panel>
|
||||
<tab class="tab" id="tab_example">
|
||||
<div>Example</div>
|
||||
<div class="tab__indicator"></div>
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
<template name="config-menu__controls">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<form class="config__form" data-attr-cur-input="cur_input_row" data-attr-cur-binding-slot="active_binding_slot">
|
||||
<div class="config__header">
|
||||
<div class="config__header-left">
|
||||
<button
|
||||
class="toggle"
|
||||
id="cont_kb_toggle"
|
||||
data-class-toggle--checked="input_device_is_keyboard"
|
||||
onclick="toggle_input_device"
|
||||
style="nav-down: #input_row_button_0_0; nav-up: #tab_controls"
|
||||
>
|
||||
<div class="toggle__border" />
|
||||
<div class="toggle__floater" />
|
||||
<div class="toggle__icons">
|
||||
<div class="toggle__icon toggle__icon--left"><div></div></div>
|
||||
<div class="toggle__icon toggle__icon--right"><div></div></div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
class="button button--warning"
|
||||
style="nav-down:#input_row_button_0_0"
|
||||
data-event-click="reset_input_bindings_to_defaults"
|
||||
>
|
||||
<div class="button__label">Reset to defaults</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="config__wrapper input-config">
|
||||
<div class="input-config__horizontal-split">
|
||||
<div class="input-config__mappings" data-event-mouseout="set_input_row_focus(-1)">
|
||||
<div class="input-config__mappings-scroll">
|
||||
<div class="input-config__mappings-wrapper">
|
||||
<div
|
||||
class="control-option"
|
||||
data-attr-id="'input_row_' + i"
|
||||
data-for="input_bindings, i : inputs.array"
|
||||
data-event-mouseover="set_input_row_focus(i)"
|
||||
data-class-control-option--active="get_input_enum_name(i)==cur_input_row"
|
||||
data-if="!input_device_is_keyboard || (get_input_enum_name(i) != 'TOGGLE_MENU' && get_input_enum_name(i) != 'ACCEPT_MENU' && get_input_enum_name(i) != 'APPLY_MENU')"
|
||||
>
|
||||
<label
|
||||
class="control-option__label"
|
||||
>{{get_input_name(i)}}</label>
|
||||
<div class="control-option__bindings">
|
||||
<button
|
||||
data-attr-id="'input_row_button_' + i + '_' + j"
|
||||
data-event-blur="set_input_row_focus(-1)"
|
||||
data-event-focus="set_input_row_focus(i)"
|
||||
data-for="cur_binding, j : input_bindings"
|
||||
data-event-click="set_input_binding(i,j)"
|
||||
class="prompt-font control-option__binding"
|
||||
data-attr-bind-slot="j"
|
||||
data-attr-style="i == 0 ? 'nav-up:#cont_kb_toggle' : 'nav-up:auto'"
|
||||
>
|
||||
<div class="control-option__binding-recording">
|
||||
<div class="control-option__binding-circle" />
|
||||
<div class="control-option__binding-edge">
|
||||
<svg class="control-option__binding-edge-svg" src="icons/RecordBorder.svg" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-option__binding-icon">{{cur_binding}}</div>
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
data-if="get_input_enum_name(i) != 'TOGGLE_MENU' && get_input_enum_name(i) != 'ACCEPT_MENU'"
|
||||
data-event-blur="set_input_row_focus(-1)"
|
||||
data-event-focus="set_input_row_focus(i)"
|
||||
data-event-click="clear_input_bindings(i)"
|
||||
class="icon-button icon-button--danger"
|
||||
data-attr-style="i == 0 ? 'nav-up:#cont_kb_toggle' : 'nav-up:auto'"
|
||||
>
|
||||
<svg src="icons/Trash.svg" />
|
||||
</button>
|
||||
<button
|
||||
data-if="get_input_enum_name(i) == 'TOGGLE_MENU' || get_input_enum_name(i) == 'ACCEPT_MENU'"
|
||||
data-event-blur="set_input_row_focus(-1)"
|
||||
data-event-focus="set_input_row_focus(i)"
|
||||
data-event-click="reset_single_input_binding_to_default(i)"
|
||||
class="icon-button icon-button--danger"
|
||||
data-attr-style="i == 0 ? 'nav-up:#cont_kb_toggle' : 'nav-up:auto'"
|
||||
>
|
||||
<svg src="icons/Reset.svg" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="config__wrapper">
|
||||
<p>
|
||||
description area for inputs
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</template>
|
||||
|
||||
+8
-204
@@ -31,7 +31,7 @@ h3, .tab {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.label-md, .config-debug-option__label, .button, .config-option__title, .config-option--hz .config-option__title, .config-group__title, .control-option__label {
|
||||
.label-md, .config-debug-option__label, .button, .config-option__title, .config-option--hz .config-option__title, .config-group__title {
|
||||
font-size: 28dp;
|
||||
letter-spacing: 3.08dp;
|
||||
line-height: 28dp;
|
||||
@@ -103,21 +103,21 @@ h3, .tab {
|
||||
*/
|
||||
.nav-vert, .nav-dir, .nav-all, .config-debug__select-wrapper select selectbox option, .config-debug__select-wrapper select, .config-debug__select-wrapper input, .toggle, .subtitle-title:not(:disabled, [disabled]), .menu-list-item:not(:disabled, [disabled]), .icon-button:not([disabled]), .button:not([disabled]), .button, .config-option-dropdown__select selectbox option, .config-option-dropdown__wrapper selectbox option, .config-option-textfield__select selectbox option, .config-option-textfield__wrapper selectbox option, .config-option-dropdown__select, .config-option-dropdown__wrapper, .config-option-textfield__select, .config-option-textfield__wrapper, .config-option__radio-tabs input.radio,
|
||||
.config-option__list input.radio, .config-option__radio-tabs .config-option__checkbox,
|
||||
.config-option__list .config-option__checkbox, .tab, .control-option__binding:not([disabled]) {
|
||||
.config-option__list .config-option__checkbox, .tab {
|
||||
nav-up: auto;
|
||||
nav-down: auto;
|
||||
}
|
||||
|
||||
.nav-horiz, .nav-dir, .nav-all, .config-debug__select-wrapper select selectbox option, .config-debug__select-wrapper select, .config-debug__select-wrapper input, .toggle, .subtitle-title:not(:disabled, [disabled]), .menu-list-item:not(:disabled, [disabled]), .icon-button:not([disabled]), .button:not([disabled]), .button, .config-option-dropdown__select selectbox option, .config-option-dropdown__wrapper selectbox option, .config-option-textfield__select selectbox option, .config-option-textfield__wrapper selectbox option, .config-option-dropdown__select, .config-option-dropdown__wrapper, .config-option-textfield__select, .config-option-textfield__wrapper, .config-option__radio-tabs input.radio,
|
||||
.config-option__list input.radio, .config-option__radio-tabs .config-option__checkbox,
|
||||
.config-option__list .config-option__checkbox, .tab, .control-option__binding:not([disabled]) {
|
||||
.config-option__list .config-option__checkbox, .tab {
|
||||
nav-right: auto;
|
||||
nav-left: auto;
|
||||
}
|
||||
|
||||
.nav-foc, .nav-all, .config-debug__select-wrapper select selectbox option, .config-debug__select-wrapper select, .config-debug__select-wrapper input, .toggle, .subtitle-title:not(:disabled, [disabled]), .menu-list-item:not(:disabled, [disabled]), .icon-button:not([disabled]), .button:not([disabled]), .button, .config-option-dropdown__select selectbox option, .config-option-dropdown__wrapper selectbox option, .config-option-textfield__select selectbox option, .config-option-textfield__wrapper selectbox option, .config-option-dropdown__select, .config-option-dropdown__wrapper, .config-option-textfield__select, .config-option-textfield__wrapper, .config-option__radio-tabs input.radio,
|
||||
.config-option__list input.radio, .config-option__radio-tabs .config-option__checkbox,
|
||||
.config-option__list .config-option__checkbox, .tab, .control-option__binding:not([disabled]) {
|
||||
.config-option__list .config-option__checkbox, .tab {
|
||||
focus: auto;
|
||||
tab-index: auto;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ h3, .tab {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.label-md, .config-debug-option__label, .button, .config-option__title, .config-option--hz .config-option__title, .config-group__title, .control-option__label {
|
||||
.label-md, .config-debug-option__label, .button, .config-option__title, .config-option--hz .config-option__title, .config-group__title {
|
||||
font-size: 28dp;
|
||||
letter-spacing: 3.08dp;
|
||||
line-height: 28dp;
|
||||
@@ -230,21 +230,21 @@ h3, .tab {
|
||||
*/
|
||||
.nav-vert, .nav-dir, .nav-all, .config-debug__select-wrapper select selectbox option, .config-debug__select-wrapper select, .config-debug__select-wrapper input, .toggle, .subtitle-title:not(:disabled, [disabled]), .menu-list-item:not(:disabled, [disabled]), .icon-button:not([disabled]), .button:not([disabled]), .button, .config-option-dropdown__select selectbox option, .config-option-dropdown__wrapper selectbox option, .config-option-textfield__select selectbox option, .config-option-textfield__wrapper selectbox option, .config-option-dropdown__select, .config-option-dropdown__wrapper, .config-option-textfield__select, .config-option-textfield__wrapper, .config-option__radio-tabs input.radio,
|
||||
.config-option__list input.radio, .config-option__radio-tabs .config-option__checkbox,
|
||||
.config-option__list .config-option__checkbox, .tab, .control-option__binding:not([disabled]) {
|
||||
.config-option__list .config-option__checkbox, .tab {
|
||||
nav-up: auto;
|
||||
nav-down: auto;
|
||||
}
|
||||
|
||||
.nav-horiz, .nav-dir, .nav-all, .config-debug__select-wrapper select selectbox option, .config-debug__select-wrapper select, .config-debug__select-wrapper input, .toggle, .subtitle-title:not(:disabled, [disabled]), .menu-list-item:not(:disabled, [disabled]), .icon-button:not([disabled]), .button:not([disabled]), .button, .config-option-dropdown__select selectbox option, .config-option-dropdown__wrapper selectbox option, .config-option-textfield__select selectbox option, .config-option-textfield__wrapper selectbox option, .config-option-dropdown__select, .config-option-dropdown__wrapper, .config-option-textfield__select, .config-option-textfield__wrapper, .config-option__radio-tabs input.radio,
|
||||
.config-option__list input.radio, .config-option__radio-tabs .config-option__checkbox,
|
||||
.config-option__list .config-option__checkbox, .tab, .control-option__binding:not([disabled]) {
|
||||
.config-option__list .config-option__checkbox, .tab {
|
||||
nav-right: auto;
|
||||
nav-left: auto;
|
||||
}
|
||||
|
||||
.nav-foc, .nav-all, .config-debug__select-wrapper select selectbox option, .config-debug__select-wrapper select, .config-debug__select-wrapper input, .toggle, .subtitle-title:not(:disabled, [disabled]), .menu-list-item:not(:disabled, [disabled]), .icon-button:not([disabled]), .button:not([disabled]), .button, .config-option-dropdown__select selectbox option, .config-option-dropdown__wrapper selectbox option, .config-option-textfield__select selectbox option, .config-option-textfield__wrapper selectbox option, .config-option-dropdown__select, .config-option-dropdown__wrapper, .config-option-textfield__select, .config-option-textfield__wrapper, .config-option__radio-tabs input.radio,
|
||||
.config-option__list input.radio, .config-option__radio-tabs .config-option__checkbox,
|
||||
.config-option__list .config-option__checkbox, .tab, .control-option__binding:not([disabled]) {
|
||||
.config-option__list .config-option__checkbox, .tab {
|
||||
focus: auto;
|
||||
tab-index: auto;
|
||||
}
|
||||
@@ -477,173 +477,6 @@ scrollbarhorizontal sliderbar {
|
||||
margin-right: 4dp;
|
||||
}
|
||||
|
||||
.control-option {
|
||||
color: TextDim;
|
||||
transition: color 0.05s linear-in-out, background-color 0.05s linear-in-out, opacity 0.05s linear-in-out;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding: 4dp 16dp 4dp 20dp;
|
||||
border-radius: 12dp;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
.control-option svg {
|
||||
image-color: TextDim;
|
||||
}
|
||||
.control-option svg {
|
||||
transition: image-color 0.05s linear-in-out, background-color 0.05s linear-in-out;
|
||||
}
|
||||
.control-option:focus-visible:not(:disabled, [disabled]), .control-option:hover:not(:disabled, [disabled]) {
|
||||
color: Text;
|
||||
background-color: BGOverlay;
|
||||
}
|
||||
.control-option:focus-visible:not(:disabled, [disabled]) svg, .control-option:hover:not(:disabled, [disabled]) svg {
|
||||
image-color: Text;
|
||||
}
|
||||
.control-option:disabled, .control-option[disabled] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
[cur-binding-slot="0"] .control-option--active .control-option__binding[bind-slot="0"] {
|
||||
border-color: Danger;
|
||||
}
|
||||
[cur-binding-slot="0"] .control-option--active .control-option__binding[bind-slot="0"] .control-option__binding-icon {
|
||||
opacity: 0;
|
||||
}
|
||||
[cur-binding-slot="0"] .control-option--active .control-option__binding[bind-slot="0"] .control-option__binding-recording {
|
||||
opacity: 1;
|
||||
}
|
||||
[cur-binding-slot="1"] .control-option--active .control-option__binding[bind-slot="1"] {
|
||||
border-color: Danger;
|
||||
}
|
||||
[cur-binding-slot="1"] .control-option--active .control-option__binding[bind-slot="1"] .control-option__binding-icon {
|
||||
opacity: 0;
|
||||
}
|
||||
[cur-binding-slot="1"] .control-option--active .control-option__binding[bind-slot="1"] .control-option__binding-recording {
|
||||
opacity: 1;
|
||||
}
|
||||
.control-option .icon-button {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.control-option__label {
|
||||
flex: 2 1 300dp;
|
||||
height: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.control-option__bindings {
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex: 2 1 400dp;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 56dp;
|
||||
padding: 0 12dp 0 4dp;
|
||||
}
|
||||
|
||||
.control-option__binding {
|
||||
color: TextDim;
|
||||
transition: color 0.05s linear-in-out, background-color 0.05s linear-in-out, opacity 0.05s linear-in-out, border-color 0.05s linear-in-out;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex: 1 1 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 56dp;
|
||||
margin: 0 4dp;
|
||||
padding: 8dp;
|
||||
border-width: 1.1dp;
|
||||
border-radius: 12dp;
|
||||
border-color: BGOverlay;
|
||||
background-color: BGOverlay;
|
||||
}
|
||||
.control-option__binding svg {
|
||||
image-color: TextDim;
|
||||
}
|
||||
.control-option__binding svg {
|
||||
transition: image-color 0.05s linear-in-out, background-color 0.05s linear-in-out;
|
||||
}
|
||||
.control-option__binding:focus, .control-option__binding:hover {
|
||||
color: Text;
|
||||
border-color: Text;
|
||||
background-color: BorderSoft;
|
||||
}
|
||||
.control-option__binding:focus svg, .control-option__binding:hover svg {
|
||||
image-color: Text;
|
||||
}
|
||||
.control-option__binding:active {
|
||||
color: TextActive;
|
||||
}
|
||||
.control-option__binding:active svg {
|
||||
image-color: TextActive;
|
||||
}
|
||||
.control-option__binding:disabled, .control-option__binding[disabled] {
|
||||
color: TextDim;
|
||||
opacity: 0.5;
|
||||
}
|
||||
.control-option__binding:disabled svg, .control-option__binding[disabled] svg {
|
||||
image-color: TextDim;
|
||||
}
|
||||
.control-option__binding:not([disabled]) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.control-option__binding-icon {
|
||||
transition: color 0.05s linear-in-out, background-color 0.05s linear-in-out, opacity 0.05s linear-in-out;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@keyframes control-option__binding-recording-scale {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
transform: scale(0.85);
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
.control-option__binding-recording {
|
||||
transition: color 0.05s linear-in-out, background-color 0.05s linear-in-out, opacity 0.05s linear-in-out;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
}
|
||||
.control-option__binding-recording .control-option__binding-circle {
|
||||
width: 24dp;
|
||||
height: 24dp;
|
||||
animation: 1.5s sine-in-out infinite control-option__binding-recording-scale;
|
||||
border-radius: 24dp;
|
||||
background-color: Danger;
|
||||
}
|
||||
.control-option__binding-recording .control-option__binding-edge {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: 36dp;
|
||||
height: 36dp;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.control-option__binding-recording .control-option__binding-edge > svg.control-option__binding-edge-svg {
|
||||
width: 36dp;
|
||||
height: 36dp;
|
||||
image-color: Danger;
|
||||
}
|
||||
|
||||
/*
|
||||
Example:
|
||||
<tab class="tab">
|
||||
@@ -1215,35 +1048,6 @@ scrollbarhorizontal sliderbar {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.input-config {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.input-config__horizontal-split {
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: row;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.input-config__mappings {
|
||||
display: block;
|
||||
flex: 1 1 auto;
|
||||
min-width: 640dp;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.input-config__mappings-scroll {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.input-config__mappings-wrapper {
|
||||
padding: 8dp;
|
||||
}
|
||||
|
||||
.button {
|
||||
border-color: PrimaryA80;
|
||||
background-color: PrimaryA5;
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
@use 'sass:color';
|
||||
@use 'sass:math';
|
||||
|
||||
.control-option {
|
||||
@include set-color($color-text-dim);
|
||||
@include trans-colors-svg;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding: space(4) space(16) space(4) space(20);
|
||||
border-radius: $border-radius-sm;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
|
||||
&:focus-visible:not(:disabled, [disabled]),
|
||||
&:hover:not(:disabled, [disabled]) {
|
||||
@include set-color($color-text);
|
||||
background-color: $color-bg-overlay;
|
||||
}
|
||||
|
||||
&:disabled, &[disabled] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
&--active {
|
||||
// while actively looking for inputs, set styles to the correct slots
|
||||
$valid-binding-slots: 0, 1;
|
||||
@each $slot in $valid-binding-slots {
|
||||
// global attr -> this active row -> binding slot
|
||||
[cur-binding-slot="#{$slot}"] & .control-option__binding[bind-slot="#{$slot}"] {
|
||||
border-color: $color-danger;
|
||||
|
||||
.control-option__binding-icon {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.control-option__binding-recording {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon-button {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.control-option__label {
|
||||
@extend %label-md;
|
||||
flex: 2 1 space(300);
|
||||
height: auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.control-option__bindings {
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex: 2 1 space(400);
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: space(56);
|
||||
padding: 0 space(12) 0 space(4);
|
||||
}
|
||||
|
||||
.control-option__binding {
|
||||
@include set-color($color-text-dim);
|
||||
@include trans-colors-border;
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
||||
flex: 1 1 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: space(56);
|
||||
margin: 0 space(4);
|
||||
padding: space(8);
|
||||
border-width: $border-width-thickness;
|
||||
border-radius: $border-radius-sm;
|
||||
border-color: $color-bg-overlay;
|
||||
background-color: $color-bg-overlay;
|
||||
|
||||
&:focus, &:hover {
|
||||
@include set-color($color-text);
|
||||
border-color: $color-text;
|
||||
background-color: $color-border-soft;
|
||||
}
|
||||
|
||||
&:active {
|
||||
@include set-color($color-text-active);
|
||||
}
|
||||
|
||||
&:disabled, &[disabled] {
|
||||
@include set-color($color-text-dim);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
&:not([disabled]) {
|
||||
@extend %nav-all;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.control-option__binding-icon {
|
||||
@include trans-colors-opa;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@keyframes control-option__binding-recording-scale {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(0.85);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.control-option__binding-recording {
|
||||
@include trans-colors-opa;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
|
||||
.control-option__binding-circle {
|
||||
$rec-size: 24;
|
||||
|
||||
width: space($rec-size);
|
||||
height: space($rec-size);
|
||||
animation: 1.5s sine-in-out infinite control-option__binding-recording-scale;
|
||||
border-radius: space($rec-size);
|
||||
background-color: $color-danger;
|
||||
}
|
||||
|
||||
.control-option__binding-edge {
|
||||
$edge-size: 36;
|
||||
$h-edge-size: math.div($edge-size, 2);
|
||||
|
||||
position: absolute;
|
||||
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
width: space($edge-size);
|
||||
height: space($edge-size);
|
||||
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
> svg.control-option__binding-edge-svg {
|
||||
width: space($edge-size);
|
||||
height: space($edge-size);
|
||||
image-color: $color-danger;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
@use 'sass:math';
|
||||
|
||||
// Probably will need to adjust for other langs...
|
||||
$mapping-min-width: 80 * 8;
|
||||
$visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width;
|
||||
|
||||
.input-config {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.input-config__horizontal-split {
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: row;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.input-config__mappings {
|
||||
display: block;
|
||||
flex: 1 1 auto;
|
||||
min-width: space($mapping-min-width);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.input-config__mappings-scroll {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.input-config__mappings-wrapper {
|
||||
padding: space(8);
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
@import "./CenteredPage";
|
||||
@import "./ControlOption";
|
||||
@import "./Tabs";
|
||||
@import "./Config";
|
||||
@import "./ConfigGroup";
|
||||
@import "./ConfigOption";
|
||||
@import "./ConfigDescription";
|
||||
@import "./InputConfig";
|
||||
@import "./Button";
|
||||
@import "./IconButton";
|
||||
@import "./Launcher";
|
||||
|
||||
@@ -15,13 +15,9 @@
|
||||
ultramodern::renderer::GraphicsConfig new_options;
|
||||
Rml::DataModelHandle nav_help_model_handle;
|
||||
Rml::DataModelHandle general_model_handle;
|
||||
Rml::DataModelHandle controls_model_handle;
|
||||
Rml::DataModelHandle graphics_model_handle;
|
||||
Rml::DataModelHandle sound_options_model_handle;
|
||||
|
||||
// True if controller config menu is open, false if keyboard config menu is open, undefined otherwise
|
||||
bool configuring_controller = false;
|
||||
|
||||
int recompui::config_tab_to_index(recompui::ConfigTab tab) {
|
||||
switch (tab) {
|
||||
case recompui::ConfigTab::General:
|
||||
@@ -91,9 +87,6 @@ void bind_atomic(Rml::DataModelConstructor& constructor, Rml::DataModelHandle ha
|
||||
);
|
||||
}
|
||||
|
||||
static int scanned_binding_index = -1;
|
||||
static int scanned_input_index = -1;
|
||||
static int focused_input_index = -1;
|
||||
static int focused_config_option_index = -1;
|
||||
|
||||
static bool msaa2x_supported = false;
|
||||
@@ -457,15 +450,6 @@ public:
|
||||
[](const std::string& param, Rml::Event& event) {
|
||||
banjo::open_quit_game_prompt();
|
||||
});
|
||||
|
||||
recompui::register_event(listener, "toggle_input_device",
|
||||
[](const std::string& param, Rml::Event& event) {
|
||||
cur_device = cur_device == recomp::InputDevice::Controller
|
||||
? recomp::InputDevice::Keyboard
|
||||
: recomp::InputDevice::Controller;
|
||||
controls_model_handle.DirtyVariable("input_device_is_keyboard");
|
||||
controls_model_handle.DirtyVariable("inputs");
|
||||
});
|
||||
}
|
||||
|
||||
void bind_config_list_events(Rml::DataModelConstructor &constructor) {
|
||||
@@ -588,174 +572,6 @@ public:
|
||||
graphics_model_handle = constructor.GetModelHandle();
|
||||
}
|
||||
|
||||
void make_controls_bindings(Rml::Context* context) {
|
||||
Rml::DataModelConstructor constructor = context->CreateDataModel("controls_model");
|
||||
if (!constructor) {
|
||||
throw std::runtime_error("Failed to make RmlUi data model for the controls config menu");
|
||||
}
|
||||
|
||||
constructor.BindFunc("input_count", [](Rml::Variant& out) { out = static_cast<uint64_t>(recomp::get_num_inputs()); } );
|
||||
constructor.BindFunc("input_device_is_keyboard", [](Rml::Variant& out) { out = cur_device == recomp::InputDevice::Keyboard; } );
|
||||
|
||||
constructor.RegisterTransformFunc("get_input_name", [](const Rml::VariantList& inputs) {
|
||||
return Rml::Variant{recomp::get_input_name(static_cast<recomp::GameInput>(inputs.at(0).Get<size_t>()))};
|
||||
});
|
||||
|
||||
constructor.RegisterTransformFunc("get_input_enum_name", [](const Rml::VariantList& inputs) {
|
||||
return Rml::Variant{recomp::get_input_enum_name(static_cast<recomp::GameInput>(inputs.at(0).Get<size_t>()))};
|
||||
});
|
||||
|
||||
constructor.BindEventCallback("set_input_binding",
|
||||
[](Rml::DataModelHandle model_handle, Rml::Event& event, const Rml::VariantList& inputs) {
|
||||
scanned_input_index = inputs.at(0).Get<size_t>();
|
||||
scanned_binding_index = inputs.at(1).Get<size_t>();
|
||||
model_handle.DirtyVariable("active_binding_input");
|
||||
model_handle.DirtyVariable("active_binding_slot");
|
||||
});
|
||||
|
||||
constructor.BindEventCallback("reset_input_bindings_to_defaults",
|
||||
[](Rml::DataModelHandle model_handle, Rml::Event& event, const Rml::VariantList& inputs) {
|
||||
if (cur_device == recomp::InputDevice::Controller) {
|
||||
// TODO: Needs the profile index.
|
||||
banjo::reset_cont_input_bindings(0);
|
||||
} else {
|
||||
// TODO: Needs the profile index.
|
||||
banjo::reset_kb_input_bindings(0);
|
||||
}
|
||||
model_handle.DirtyAllVariables();
|
||||
nav_help_model_handle.DirtyVariable("nav_help__accept");
|
||||
nav_help_model_handle.DirtyVariable("nav_help__exit");
|
||||
graphics_model_handle.DirtyVariable("gfx_help__apply");
|
||||
});
|
||||
|
||||
constructor.BindEventCallback("clear_input_bindings",
|
||||
[](Rml::DataModelHandle model_handle, Rml::Event& event, const Rml::VariantList& inputs) {
|
||||
recomp::GameInput input = static_cast<recomp::GameInput>(inputs.at(0).Get<size_t>());
|
||||
for (size_t binding_index = 0; binding_index < recomp::bindings_per_input; binding_index++) {
|
||||
// TODO: Needs the profile index.
|
||||
recomp::set_input_binding(0, input, binding_index, recomp::InputField{});
|
||||
}
|
||||
model_handle.DirtyVariable("inputs");
|
||||
graphics_model_handle.DirtyVariable("gfx_help__apply");
|
||||
});
|
||||
|
||||
constructor.BindEventCallback("reset_single_input_binding_to_default",
|
||||
[](Rml::DataModelHandle model_handle, Rml::Event& event, const Rml::VariantList& inputs) {
|
||||
// TODO: Needs the profile index.
|
||||
recomp::GameInput input = static_cast<recomp::GameInput>(inputs.at(0).Get<size_t>());
|
||||
banjo::reset_single_input_binding(0, cur_device, input);
|
||||
model_handle.DirtyVariable("inputs");
|
||||
nav_help_model_handle.DirtyVariable("nav_help__accept");
|
||||
nav_help_model_handle.DirtyVariable("nav_help__exit");
|
||||
});
|
||||
|
||||
constructor.BindEventCallback("set_input_row_focus",
|
||||
[](Rml::DataModelHandle model_handle, Rml::Event& event, const Rml::VariantList& inputs) {
|
||||
int input_index = inputs.at(0).Get<size_t>();
|
||||
// watch for mouseout being overzealous during event bubbling, only clear if the event's attached element matches the current
|
||||
if (input_index == -1 && event.GetType() == "mouseout" && event.GetCurrentElement() != event.GetTargetElement()) {
|
||||
return;
|
||||
}
|
||||
focused_input_index = input_index;
|
||||
model_handle.DirtyVariable("cur_input_row");
|
||||
});
|
||||
|
||||
// Rml variable definition for an individual InputField.
|
||||
struct InputFieldVariableDefinition : public Rml::VariableDefinition {
|
||||
InputFieldVariableDefinition() : Rml::VariableDefinition(Rml::DataVariableType::Scalar) {}
|
||||
|
||||
virtual bool Get(void* ptr, Rml::Variant& variant) override { variant = reinterpret_cast<recomp::InputField*>(ptr)->to_string(); return true; }
|
||||
virtual bool Set(void* ptr, const Rml::Variant& variant) override { return false; }
|
||||
};
|
||||
// Static instance of the InputField variable definition to have a pointer to return to RmlUi.
|
||||
static InputFieldVariableDefinition input_field_definition_instance{};
|
||||
|
||||
// Rml variable definition for an array of InputField values (e.g. all the bindings for a single input).
|
||||
struct BindingContainerVariableDefinition : public Rml::VariableDefinition {
|
||||
BindingContainerVariableDefinition() : Rml::VariableDefinition(Rml::DataVariableType::Array) {}
|
||||
|
||||
virtual bool Get(void* ptr, Rml::Variant& variant) override { return false; }
|
||||
virtual bool Set(void* ptr, const Rml::Variant& variant) override { return false; }
|
||||
|
||||
virtual int Size(void* ptr) override { return recomp::bindings_per_input; }
|
||||
virtual Rml::DataVariable Child(void* ptr, const Rml::DataAddressEntry& address) override {
|
||||
recomp::GameInput input = static_cast<recomp::GameInput>((uintptr_t)ptr);
|
||||
// TODO: Needs the profile index.
|
||||
return Rml::DataVariable{&input_field_definition_instance, &recomp::get_input_binding(0, input, address.index)};
|
||||
}
|
||||
};
|
||||
// Static instance of the InputField array variable definition to have a fixed pointer to return to RmlUi.
|
||||
static BindingContainerVariableDefinition binding_container_var_instance{};
|
||||
|
||||
// Rml variable definition for an array of an array of InputField values (e.g. all the bindings for all inputs).
|
||||
struct BindingArrayContainerVariableDefinition : public Rml::VariableDefinition {
|
||||
BindingArrayContainerVariableDefinition() : Rml::VariableDefinition(Rml::DataVariableType::Array) {}
|
||||
|
||||
virtual bool Get(void* ptr, Rml::Variant& variant) override { return false; }
|
||||
virtual bool Set(void* ptr, const Rml::Variant& variant) override { return false; }
|
||||
|
||||
virtual int Size(void* ptr) override { return recomp::get_num_inputs(); }
|
||||
virtual Rml::DataVariable Child(void* ptr, const Rml::DataAddressEntry& address) override {
|
||||
// Encode the input index as the pointer to avoid needing to do any allocations.
|
||||
return Rml::DataVariable(&binding_container_var_instance, (void*)(uintptr_t)address.index);
|
||||
}
|
||||
};
|
||||
|
||||
// Static instance of the BindingArrayContainerVariableDefinition variable definition to have a fixed pointer to return to RmlUi.
|
||||
static BindingArrayContainerVariableDefinition binding_array_var_instance{};
|
||||
|
||||
struct InputContainerVariableDefinition : public Rml::VariableDefinition {
|
||||
InputContainerVariableDefinition() : Rml::VariableDefinition(Rml::DataVariableType::Struct) {}
|
||||
|
||||
virtual bool Get(void* ptr, Rml::Variant& variant) override { return true; }
|
||||
virtual bool Set(void* ptr, const Rml::Variant& variant) override { return false; }
|
||||
|
||||
virtual int Size(void* ptr) override { return recomp::get_num_inputs(); }
|
||||
virtual Rml::DataVariable Child(void* ptr, const Rml::DataAddressEntry& address) override {
|
||||
if (address.name == "array") {
|
||||
return Rml::DataVariable(&binding_array_var_instance, nullptr);
|
||||
}
|
||||
else {
|
||||
recomp::GameInput input = recomp::get_input_from_enum_name(address.name);
|
||||
if (input != recomp::GameInput::COUNT) {
|
||||
return Rml::DataVariable(&binding_container_var_instance, (void*)(uintptr_t)input);
|
||||
}
|
||||
}
|
||||
return Rml::DataVariable{};
|
||||
}
|
||||
};
|
||||
|
||||
// Dummy type to associate with the variable definition.
|
||||
struct InputContainer {};
|
||||
constructor.RegisterCustomDataVariableDefinition<InputContainer>(Rml::MakeUnique<InputContainerVariableDefinition>());
|
||||
|
||||
// Dummy instance of the dummy type to bind to the variable.
|
||||
static InputContainer dummy_container;
|
||||
constructor.Bind("inputs", &dummy_container);
|
||||
|
||||
constructor.BindFunc("cur_input_row", [](Rml::Variant& out) {
|
||||
if (focused_input_index == -1) {
|
||||
out = "NONE";
|
||||
}
|
||||
else {
|
||||
out = recomp::get_input_enum_name(static_cast<recomp::GameInput>(focused_input_index));
|
||||
}
|
||||
});
|
||||
|
||||
constructor.BindFunc("active_binding_input", [](Rml::Variant& out) {
|
||||
if (scanned_input_index == -1) {
|
||||
out = "NONE";
|
||||
}
|
||||
else {
|
||||
out = recomp::get_input_enum_name(static_cast<recomp::GameInput>(scanned_input_index));
|
||||
}
|
||||
});
|
||||
|
||||
constructor.Bind<int>("active_binding_slot", &scanned_binding_index);
|
||||
|
||||
controls_model_handle = constructor.GetModelHandle();
|
||||
}
|
||||
|
||||
void make_nav_help_bindings(Rml::Context* context) {
|
||||
Rml::DataModelConstructor constructor = context->CreateDataModel("nav_help_model");
|
||||
if (!constructor) {
|
||||
@@ -849,7 +665,6 @@ public:
|
||||
//recomp::config_menu_set_cont_or_kb(recompui::get_cont_active());
|
||||
make_nav_help_bindings(context);
|
||||
make_general_bindings(context);
|
||||
make_controls_bindings(context);
|
||||
make_graphics_bindings(context);
|
||||
make_sound_options_bindings(context);
|
||||
make_debug_bindings(context);
|
||||
|
||||
Reference in New Issue
Block a user