From 6d84cabf885b17fb171657de341601562ad0f81e Mon Sep 17 00:00:00 2001
From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com>
Date: Fri, 13 Dec 2024 15:12:36 +0900
Subject: [PATCH] [Update] Config Page: VR Tab: Add restore default settings
button.
---
.../setting_section/setting_box/vr/Vr.jsx | 12 ++++++++
.../setting_box/vr/Vr.module.scss | 14 ++++++++++
src-ui/ui_configs.js | 28 +++++++++++++++++++
3 files changed, 54 insertions(+)
diff --git a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx
index 1d9d4f6e..fabe60e8 100644
--- a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx
+++ b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx
@@ -34,6 +34,12 @@ export const Vr = () => {
const { currentOverlayLargeLogSettings, setOverlayLargeLogSettings } = useOverlayLargeLogSettings();
const { currentIsEnabledOverlayLargeLog, toggleIsEnabledOverlayLargeLog } = useIsEnabledOverlayLargeLog();
+
+ const restoreDefaultSettings = () => {
+ setOverlaySmallLogSettings(ui_configs.overlay_small_log_default_settings);
+ setOverlayLargeLogSettings(ui_configs.overlay_large_log_default_settings);
+ };
+
return (
@@ -64,6 +70,12 @@ export const Vr = () => {
)}
+
);
};
diff --git a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.module.scss b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.module.scss
index e32a0fb2..fe7b244d 100644
--- a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.module.scss
+++ b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.module.scss
@@ -196,4 +196,18 @@
.common_label {
font-size: 1.4rem;
+}
+
+.restore_default_settings_button {
+ color: var(--dark_basic_text_color);
+ font-size: 1.2rem;
+ margin-top: 6rem;
+ padding: 0.8rem;
+ border-radius: 0.4rem;
+ &:hover {
+ background-color: var(--dark_775_color);
+ }
+ &:active {
+ background-color: var(--dark_900_color);
+ }
}
\ No newline at end of file
diff --git a/src-ui/ui_configs.js b/src-ui/ui_configs.js
index 0650726e..1b854015 100644
--- a/src-ui/ui_configs.js
+++ b/src-ui/ui_configs.js
@@ -15,6 +15,34 @@ export const ui_configs = {
z_pos: { step: 0.05, min: -0.5, max: 1.5 },
ui_scaling: { step: 10, min: 40, max: 200 },
},
+
+ overlay_small_log_default_settings: {
+ x_pos: 0.0,
+ y_pos: 0.0,
+ z_pos: 0.0,
+ x_rotation: 0.0,
+ y_rotation: 0.0,
+ z_rotation: 0.0,
+ display_duration: 5,
+ fadeout_duration: 2,
+ opacity: 1.0,
+ ui_scaling: 1.0,
+ tracker: "HMD",
+ },
+ overlay_large_log_default_settings: {
+ x_pos: 0.0,
+ y_pos: 0.0,
+ z_pos: 0.0,
+ x_rotation: 0.0,
+ y_rotation: 0.0,
+ z_rotation: 0.0,
+ display_duration: 5,
+ fadeout_duration: 2,
+ opacity: 1.0,
+ ui_scaling: 1.0,
+ tracker: "LeftHand",
+ },
+
selectable_ui_languages: [
{id: "en", label: "English"},
{id: "ja", label: "日本語"},