Skip to content

Commit d9f89fa

Browse files
oo8devgalister
authored andcommitted
wayvr: "Fix floor" countdown timer and sound
- 5-second timeout sound with countdown timer - sort locale JSON - modify toast lerp amount
1 parent 7699785 commit d9f89fa

File tree

11 files changed

+117
-76
lines changed

11 files changed

+117
-76
lines changed

wayvr/src/assets/lang/de.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@
109109
"LAST_EXISTING_SET": "Dies ist das letzte vorhandene Set.",
110110
"EMPTY_SET": "Leeres Set!",
111111
"LETS_ADD_OVERLAYS": "Lass uns ein paar Overlays von der Uhr hinzufügen!",
112-
"FIXING_FLOOR": "Boden wird in 5 Sekunden fixiert...",
113112
"ONE_CONTROLLER_ON_FLOOR": "Lege einen Controller auf den Boden!",
114113
"CANNOT_ADD_SET": "Satz kann nicht hinzugefügt werden!",
115-
"MAXIMUM_SETS_REACHED": "Maximale Anzahl an Sets erreicht."
116-
}
114+
"MAXIMUM_SETS_REACHED": "Maximale Anzahl an Sets erreicht.",
115+
"FIXING_FLOOR_IN_X_SECS": "Boden wird in {SECONDS} Sekunde(n) repariert..."
116+
},
117+
"DONE": "Erledigt"
117118
}

