mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-23 18:41:24 -08:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42eda428ae | ||
|
|
6504ebb9fb | ||
|
|
6332615b08 | ||
|
|
e054c393ea | ||
|
|
85c30b9425 | ||
|
|
5f5d96a1c7 | ||
|
|
2bce1af454 | ||
|
|
d45527f72e | ||
|
|
bd3acf1889 | ||
|
|
347fcf503f |
No files matched your search
+1
-1
@@ -14,7 +14,7 @@
|
||||
/gui/src/i18n/ @ImUrX @Erimelowo
|
||||
/l10n.toml @ImUrX @Erimelowo
|
||||
|
||||
/gui/src/components/settings/ @Erimelowo @ImUrX
|
||||
/gui/src/components/settings/ @Erimelowo @ImUrX @loucass003
|
||||
|
||||
# Rust part of the GUI
|
||||
/gui/src-tauri/ @ImUrX
|
||||
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
|
||||
- if: startsWith(matrix.os, 'ubuntu')
|
||||
name: Set up Linux dependencies
|
||||
uses: awalsh128/[email protected].0
|
||||
uses: awalsh128/[email protected].1
|
||||
with:
|
||||
packages: libgtk-3-dev webkit2gtk-4.1 libappindicator3-dev librsvg2-dev patchelf
|
||||
# Increment to invalidate the cache
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# This workflow will build the update manifest for the updater and update a GitHub release
|
||||
|
||||
name: Generate update manifest
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
jobs:
|
||||
generate-manifest:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22.x'
|
||||
|
||||
- name: Generate update-manifest.json
|
||||
run: |
|
||||
npx @slimevr/update-manifest-generator@latest
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: "update-manifest.json"
|
||||
path: ./update-manifest.json
|
||||
|
||||
- name: Upload update-manifest.json to release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ secrets.UPDATE_MANIFEST_RELEASE_TAG }}
|
||||
files: ./update-manifest.json
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -164,7 +164,7 @@ jobs:
|
||||
path: server/desktop/build/libs/
|
||||
|
||||
- name: Set up Linux dependencies
|
||||
uses: awalsh128/[email protected].0
|
||||
uses: awalsh128/[email protected].1
|
||||
with:
|
||||
packages: |
|
||||
build-essential curl wget file libssl-dev libgtk-3-dev libappindicator3-dev librsvg2-dev
|
||||
|
||||
Generated
+1033
-449
File diff suppressed because it is too large.
Load diff
@@ -129,7 +129,7 @@
|
||||
enable = true;
|
||||
toolchain = fenixpkgs.fromToolchainName {
|
||||
name = rust_toolchain.toolchain.channel;
|
||||
sha256 = "sha256-VZZnlyP69+Y3crrLHQyJirqlHrTtGTsyiSnZB8jEvVo=";
|
||||
sha256 = "sha256-yMuSb5eQPO/bHv+Bcf/US8LVMbf/G/0MSfiPwBhiPpk=";
|
||||
};
|
||||
components = rust_toolchain.toolchain.components;
|
||||
};
|
||||
|
||||
+1
-1
@@ -19,6 +19,7 @@
|
||||
"@tauri-apps/api": "^2.0.2",
|
||||
"@tauri-apps/plugin-dialog": "^2.0.0",
|
||||
"@tauri-apps/plugin-fs": "^2.0.0",
|
||||
"@tauri-apps/plugin-http": "^2.5.0",
|
||||
"@tauri-apps/plugin-os": "^2.0.0",
|
||||
"@tauri-apps/plugin-shell": "^2.0.0",
|
||||
"@tauri-apps/plugin-store": "^2.0.0",
|
||||
@@ -26,7 +27,6 @@
|
||||
"@twemoji/svg": "^15.0.0",
|
||||
"browser-fs-access": "^0.35.0",
|
||||
"classnames": "^2.5.1",
|
||||
"convert": "^5.10.0",
|
||||
"flatbuffers": "22.10.26",
|
||||
"intl-pluralrules": "^2.0.1",
|
||||
"ip-num": "^1.5.1",
|
||||
|
||||
@@ -676,11 +676,6 @@ settings-interface-appearance-font_size-description = This affects the font size
|
||||
settings-interface-appearance-decorations = Use the system native decorations
|
||||
settings-interface-appearance-decorations-description = This will not render the top bar of the interface and will use the operating system's instead.
|
||||
settings-interface-appearance-decorations-label = Use native decorations
|
||||
settings-interface-appearance-unit_system = Select unit system
|
||||
settings-interface-appearance-unit_system-description = Change if you want to use the metric system or the imperial system for body measurements.
|
||||
settings-interface-appearance-unit_system-placeholder = Select the unit system to use
|
||||
settings-interface-appearance-unit_system-metric = Metric units
|
||||
settings-interface-appearance-unit_system-imperial = Imperial units
|
||||
|
||||
## Notification settings
|
||||
settings-interface-notifications = Notifications
|
||||
|
||||
@@ -53,7 +53,7 @@ body_part-LEFT_LOWER_ARM = แขนซ้ายส่วนล่าง
|
||||
body_part-LEFT_HAND = มือซ้าย
|
||||
body_part-LEFT_UPPER_LEG = ต้นขาซ้าย
|
||||
body_part-LEFT_LOWER_LEG = ข้อเท้าซ้าย
|
||||
body_part-LEFT_FOOT = เท้าขวา
|
||||
body_part-LEFT_FOOT = เท้าซ้าย
|
||||
body_part-LEFT_THUMB_METACARPAL = ฝ่ามือนิ้วโป้งซ้าย
|
||||
body_part-LEFT_THUMB_PROXIMAL = โคนนิ้วโป้งซ้าย
|
||||
body_part-LEFT_THUMB_DISTAL = ปลายนิ้วโป้งซ้าย
|
||||
@@ -992,9 +992,6 @@ onboarding-connect_tracker-next = ฉันเชื่อมต่อแทร
|
||||
|
||||
onboarding-calibration_tutorial = บทเรียนการปรับเทียบ IMU
|
||||
onboarding-calibration_tutorial-subtitle = นี่จะเป็นการช่วยลดค่าดริฟท์ของแทร็กเกอร์
|
||||
onboarding-calibration_tutorial-description =
|
||||
ทุกครั้งที่มีการใช้แทร็กเกอร์ คุณควรจะวางไว้บนพื้นเรียบสักครู่เพื่อเริ่มต้นการปรับเทียบ งั้นเรามาทำแบบนั้นกันเลยด้วยการคลิกไปที่
|
||||
"{ onboarding-calibration_tutorial-calibrate }" <b>และอย่าขยับมัน!</b>
|
||||
onboarding-calibration_tutorial-calibrate = ฉันได้วางแทร็กเกอร์ไว้บนโต๊ะแล้ว
|
||||
onboarding-calibration_tutorial-status-waiting = เรารอคุณอยู่
|
||||
onboarding-calibration_tutorial-status-calibrating = กำลังปรับเทียบ
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
|
||||
websocket-connecting = Đang kết nối với máy chủ
|
||||
websocket-connection_lost = Kết nối với máy chủ đã mất. Đang kết nối lại...
|
||||
websocket-connection_lost-desc = Máy chủ SlimeVR bị dừng. Hãy kiểm tra nhật ký logs và khởi động lại chương trình.
|
||||
websocket-timedout = Không thể tìm thấy máy chủ
|
||||
websocket-timedout-desc = Có vẻ như máy chủ SlimeVR đã bị sập hoặc hết thời gian chờ. Vui lòng kiểm tra nhật ký logs và khởi động lại chương trình.
|
||||
websocket-error-close = Thoát SlimeVR
|
||||
websocket-error-logs = Mở thư mục nhật ký logs
|
||||
|
||||
## Update notification
|
||||
|
||||
@@ -50,6 +55,11 @@ body_part-LEFT_UPPER_LEG = Bắp chân trái
|
||||
body_part-LEFT_LOWER_LEG = Cẳng chân trái
|
||||
body_part-LEFT_FOOT = Bàn chân trái
|
||||
|
||||
## BoardType
|
||||
|
||||
board_type-MOCOPI = Sony Mocopi
|
||||
board_type-WEMOSWROOM02 = Wemos Wroom-02 D1 Mini
|
||||
|
||||
## Proportions
|
||||
|
||||
skeleton_bone-NONE = Chưa được gán
|
||||
@@ -421,9 +431,6 @@ settings-general-fk_settings-skeleton_settings-interp_knee_tracker_ankle = Tính
|
||||
settings-general-fk_settings-skeleton_settings-interp_knee_ankle = Tính trung bình của chiều quay đầu gối ngáp và lăn bằng mắt cá chân '
|
||||
settings-general-fk_settings-self_localization-title = Chế độ Mocap
|
||||
settings-general-fk_settings-self_localization-description = Chế độ Mocap cho phép bộ xương theo dõi đại khái vị trí của chính nó mà không cần kính VR hoặc các thiết bị theo dõi khác. Lưu ý rằng điều này yêu cầu bộ theo dõi chân và đầu để hoạt động và chức năng này vẫn đang trong quá trình thử nghiệm.
|
||||
settings-general-fk_settings-vive_emulation-title = Giả lập tracker Vive
|
||||
settings-general-fk_settings-vive_emulation-description = Giả lập cách tracker của Vive gặp vấn đề với việc theo dõi eo, đây là 1 tính năng được làm cho vui và sẽ làm giảm độ chính xác
|
||||
settings-general-fk_settings-vive_emulation-label = Giả lập tracker Vive
|
||||
|
||||
## Gesture control settings (tracker tapping)
|
||||
|
||||
@@ -485,6 +492,12 @@ settings-general-interface-feedback_sound-volume = Âm lượng phản hồi
|
||||
settings-general-interface-connected_trackers_warning = Cảnh báo với thiết bị đã kết nối
|
||||
settings-general-interface-connected_trackers_warning-description = Tùy chọn này sẽ hiển thị cửa sổ bật lên mỗi khi bạn thử thoát khỏi SlimeVR trong khi có một hoặc nhiều thiết bị theo dõi được kết nối. Nó nhắc nhở bạn tắt trình theo dõi khi bạn hoàn tất để duy trì tuổi thọ pin.
|
||||
settings-general-interface-connected_trackers_warning-label = Cảnh báo thiết bị đã kết nối khi thoát chương trình
|
||||
|
||||
## Behavior settings
|
||||
|
||||
settings-general-interface-dev_mode = Chế độ nhà phát triển
|
||||
settings-general-interface-dev_mode-description = Hữu dụng nếu cần thêm thông tin chi tiết của tracker hay can thiệp sâu hơn vào tracker
|
||||
settings-general-interface-dev_mode-label = Chế độ nhà phát triển
|
||||
settings-general-interface-use_tray = Thu nhỏ vào khay hệ thống
|
||||
settings-general-interface-use_tray-description = Cho phép bạn đóng cửa sổ mà không cần đóng máy chủ SlimeVR để bạn có thể tiếp tục sử dụng nó mà không bị GUI làm phiền.
|
||||
settings-general-interface-use_tray-label = Thu nhỏ vào khay hệ thống
|
||||
@@ -601,12 +614,6 @@ settings-osc-vmc-network-address-description = Chọn địa chỉ để gửi d
|
||||
settings-osc-vmc-network-address-placeholder = Địa chỉ IPV4
|
||||
settings-osc-vmc-vrm = Model VRM
|
||||
settings-osc-vmc-vrm-description = Tải mô hình VRM để cho phép neo đầu và cho phép khả năng tương thích cao hơn với các ứng dụng khác.
|
||||
settings-osc-vmc-vrm-model_unloaded = Chưa có mô hình tải lên
|
||||
settings-osc-vmc-vrm-model_loaded =
|
||||
{ $titled ->
|
||||
[true] Mô hình đã được tải: { $name }
|
||||
*[other] Mô hình chưa có tiêu đề đã được tải
|
||||
}
|
||||
settings-osc-vmc-vrm-file_select = Kéo và thả mô hình để sử dụng hoặc <u>duyệt file</u>
|
||||
settings-osc-vmc-anchor_hip = Cố định ở hông
|
||||
settings-osc-vmc-anchor_hip-description = Cố định theo dõi ở hông, hữu ích cho VTubing ngồi. Nếu tắt, hãy tải mô hình VRM.
|
||||
@@ -622,8 +629,6 @@ settings-utils-advanced-reset-gui = Đặt lại cài đặt GUI
|
||||
settings-utils-advanced-reset-all-label = Đặt lại tất cả
|
||||
settings-utils-advanced-reset_warning-reset = Đặt lại cài đặt
|
||||
settings-utils-advanced-reset_warning-cancel = Hủy
|
||||
settings-utils-advanced-open_data = Thư mục dữ liệu
|
||||
settings-utils-advanced-open_data-description = Mở thư mục dữ liệu của SlimeVR trong tệp, chứa các tệp cấu hình và logs.
|
||||
settings-utils-advanced-open_data-label = Mở thư mục
|
||||
|
||||
## Setup/onboarding menu
|
||||
@@ -731,7 +736,6 @@ onboarding-connect_tracker-next = Đã kết nối với tất cả tracker
|
||||
|
||||
onboarding-calibration_tutorial = Hướng dẫn hiệu chuẩn IMU
|
||||
onboarding-calibration_tutorial-subtitle = Cái này sẽ giúp giảm trôi trượt theo dõi!
|
||||
onboarding-calibration_tutorial-description = Mỗi khi bạn bật thiết bị theo dõi, chúng cần nghỉ ngơi một lúc trên bề mặt phẳng để hiệu chỉnh. Hãy làm điều tương tự bằng cách nhấp vào nút "{ onboarding-calibration_tutorial-calibrate }", <b>và không di chuyển chúng!</b>
|
||||
onboarding-calibration_tutorial-calibrate = Tôi đã đặt thiết bị theo dõi của mình lên bàn
|
||||
onboarding-calibration_tutorial-status-waiting = Đang chờ bạn hoàn thành
|
||||
onboarding-calibration_tutorial-status-calibrating = Đang hiệu chuẩn
|
||||
@@ -895,44 +899,14 @@ onboarding-automatic_mounting-mounting_reset-title = Đặt lại hướng gắn
|
||||
onboarding-automatic_mounting-mounting_reset-step-0 = 1. Đứng khom người như tư thế trượt tuyết với đầu gối khom lại, thân trên hướng tới trước và hai tay co lại để giữ thăng bằng như hình bên
|
||||
onboarding-automatic_mounting-mounting_reset-step-1 = 2. Nhấn nút đặt lại và chờ 3 giây trước khi hệ thống cân chỉnh hướng gắn tracker
|
||||
onboarding-automatic_mounting-preparation-title = Chuẩn bị tư thế
|
||||
onboarding-automatic_mounting-preparation-step-0 = 1. Đứng thẳng với hai tay duỗi thẳng
|
||||
onboarding-automatic_mounting-preparation-step-1 = 2. Nhấn nút đặt lại và chờ 3 giây trước khi tracker được đặt lại.
|
||||
onboarding-automatic_mounting-put_trackers_on-title = Đeo tracker lên người
|
||||
onboarding-automatic_mounting-put_trackers_on-description = Để cân chỉnh hướng gắn của tracker, SlimeVR sẽ tiến hành đo góc nghiêng của tracker khi đang đeo để cân chỉnh hướng gắn, hãy đeo tracker theo đúng vị trí đã thiết lập
|
||||
onboarding-automatic_mounting-put_trackers_on-next = Tiếp tục
|
||||
|
||||
## Tracker proportions method choose
|
||||
|
||||
onboarding-choose_proportions = Phương pháp hiệu chuẩn tỷ lệ nào để sử dụng?
|
||||
# Multiline string
|
||||
onboarding-choose_proportions-description-v1 =
|
||||
Tỷ lệ cơ thể được sử dụng để biết các số đo của cơ thể bạn. Họ được yêu cầu tính toán vị trí của trình theo dõi.
|
||||
Khi tỷ lệ cơ thể của bạn không khớp với tỷ lệ được lưu, độ chính xác theo dõi của bạn sẽ kém hơn và bạn sẽ nhận thấy những thứ như trượt băng hoặc trượt, hoặc cơ thể của bạn không khớp với hình đại diện của bạn.
|
||||
<b>Bạn chỉ cần đo cơ thể của bạn một lần!</b> Trừ khi chúng sai hoặc cơ thể bạn đã thay đổi, thì bạn không cần phải làm lại.
|
||||
onboarding-choose_proportions-auto_proportions = Đo kích thước cơ thể tự động
|
||||
# Italicized text
|
||||
onboarding-choose_proportions-auto_proportions-subtitle = Khuyến khích dùng
|
||||
onboarding-choose_proportions-auto_proportions-descriptionv3 =
|
||||
Tính năng này sẽ đoán tỷ lệ cơ thể của bạn bằng cách ghi lại một mẫu chuyển động của bạn và chuyển nó qua một thuật toán.
|
||||
|
||||
<b>Tính năng này sẽ yêu cầu headset của bạn (HMD) được kết nối với SlimeVR và đang nằm ở trên đầu của bạn!</b>
|
||||
onboarding-choose_proportions-manual_proportions = Đo kích thước cơ thể thủ công
|
||||
# Italicized text
|
||||
onboarding-choose_proportions-manual_proportions-subtitle = Cho chính xác
|
||||
onboarding-choose_proportions-manual_proportions-description = Tính năng này sẽ cho phép bạn điều chỉnh tỉ lệ cơ thể của mình theo cách thủ công bằng cách chỉnh sửa các con số một cách trực tiếp
|
||||
onboarding-choose_proportions-export = Xuất tỉ lệ cơ thể
|
||||
onboarding-choose_proportions-import = Nhập tỉ lệ cơ thể
|
||||
onboarding-choose_proportions-import-success = Đã được nhập
|
||||
onboarding-choose_proportions-import-failed = Thất bại
|
||||
onboarding-choose_proportions-file_type = File tỉ lệ cơ thể
|
||||
|
||||
## Tracker manual proportions setup
|
||||
## Tracker manual proportions setupa
|
||||
|
||||
onboarding-manual_proportions-back = Quay lại cân chỉnh hướng gắn
|
||||
onboarding-manual_proportions-title = Đo kích thước cơ thể thủ công
|
||||
onboarding-manual_proportions-precision = Cân chỉnh cụ thể (giảm hệ số chỉnh)
|
||||
onboarding-manual_proportions-auto = Đo kích thước cơ thể tự động
|
||||
onboarding-manual_proportions-ratio = Điều chỉnh theo nhóm tỷ lệ
|
||||
|
||||
## Tracker automatic proportions setup
|
||||
|
||||
@@ -953,20 +927,11 @@ onboarding-automatic_proportions-requirements-descriptionv2 =
|
||||
Headset của bạn đang báo cáo dữ liệu vị trí cho máy chủ SlimeVR (điều này thường có nghĩa là SteamVR đang chạy và kết nối với SlimeVR bằng driver SteamVR của SlimeVR).
|
||||
Tracking của bạn đang hoạt động và thể hiện chính xác các chuyển động của bạn (ví dụ: bạn đã thực hiện thiết đặt lại hoàn toàn và chúng di chuyển đúng hướng khi đá, cúi xuống, ngồi, v.v.).
|
||||
onboarding-automatic_proportions-requirements-next = Tôi đã đọc các yêu cầu
|
||||
onboarding-automatic_proportions-check_height-title = Kiểm tra chiều cao của bạn
|
||||
onboarding-automatic_proportions-check_height-description = Chúng tôi sử dụng chiều cao của bạn làm cơ sở cho các phép đo của chúng tôi bằng cách sử dụng chiều cao của headset (HMD) làm chiều cao ước tính thực tế của bạn, nhưng tốt hơn hết bạn nên tự kiểm tra xem chúng có đúng không!
|
||||
# All the text is in bold!
|
||||
onboarding-automatic_proportions-check_height-calculation_warning = Vui lòng nhấn nút trong khi đứng <u>thẳng</u> để tính chiều cao của bạn. Bạn có 3 giây sau khi nhấn nút!
|
||||
onboarding-automatic_proportions-check_height-guardian_tip =
|
||||
Nếu bạn đang sử dụng Kính VR Standalone, hãy đảm bảo có guardian /
|
||||
Ranh giới được bật để chiều cao của bạn là chính xác!
|
||||
onboarding-automatic_proportions-check_height-fetch_height = Tôi đang đứng!
|
||||
# Context is that the height is unknown
|
||||
onboarding-automatic_proportions-check_height-unknown = Không rõ
|
||||
# Shows an element below it
|
||||
onboarding-automatic_proportions-check_height-hmd_height1 = Chiều cao của HMD là
|
||||
# Shows an element below it
|
||||
onboarding-automatic_proportions-check_height-height1 = vậy chiều cao thật của bạn là
|
||||
onboarding-automatic_proportions-check_height-next_step = Những chỉ số này là đúng
|
||||
onboarding-automatic_proportions-start_recording-title = Chuẩn bị đo
|
||||
onboarding-automatic_proportions-start_recording-description = Phần mềm sẽ đo một số chuyển động, cử chỉ cụ thể, hãy chuẩn bị cho việc di chuyển theo yêu cầu trong phần tiếp theo
|
||||
@@ -997,11 +962,17 @@ onboarding-automatic_proportions-verify_results-redo = Thử lại
|
||||
onboarding-automatic_proportions-verify_results-confirm = Kết quả tương đối chính xác
|
||||
onboarding-automatic_proportions-done-title = Đã lưu chỉ số đo
|
||||
onboarding-automatic_proportions-done-description = Quá trình đo đã hoàn tất
|
||||
onboarding-automatic_proportions-error_modal =
|
||||
<b>Lưu ý:</b> Một lỗi đã được tìm thấy trong khi ước tính tỷ lệ cơ thể!
|
||||
Vui lòng <docs>kiểm tra hướng dẫn</docs> hoặc tham gia <discord>Discord</discord> của chúng tôi để được trợ giúp ^_^
|
||||
onboarding-automatic_proportions-error_modal-confirm = Đã hiểu!
|
||||
|
||||
## Tracker scaled proportions setup
|
||||
|
||||
|
||||
## Tracker scaled proportions reset
|
||||
|
||||
|
||||
## Stay Aligned setup
|
||||
|
||||
|
||||
## Home
|
||||
|
||||
home-no_trackers = Chưa có thiết bị nào được phát hiện hoặc điều ra
|
||||
@@ -1026,6 +997,21 @@ status_system-StatusSteamVRDisconnected =
|
||||
status_system-StatusTrackerError = Tracker { $trackerName } có lỗi.
|
||||
status_system-StatusUnassignedHMD = Kính thực tế ảo VR này nên được giao là bộ theo dõi đầu.
|
||||
|
||||
## Firmware tool globals
|
||||
|
||||
|
||||
## Firmware tool Steps
|
||||
|
||||
|
||||
## firmware tool build status
|
||||
|
||||
|
||||
## Firmware update status
|
||||
|
||||
|
||||
## Dedicated Firmware Update Page
|
||||
|
||||
|
||||
## Tray Menu
|
||||
|
||||
tray_menu-show = Xem
|
||||
@@ -1053,3 +1039,6 @@ unknown_device-modal-description =
|
||||
Bạn có muốn kết nối nó với SlimeVR không?
|
||||
unknown_device-modal-confirm = Chắc!
|
||||
unknown_device-modal-forget = Bỏ qua
|
||||
|
||||
## Error collection consent modal
|
||||
|
||||
@@ -54,6 +54,7 @@ dirs-next = "2.0.0"
|
||||
discord-sdk = "0.3.6"
|
||||
tokio = { version = "1.37.0", features = ["time"] }
|
||||
itertools = "0.13.0"
|
||||
tauri-plugin-http = "2.5.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
win32job = "1"
|
||||
|
||||
@@ -31,6 +31,14 @@
|
||||
{
|
||||
"identifier": "fs:scope",
|
||||
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
|
||||
},
|
||||
{
|
||||
"identifier": "http:default",
|
||||
"allow": [
|
||||
{
|
||||
"url": "https://github.com/SlimeVR/SlimeVR-Tracker-ESP/releases/download/*"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -254,6 +254,7 @@ fn setup_tauri(
|
||||
.plugin(tauri_plugin_os::init())
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.plugin(tauri_plugin_store::Builder::default().build())
|
||||
.plugin(tauri_plugin_http::init())
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
update_window_state,
|
||||
logging,
|
||||
|
||||
@@ -105,7 +105,7 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
|
||||
.title("SlimeVR")
|
||||
.tooltip("SlimeVR")
|
||||
.icon_as_template(true)
|
||||
.menu_on_left_click(false)
|
||||
.show_menu_on_left_click(false)
|
||||
.icon(if cfg!(target_os = "macos") {
|
||||
include_image!("icons/appleTrayIcon.png")
|
||||
} else {
|
||||
@@ -146,7 +146,7 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
|
||||
_ => {}
|
||||
})
|
||||
// We don't want this as we open the window on left click
|
||||
.menu_on_left_click(false)
|
||||
.show_menu_on_left_click(false)
|
||||
.build(app)?;
|
||||
|
||||
app.manage(TrayAvailable(true));
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
},
|
||||
"rpm": {
|
||||
"depends": [
|
||||
"java-17-openjdk",
|
||||
"java-latest-openjdk",
|
||||
"udev"
|
||||
],
|
||||
"files": {
|
||||
|
||||
@@ -72,7 +72,7 @@ export function DropdownItems({
|
||||
<div
|
||||
ref={ref}
|
||||
className={classNames(
|
||||
'z-[1000] fixed rounded shadow w-fit',
|
||||
'z-[1000] fixed rounded shadow',
|
||||
'overflow-y-auto dropdown-scroll overflow-x-hidden text-background-10',
|
||||
variant == 'primary' && 'bg-background-60',
|
||||
variant == 'secondary' && 'bg-background-70',
|
||||
@@ -100,13 +100,13 @@ export function DropdownItems({
|
||||
style={item.fontName ? { fontFamily: item.fontName } : {}}
|
||||
className={classNames(
|
||||
'py-2 px-4 min-w-max cursor-pointer first-of-type:*:pointer-events-none',
|
||||
variant === 'primary' &&
|
||||
'data-checked:bg-background-40 hover:bg-background-50 text-background-20 ' +
|
||||
variant == 'primary' &&
|
||||
'checked-hover:bg-background-50 text-background-20 ' +
|
||||
'checked-hover:text-background-10',
|
||||
variant === 'secondary' &&
|
||||
'data-checked:bg-background-50 hover:bg-background-60 text-background-20 ' +
|
||||
variant == 'secondary' &&
|
||||
'checked-hover:bg-background-60 text-background-20 ' +
|
||||
'checked-hover:text-background-10',
|
||||
variant === 'tertiary' &&
|
||||
variant == 'tertiary' &&
|
||||
'bg-accent-background-30 checked-hover:bg-accent-background-20'
|
||||
)}
|
||||
onClick={() => {
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
import { defaultConfig, UnitType, useConfig } from '@/hooks/config';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
import convert from 'convert';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export function HeightDisplay({
|
||||
height,
|
||||
/**
|
||||
* Unit type of only the input height
|
||||
*/
|
||||
heightUnit = 'm',
|
||||
unitDisplay = 'short',
|
||||
className,
|
||||
roundInches = false,
|
||||
}: {
|
||||
heightUnit?: 'm' | 'cm' | 'in';
|
||||
height: number;
|
||||
unitDisplay?: 'narrow' | 'short' | 'long';
|
||||
className?: string;
|
||||
roundInches?: boolean;
|
||||
}) {
|
||||
const { currentLocales } = useLocaleConfig();
|
||||
const { config } = useConfig();
|
||||
|
||||
const cmFormat = useMemo(
|
||||
() =>
|
||||
new Intl.NumberFormat(currentLocales, {
|
||||
style: 'unit',
|
||||
unit: 'centimeter',
|
||||
unitDisplay,
|
||||
maximumFractionDigits: 2,
|
||||
}),
|
||||
[currentLocales, unitDisplay]
|
||||
);
|
||||
|
||||
const [footFormat, inchesFormat] = useMemo(
|
||||
() => [
|
||||
new Intl.NumberFormat(currentLocales, {
|
||||
style: 'unit',
|
||||
unit: 'foot',
|
||||
unitDisplay: 'narrow',
|
||||
maximumFractionDigits: 0,
|
||||
roundingMode: 'trunc',
|
||||
}),
|
||||
new Intl.NumberFormat(currentLocales, {
|
||||
style: 'unit',
|
||||
unit: 'inch',
|
||||
unitDisplay: 'narrow',
|
||||
maximumFractionDigits: 1,
|
||||
roundingMode: 'trunc',
|
||||
}),
|
||||
],
|
||||
[currentLocales]
|
||||
);
|
||||
|
||||
const value = useMemo(() => {
|
||||
const unitSystem = config?.unitSystem ?? defaultConfig.unitSystem;
|
||||
|
||||
if (unitSystem === UnitType.Metric) {
|
||||
return cmFormat.format(convert(height, heightUnit).to('cm'));
|
||||
} else {
|
||||
let totalInches = convert(height, heightUnit).to('inches');
|
||||
if (roundInches) totalInches = Math.round(totalInches);
|
||||
|
||||
const feet = Math.trunc(totalInches / 12);
|
||||
const remainingInches = totalInches % 12;
|
||||
return (
|
||||
(feet ? footFormat.format(feet) : '') +
|
||||
inchesFormat.format(remainingInches)
|
||||
);
|
||||
}
|
||||
}, [config?.unitSystem, height, heightUnit]);
|
||||
|
||||
return <span className={className}>{value}</span>;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useEffect, useMemo, useContext } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { defaultConfig, useConfig } from '@/hooks/config';
|
||||
import { useConfig } from '@/hooks/config';
|
||||
import { LangContext } from '@/i18n/config';
|
||||
import { langs } from '@/i18n/names';
|
||||
import { Dropdown, DropdownDirection } from './Dropdown';
|
||||
@@ -17,7 +17,7 @@ export function LangSelector({
|
||||
const { l10n } = useLocalization();
|
||||
const { config, setConfig } = useConfig();
|
||||
const { control, watch, handleSubmit } = useForm<{ lang: string }>({
|
||||
defaultValues: { lang: config?.lang ?? defaultConfig.lang },
|
||||
defaultValues: { lang: config?.lang || 'en' },
|
||||
});
|
||||
|
||||
const languagesItems = useMemo(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Control, Controller } from 'react-hook-form';
|
||||
import { Button } from './Button';
|
||||
import { Typography } from './Typography';
|
||||
import { ReactNode, useMemo } from 'react';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
|
||||
export function NumberSelector({
|
||||
@@ -14,33 +14,34 @@ export function NumberSelector({
|
||||
step,
|
||||
doubleStep,
|
||||
disabled = false,
|
||||
showButtonWithNumber,
|
||||
showButtonWithNumber = false,
|
||||
}: {
|
||||
label?: string;
|
||||
valueLabelFormat?: (value: number) => string | ReactNode;
|
||||
valueLabelFormat?: (value: number) => string;
|
||||
control: Control<any>;
|
||||
name: string;
|
||||
min: number;
|
||||
max: number;
|
||||
step: number | ((value: number, sign: number) => number);
|
||||
doubleStep?: number | ((value: number, sign: number) => number);
|
||||
step: number | ((value: number, add: boolean) => number);
|
||||
doubleStep?: number;
|
||||
disabled?: boolean;
|
||||
showButtonWithNumber?: number;
|
||||
showButtonWithNumber?: boolean;
|
||||
}) {
|
||||
const { currentLocales } = useLocaleConfig();
|
||||
|
||||
const stepFn =
|
||||
typeof step === 'function'
|
||||
? step
|
||||
: (value: number, sign: number) => +(value + step * sign).toFixed(2);
|
||||
: (value: number, add: boolean) =>
|
||||
+(add ? value + step : value - step).toFixed(2);
|
||||
|
||||
const doubleStepFn =
|
||||
typeof doubleStep === 'function'
|
||||
? doubleStep
|
||||
: (value: number, sign: number) =>
|
||||
doubleStep === undefined
|
||||
? 0
|
||||
: +(value + doubleStep * sign).toFixed(2);
|
||||
const doubleStepFn = useCallback(
|
||||
(value: number, add: boolean) =>
|
||||
doubleStep === undefined
|
||||
? 0
|
||||
: +(add ? value + doubleStep : value - doubleStep).toFixed(2),
|
||||
[doubleStep]
|
||||
);
|
||||
|
||||
const decimalFormat = useMemo(
|
||||
() =>
|
||||
@@ -65,19 +66,19 @@ export function NumberSelector({
|
||||
<Button
|
||||
variant="tertiary"
|
||||
rounded
|
||||
onClick={() => onChange(doubleStepFn(value, -1))}
|
||||
disabled={doubleStepFn(value, -1) < min || disabled}
|
||||
onClick={() => onChange(doubleStepFn(value, false))}
|
||||
disabled={doubleStepFn(value, false) < min || disabled}
|
||||
>
|
||||
{showButtonWithNumber !== undefined
|
||||
? decimalFormat.format(-showButtonWithNumber)
|
||||
{showButtonWithNumber
|
||||
? decimalFormat.format(-doubleStep)
|
||||
: '--'}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
variant="tertiary"
|
||||
rounded
|
||||
onClick={() => onChange(stepFn(value, -1))}
|
||||
disabled={stepFn(value, -1) < min || disabled}
|
||||
onClick={() => onChange(stepFn(value, false))}
|
||||
disabled={stepFn(value, false) < min || disabled}
|
||||
>
|
||||
-
|
||||
</Button>
|
||||
@@ -89,8 +90,8 @@ export function NumberSelector({
|
||||
<Button
|
||||
variant="tertiary"
|
||||
rounded
|
||||
onClick={() => onChange(stepFn(value, 1))}
|
||||
disabled={stepFn(value, 1) > max || disabled}
|
||||
onClick={() => onChange(stepFn(value, true))}
|
||||
disabled={stepFn(value, true) > max || disabled}
|
||||
>
|
||||
+
|
||||
</Button>
|
||||
@@ -98,11 +99,11 @@ export function NumberSelector({
|
||||
<Button
|
||||
variant="tertiary"
|
||||
rounded
|
||||
onClick={() => onChange(doubleStepFn(value, 1))}
|
||||
disabled={doubleStepFn(value, 1) > max || disabled}
|
||||
onClick={() => onChange(doubleStepFn(value, true))}
|
||||
disabled={doubleStepFn(value, true) > max || disabled}
|
||||
>
|
||||
{showButtonWithNumber !== undefined
|
||||
? decimalFormat.format(showButtonWithNumber)
|
||||
{showButtonWithNumber
|
||||
? decimalFormat.format(doubleStep)
|
||||
: '++'}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
import { defaultConfig, UnitType, useConfig } from '@/hooks/config';
|
||||
import { Dropdown, DropdownDirection } from './Dropdown';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
|
||||
export function UnitSelector({
|
||||
direction = 'up',
|
||||
alignment = 'right',
|
||||
}: {
|
||||
direction?: DropdownDirection;
|
||||
alignment?: 'right' | 'left';
|
||||
}) {
|
||||
const { l10n } = useLocalization();
|
||||
const { config, setConfig } = useConfig();
|
||||
const { control, watch, handleSubmit } = useForm<{ unitSystem: UnitType }>({
|
||||
defaultValues: {
|
||||
unitSystem: config?.unitSystem ?? defaultConfig.unitSystem,
|
||||
},
|
||||
});
|
||||
|
||||
const unitItems = useMemo(
|
||||
() =>
|
||||
Object.values(UnitType).map((type) => ({
|
||||
label: l10n.getString(
|
||||
`settings-interface-appearance-unit_system-${type}`
|
||||
),
|
||||
value: type,
|
||||
})),
|
||||
[l10n]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const subscription = watch(() => handleSubmit(onSubmit)());
|
||||
return () => subscription.unsubscribe();
|
||||
}, []);
|
||||
|
||||
const onSubmit = (value: { unitSystem: UnitType }) => {
|
||||
setConfig({ unitSystem: value.unitSystem });
|
||||
};
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
control={control}
|
||||
name="unitSystem"
|
||||
placeholder={l10n.getString(
|
||||
'settings-interface-appearance-unit_system-placeholder'
|
||||
)}
|
||||
items={unitItems}
|
||||
direction={direction}
|
||||
alignment={alignment}
|
||||
></Dropdown>
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import { Button } from '@/components/commons/Button';
|
||||
import { SlimeVRIcon } from '@/components/commons/icon/SimevrIcon';
|
||||
import { LangSelector } from '@/components/commons/LangSelector';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { UnitSelector } from '@/components/commons/UnitSelector';
|
||||
|
||||
export function HomePage() {
|
||||
const { l10n } = useLocalization();
|
||||
@@ -24,9 +23,8 @@ export function HomePage() {
|
||||
{l10n.getString('onboarding-home-start')}
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex flex-col gap-3 absolute right-4 bottom-4 z-50">
|
||||
<div className="absolute right-4 bottom-4 z-50">
|
||||
<LangSelector />
|
||||
<UnitSelector />
|
||||
</div>
|
||||
<div
|
||||
className="absolute bg-accent-background-50 w-full rounded-full"
|
||||
|
||||
@@ -32,9 +32,9 @@ import { FullResetIcon } from '@/components/commons/icon/ResetIcon';
|
||||
import { ImportIcon } from '@/components/commons/icon/ImportIcon';
|
||||
import { HumanIcon } from '@/components/commons/icon/HumanIcon';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { ResetButton } from '@/components/home/ResetButton';
|
||||
import { HeightDisplay } from '@/components/commons/HeightDisplay';
|
||||
import { Vector3 } from 'three';
|
||||
|
||||
function IconButton({
|
||||
@@ -406,6 +406,7 @@ function ButtonsControl({ control }: { control: ManualProportionControls }) {
|
||||
export function ManualProportionsPage() {
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const { useRPCPacket } = useWebsocketAPI();
|
||||
const { currentLocales } = useLocaleConfig();
|
||||
|
||||
const [userHeight, setUserHeight] = useState(0);
|
||||
|
||||
@@ -420,6 +421,15 @@ export function ManualProportionsPage() {
|
||||
});
|
||||
const { precise, ratio } = watch();
|
||||
|
||||
const { cmFormat } = useMemo(() => {
|
||||
const cmFormat = Intl.NumberFormat(currentLocales, {
|
||||
style: 'unit',
|
||||
unit: 'centimeter',
|
||||
maximumFractionDigits: 1,
|
||||
});
|
||||
return { cmFormat };
|
||||
}, [currentLocales]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem('ratioMode', ratio?.toString() ?? 'true');
|
||||
}, [ratio]);
|
||||
@@ -481,7 +491,7 @@ export function ManualProportionsPage() {
|
||||
>
|
||||
<div className="h-14 bg-background-50 p-4 flex items-center rounded-lg min-w-36 justify-center">
|
||||
<Typography variant="main-title">
|
||||
<HeightDisplay height={userHeight / 0.936} />
|
||||
{cmFormat.format((userHeight * 100) / 0.936)}
|
||||
</Typography>
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
+22
-35
@@ -2,7 +2,8 @@ import { useWebsocketAPI } from '@/hooks/websocket-api';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useEffect } from 'react';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
import {
|
||||
DEFAULT_FULL_HEIGHT,
|
||||
EYE_HEIGHT_TO_HEIGHT_RATIO,
|
||||
@@ -18,16 +19,11 @@ import {
|
||||
import { NumberSelector } from '@/components/commons/NumberSelector';
|
||||
import { useOnboarding } from '@/hooks/onboarding';
|
||||
import { MIN_HEIGHT } from '@/hooks/manual-proportions';
|
||||
import { HeightDisplay } from '@/components/commons/HeightDisplay';
|
||||
import { useUnit } from '@/hooks/config';
|
||||
import convert from 'convert';
|
||||
|
||||
interface HeightForm {
|
||||
height: number;
|
||||
}
|
||||
|
||||
const INCH_IN_METER = convert(1, 'inch').to('m');
|
||||
|
||||
export function ManualHeightStep({
|
||||
nextStep,
|
||||
prevStep,
|
||||
@@ -45,8 +41,8 @@ export function ManualHeightStep({
|
||||
defaultValues: { height: DEFAULT_FULL_HEIGHT },
|
||||
});
|
||||
const { sendRPCPacket } = useWebsocketAPI();
|
||||
const { currentLocales } = useLocaleConfig();
|
||||
const height = watch('height');
|
||||
const currentUnit = useUnit();
|
||||
|
||||
// Load the last configured height
|
||||
useEffect(() => {
|
||||
@@ -57,6 +53,16 @@ export function ManualHeightStep({
|
||||
});
|
||||
}, [currentHeight]);
|
||||
|
||||
const mFormat = useMemo(
|
||||
() =>
|
||||
new Intl.NumberFormat(currentLocales, {
|
||||
style: 'unit',
|
||||
unit: 'meter',
|
||||
maximumFractionDigits: 2,
|
||||
}),
|
||||
[currentLocales]
|
||||
);
|
||||
|
||||
const submitFullHeight = (values: HeightForm) => {
|
||||
const newHeight = values.height * EYE_HEIGHT_TO_HEIGHT_RATIO;
|
||||
setHmdHeight(newHeight);
|
||||
@@ -98,36 +104,17 @@ export function ManualHeightStep({
|
||||
'onboarding-scaled_proportions-manual_height-height-v2'
|
||||
)}
|
||||
valueLabelFormat={(value) =>
|
||||
isNaN(value) ? (
|
||||
l10n.getString(
|
||||
'onboarding-scaled_proportions-manual_height-unknown'
|
||||
)
|
||||
) : (
|
||||
<HeightDisplay
|
||||
height={value}
|
||||
unitDisplay="narrow"
|
||||
roundInches
|
||||
/>
|
||||
)
|
||||
isNaN(value)
|
||||
? l10n.getString(
|
||||
'onboarding-scaled_proportions-manual_height-unknown'
|
||||
)
|
||||
: mFormat.format(value)
|
||||
}
|
||||
min={MIN_HEIGHT}
|
||||
max={4}
|
||||
step={
|
||||
currentUnit === 'm'
|
||||
? 0.01
|
||||
: (v, s) =>
|
||||
Math.round((v + INCH_IN_METER * s) / INCH_IN_METER) *
|
||||
INCH_IN_METER
|
||||
}
|
||||
showButtonWithNumber={currentUnit === 'm' ? 10 : 12}
|
||||
doubleStep={
|
||||
currentUnit === 'm'
|
||||
? 0.1
|
||||
: (v, s) =>
|
||||
Math.round(
|
||||
(v + convert(1, 'ft').to('m') * s) / INCH_IN_METER
|
||||
) * INCH_IN_METER
|
||||
}
|
||||
step={0.01}
|
||||
showButtonWithNumber
|
||||
doubleStep={0.1}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col self-center items-center justify-center">
|
||||
@@ -137,7 +124,7 @@ export function ManualHeightStep({
|
||||
)}
|
||||
</Typography>
|
||||
<Typography>
|
||||
<HeightDisplay height={height * EYE_HEIGHT_TO_HEIGHT_RATIO} />
|
||||
{mFormat.format(height * EYE_HEIGHT_TO_HEIGHT_RATIO)}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,6 @@ import { Range } from '@/components/commons/Range';
|
||||
import { Dropdown } from '@/components/commons/Dropdown';
|
||||
import { ArrowRightLeftIcon } from '@/components/commons/icon/ArrowIcons';
|
||||
import { isTrayAvailable } from '@/utils/tauri';
|
||||
import { UnitSelector } from '@/components/commons/UnitSelector';
|
||||
import { isTauri } from '@tauri-apps/api/core';
|
||||
import { TauriFileInput } from '@/components/commons/TauriFileInput';
|
||||
|
||||
@@ -553,20 +552,6 @@ export function InterfaceSettings() {
|
||||
<div className="grid sm:grid-cols-2 pb-4">
|
||||
<LangSelector alignment="left" />
|
||||
</div>
|
||||
|
||||
<Typography bold>
|
||||
{l10n.getString('settings-interface-appearance-unit_system')}
|
||||
</Typography>
|
||||
<div className="flex flex-col pt-1 pb-2">
|
||||
<Typography color="secondary">
|
||||
{l10n.getString(
|
||||
'settings-interface-appearance-unit_system-description'
|
||||
)}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="grid sm:grid-cols-2 pb-4">
|
||||
<UnitSelector alignment="left" />
|
||||
</div>
|
||||
</>
|
||||
</SettingsPagePaneLayout>
|
||||
</form>
|
||||
|
||||
+1
-16
@@ -1,4 +1,4 @@
|
||||
import { createContext, useContext, useMemo, useState } from 'react';
|
||||
import { createContext, useContext, useState } from 'react';
|
||||
import {
|
||||
defaultValues as defaultDevSettings,
|
||||
DeveloperModeWidgetForm,
|
||||
@@ -25,11 +25,6 @@ export enum AssignMode {
|
||||
All = 'all',
|
||||
}
|
||||
|
||||
export enum UnitType {
|
||||
Metric = 'metric',
|
||||
Imperial = 'imperial',
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
debug: boolean;
|
||||
lang: string;
|
||||
@@ -51,7 +46,6 @@ export interface Config {
|
||||
showNavbarOnboarding: boolean;
|
||||
vrcMutedWarnings: string[];
|
||||
bvhDirectory: string | null;
|
||||
unitSystem: UnitType;
|
||||
}
|
||||
|
||||
export interface ConfigContext {
|
||||
@@ -79,7 +73,6 @@ export const defaultConfig: Config = {
|
||||
decorations: false,
|
||||
showNavbarOnboarding: true,
|
||||
vrcMutedWarnings: [],
|
||||
unitSystem: UnitType.Metric,
|
||||
devSettings: defaultDevSettings,
|
||||
bvhDirectory: null,
|
||||
};
|
||||
@@ -208,11 +201,3 @@ export function useConfig() {
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
export function useUnit() {
|
||||
const { config } = useConfig();
|
||||
return useMemo(() => {
|
||||
const unitSystem = config?.unitSystem ?? defaultConfig.unitSystem;
|
||||
return unitSystem === UnitType.Metric ? 'm' : 'in';
|
||||
}, [config?.unitSystem]);
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
import { BoardType, DeviceDataT } from 'solarxr-protocol';
|
||||
import { fetch as tauriFetch } from '@tauri-apps/plugin-http';
|
||||
import { cacheWrap } from './cache';
|
||||
import semver from 'semver';
|
||||
import { hostname, locale, platform, version } from '@tauri-apps/plugin-os';
|
||||
|
||||
type DeployDataJson = Map<string, string>;
|
||||
type DeployData = Map<number, Date>;
|
||||
|
||||
export interface FirmwareRelease {
|
||||
name: string;
|
||||
version: string;
|
||||
@@ -26,49 +24,49 @@ const hash = (str: string) => {
|
||||
return (hash >>> 0) / 2 ** 32;
|
||||
};
|
||||
|
||||
const uniqueUserKey = `${await hostname()}-${await locale()}-${platform()}-${version()}`;
|
||||
|
||||
const firstAsset = (assets: any[], name: string) =>
|
||||
assets.find((asset: any) => asset.name === name && asset.browser_download_url);
|
||||
|
||||
const processDeployData = (sortedMap: [string, string][]) => {
|
||||
const deployData: DeployData = new Map();
|
||||
let minTime = 0;
|
||||
for (const [percent, date] of sortedMap) {
|
||||
const d = new Date(date);
|
||||
if (d.getTime() <= minTime) return null; // Dates in the wrong order / cancel
|
||||
minTime = d.getTime();
|
||||
deployData.set(parseFloat(percent), new Date(date));
|
||||
}
|
||||
return deployData;
|
||||
};
|
||||
|
||||
const checkUserCanUpdate = async (deployAssetUrl: string) => {
|
||||
if (!deployAssetUrl) return false;
|
||||
const deployDataJson: DeployData | null = await fetch(deployAssetUrl)
|
||||
.then((res) => res.json())
|
||||
.catch(() => null);
|
||||
if (!deployDataJson) return false;
|
||||
|
||||
const deployDataMap = new Map(
|
||||
Object.entries(deployDataJson)
|
||||
) as unknown as DeployDataJson;
|
||||
const sortedMap = [...deployDataMap].sort(
|
||||
([a], [b]) => parseFloat(b) - parseFloat(a)
|
||||
const checkUserCanUpdate = async (url: string, fwVersion: string) => {
|
||||
if (!url) return true;
|
||||
const deployDataJson = JSON.parse(
|
||||
(await cacheWrap(
|
||||
`firmware-${fwVersion}-deploy`,
|
||||
() =>
|
||||
tauriFetch(url)
|
||||
.then((res) => res.text())
|
||||
.catch(() => null),
|
||||
60 * 60 * 1000
|
||||
)) || 'null'
|
||||
);
|
||||
if (!deployDataJson) return true;
|
||||
|
||||
if (sortedMap.keys().find((key) => key > 1 || key <= 0)) return false; // values outside boundaries / cancel
|
||||
const deployData = (
|
||||
Object.entries(deployDataJson).map(([key, val]) => {
|
||||
return [parseFloat(key), new Date(val as string)];
|
||||
}) as [number, Date][]
|
||||
).sort(([a], [b]) => a - b);
|
||||
|
||||
const deployData = processDeployData(sortedMap);
|
||||
if (!deployData) return false;
|
||||
if (deployData.find(([key]) => key > 1 || key <= 0)) return false; // values outside boundaries / cancel
|
||||
|
||||
if (
|
||||
deployData.find(
|
||||
([, date], index) =>
|
||||
index > 0 && date.getTime() < deployData[index - 1][1].getTime()
|
||||
)
|
||||
)
|
||||
return false; // Dates in the wrong order / cancel
|
||||
|
||||
const todayUpdateRange = deployData.find(([, date], index) => {
|
||||
if (index === 0 && Date.now() < date.getTime()) return true;
|
||||
return Date.now() >= date.getTime();
|
||||
})?.[0];
|
||||
|
||||
const todayUpdateRange = deployData
|
||||
.entries()
|
||||
.find(([, date]) => Date.now() >= date.getTime())?.[0];
|
||||
if (!todayUpdateRange) return false;
|
||||
|
||||
const uniqueUserKey = `${await hostname()}-${await locale()}-${platform()}-${version()}`;
|
||||
// Make it so the hash change every version. Prevent the same user from getting the same delay
|
||||
return hash(`${uniqueUserKey}-${version}`) <= todayUpdateRange;
|
||||
return hash(`${uniqueUserKey}-${fwVersion}`) <= todayUpdateRange;
|
||||
};
|
||||
|
||||
export async function fetchCurrentFirmwareRelease(): Promise<FirmwareRelease | null> {
|
||||
@@ -87,7 +85,6 @@ export async function fetchCurrentFirmwareRelease(): Promise<FirmwareRelease | n
|
||||
const processedReleses = [];
|
||||
for (const release of releases) {
|
||||
const fwAsset = firstAsset(release.assets, 'BOARD_SLIMEVR-firmware.bin');
|
||||
const deployAsset = firstAsset(release.assets, 'deploy.json');
|
||||
if (!release.assets || !fwAsset /* || release.prerelease */) continue;
|
||||
|
||||
let version = release.tag_name;
|
||||
@@ -95,10 +92,11 @@ export async function fetchCurrentFirmwareRelease(): Promise<FirmwareRelease | n
|
||||
version = version.substring(1);
|
||||
}
|
||||
|
||||
const userCanUpdate = !deployAsset
|
||||
? true
|
||||
: await checkUserCanUpdate(deployAsset?.browser_download_url);
|
||||
|
||||
const deployAsset = firstAsset(release.assets, 'deploy.json');
|
||||
const userCanUpdate = await checkUserCanUpdate(
|
||||
deployAsset?.browser_download_url,
|
||||
version
|
||||
);
|
||||
processedReleses.push({
|
||||
name: release.name,
|
||||
version,
|
||||
|
||||
@@ -2,7 +2,6 @@ import { createContext, useContext, useEffect, useMemo, useState } from 'react';
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
import { RpcMessage, SettingsRequestT, SettingsResponseT } from 'solarxr-protocol';
|
||||
import { MIN_HEIGHT } from './manual-proportions';
|
||||
import convert from 'convert';
|
||||
|
||||
export interface HeightContext {
|
||||
hmdHeight: number | null;
|
||||
@@ -74,7 +73,4 @@ export const EYE_HEIGHT_TO_HEIGHT_RATIO = 0.936;
|
||||
// Based on average human height (1.65m)
|
||||
// From https://ourworldindata.org/human-height (January 2024)
|
||||
export const DEFAULT_FULL_HEIGHT = 1.65;
|
||||
export const DEFAULT_FULL_HEIGHT_INCHES = Math.round(
|
||||
convert(DEFAULT_FULL_HEIGHT, 'm').to('in')
|
||||
);
|
||||
export const DEFAULT_EYE_HEIGHT = DEFAULT_FULL_HEIGHT * EYE_HEIGHT_TO_HEIGHT_RATIO;
|
||||
@@ -258,12 +258,10 @@ const config = {
|
||||
addUtilities({
|
||||
'.text-main-title': textConfig('calc(var(--font-size-title) / 16)', 700),
|
||||
'.text-section-title': textConfig('calc(var(--font-size-vr) / 16)', 700),
|
||||
|
||||
'.text-standard': textConfig('calc(var(--font-size-standard) / 16)', 500),
|
||||
'.text-standard-bold': textConfig('calc(var(--font-size-standard) / 16)', 700),
|
||||
|
||||
'.text-vr-accesible': textConfig('calc(var(--font-size-vr) / 16)', 500),
|
||||
'.text-vr-accesible-bold': textConfig('calc(var(--font-size-vr) / 16)', 700),
|
||||
'.text-standard-bold': textConfig('calc(var(--font-size-standard) / 16)', 700),
|
||||
});
|
||||
}),
|
||||
plugin(function ({ addVariant }) {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2022",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"lib": ["dom", "dom.iterable", "ES2023"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
|
||||
Generated
+16
-8
@@ -62,6 +62,9 @@ importers:
|
||||
'@tauri-apps/plugin-fs':
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0
|
||||
'@tauri-apps/plugin-http':
|
||||
specifier: ^2.5.0
|
||||
version: 2.5.0
|
||||
'@tauri-apps/plugin-os':
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0
|
||||
@@ -83,9 +86,6 @@ importers:
|
||||
classnames:
|
||||
specifier: ^2.5.1
|
||||
version: 2.5.1
|
||||
convert:
|
||||
specifier: ^5.10.0
|
||||
version: 5.10.0
|
||||
flatbuffers:
|
||||
specifier: 22.10.26
|
||||
version: 22.10.26
|
||||
@@ -488,6 +488,7 @@ packages:
|
||||
'@dword-design/[email protected]':
|
||||
resolution: {integrity: sha512-16A97RKtn21xLWI7Y7VhFz4WCWui+TLit/J5/l77BDpWmPi2LzgjQzDbafDDw7OUeY6GEAi/M4jdbuQhsIbSEg==}
|
||||
engines: {node: '>=14'}
|
||||
deprecated: Use lodash and endent
|
||||
|
||||
'@esbuild/[email protected]':
|
||||
resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==}
|
||||
@@ -1182,6 +1183,9 @@ packages:
|
||||
'@tauri-apps/[email protected]':
|
||||
resolution: {integrity: sha512-3wSwmG+1kr6WrgAFKK5ijkNFPp8TT3FLj3YHUb5EwMO+3FxX4uWlfSWkeeBy+Kc1RsKzugtYLuuya+98Flj+3w==}
|
||||
|
||||
'@tauri-apps/[email protected]':
|
||||
resolution: {integrity: sha512-hRNcdercfgpzgFrMXWwNDBN0B7vNzOzRepy6ZAmhxi5mDLVPNrTpo9MGg2tN/F7JRugj4d2aF7E1rtPXAHaetg==}
|
||||
|
||||
'@tauri-apps/[email protected]':
|
||||
resolution: {integrity: sha512-jIsbxGWS+As1ZN7umo90nkql/ZAbrDK0GBT6UsgHSz5zSwwArICsZFFwE1pLZip5yoiV5mn3TGG2c1+v+0puzQ==}
|
||||
engines: {node: '>= 10'}
|
||||
@@ -1253,6 +1257,9 @@ packages:
|
||||
'@tauri-apps/[email protected]':
|
||||
resolution: {integrity: sha512-BNEeQQ5aH8J5SwYuWgRszVyItsmquRuzK2QRkVj8Z0sCsLnSvJFYI3JHRzzr3ltZGq1nMPtblrlZzuKqVzRawA==}
|
||||
|
||||
'@tauri-apps/[email protected]':
|
||||
resolution: {integrity: sha512-l4M2DUIsOBIMrbj4dJZwrB4mJiB7OA/2Tj3gEbX2fjq5MOpETklJPKfDvzUTDwuq4lIKCKKykz8E8tpOgvi0EQ==}
|
||||
|
||||
'@tauri-apps/[email protected]':
|
||||
resolution: {integrity: sha512-M7hG/nNyQYTJxVG/UhTKhp9mpXriwWzrs9mqDreB8mIgqA3ek5nHLdwRZJWhkKjZrnDT4v9CpA9BhYeplTlAiA==}
|
||||
|
||||
@@ -1871,9 +1878,6 @@ packages:
|
||||
resolution: {integrity: sha512-cj09EBuObp9gZNQCzc7hByQyrs6jVGE+o9kSJmeUoj+GiPiJvi5LYqEH/Hmme4+MTLHM+Ejtq+FChpjjEnsPdQ==}
|
||||
engines: {node: '>= 4'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-1agZ7UULsa0AVUZefVDmfy7hdHDIm7hr/tB8scKwSy8HE8a+5c3EQsCTEQfx6/+8LGNa7Re2+4fir9mKxFsBuw==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
|
||||
|
||||
@@ -5411,6 +5415,8 @@ snapshots:
|
||||
|
||||
'@tauri-apps/[email protected]': {}
|
||||
|
||||
'@tauri-apps/[email protected]': {}
|
||||
|
||||
'@tauri-apps/[email protected]':
|
||||
optional: true
|
||||
|
||||
@@ -5462,6 +5468,10 @@ snapshots:
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.2
|
||||
|
||||
'@tauri-apps/[email protected]':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.6.0
|
||||
|
||||
'@tauri-apps/[email protected]':
|
||||
dependencies:
|
||||
'@tauri-apps/api': 2.0.2
|
||||
@@ -6162,8 +6172,6 @@ snapshots:
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
[toolchain]
|
||||
channel = "1.81"
|
||||
channel = "1.82"
|
||||
profile = "default"
|
||||
components = ["rustc", "cargo", "clippy", "rustfmt", "rust-analyzer", "rust-src"]
|
||||
Reference in new issue
Block a user