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

Overhaul command-line parameter functionality. #1428

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

Penguin-Guru
Copy link

@Penguin-Guru Penguin-Guru commented Oct 25, 2021

I don't use any of these so I can't really tell whether or not they're working. If they aren't working, let me know how to test the parameter that's broken and I'll try to look into the handling. Parameter order and descriptions are based on the current documentation.

#1392

#827

#835

@Penguin-Guru

This comment has been minimized.

@digisomni digisomni added this to the 2021.2.1 Selene Release milestone Oct 28, 2021
@digisomni digisomni changed the title Fixing Command-line Parameters Fixing command-line parameter functionality. Oct 28, 2021
@digisomni digisomni added allow-build-upload Allows the upload of a build for non white-listed users rebuild rebuild through the GithubActions labels Oct 28, 2021
Copy link
Contributor

@daleglass daleglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this a lot! Just a few minor quibbles so far.

interface/src/Application.cpp Outdated Show resolved Hide resolved
interface/src/main.cpp Show resolved Hide resolved
interface/src/main.cpp Show resolved Hide resolved
interface/src/main.cpp Show resolved Hide resolved
interface/src/main.cpp Show resolved Hide resolved
interface/src/Application.h Outdated Show resolved Hide resolved
@digisomni digisomni changed the title Fixing command-line parameter functionality. Overhaul command-line parameter functionality. Nov 6, 2021
Copy link
Contributor

@daleglass daleglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvements :)

I've been testing, and there's a number of 'probably' that shouldn't be there, so I checked the code to see if that could be improved.

interface/src/main.cpp Outdated Show resolved Hide resolved
interface/src/main.cpp Outdated Show resolved Hide resolved
interface/src/main.cpp Outdated Show resolved Hide resolved
);
QCommandLineOption scriptsOption(
"scripts",
"Set path for defaultScripts. These are probably scripts that run automatically.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option seems to be broken in the code. The path doesn't seem to be passed on to the script engine:

https://github.com/Penguin-Guru/vircadia/blob/46d2ff0d0774c0ac7475bc6a40c2da5eac100e94/interface/src/Application.cpp#L5816-L5816

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we try to fix it or comment out the parameters? This one is actually in the docs but I can't tell what it's supposed to do from the description.
https://docs.vircadia.dev/interfaces/native/command-line-parameters.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be an easy fix. The main issue is that it doesn't actually pass the path to scriptEngines.

There's also the loadDefaultScripts vs loadScripts difference that is suspicious.

Copy link
Author

@Penguin-Guru Penguin-Guru Nov 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These both call loadScript(), which does not seem to support directories. Maybe it does somehow.

loadScripts reads from the settings before handling "_defaultScriptsOverride", which seems strange.
https://github.com/vircadia/vircadia/blob/master/libraries/script-engine/src/ScriptEngines.cpp#L343

"_defaultScriptsOverride" is protected and only set in ScriptEngines' constructor and I'm not sure how to assign that yet. I pushed the other fixes for you to test.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@Penguin-Guru Penguin-Guru Nov 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I'm having a really hard time telling these features apart. The variable names overlap a lot and I'm not sure how the parameters are supposed to be different from each other.

See how --scripts is referenced here: https://github.com/Penguin-Guru/vircadia/blob/FixingParameters/interface/src/Application.cpp#L1929

Copy link
Author

@Penguin-Guru Penguin-Guru Nov 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loadScripts() does not accept a parameter, and it contains code that handles --defaultScriptsOverride in a way that completely overlaps with the specified functionality of --scripts. The variable names for --scripts suggest it serves the exact same purpose. Perhaps it was only partially implemented, intended to replace --defaultScriptsOverride and mirror the name of the settings value? But --scripts is in the web documentation and --defaultScriptsOverride is not.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have confirmed that --scripts does not work, should I comment it out for now or make it a pseudonym for --defaultScriptsOverride? If we're commenting it out, it should probably also be removed from the web docs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it, and as far as I can tell, it's not doing anything. I'll create an issue.

Copy link
Author

@Penguin-Guru Penguin-Guru Nov 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I will add a warning to the --help output for now but I suggest commenting --scripts out of the code and removing it from the web docs if no other resolution is determined before this PR is merged. The main goal of this PR is to fix such inconsistencies and I think this is the only one left (hopefully).

);
QCommandLineOption systemCursorOption(
"system-cursor",
"Probably prevents changing the cursor when application has focus."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "probably". I'd describe it simply as "Uses the default system cursor". Which is maybe not ideal, but should do for now.

It looks like the cursor can change to a reticle when using an HMD, this should disable that and use whatever the OS wants to use by default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have attempted to fix this. Please let me know if it is resolved after I push the commit.

interface/src/main.cpp Outdated Show resolved Hide resolved
interface/src/main.cpp Outdated Show resolved Hide resolved
interface/src/Application.cpp Outdated Show resolved Hide resolved
@Penguin-Guru
Copy link
Author

@daleglass Should be up to date with master now. I can't test this right now but I assume it will work since there were no conflicts.

@digisomni digisomni self-requested a review December 2, 2021 22:10
@digisomni
Copy link
Member

Needs a merge from master to fix merge conflict.

@Penguin-Guru
Copy link
Author

Go for it.

@digisomni
Copy link
Member

digisomni commented Dec 30, 2021

Tested with the Pantheon Launcher on Windows, it successfully launched however my OpenVR disabling parameters did not work correctly and it launched with SteamVR anyway.

https://docs.vircadia.dev/interfaces/native/command-line-parameters the two command line parameters being used are:

--disable-displays=<device> and --disable-inputs=<device>.

@digisomni
Copy link
Member

@namark can you see about testing out the command lines apply the necessary fixes/revisions?

@stale
Copy link

stale bot commented Aug 7, 2022

Hello! Is this still an issue?

@stale stale bot added the stale Issue / PR has not had activity label Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
allow-build-upload Allows the upload of a build for non white-listed users bugfix CR Approved At least one code reviewer has approved the PR. enhancement New feature or request needs testing (QA) The PR is ready for testing rebuild rebuild through the GithubActions stale Issue / PR has not had activity
Projects
None yet
6 participants