wayvr/src/assets/lang/en.json

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,56 @@
44
},
55
"BAR": {
66
"ADD_MIRROR": "Add a new mirror overlay",
7-
"EDIT_MODE_TOGGLE": "Toggle edit mode",
87
"ADD_NEW_SET": "Add new set",
9-
"DELETE_CURRENT_SET": "Delete current set",
10-
"TOGGLE_VISIBILITY": "Toggle visibility",
11-
"RESET_POSITION": "Reset position",
12-
"RELOAD_FROM_DISK": "Reload XML from disk",
13-
"CLOSE_MIRROR": "Close mirror",
148
"CLOSE_APP": "Close app",
9+
"CLOSE_MIRROR": "Close mirror",
10+
"DELETE_CURRENT_SET": "Delete current set",
11+
"EDIT_MODE_TOGGLE": "Toggle edit mode",
1512
"FORCE_CLOSE_APP": "Force close app",
1613
"HANDSFREE": {
17-
"TITLE": "Handsfree mode",
18-
"NONE": "Off",
19-
"HMD": "HMD + pinch",
14+
"EYE_ONLY": "Eye only",
2015
"EYE_TRACKING": "Eye + pinch",
16+
"HMD": "HMD + pinch",
2117
"HMD_ONLY": "HMD only",
22-
"EYE_ONLY": "Eye only"
23-
}
18+
"NONE": "Off",
19+
"TITLE": "Handsfree mode"
20+
},
21+
"RELOAD_FROM_DISK": "Reload XML from disk",
22+
"RESET_POSITION": "Reset position",
23+
"TOGGLE_VISIBILITY": "Toggle visibility"
2424
},
2525
"DEFAULT": "Default",
2626
"DISABLED": "Disabled",
27+
"DONE": "Done",
2728
"EDIT_MODE": {
2829
"ADJUST_CURVATURE": "Adjust curvature",
30+
"ALIGN_TO_HMD": "Align to HMD",
2931
"ALPHA_BLEND_MODE": "Alpha blend mode",
30-
"BLENDING_ADDITIVE": "Additive blending",
3132
"ANGLE_FADE": "Angle fade",
3233
"ANGLE_FADE_HELP": "Fade when not facing HMD",
34+
"BLENDING_ADDITIVE": "Additive blending",
35+
"BLOCK_INPUT": "Block game input",
3336
"CURVATURE": "Curvature",
3437
"DELETE": "Long press to remove from current set",
3538
"DISABLE_GRAB": "Disable grab",
39+
"GLOBAL": "Always visible",
3640
"HINT_POINT_WINDOW": "Point at a window to change its parameters.\nOnce done, leave edit mode using the button on the right.",
3741
"INTERPOLATION": "Interpolation",
38-
"ALIGN_TO_HMD": "Align to HMD",
3942
"KEYBOARD": "Keyboard",
4043
"LEAVE": "Leave edit mode",
4144
"LOCK_INTERACTION": "Lock interaction",
45+
"MOUSE": {
46+
"FLIP180": "Flipped 180°",
47+
"FLIP270": "Flipped 270°",
48+
"FLIP90": "Flipped 90°",
49+
"FLIPPED": "Flipped",
50+
"NORMAL": "Normal",
51+
"ROTATE180": "Rotated 180°",
52+
"ROTATE270": "Rotated 270°",
53+
"ROTATE90": "Rotated 90°",
54+
"TITLE": "Mouse fixes",
55+
"WRONG_SCREEN_SELECTION_HELP": "If the cursor moves on a completely different screen,\nthe screens were likely selected wrong. See readme."
56+
},
4257
"MOVE_PRESS_AND_DRAG": "Move (press & drag)",
4358
"OPACITY": "Opacity",
4459
"POS_ANCHORED": "Anchored: Moves with center marker. Default.",
@@ -48,56 +63,42 @@
4863
"POS_HMD": "Follow the HMD.",
4964
"POS_STATIC": "Static: Not part of any set, no recenter.",
5065
"POSITIONING": "Positioning",
51-
"GLOBAL": "Always visible",
52-
"BLOCK_INPUT": "Block game input",
5366
"RESIZE_PRESS_AND_DRAG": "Resize (press & drag)",
5467
"STEREO_3D_MODE": {
5568
"ADJUST_MOUSE": "Adjust mouse",
69+
"FULL_FRAME": "Full 3D",
70+
"FULL_FRAME_BAT": "Full-BAT",
71+
"FULL_FRAME_SBS": "Full-SBS",
72+
"FULL_FRAME_TAB": "Full-TAB",
5673
"SPLIT_BOTTOM_TOP": "BOTTOM→TOP",
5774
"SPLIT_LEFT_RIGHT": "LEFT→RIGHT",
5875
"SPLIT_RIGHT_LEFT": "RIGHT→LEFT",
5976
"SPLIT_TOP_BOTTOM": "TOP→BOTTOM",
60-
"TITLE": "3D Stereo Mode",
61-
"FULL_FRAME": "Full 3D",
62-
"FULL_FRAME_SBS": "Full-SBS",
63-
"FULL_FRAME_TAB": "Full-TAB",
64-
"FULL_FRAME_BAT": "Full-BAT"
65-
},
66-
"MOUSE": {
67-
"TITLE": "Mouse fixes",
68-
"WRONG_SCREEN_SELECTION_HELP": "If the cursor moves on a completely different screen,\nthe screens were likely selected wrong. See readme.",
69-
"NORMAL": "Normal",
70-
"ROTATE90": "Rotated 90°",
71-
"ROTATE180": "Rotated 180°",
72-
"ROTATE270": "Rotated 270°",
73-
"FLIPPED": "Flipped",
74-
"FLIP90": "Flipped 90°",
75-
"FLIP180": "Flipped 180°",
76-
"FLIP270": "Flipped 270°"
77+
"TITLE": "3D Stereo Mode"
7778
}
7879
},
7980
"GRAB": {
8081
"ADJUST_DISTANCE": "Adjust distance",
8182
"ADJUST_SIZE": "Adjust size",
82-
"UNRESTRICTED_MOVEMENT": "Unrestricted movement",
83-
"GRABBING_WATCH": "To swap hands, move the watch in front and grab it with the other hand.",
84-
"GRABBING_STATIC": "This overlay is Static and will stay in place, ignoring recenter.",
8583
"GRABBING_ANCHORED": "Anchored overlays all move together. Separate a single window by grabbing it with the other hand while still grabbing the anchor.",
8684
"GRABBING_ANCHORED_EDIT": "This overlay will stay anchored to the center marker.",
8785
"GRABBING_FLOATING": "This overlay is Floating and will stay in place, unless recentered.",
88-
"GRABBING_FOLLOW": "This overlay will follow the device it is attached to."
86+
"GRABBING_FOLLOW": "This overlay will follow the device it is attached to.",
87+
"GRABBING_STATIC": "This overlay is Static and will stay in place, ignoring recenter.",
88+
"GRABBING_WATCH": "To swap hands, move the watch in front and grab it with the other hand.",
89+
"UNRESTRICTED_MOVEMENT": "Unrestricted movement"
8990
},
9091
"TOAST": {
91-
"DEFAULT_TITLE": "Notification",
92-
"ERROR": "Error",
9392
"CANNOT_ADD_SET": "Cannot add set!",
94-
"MAXIMUM_SETS_REACHED": "Maximum number of sets reached.",
9593
"CANNOT_REMOVE_SET": "Cannot remove set!",
96-
"NO_SET_SELECTED": "No set is selected.",
97-
"LAST_EXISTING_SET": "This is the last existing set.",
94+
"DEFAULT_TITLE": "Notification",
9895
"EMPTY_SET": "Empty set!",
96+
"ERROR": "Error",
97+
"FIXING_FLOOR_IN_X_SECS": "Fixing floor in {SECONDS} second(s)...",
98+
"LAST_EXISTING_SET": "This is the last existing set.",
9999
"LETS_ADD_OVERLAYS": "Let's add some overlays from the watch!",
100-
"FIXING_FLOOR": "Fixing floor in 5 seconds...",
100+
"MAXIMUM_SETS_REACHED": "Maximum number of sets reached.",
101+
"NO_SET_SELECTED": "No set is selected.",
101102
"ONE_CONTROLLER_ON_FLOOR": "Place one controller on the floor!"
102103
},
103104
"WATCH": {

wayvr/src/assets/lang/es.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@
109109
"LAST_EXISTING_SET": "Este es el último conjunto existente.",
110110
"EMPTY_SET": "¡Conjunto vacío!",
111111
"LETS_ADD_OVERLAYS": "¡Añadamos algunos overlays desde el reloj!",
112-
"FIXING_FLOOR": "Fijando el suelo en 5 segundos...",
113112
"ONE_CONTROLLER_ON_FLOOR": "¡Coloca un mando en el suelo!",
114113
"CANNOT_ADD_SET": "¡No se puede agregar el conjunto!",
115-
"MAXIMUM_SETS_REACHED": "Se ha alcanzado el número máximo de sets."
116-
}
114+
"MAXIMUM_SETS_REACHED": "Se ha alcanzado el número máximo de sets.",
115+
"FIXING_FLOOR_IN_X_SECS": "Corrigiendo el suelo en {SECONDS} segundo(s)..."
116+
},
117+
"DONE": "Hecho"
117118
}

