Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Hide Menu on Launch" Setting #121

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class ClientSimSettingsWindow : EditorWindow
private readonly GUIContent _generalFoldoutGuiContent = new GUIContent("General Settings", "");
private readonly GUIContent _enableToggleGuiContent = new GUIContent("Enable ClientSim", "If enabled, all triggers will function similarly to VRChat. Note that behavior may be different than the actual game!");
private readonly GUIContent _displayLogsToggleGuiContent = new GUIContent("Enable Console Logging", "Enabling logging will print messages to the console when certain events happen. Examples include trigger execution, pickup grabbed, station entered, etc.");
private readonly GUIContent _hideMenuOnLaunchToggleGuiContent = new GUIContent("Hide Menu On Launch", "Enabling this setting will prevent the ClientSim menu from being displayed when initially entering play mode.");
private readonly GUIContent _deleteEditorOnlyToggleGuiContent = new GUIContent("Remove \"EditorOnly\"", "Enabling this setting will ensure that all objects with the tag \"EditorOnly\" are deleted when in playmode. This can be helpful in finding objects that will not be uploaded with your world. Enable console logging to see which objects are deleted.");
private readonly GUIContent _startupDelayGuiContent = new GUIContent("Startup Delay", "The duration that the Client Sim will wait to simulate the VRChat client loading before spawning the player and initializing Udon. This is useful to test when Unity components behave differently at startup compared to VRChat.");
private readonly GUIContent _stopOnScriptChangesToggleGuiContent = new GUIContent("Stop On Script Changes", "If enabled, the editor will stop if script changes are detected while in play mode. This will override the Unity Editor setting 'Preferences > General > Script Changes While Playing'.");
Expand Down Expand Up @@ -345,6 +346,8 @@ private void DrawGeneralSettings()

// Settings that cannot be changed at runtime
EditorGUI.BeginDisabledGroup(Application.isPlaying);

_settings.hideMenuOnLaunch = EditorGUILayout.Toggle(_hideMenuOnLaunchToggleGuiContent, _settings.hideMenuOnLaunch);

_settings.deleteEditorOnly = EditorGUILayout.Toggle(_deleteEditorOnlyToggleGuiContent, _settings.deleteEditorOnly);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public static ClientSimSettings Instance
// TODO move settings to be per project instead of global to all
public bool enableClientSim = true;
public bool displayLogs = true;
public bool hideMenuOnLaunch = false;
public bool deleteEditorOnly = true;
public bool spawnPlayer = true;

Expand Down
4 changes: 4 additions & 0 deletions Packages/com.vrchat.ClientSim/Runtime/System/ClientSimMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ private void Start()
OpenSettings();
SetDisplayedPage(ClientSimDisplayedPage.INVALID_SETTINGS_PAGE);
}
else if (_settings.hideMenuOnLaunch)
{
shouldShowMenu = false;
}
else if (_settings.initializationDelay > 0)
{
SetDisplayedPage(ClientSimDisplayedPage.DELAYED_START_PAGE);
Expand Down
Loading