Skip to content

Commit

Permalink
Add passthrough and body tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Futuremappermydud committed Apr 10, 2024
1 parent e4580ed commit aaa45d7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions QuestPatcher.Core/Models/PatchingOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public bool HandTracking

public ModLoader ModLoader { get; set; } = ModLoader.QuestLoader;

public bool Passthrough { get; set; }

public bool BodyTracking { get; set; }

/// <summary>
/// Path to a PNG file containing a custom splash screen.
/// </summary>
Expand Down
11 changes: 11 additions & 0 deletions QuestPatcher.Core/Patching/PatchingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,17 @@ private async Task PatchManifest(ApkZip apk)
});
}

if (permissions.Passthrough)
{
addingFeatures.Add("com.oculus.feature.PASSTHROUGH");
}

if (permissions.BodyTracking)
{
addingFeatures.Add("com.oculus.software.body_tracking");
addingPermissions.Add("com.oculus.permission.BODY_TRACKING");
}

// Find which features and permissions already exist to avoid adding existing ones
var existingPermissions = GetExistingChildren(manifest, "uses-permission");
var existingFeatures = GetExistingChildren(manifest, "uses-feature");
Expand Down
7 changes: 5 additions & 2 deletions QuestPatcher/Views/PatchingView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Design.DataContext>
<viewModels:PatchingViewModel />
</Design.DataContext>

<Panel>
<DockPanel IsVisible="{Binding !IsPatchingInProgress}">
<StackPanel Margin="20" Orientation="Vertical" DockPanel.Dock="Top">
Expand All @@ -30,6 +30,9 @@
<ComboBoxItem>V2</ComboBoxItem>
</ComboBox>
</StackPanel>

<ToggleSwitch IsChecked="{Binding Config.PatchingOptions.Passthrough}">Enable Passthrough</ToggleSwitch>
<ToggleSwitch IsChecked="{Binding Config.PatchingOptions.BodyTracking}">Enable Body Tracking</ToggleSwitch>
</StackPanel>
</ScrollViewer>
<Panel Margin="0 10 0 0" Background="{DynamicResource PatchingOptionsBackground}">
Expand All @@ -45,7 +48,7 @@
</StackPanel>
</Panel>
</StackPanel>

<StackPanel HorizontalAlignment="Center" Orientation="Vertical" VerticalAlignment="Center" Spacing="20">
<StackPanel Orientation="Vertical" Spacing="5">
<TextBlock TextAlignment="Center">Before you install mods, QuestPatcher must patch your app.</TextBlock>
Expand Down

0 comments on commit aaa45d7

Please sign in to comment.