wayvr/src/assets/lang/it.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
9797
"LAST_EXISTING_SET": "Questo è l'ultimo set esistente.",
9898
"EMPTY_SET": "Set vuoto!",
9999
"LETS_ADD_OVERLAYS": "Aggiungiamo degli overlay dal Watch!",
100-
"FIXING_FLOOR": "Rifissaggio del pavimento tra 5 secondi...",
101-
"ONE_CONTROLLER_ON_FLOOR": "Posiziona un controller a terra!"
100+
"ONE_CONTROLLER_ON_FLOOR": "Posiziona un controller a terra!",
101+
"FIXING_FLOOR_IN_X_SECS": "Correzione del pavimento in {SECONDS} secondo/i..."
102102
},
103103
"WATCH": {
104104
"ADD_NEW_SET": "Aggiungi un nuovo set",
@@ -111,5 +111,6 @@
111111
"RECENTER": "Recentra l'area di gioco",
112112
"SWITCH_TO_SET": "Passa a set",
113113
"TOGGLE_FOR_CURRENT_SET": "Attiva/disattiva per il set corrente"
114-
}
114+
},
115+
"DONE": "Fatto"
115116
}

wayvr/src/assets/lang/ja.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@
107107
"LAST_EXISTING_SET": "これが最後の設定です。",
108108
"EMPTY_SET": "空のセットです!",
109109
"LETS_ADD_OVERLAYS": "ウォッチからオーバーレイを追加しましょう!",
110-
"FIXING_FLOOR": "5秒後にフロアを固定します...",
111110
"ONE_CONTROLLER_ON_FLOOR": "コントローラーを床に置いてください!",
112111
"CANNOT_ADD_SET": "セットを追加できません!",
113-
"MAXIMUM_SETS_REACHED": "最大セット数に達しました。"
114-
}
112+
"MAXIMUM_SETS_REACHED": "最大セット数に達しました。",
113+
"FIXING_FLOOR_IN_X_SECS": "{SECONDS}秒で床を固定中..."
114+
},
115+
"DONE": "完了"
115116
}

wayvr/src/assets/lang/pl.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@
107107
"LAST_EXISTING_SET": "To jest ostatni istniejący zestaw.",
108108
"EMPTY_SET": "Pusty zestaw!",
109109
"LETS_ADD_OVERLAYS": "Dodajmy kilka nakładek z zegarka!",
110-
"FIXING_FLOOR": "Naprawianie podłogi za 5 sekund...",
111110
"ONE_CONTROLLER_ON_FLOOR": "Umieść jeden kontroler na podłodze!",
112111
"CANNOT_ADD_SET": "Nie można dodać zestawu!",
113-
"MAXIMUM_SETS_REACHED": "Osiągnięto maksymalną liczbę zestawów."
114-
}
112+
"MAXIMUM_SETS_REACHED": "Osiągnięto maksymalną liczbę zestawów.",
113+
"FIXING_FLOOR_IN_X_SECS": "Naprawianie podłogi za {SECONDS} sekund(y)..."
114+
},
115+
"DONE": "Gotowe"
115116
}

