Skip to content

Commit

Permalink
Merge pull request #12 from Float3/dev
Browse files Browse the repository at this point in the history
Dev 12
  • Loading branch information
float3 authored Apr 21, 2022
2 parents d818a08 + 09d25a8 commit 5d96cdb
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 44 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# VRCLauncher
![VRCLauncher_9mqY6RYlZd](https://user-images.githubusercontent.com/86748455/161536489-70a9eed6-f054-47b9-b30e-f19272189316.png)
![VRCLauncher_Ip4QekJZhk](https://user-images.githubusercontent.com/86748455/164448202-0e7d2a48-9a29-4d7e-9c65-d94ab90f261c.png)

For In-Depth explanations for most of the commands go to

https://docs.vrchat.com/docs/launch-options

https://docs.unity3d.com/2019.4/Documentation/Manual/PlayerCommandLineArguments.html

Arguments that aren't covered by those links can be found below

| argument | default value | explanation | source |
|-------------------------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| --osc=inPort:senderIP:outPort | --osc=9000:127.0.0.1:9001 | https://github.com/vrchat-community/osc/wiki#vrchat-ports | https://github.com/vrchat-community/osc/wiki#vrchat-ports |
| | | | |
| vrchat://launch?id= | | Specify launch instance | |
| | | | |
| --log-debug-levels= | | extends logging. know "debug-levls" include (this information is most likely out of date): <br/><br/> --log-debug-levels="Always;API;AssetBundleDownloadManager;ContentCreator;All;NetworkTransport;NetworkData;NetworkProcessing" | |
| | | | |
| --custom-arm-ratio= | --custom-arm-ratio="0.4537" | The IK-Beta Changelog of VRChat 2022.1.1p3 build 11721 states:<br/><br/>- Added --custom-arm-ratio="0.4537" launch option. "0.4537" is default, "0.415" will approximate previous beta arm scale | An announcement on the VRChat Discord server: https://discord.com/channels/189511567539306508/503009489486872583/955619620310646814 |
| --disable-shoulder-tracking | | The IK-Beta Changelog of VRChat 2022.1.1p4 build 11731 states:<br/><br/>- Added --disable-shoulder-tracking launch option. Use this to avoid issues with some types of IMU-only based arm trackers. | An announcement on the VRChat Discord server: https://discord.com/channels/189511567539306508/503009489486872583/958535824490758144 |
| --calibration-range= | --calibration-range="0.3" | The IK-Beta 2.0 Changelog of VRChat 2022.1.1p5 build 11748 states:<br/><br/>- **Added the --calibration-range="0.3" launch option**. This determines the distance from predicted supported binding points that the calibration will search (in meters)<br/>- The default value is 0.3, corresponding to a 30cm radius sphere around possible binding points | An announcement on the VRChat Discord server: https://discord.com/channels/189511567539306508/503009489486872583/966575806522466305 |
69 changes: 41 additions & 28 deletions VRCLauncher/Model/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,43 @@
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Windows;
using Microsoft.Win32;

// ReSharper disable InconsistentNaming

namespace VRCLauncher.Model;

public class Config
{
public bool NoVR { get; set; }
public int FPS { get; set; }
public bool LegacyFBTCalibrate { get; set; }
public int Profile { get; set; }

public bool WatchWorlds { get; set; }
public bool WatchAvatars { get; set; }

public bool Fullscreen { get; set; }
public int Width { get; set; }

public int Height { get; set; }
public int Monitor { get; set; }

// public int Monitor { get; set; }
public bool UdonDebugLogging { get; set; }
public bool DebugGUI { get; set; }
public bool SDKLogLevels { get; set; }
public bool VerboseLogging { get; set; }
public string MidiDevice { get; set; }
public string OSCPorts { get; set; }

public bool LegacyFBTCalibrate { get; set; }
public string CustomArmRatio { get; set; }
public bool DisableShoulderTracking { get; set; }
public string CalibrationRange { get; set; }

public string MidiDevice { get; set; }
public string OSCPorts { get; set; }
public string LaunchInstance { get; set; }
public string ArbitraryArguments { get; set; }

public ObservableCollection<CompanionApp> CompanionApps { get; set; }
public bool LaunchCompanionApps { get; set; }

Expand All @@ -54,18 +57,19 @@ public Config()
WatchAvatars = false;

Fullscreen = true;
Width = 0;
Height = 0;
// Monitor = 0;
Width = 0; // (int) SystemParameters.PrimaryScreenWidth;
Height = 0; // (int) SystemParameters.PrimaryScreenHeight;
Monitor = 1;

UdonDebugLogging = false;
DebugGUI = false;
SDKLogLevels = false;
VerboseLogging = false;

LegacyFBTCalibrate = false;
CustomArmRatio = "0.4537";
CustomArmRatio = "";
DisableShoulderTracking = false;
CalibrationRange = "";

MidiDevice = "";
OSCPorts = "";
Expand All @@ -76,7 +80,6 @@ public Config()
LaunchCompanionApps = true;
}

// ReSharper disable once IdentifierTypo
public static string FindVRCexePath()
{
try
Expand Down Expand Up @@ -131,21 +134,13 @@ public List<string> GetArgs()

args.Add("--fps=" + FPS);

if (LegacyFBTCalibrate) args.Add("--legacy-fbt-calibrate");

args.Add("--profile=" + Profile);


if (WatchWorlds) args.Add("--watch-worlds");

if (WatchAvatars) args.Add("--watch-avatars");

if (UdonDebugLogging) args.Add("--enable-udon-debug-logging");

if (DebugGUI) args.Add("--enable-debug-gui");

if (SDKLogLevels) args.Add("--enable-sdk-log-levels");

if (VerboseLogging) args.Add("--enable-verbose-logging");

args.Add("-screen-fullscreen");
args.Add(Fullscreen ? "1" : "0");
Expand All @@ -162,17 +157,32 @@ public List<string> GetArgs()
args.Add(Height.ToString());
}

// args.Add("-monitor");
// args.Add(Monitor.ToString());
args.Add("-monitor");
args.Add(Monitor.ToString());

if (MidiDevice != "") args.Add("--midi=" + MidiDevice);

if (OSCPorts != "") args.Add("--osc-ports=" + OSCPorts);
if (UdonDebugLogging) args.Add("--enable-udon-debug-logging");

if (CustomArmRatio != "") args.Add("--custom-arm-ratio=" + CustomArmRatio);
if (DebugGUI) args.Add("--enable-debug-gui");

if (SDKLogLevels) args.Add("--enable-sdk-log-levels");

if (VerboseLogging) args.Add("--enable-verbose-logging");


if (LegacyFBTCalibrate) args.Add("--legacy-fbt-calibrate");

if (CustomArmRatio != "") args.Add("--custom-arm-ratio=\"" + CustomArmRatio + "\"");

if (DisableShoulderTracking) args.Add("--disable-shoulder-tracking");

if (CalibrationRange != "") args.Add("--calibration-range=\"" + CalibrationRange + "\"");


if (MidiDevice != "") args.Add("--midi=" + MidiDevice);

if (OSCPorts != "") args.Add("--osc-ports=" + OSCPorts);

if (LaunchInstance != "") args.Add(LaunchInstance);

if (ArbitraryArguments != "")
Expand All @@ -187,6 +197,8 @@ public void LaunchApps(List<string> args)
{
if (LaunchCompanionApps)
{
Process[] processes = Process.GetProcesses();

foreach (CompanionApp app in CompanionApps)
{
bool launch = true;
Expand Down Expand Up @@ -216,7 +228,7 @@ public void LaunchApps(List<string> args)
}
}

foreach (Process process in Process.GetProcesses())
foreach (Process process in processes)
{
if (process.ProcessName.ToLower() == app.Name.ToLower())
{
Expand All @@ -238,7 +250,8 @@ public void LaunchApps(List<string> args)
else if (app.Path.EndsWith(".py"))
{
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = app.Path + " " + app.Args;
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(app.Path);
process.StartInfo.Arguments = "";
process.StartInfo.RedirectStandardInput = true;
process.Start();

Expand Down
62 changes: 56 additions & 6 deletions VRCLauncher/View/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@
HorizontalAlignment="Center" VerticalAlignment="Center" />
</StackPanel>

<!--<StackPanel Orientation="Horizontal">
<Label Content="-monitor " Width="110" HorizontalContentAlignment="Left" />
<TextBox Text="{Binding Monitor}" Width="80" TextAlignment="Center"
HorizontalContentAlignment="Center"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</StackPanel>-->
<StackPanel Orientation="Horizontal">
<Label Content="-monitor " Width="110" HorizontalContentAlignment="Left" />
<TextBox Text="{Binding Monitor}" Width="80" TextAlignment="Center"
HorizontalContentAlignment="Center"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</StackPanel>

</StackPanel>
</GroupBox>
Expand Down Expand Up @@ -235,6 +235,56 @@
HorizontalContentAlignment="Left" />
<CheckBox IsChecked="{Binding DisableShoulderTracking}" />
</StackPanel>

<StackPanel Orientation="Horizontal">
<Label Content="--calibration-range=" Width="120" HorizontalContentAlignment="Left" />
<TextBox Text="{Binding CalibrationRange}" Width="200" TextAlignment="Left"
HorizontalContentAlignment="Center"
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"
PreviewTextInput="ValidateFloatTextBox">

<TextBox.Resources>
<VisualBrush
x:Key="Watermark"
AlignmentX="Left"
Stretch="None"
TileMode="None">
<VisualBrush.Visual>
<TextBlock
FontStyle="Italic"
Foreground="#959595"
Text="default: 0.3" />
</VisualBrush.Visual>
</VisualBrush>
</TextBox.Resources>

<TextBox.Style>
<Style TargetType="TextBox">
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground"
Value="{StaticResource ForegroundColorBrush}" />
<Setter Property="Background"
Value="{StaticResource TextBackgroundColorBrush}" />
<Setter Property="BorderBrush"
Value="{StaticResource TextBackgroundColorBrush}" />
<Style.Triggers>
<Trigger Property="Text" Value="">
<Setter Property="Background"
Value="{StaticResource Watermark}" />
</Trigger>

<Trigger Property="Text" Value="{x:Null}">
<Setter Property="Background"
Value="{StaticResource Watermark}" />
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>

</TextBox>
</StackPanel>

</StackPanel>
</GroupBox>
</StackPanel>
Expand Down
36 changes: 27 additions & 9 deletions VRCLauncher/ViewModel/ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public ViewModel()
Fullscreen = Config.Fullscreen;
Width = Config.Width;
Height = Config.Height;
// Monitor = Config.Monitor;
Monitor = Config.Monitor;

UdonDebugLogging = Config.UdonDebugLogging;
DebugGUI = Config.DebugGUI;
Expand All @@ -32,12 +32,13 @@ public ViewModel()
LegacyFBTCalibrate = Config.LegacyFBTCalibrate;
CustomArmRatio = Config.CustomArmRatio;
DisableShoulderTracking = Config.DisableShoulderTracking;
CalibrationRange = Config.CalibrationRange;

MidiDevice = Config.MidiDevice;
OSCPorts = Config.OSCPorts;
LaunchInstance = Config.LaunchInstance;
ArbitraryArguments = Config.ArbitraryArguments;

LaunchCompanionApps = Config.LaunchCompanionApps;
CompanionApps = Config.CompanionApps;
}
Expand Down Expand Up @@ -128,12 +129,12 @@ public bool WatchAvatars
}
}

private bool _fullscreen;

#endregion

#region Screen

private bool _fullscreen;

public bool Fullscreen
{
get => Config.Fullscreen;
Expand Down Expand Up @@ -180,21 +181,22 @@ public int Width
}
}

/*private int _monitor;
private int _monitor;

public int Monitor
{
get => Config.Monitor;
set
{
if (_monitor != value)
{
if (value < 1) value = 1; // Monitor is specified by a 1-based index number
_monitor = value;
Config.Monitor = value;
OnPropertyChanged(nameof(Monitor));
}
}
}*/
}

#endregion

Expand Down Expand Up @@ -316,6 +318,22 @@ public bool DisableShoulderTracking
}
}

private string _calibrationRange;

public string CalibrationRange
{
get => Config.CalibrationRange;
set
{
if (_calibrationRange != value)
{
_calibrationRange = value;
Config.CalibrationRange = value;
OnPropertyChanged(nameof(CalibrationRange));
}
}
}

#endregion

#region MISC
Expand Down Expand Up @@ -406,7 +424,7 @@ public ObservableCollection<CompanionApp> CompanionApps
}
}
}

private bool _launchCompanionApps;

public bool LaunchCompanionApps
Expand All @@ -422,7 +440,7 @@ public bool LaunchCompanionApps
}
}
}

#endregion

public event PropertyChangedEventHandler PropertyChanged;
Expand Down

0 comments on commit 5d96cdb

Please sign in to comment.