Skip to content

Commit

Permalink
Merge branch 'main' of github.com:SlimeVR/SlimeVR-Server into drift-p…
Browse files Browse the repository at this point in the history
…rediction
  • Loading branch information
loucass003 committed Oct 9, 2024
2 parents e8a9cf0 + 8da5d84 commit eca3e8e
Show file tree
Hide file tree
Showing 18 changed files with 301 additions and 66 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto

*.png binary
*.webp binary
*.gif binary
76 changes: 38 additions & 38 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# Global code owner
* @Eirenliel

# Make everyone be able to approve SolarXR submodule changes
/solarxr-protocol @ButterscotchV @Erimelowo @ImUrX @loucass003

# Make Loucas and Uriel the owners of all GUI stuff
/gui/ @ImUrX @loucass003
/pnpm-lock.yaml @ImUrX @loucass003
/pnpm-workspace.yaml @ImUrX @loucass003

# Uriel and Erimel responsible for i18n
/gui/public/i18n/ @ImUrX @Erimelowo
/gui/src/i18n/ @ImUrX @Erimelowo
/l10n.toml @ImUrX @Erimelowo

/gui/src/components/settings/ @Erimelowo @ImUrX

# Rust part of the GUI
/gui/src-tauri/ @ImUrX
/Cargo.lock @ImUrX

# Some server code~
/server/ @ButterscotchV @Eirenliel @Erimelowo

/server/src/main/java/dev/slimevr/autobone/ @ButterscotchV
/server/src/main/java/dev/slimevr/poserecorder/ @ButterscotchV
/server/src/main/java/dev/slimevr/posestreamer/ @ButterscotchV

/server/src/main/java/dev/slimevr/osc/ @Erimelowo
/server/src/main/java/dev/slimevr/tracking/processor/ @Erimelowo
/server/src/main/java/dev/slimevr/filtering/ @Erimelowo

# Linux files
*.nix @ImUrX
/flake.lock @ImUrX
/dev.slimevr.SlimeVR.metainfo.xml @ImUrX
/.envrc @ImUrX
# Global code owner
* @Eirenliel

# Make everyone be able to approve SolarXR submodule changes
/solarxr-protocol @ButterscotchV @Erimelowo @ImUrX @loucass003

# Make Loucas and Uriel the owners of all GUI stuff
/gui/ @ImUrX @loucass003
/pnpm-lock.yaml @ImUrX @loucass003
/pnpm-workspace.yaml @ImUrX @loucass003

# Uriel and Erimel responsible for i18n
/gui/public/i18n/ @ImUrX @Erimelowo
/gui/src/i18n/ @ImUrX @Erimelowo
/l10n.toml @ImUrX @Erimelowo

/gui/src/components/settings/ @Erimelowo @ImUrX

# Rust part of the GUI
/gui/src-tauri/ @ImUrX
/Cargo.lock @ImUrX

# Some server code~
/server/ @ButterscotchV @Eirenliel @Erimelowo

/server/src/main/java/dev/slimevr/autobone/ @ButterscotchV
/server/src/main/java/dev/slimevr/poserecorder/ @ButterscotchV
/server/src/main/java/dev/slimevr/posestreamer/ @ButterscotchV

/server/src/main/java/dev/slimevr/osc/ @Erimelowo
/server/src/main/java/dev/slimevr/tracking/processor/ @Erimelowo
/server/src/main/java/dev/slimevr/filtering/ @Erimelowo

