mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 18:36:45 +02:00
Fix ktx_cache path for android. Load the least js scripts for android
This commit is contained in:
parent
ef8ba1cad0
commit
fc62b2d34a
4 changed files with 65 additions and 1 deletions
|
@ -5932,7 +5932,9 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe
|
||||||
scriptEngine->registerGetterSetter("location", LocationScriptingInterface::locationGetter,
|
scriptEngine->registerGetterSetter("location", LocationScriptingInterface::locationGetter,
|
||||||
LocationScriptingInterface::locationSetter);
|
LocationScriptingInterface::locationSetter);
|
||||||
|
|
||||||
|
#ifndef ANDROID
|
||||||
scriptEngine->registerFunction("OverlayWebWindow", QmlWebWindowClass::constructor);
|
scriptEngine->registerFunction("OverlayWebWindow", QmlWebWindowClass::constructor);
|
||||||
|
#endif
|
||||||
scriptEngine->registerFunction("OverlayWindow", QmlWindowClass::constructor);
|
scriptEngine->registerFunction("OverlayWindow", QmlWindowClass::constructor);
|
||||||
|
|
||||||
scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance());
|
scriptEngine->registerGlobalObject("Menu", MenuScriptingInterface::getInstance());
|
||||||
|
@ -5984,6 +5986,9 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe
|
||||||
scriptEngine->registerGlobalObject("UserActivityLogger", DependencyManager::get<UserActivityLoggerScriptingInterface>().data());
|
scriptEngine->registerGlobalObject("UserActivityLogger", DependencyManager::get<UserActivityLoggerScriptingInterface>().data());
|
||||||
scriptEngine->registerGlobalObject("Users", DependencyManager::get<UsersScriptingInterface>().data());
|
scriptEngine->registerGlobalObject("Users", DependencyManager::get<UsersScriptingInterface>().data());
|
||||||
|
|
||||||
|
scriptEngine->registerGlobalObject("App", this);
|
||||||
|
scriptEngine->registerFunction("App", "isAndroid", Application::isAndroid, 0);
|
||||||
|
|
||||||
scriptEngine->registerGlobalObject("LimitlessSpeechRecognition", DependencyManager::get<LimitlessVoiceRecognitionScriptingInterface>().data());
|
scriptEngine->registerGlobalObject("LimitlessSpeechRecognition", DependencyManager::get<LimitlessVoiceRecognitionScriptingInterface>().data());
|
||||||
scriptEngine->registerGlobalObject("GooglePoly", DependencyManager::get<GooglePolyScriptingInterface>().data());
|
scriptEngine->registerGlobalObject("GooglePoly", DependencyManager::get<GooglePolyScriptingInterface>().data());
|
||||||
|
|
||||||
|
@ -7567,6 +7572,18 @@ void Application::updateThreadPoolCount() const {
|
||||||
QThreadPool::globalInstance()->setMaxThreadCount(threadPoolSize);
|
QThreadPool::globalInstance()->setMaxThreadCount(threadPoolSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QScriptValue Application::isAndroid(QScriptContext* context, QScriptEngine* engine) {
|
||||||
|
return QScriptValue(engine, isAndroid());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Application::isAndroid() {
|
||||||
|
#ifdef Q_OS_ANDROID
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void Application::updateSystemTabletMode() {
|
void Application::updateSystemTabletMode() {
|
||||||
qApp->setProperty(hifi::properties::HMD, isHMDMode());
|
qApp->setProperty(hifi::properties::HMD, isHMDMode());
|
||||||
if (isHMDMode()) {
|
if (isHMDMode()) {
|
||||||
|
|
|
@ -282,6 +282,9 @@ public:
|
||||||
bool getSaveAvatarOverrideUrl() { return _saveAvatarOverrideUrl; }
|
bool getSaveAvatarOverrideUrl() { return _saveAvatarOverrideUrl; }
|
||||||
void saveNextPhysicsStats(QString filename);
|
void saveNextPhysicsStats(QString filename);
|
||||||
|
|
||||||
|
static Q_INVOKABLE QScriptValue isAndroid(QScriptContext* context, QScriptEngine* engine);
|
||||||
|
static bool isAndroid();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void svoImportRequested(const QString& url);
|
void svoImportRequested(const QString& url);
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@ QString TEMP_DIR_FORMAT { "%1-%2-%3" };
|
||||||
const QString& PathUtils::resourcesPath() {
|
const QString& PathUtils::resourcesPath() {
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
static const QString staticResourcePath = QCoreApplication::applicationDirPath() + "/../Resources/";
|
static const QString staticResourcePath = QCoreApplication::applicationDirPath() + "/../Resources/";
|
||||||
|
#elif defined (ANDROID)
|
||||||
|
static const QString staticResourcePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/resources/";
|
||||||
#else
|
#else
|
||||||
static const QString staticResourcePath = QCoreApplication::applicationDirPath() + "/resources/";
|
static const QString staticResourcePath = QCoreApplication::applicationDirPath() + "/resources/";
|
||||||
#endif
|
#endif
|
||||||
|
@ -72,7 +74,11 @@ QString PathUtils::getAppLocalDataPath() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise return standard path
|
// otherwise return standard path
|
||||||
|
#ifndef Q_OS_ANDROID
|
||||||
return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/";
|
return QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/";
|
||||||
|
#else
|
||||||
|
return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PathUtils::getAppDataFilePath(const QString& filename) {
|
QString PathUtils::getAppDataFilePath(const QString& filename) {
|
||||||
|
|
|
@ -12,6 +12,16 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
var DEFAULT_SCRIPTS_COMBINED = [
|
var DEFAULT_SCRIPTS_COMBINED = [
|
||||||
|
];
|
||||||
|
|
||||||
|
function pushAll(dest, orig) {
|
||||||
|
for (var k in orig) {
|
||||||
|
dest.push(orig[k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!App.isAndroid()) {
|
||||||
|
pushAll(DEFAULT_SCRIPTS_COMBINED, [
|
||||||
"system/progress.js",
|
"system/progress.js",
|
||||||
"system/away.js",
|
"system/away.js",
|
||||||
"system/audio.js",
|
"system/audio.js",
|
||||||
|
@ -30,12 +40,40 @@ var DEFAULT_SCRIPTS_COMBINED = [
|
||||||
"system/dialTone.js",
|
"system/dialTone.js",
|
||||||
"system/firstPersonHMD.js",
|
"system/firstPersonHMD.js",
|
||||||
"system/tablet-ui/tabletUI.js"
|
"system/tablet-ui/tabletUI.js"
|
||||||
];
|
]);
|
||||||
|
} else {
|
||||||
|
pushAll(DEFAULT_SCRIPTS_COMBINED, [
|
||||||
|
"system/progress.js"/*,
|
||||||
|
"system/away.js",
|
||||||
|
"system/controllers/controllerDisplayManager.js",
|
||||||
|
"system/controllers/handControllerGrabAndroid.js",
|
||||||
|
"system/controllers/handControllerPointerAndroid.js",
|
||||||
|
"system/controllers/squeezeHands.js",
|
||||||
|
"system/controllers/grab.js",
|
||||||
|
"system/controllers/teleport.js",
|
||||||
|
"system/controllers/toggleAdvancedMovementForHandControllers.js",
|
||||||
|
"system/dialTone.js",
|
||||||
|
"system/firstPersonHMD.js",
|
||||||
|
"system/bubble.js",
|
||||||
|
"system/android.js",
|
||||||
|
"developer/debugging/debugAndroidMouse.js"*/
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
var DEFAULT_SCRIPTS_SEPARATE = [
|
var DEFAULT_SCRIPTS_SEPARATE = [
|
||||||
"system/controllers/controllerScripts.js"
|
"system/controllers/controllerScripts.js"
|
||||||
//"system/chat.js"
|
//"system/chat.js"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
if (!App.isAndroid()) {
|
||||||
|
pushAll(DEFAULT_SCRIPTS_SEPARATE, [
|
||||||
|
"system/controllers/controllerScripts.js"
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
pushAll(DEFAULT_SCRIPTS_SEPARATE, []);
|
||||||
|
}
|
||||||
|
|
||||||
// add a menu item for debugging
|
// add a menu item for debugging
|
||||||
var MENU_CATEGORY = "Developer";
|
var MENU_CATEGORY = "Developer";
|
||||||
var MENU_ITEM = "Debug defaultScripts.js";
|
var MENU_ITEM = "Debug defaultScripts.js";
|
||||||
|
|
Loading…
Reference in a new issue