Requested fixes (hopefully).

This commit is contained in:
Penguin-Guru 2021-11-20 17:12:49 -08:00
parent b11b173b60
commit b844b16285
2 changed files with 33 additions and 31 deletions

View file

@ -1337,25 +1337,27 @@ Application::Application(
connect(this, &QCoreApplication::aboutToQuit, addressManager.data(), &AddressManager::storeCurrentAddress); connect(this, &QCoreApplication::aboutToQuit, addressManager.data(), &AddressManager::storeCurrentAddress);
connect(this, &Application::activeDisplayPluginChanged, this, &Application::updateThreadPoolCount); connect(this, &Application::activeDisplayPluginChanged, this, &Application::updateThreadPoolCount);
connect(this, &Application::activeDisplayPluginChanged, this, [=](){ if (parser.isSet("system-cursor")) {
qApp->setProperty(hifi::properties::HMD, qApp->isHMDMode()); _preferredCursor.set(Cursor::Manager::getIconName(Cursor::Icon::SYSTEM));
auto displayPlugin = qApp->getActiveDisplayPlugin();
if (displayPlugin->isHmd()) { connect(this, &Application::activeDisplayPluginChanged, this, [=](){
if (_preferredCursor.get() == Cursor::Manager::getIconName(Cursor::Icon::RETICLE)) { qApp->setProperty(hifi::properties::HMD, qApp->isHMDMode());
setPreferredCursor(Cursor::Manager::getIconName(Cursor::Icon::RETICLE)); auto displayPlugin = qApp->getActiveDisplayPlugin();
}
else {
setPreferredCursor(Cursor::Manager::getIconName(Cursor::Icon::ARROW));
}
}
else {
setPreferredCursor(Cursor::Manager::getIconName(Cursor::Icon::SYSTEM));
}
setCrashAnnotation("display_plugin", displayPlugin->getName().toStdString()); if (displayPlugin->isHmd()) {
setCrashAnnotation("hmd", displayPlugin->isHmd() ? "1" : "0"); if (_preferredCursor.get() == Cursor::Manager::getIconName(Cursor::Icon::RETICLE)) {
}); setPreferredCursor(Cursor::Manager::getIconName(Cursor::Icon::RETICLE));
} else {
setPreferredCursor(Cursor::Manager::getIconName(Cursor::Icon::ARROW));
}
} else {
setPreferredCursor(Cursor::Manager::getIconName(Cursor::Icon::SYSTEM));
}
setCrashAnnotation("display_plugin", displayPlugin->getName().toStdString());
setCrashAnnotation("hmd", displayPlugin->isHmd() ? "1" : "0");
});
}
connect(this, &Application::activeDisplayPluginChanged, this, &Application::updateSystemTabletMode); connect(this, &Application::activeDisplayPluginChanged, this, &Application::updateSystemTabletMode);
connect(this, &Application::activeDisplayPluginChanged, this, [&](){ connect(this, &Application::activeDisplayPluginChanged, this, [&](){
if (getLoginDialogPoppedUp()) { if (getLoginDialogPoppedUp()) {
@ -1472,9 +1474,9 @@ Application::Application(
_glWidget->setFocusPolicy(Qt::StrongFocus); _glWidget->setFocusPolicy(Qt::StrongFocus);
_glWidget->setFocus(); _glWidget->setFocus();
if (parser.isSet("system-cursor")) { /*if (parser.isSet("system-cursor")) { // This is now done above, since the conditional was needed anyway.
_preferredCursor.set(Cursor::Manager::getIconName(Cursor::Icon::SYSTEM)); _preferredCursor.set(Cursor::Manager::getIconName(Cursor::Icon::SYSTEM));
} }*/
showCursor(Cursor::Manager::lookupIcon(_preferredCursor.get())); showCursor(Cursor::Manager::lookupIcon(_preferredCursor.get()));
// enable mouse tracking; otherwise, we only get drag events // enable mouse tracking; otherwise, we only get drag events
@ -5809,10 +5811,10 @@ void Application::resumeAfterLoginDialogActionTaken() {
// if the --scripts command-line argument was used. // if the --scripts command-line argument was used.
if (_overrideDefaultScriptsLocation && _defaultScriptsLocation.exists()) { if (_overrideDefaultScriptsLocation && _defaultScriptsLocation.exists()) {
scriptEngines->loadDefaultScripts(); scriptEngines->loadScripts();
scriptEngines->defaultScriptsLocationOverridden(true); scriptEngines->defaultScriptsLocationOverridden(true);
} else { } else {
scriptEngines->loadScripts(); scriptEngines->loadDefaultScripts();
} }
} }

View file

@ -65,7 +65,7 @@ int main(int argc, const char* argv[]) {
setupHifiApplication(BuildInfo::INTERFACE_NAME); setupHifiApplication(BuildInfo::INTERFACE_NAME);
QCommandLineParser parser; QCommandLineParser parser;
parser.setApplicationDescription("Overte"); parser.setApplicationDescription("Overte -- A free/libre and open-source metaverse client");
QCommandLineOption helpOption = parser.addHelpOption(); QCommandLineOption helpOption = parser.addHelpOption();
QCommandLineOption versionOption = parser.addVersionOption(); QCommandLineOption versionOption = parser.addVersionOption();
@ -148,7 +148,7 @@ int main(int argc, const char* argv[]) {
); );
QCommandLineOption systemCursorOption( QCommandLineOption systemCursorOption(
"system-cursor", "system-cursor",
"Probably prevents changing the cursor when application has focus." "Use the default system cursor."
); );
QCommandLineOption concurrentDownloadsOption( QCommandLineOption concurrentDownloadsOption(
"concurrent-downloads", "concurrent-downloads",
@ -182,12 +182,12 @@ int main(int argc, const char* argv[]) {
); );
QCommandLineOption overrideScriptsPathOption( QCommandLineOption overrideScriptsPathOption(
"overrideScriptsPath", "overrideScriptsPath",
"Probably specifies where to look for scripts.", "Specifies path to default directory where the application will look for scripts to load.",
"string" "string"
); );
QCommandLineOption defaultScriptOverrideOption( QCommandLineOption defaultScriptsOverrideOption(
"defaultScriptOverride", "defaultScriptsOverride",
"Override defaultsScripts.js.", "Override default script to run automatically on start. Default is \"defaultsScripts.js\".",
"string" "string"
); );
QCommandLineOption responseTokensOption( QCommandLineOption responseTokensOption(
@ -206,13 +206,13 @@ int main(int argc, const char* argv[]) {
); );
QCommandLineOption traceFileOption( QCommandLineOption traceFileOption(
"traceFile", "traceFile",
"Probably writes a trace to a file? Only works if \"--traceDuration\" is specified.", "Writes a trace to a file in the documents folder. Only works if \"--traceDuration\" is specified.",
"path" "path"
); );
QCommandLineOption traceDurationOption( QCommandLineOption traceDurationOption(
"traceDuration", "traceDuration",
"Probably a number of seconds? Only works if \"--traceFile\" is specified.", "Automatically quit interface after duration. Only works if \"--traceFile\" is specified.",
"number" "seconds"
); );
QCommandLineOption clockSkewOption( QCommandLineOption clockSkewOption(
"clockSkew", "clockSkew",
@ -269,7 +269,7 @@ int main(int argc, const char* argv[]) {
parser.addOption(responseTokensOption); parser.addOption(responseTokensOption);
parser.addOption(displayNameOption); parser.addOption(displayNameOption);
parser.addOption(overrideScriptsPathOption); parser.addOption(overrideScriptsPathOption);
parser.addOption(defaultScriptOverrideOption); parser.addOption(defaultScriptsOverrideOption);
parser.addOption(traceFileOption); parser.addOption(traceFileOption);
parser.addOption(traceDurationOption); parser.addOption(traceDurationOption);
parser.addOption(clockSkewOption); parser.addOption(clockSkewOption);