Skip to content

Commit b864cce

Browse files
committed
Fix wrong presets names
1 parent 136e3fd commit b864cce

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

alvr/dashboard/src/dashboard/components/settings_controls/number.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl Control {
9898
ui.style_mut().spacing.interact_size.y = SCROLLBAR_DOT_DIAMETER;
9999
ui.add(slider)
100100
};
101-
101+
102102
let mut drag_value = DragValue::new(editing_value_mut);
103103
// Note: the following ifs cannot be merged with the ones above to avoid double
104104
// mutable borrow of editing_value_mut.

alvr/dashboard/src/dashboard/components/settings_controls/presets/builtin_schema.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn bool_modifier(target_path: &str, value: bool) -> PresetModifier {
3131

3232
pub fn resolution_schema() -> PresetSchemaNode {
3333
PresetSchemaNode::HigherOrderChoice(HigherOrderChoiceSchema {
34-
name: "resolution".into(),
34+
name: "Resolution".into(),
3535
strings: [(
3636
"help".into(),
3737
"Choosing too high resolution (commonly 'High (width: 5184)') may result in high latency or black screen.".into(),
@@ -88,7 +88,7 @@ pub fn resolution_schema() -> PresetSchemaNode {
8888

8989
pub fn framerate_schema() -> PresetSchemaNode {
9090
PresetSchemaNode::HigherOrderChoice(HigherOrderChoiceSchema {
91-
name: "preferred_framerate".into(),
91+
name: "Preferred framerate".into(),
9292
strings: HashMap::new(),
9393
flags: ["steamvr-restart".into()].into_iter().collect(),
9494
options: [60, 72, 80, 90, 120]
@@ -111,7 +111,7 @@ pub fn framerate_schema() -> PresetSchemaNode {
111111

112112
pub fn codec_preset_schema() -> PresetSchemaNode {
113113
PresetSchemaNode::HigherOrderChoice(HigherOrderChoiceSchema {
114-
name: "codec_preset".into(),
114+
name: "Codec preset".into(),
115115
strings: [(
116116
"help".into(),
117117
"AV1 encoding is only supported on RDNA3, Ada Lovelace, Intel ARC or newer GPUs (AMD RX 7xxx+ , NVIDIA RTX 40xx+, Intel ARC)
@@ -141,7 +141,7 @@ and on headsets that have XR2 Gen 2 onboard (Quest 3, Pico 4 Ultra)"
141141

142142
pub fn encoder_preset_schema() -> PresetSchemaNode {
143143
PresetSchemaNode::HigherOrderChoice(HigherOrderChoiceSchema {
144-
name: "encoder_preset".into(),
144+
name: "Encoder preset".into(),
145145
strings: [(
146146
"help".into(),
147147
"Selecting a quality too high may result in stuttering or still image!".into(),
@@ -180,7 +180,7 @@ pub fn encoder_preset_schema() -> PresetSchemaNode {
180180
pub fn foveation_preset_schema() -> PresetSchemaNode {
181181
const PREFIX: &str = "session_settings.video.foveated_encoding";
182182
PresetSchemaNode::HigherOrderChoice(HigherOrderChoiceSchema {
183-
name: "foveation_preset".into(),
183+
name: "Foveation preset".into(),
184184
strings: [(
185185
"help".into(),
186186
"Foveation affects pixelation on the edges of \

alvr/dashboard/src/dashboard/components/settings_controls/presets/higher_order_choice.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use settings_schema::{SchemaEntry, SchemaNode};
77
use std::collections::{HashMap, HashSet};
88

99
pub struct Control {
10+
name: String,
1011
modifiers: HashMap<String, Vec<PathValuePair>>,
1112
control: SettingControl,
1213
preset_json: json::Value,
@@ -35,11 +36,11 @@ impl Control {
3536
.collect();
3637

3738
let mut strings = schema.strings;
38-
strings.insert("display_name".into(), schema.name);
39+
strings.insert("display_name".into(), schema.name.clone());
3940

4041
let control_schema = SchemaNode::Section {
4142
entries: vec![SchemaEntry {
42-
name: "".into(),
43+
name: schema.name.clone(),
4344
strings,
4445
flags: schema.flags,
4546
content: SchemaNode::Choice {
@@ -76,9 +77,10 @@ impl Control {
7677
control_schema,
7778
);
7879

79-
let preset_json = json::json!({ "": { "variant": "" } });
80+
let preset_json = json::json!({ {&schema.name}: { "variant": "" } });
8081

8182
Self {
83+
name: schema.name,
8284
modifiers,
8385
control,
8486
preset_json,
@@ -124,7 +126,7 @@ impl Control {
124126
}
125127

126128
// Note: if no modifier matched, the control will unselect all options
127-
self.preset_json[""]["variant"] = json::Value::String(selected_option);
129+
self.preset_json[&self.name]["variant"] = json::Value::String(selected_option);
128130
}
129131

130132
pub fn ui(&mut self, ui: &mut Ui) -> Vec<PathValuePair> {

0 commit comments

Comments
 (0)