wayvr/src/assets/lang/zh_CN.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
9797
"LAST_EXISTING_SET": "这是最后一个现有的集合。",
9898
"EMPTY_SET": "空集合!",
9999
"LETS_ADD_OVERLAYS": "让我们从手表添加一些覆盖层吧!",
100-
"FIXING_FLOOR": "将在 5 秒内修复地面...",
101-
"ONE_CONTROLLER_ON_FLOOR": "请将一个控制器放在地面上!"
100+
"ONE_CONTROLLER_ON_FLOOR": "请将一个控制器放在地面上!",
101+
"FIXING_FLOOR_IN_X_SECS": "{SECONDS}秒内固定地面..."
102102
},
103103
"WATCH": {
104104
"ADD_NEW_SET": "添加新集合",
@@ -111,5 +111,6 @@
111111
"RECENTER": "重置游玩区中心 (Recenter)",
112112
"SWITCH_TO_SET": "切换到集合",
113113
"TOGGLE_FOR_CURRENT_SET": "切换当前集合"
114-
}
114+
},
115+
"DONE": "完成"
115116
}

wayvr/src/gui/panel/button.rs

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -577,19 +577,37 @@ pub(super) fn setup_custom_button<S: 'static>(
577577
return Ok(EventResult::Pass);
578578
}
579579

580-
Toast::new(
581-
ToastTopic::System,
582-
"TOAST.FIXING_FLOOR".into(),
583-
"TOAST.ONE_CONTROLLER_ON_FLOOR".into(),
584-
)
585-
.with_timeout(5.)
586-
.with_sound(true)
587-
.submit(app);
588-
589-
app.tasks.enqueue_at(
590-
TaskType::Playspace(PlayspaceTask::FixFloor),
591-
Instant::now() + Duration::from_secs(5),
592-
);
580+
let globals = app.wgui_globals.clone();
581+
582+
let duration_secs = 5;
583+
let now = Instant::now();
584+
585+
for i in 0..duration_secs {
586+
Toast::new(
587+
ToastTopic::System,
588+
globals.i18n().translate_and_replace(
589+
"TOAST.FIXING_FLOOR_IN_X_SECS",
590+
("{SECONDS}", &format!("{}", duration_secs - i)),
591+
),
592+
"TOAST.ONE_CONTROLLER_ON_FLOOR".into(),
593+
)
594+
.with_timeout(1.0)
595+
.with_lerp_amount(1.0)
596+
.with_sound(i == 0)
597+
.submit_at(app, now + Duration::from_secs(i as _));
598+
}
599+
600+
app.audio_sample_player
601+
.play_sample(&mut app.audio_system, "fix_floor");
602+
603+
let deadline = now + Duration::from_secs(duration_secs);
604+
605+
app.tasks
606+
.enqueue_at(TaskType::Playspace(PlayspaceTask::FixFloor), deadline);
607+
608+
Toast::new(ToastTopic::System, "DONE".into(), String::new())
609+
.with_timeout(2.0)
610+
.submit_at(app, deadline);
593611
Ok(EventResult::Consumed)
594612
}),
595613
"::Shutdown" => Box::new(move |_common, data, app, _| {

wayvr/src/overlays/toast.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub struct Toast {
3030
pub body: String,
3131
pub opacity: f32,
3232
pub timeout: f32,
33+
pub lerp_amount: f32,
3334
pub sound: bool,
3435
pub topic: ToastTopic,
3536
}
@@ -41,6 +42,7 @@ impl Toast {
4142
title,
4243
body,
4344
opacity: 1.0,
45+
lerp_amount: 0.1,
4446
timeout: 3.0,
4547
sound: false,
4648
topic,
@@ -50,6 +52,10 @@ impl Toast {
5052
self.timeout = timeout;
5153
self
5254
}
55+
pub const fn with_lerp_amount(mut self, lerp: f32) -> Self {
56+
self.lerp_amount = lerp;
57+
self
58+
}
5359
pub const fn with_opacity(mut self, opacity: f32) -> Self {
5460
self.opacity = opacity;
5561
self
@@ -118,7 +124,9 @@ fn new_toast(toast: Toast, app: &mut AppState) -> Option<OverlayWindowConfig> {
118124
ToastDisplayMethod::Center => (
119125
vec3(0., -0.2, -0.5),
120126
Quat::IDENTITY,
121-
Positioning::FollowHead { lerp: 0.1 },
127+
Positioning::FollowHead {
128+
lerp: toast.lerp_amount,
129+
},
122130
),
123131
ToastDisplayMethod::Watch => {
124132
let relative_to = Positioning::FollowHand {

wayvr/src/res/fix_floor.mp3

72.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)