mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2024-11-22 12:59:14 +01:00
disable ds options conditionally
This commit is contained in:
parent
1caf81e1cf
commit
7648753fe7
@ -21,9 +21,9 @@
|
|||||||
<div class="config-option__list">
|
<div class="config-option__list">
|
||||||
<input type="radio" name="downsampling" data-checked="ds_option" value="1" id="ds_windowed" style="nav-up:#tab_graphics"/>
|
<input type="radio" name="downsampling" data-checked="ds_option" value="1" id="ds_windowed" style="nav-up:#tab_graphics"/>
|
||||||
<label class="config-option__tab-label" for="ds_windowed">Off</label>
|
<label class="config-option__tab-label" for="ds_windowed">Off</label>
|
||||||
<input type="radio" name="downsampling" data-checked="ds_option" value="2" id="ds_2x" style="nav-up:#tab_graphics"/>
|
<input type="radio" name="downsampling" data-attrif-disabled="res_option == 'Auto'" data-checked="ds_option" value="2" id="ds_2x" style="nav-up:#tab_graphics"/>
|
||||||
<label class="config-option__tab-label" for="ds_2x">2x</label>
|
<label class="config-option__tab-label" for="ds_2x">2x</label>
|
||||||
<input type="radio" name="downsampling" data-checked="ds_option" value="4" id="ds_4x" style="nav-right:none;nav-up:#tab_graphics"/>
|
<input type="radio" name="downsampling" data-attrif-disabled="res_option == 'Auto'" data-checked="ds_option" value="4" id="ds_4x" style="nav-right:none;nav-up:#tab_graphics"/>
|
||||||
<label class="config-option__tab-label" for="ds_4x">4x</label>
|
<label class="config-option__tab-label" for="ds_4x">4x</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="config-option__details">{{ds_info}}</div>
|
<div class="config-option__details">{{ds_info}}</div>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -103,23 +103,34 @@
|
|||||||
|
|
||||||
input.radio {
|
input.radio {
|
||||||
@extend %nav-all;
|
@extend %nav-all;
|
||||||
|
@include trans-colors-opa;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
|
||||||
&:checked + .config-option__tab-label {
|
&:not(:disabled) {
|
||||||
border-bottom: 1dp;
|
&:checked + .config-option__tab-label {
|
||||||
border-color: $color-border-hard;
|
border-bottom: 1dp;
|
||||||
|
border-color: $color-border-hard;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus + .config-option__tab-label,
|
||||||
|
&:hover + .config-option__tab-label {
|
||||||
|
color: $color-text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:disabled + .config-option__tab-label {
|
||||||
|
opacity: 0.5;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus + .config-option__tab-label,
|
|
||||||
&:hover + .config-option__tab-label {
|
|
||||||
color: $color-text;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input.range slidertrack {
|
input.range slidertrack {
|
||||||
|
@ -45,7 +45,11 @@ template <typename T>
|
|||||||
void bind_option(Rml::DataModelConstructor& constructor, const std::string& name, T* option) {
|
void bind_option(Rml::DataModelConstructor& constructor, const std::string& name, T* option) {
|
||||||
constructor.BindFunc(name,
|
constructor.BindFunc(name,
|
||||||
[option](Rml::Variant& out) { get_option(*option, out); },
|
[option](Rml::Variant& out) { get_option(*option, out); },
|
||||||
[option](const Rml::Variant& in) { set_option(*option, in); graphics_model_handle.DirtyVariable("options_changed"); graphics_model_handle.DirtyVariable("ds_info"); }
|
[option](const Rml::Variant& in) {
|
||||||
|
set_option(*option, in);
|
||||||
|
graphics_model_handle.DirtyVariable("options_changed");
|
||||||
|
graphics_model_handle.DirtyVariable("ds_info");
|
||||||
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -293,7 +297,15 @@ public:
|
|||||||
}
|
}
|
||||||
new_options = ultramodern::get_graphics_config();
|
new_options = ultramodern::get_graphics_config();
|
||||||
|
|
||||||
bind_option(constructor, "res_option", &new_options.res_option);
|
constructor.BindFunc("res_option",
|
||||||
|
[](Rml::Variant& out) { get_option(new_options.res_option, out); },
|
||||||
|
[](const Rml::Variant& in) {
|
||||||
|
set_option(new_options.res_option, in);
|
||||||
|
graphics_model_handle.DirtyVariable("options_changed");
|
||||||
|
graphics_model_handle.DirtyVariable("ds_info");
|
||||||
|
graphics_model_handle.DirtyVariable("ds_option");
|
||||||
|
}
|
||||||
|
);
|
||||||
bind_option(constructor, "wm_option", &new_options.wm_option);
|
bind_option(constructor, "wm_option", &new_options.wm_option);
|
||||||
bind_option(constructor, "ar_option", &new_options.ar_option);
|
bind_option(constructor, "ar_option", &new_options.ar_option);
|
||||||
bind_option(constructor, "msaa_option", &new_options.msaa_option);
|
bind_option(constructor, "msaa_option", &new_options.msaa_option);
|
||||||
@ -308,7 +320,11 @@ public:
|
|||||||
});
|
});
|
||||||
constructor.BindFunc("ds_option",
|
constructor.BindFunc("ds_option",
|
||||||
[](Rml::Variant& out) {
|
[](Rml::Variant& out) {
|
||||||
out = new_options.ds_option;
|
if (new_options.res_option == ultramodern::Resolution::Auto) {
|
||||||
|
out = 1;
|
||||||
|
} else {
|
||||||
|
out = new_options.ds_option;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[](const Rml::Variant& in) {
|
[](const Rml::Variant& in) {
|
||||||
new_options.ds_option = in.Get<int>();
|
new_options.ds_option = in.Get<int>();
|
||||||
|
Loading…
Reference in New Issue
Block a user