# Linux files
*.nix @ImUrX
/flake.lock @ImUrX
/dev.slimevr.SlimeVR.metainfo.xml @ImUrX
/.envrc @ImUrX
3 changes: 2 additions & 1 deletion gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"solarxr-protocol": "file:../solarxr-protocol",
"three": "^0.163.0",
"ts-pattern": "^5.2.0",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"use-double-tap": "^1.3.6"
},
"scripts": {
"start": "vite --force",
Expand Down
26 changes: 22 additions & 4 deletions gui/public/i18n/en/translation.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,13 @@ widget-developer_mode-raw_slime_rotation = Raw rotation
widget-developer_mode-more_info = More info
## Widget: IMU Visualizer
widget-imu_visualizer = Rotation
widget-imu_visualizer-rotation_raw = Raw
widget-imu_visualizer-rotation_preview = Preview
widget-imu_visualizer-rotation_hide = Hide
widget-imu_visualizer = Tracking data
widget-imu_visualizer-preview = Preview
widget-imu_visualizer-hide = Hide
widget-imu_visualizer-rotation_raw = Raw rotation
widget-imu_visualizer-rotation_preview = Preview rotation
widget-imu_visualizer-acceleration = Acceleration
widget-imu_visualizer-position = Position
## Widget: Skeleton Visualizer
widget-skeleton_visualizer-preview = Skeleton preview
Expand Down Expand Up @@ -321,13 +324,22 @@ settings-general-tracker_mechanics-drift_compensation = Drift compensation
settings-general-tracker_mechanics-drift_compensation-description =
Compensates IMU yaw drift by applying an inverse rotation.
Change amount of compensation and up to how many resets are taken into account.
This should only be used if you need to reset very often!
settings-general-tracker_mechanics-drift_compensation-enabled-label = Drift compensation
settings-general-tracker_mechanics-drift_compensation-prediction = Drift compensation prediction
# This cares about multilines
settings-general-tracker_mechanics-drift_compensation-prediction-description =
Predicts yaw drift compensation beyond previously measured range.
Enable this if the tracker is continuously spinning on yaw axis.
settings-general-tracker_mechanics-drift_compensation-prediction-label = Drift compensation prediction
settings-general-tracker_mechanics-drift_compensation_warning =
<b>Warning:</b> Only use drift compensation if you need to reset
very often (every ~5-10 minutes).
Some IMUs prone to frequent resets include:
Joy-Cons, owoTrack, and MPUs (without recent firmware).
settings-general-tracker_mechanics-drift_compensation_warning-cancel = Cancel
settings-general-tracker_mechanics-drift_compensation_warning-done = I understand
settings-general-tracker_mechanics-drift_compensation-amount-label = Compensation amount
settings-general-tracker_mechanics-drift_compensation-max_resets-label = Use up to x last resets
settings-general-tracker_mechanics-save_mounting_reset = Save automatic mounting reset calibration
Expand Down Expand Up @@ -430,6 +442,9 @@ settings-general-interface-dev_mode = Developer Mode
settings-general-interface-dev_mode-description = This mode can be useful if you need in-depth data or to interact with connected trackers on a more advanced level.
settings-general-interface-dev_mode-label = Developer Mode
settings-general-interface-theme = Color theme
settings-general-interface-show-navbar-onboarding = Show "{ navbar-onboarding }" on navigation bar
settings-general-interface-show-navbar-onboarding-description = This changes if the "{ navbar-onboarding }" button shows on the navigation bar.
settings-general-interface-show-navbar-onboarding-label = Show "{ navbar-onboarding }"
settings-general-interface-lang = Select language
settings-general-interface-lang-description = Change the default language you want to use.
settings-general-interface-lang-placeholder = Select the language to use
Expand All @@ -441,6 +456,9 @@ settings-interface-appearance-font-os_font = OS font
settings-interface-appearance-font-slime_font = Default font
settings-interface-appearance-font_size = Base font scaling
settings-interface-appearance-font_size-description = This affects the font size of the whole interface except this settings panel.
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
## Notification settings
settings-interface-notifications = Notifications
Expand Down
1 change: 1 addition & 0 deletions gui/src-tauri/capabilities/migrated.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"window:allow-hide",
"window:allow-show",
"window:allow-set-focus",
"window:allow-set-decorations",
"shell:allow-open",
"store:allow-get",
"store:allow-set",
Expand Down
2 changes: 1 addition & 1 deletion gui/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ fn main() -> Result<()> {
.shell()
.command(java_bin.to_str().unwrap())
.current_dir(p)
.args(["-Xmx512M", "-jar", "slimevr.jar", "run"])
.args(["-Xmx128M", "-jar", "slimevr.jar", "run"])
.spawn()
.expect("Unable to start the server jar");

Expand Down
5 changes: 5 additions & 0 deletions gui/src-tauri/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub struct WindowState {
height: f64,
x: i32,
y: i32,
decorated: bool,
#[serde(skip)]
old: bool,
}
Expand Down Expand Up @@ -50,6 +51,8 @@ impl WindowState {
window: &Window,
ignore_maximized: bool,
) -> Result<()> {
self.decorated = window.is_decorated()?;

let maximized = window.is_maximized()?;
self.maximized = maximized || (self.maximized && ignore_maximized);
// We early return when it's maximized because we dont have to save the state
Expand All @@ -70,6 +73,8 @@ impl WindowState {
}

pub fn update_window(&self, window: &Window, ignore_maximized: bool) -> Result<()> {
window.set_decorations(self.decorated)?;

let maximized = !ignore_maximized && window.is_maximized()?;
if maximized && !self.maximized {
window.unmaximize()?;
Expand Down
10 changes: 7 additions & 3 deletions gui/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { RulerIcon } from './commons/icon/RulerIcon';
import { SparkleIcon } from './commons/icon/SparkleIcon';
import { WrenchIcon } from './commons/icon/WrenchIcons';
import { useBreakpoint } from '@/hooks/breakpoint';
import { useConfig } from '@/hooks/config';

export function NavButton({
to,
Expand Down Expand Up @@ -64,6 +65,7 @@ export function NavButton({
}

export function MainLinks() {
const { config } = useConfig();
const { l10n } = useLocalization();

return (
Expand Down Expand Up @@ -94,9 +96,11 @@ export function MainLinks() {
>
{l10n.getString('navbar-body_proportions')}
</NavButton>
<NavButton to="/onboarding/home" icon={<SparkleIcon></SparkleIcon>}>
{l10n.getString('navbar-onboarding')}
</NavButton>
{config?.showNavbarOnboarding && (
<NavButton to="/onboarding/home" icon={<SparkleIcon></SparkleIcon>}>
{l10n.getString('navbar-onboarding')}
</NavButton>
)}
</>
);
}
Expand Down
44 changes: 30 additions & 14 deletions gui/src/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import { TrackersStillOnModal } from './TrackersStillOnModal';
import { useConfig } from '@/hooks/config';
import { listen } from '@tauri-apps/api/event';
import { TrayOrExitModal } from './TrayOrExitModal';
import { error } from '@/utils/logging';
import { useDoubleTap } from 'use-double-tap';

export function VersionTag() {
return (
Expand Down Expand Up @@ -62,6 +64,7 @@ export function TopBar({
const [localIp, setLocalIp] = useState<string | null>(null);
const [showConnectedTrackersWarning, setConnectedTrackerWarning] =
useState(false);
const [showVersionMobile, setShowVersionMobile] = useState(false);
const [showTrayOrExitModal, setShowTrayOrExitModal] = useState(false);
const doesMatchSettings = useMatch({
path: '/settings/*',
Expand Down Expand Up @@ -90,6 +93,8 @@ export function TopBar({
await closeApp();
}
};
const showVersionBind = useDoubleTap(() => setShowVersionMobile(true));
const unshowVersionBind = useDoubleTap(() => setShowVersionMobile(false));

useEffect(() => {
const unlisten = listen('try-close', async () => {
Expand All @@ -104,6 +109,11 @@ export function TopBar({
};
}, [config?.useTray, config?.connectedTrackersWarning]);

useEffect(() => {
if (config === null || !isTauri) return;
getCurrent().setDecorations(config?.decorations).catch(error);
}, [config?.decorations]);

useEffect(() => {
sendRPCPacket(RpcMessage.ServerInfosRequest, new ServerInfosRequestT());
}, []);
Expand All @@ -121,26 +131,28 @@ export function TopBar({
<div className="h-[3px]"></div>
<div data-tauri-drag-region className="flex gap-2 h-[38px] z-50">
<div
className="flex px-2 pb-1 mt-3 justify-around z-50"
className="flex px-2 py-2 justify-around z-50"
data-tauri-drag-region
>
<div className="flex gap-2 mobile:w-5" data-tauri-drag-region>
<NavLink
to="/"
className="flex justify-around flex-col select-all"
data-tauri-drag-region
>
<SlimeVRIcon></SlimeVRIcon>
</NavLink>
{(isTauri || !isMobile) && (
<div className="flex gap-2" data-tauri-drag-region>
{!config?.decorations && (
<NavLink
to="/"
className="flex justify-around flex-col select-all"
data-tauri-drag-region
>
<SlimeVRIcon></SlimeVRIcon>
</NavLink>
)}
{(isTauri || !isMobile) && !config?.decorations && (
<div
className={classNames('flex justify-around flex-col')}
data-tauri-drag-region
>
<Typography>SlimeVR</Typography>
</div>
)}
{!isMobile && (
{(!(isMobile && !config?.decorations) || showVersionMobile) && (
<>
<VersionTag></VersionTag>
{doesMatchSettings && (
Expand All @@ -149,6 +161,7 @@ export function TopBar({
'flex justify-around flex-col text-standard-bold text-status-special',
'bg-status-special bg-opacity-20 rounded-lg px-3 select-text'
)}
{...unshowVersionBind}
>
{localIp || 'unknown local ip'}
</div>
Expand Down Expand Up @@ -192,8 +205,11 @@ export function TopBar({
</>
)}

{!isTauri && (
<div className="flex flex-row gap-2">
{!isTauri && !showVersionMobile && !config?.decorations && (
<div
className="flex flex-row gap-2"
{...(doesMatchSettings ? showVersionBind : {})}
>
<div
className="flex justify-around flex-col xs:hidden"
data-tauri-drag-region
Expand Down Expand Up @@ -230,7 +246,7 @@ export function TopBar({
</div>
)}

{isTauri && (
{isTauri && !config?.decorations && (
<>
<div
className="flex items-center justify-center hover:bg-background-60 rounded-full w-7 h-7"
Expand Down
Loading

0 comments on commit eca3e8e

Please sign in to comment.