mirror of
https://github.com/overte-org/overte.git
synced 2025-06-15 21:59:22 +02:00
Merge remote-tracking branch 'upstream/master' into android_signup
This commit is contained in:
commit
13e2b99dfa
49 changed files with 1817 additions and 264 deletions
|
@ -157,7 +157,7 @@ JNIEXPORT void Java_io_highfidelity_hifiinterface_InterfaceActivity_nativeOnCrea
|
||||||
JavaVM* jvm;
|
JavaVM* jvm;
|
||||||
env->GetJavaVM(&jvm);
|
env->GetJavaVM(&jvm);
|
||||||
|
|
||||||
QObject::connect(&AndroidHelper::instance(), &AndroidHelper::androidActivityRequested, [jvm](const QString& a, const bool backToScene, QList<QString> args) {
|
QObject::connect(&AndroidHelper::instance(), &AndroidHelper::androidActivityRequested, [jvm](const QString& a, const bool backToScene, QMap<QString, QString> args) {
|
||||||
JNIEnv* myNewEnv;
|
JNIEnv* myNewEnv;
|
||||||
JavaVMAttachArgs jvmArgs;
|
JavaVMAttachArgs jvmArgs;
|
||||||
jvmArgs.version = JNI_VERSION_1_6; // choose your JNI version
|
jvmArgs.version = JNI_VERSION_1_6; // choose your JNI version
|
||||||
|
@ -183,9 +183,11 @@ JNIEXPORT void Java_io_highfidelity_hifiinterface_InterfaceActivity_nativeOnCrea
|
||||||
jmethodID mapClassConstructor = myNewEnv->GetMethodID(hashMapClass, "<init>", "()V");
|
jmethodID mapClassConstructor = myNewEnv->GetMethodID(hashMapClass, "<init>", "()V");
|
||||||
jobject hashmap = myNewEnv->NewObject(hashMapClass, mapClassConstructor);
|
jobject hashmap = myNewEnv->NewObject(hashMapClass, mapClassConstructor);
|
||||||
jmethodID mapClassPut = myNewEnv->GetMethodID(hashMapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
|
jmethodID mapClassPut = myNewEnv->GetMethodID(hashMapClass, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
|
||||||
for (const QString& arg: args) {
|
QMap<QString, QString>::iterator i;
|
||||||
QAndroidJniObject jArg = QAndroidJniObject::fromString(arg);
|
for (i = args.begin(); i != args.end(); ++i) {
|
||||||
myNewEnv->CallObjectMethod(hashmap, mapClassPut, QAndroidJniObject::fromString("url").object<jstring>(), jArg.object<jstring>());
|
QAndroidJniObject jKey = QAndroidJniObject::fromString(i.key());
|
||||||
|
QAndroidJniObject jValue = QAndroidJniObject::fromString(i.value());
|
||||||
|
myNewEnv->CallObjectMethod(hashmap, mapClassPut, jKey.object<jstring>(), jValue.object<jstring>());
|
||||||
}
|
}
|
||||||
__interfaceActivity.callMethod<void>("openAndroidActivity", "(Ljava/lang/String;ZLjava/util/HashMap;)V", string.object<jstring>(), jBackToScene, hashmap);
|
__interfaceActivity.callMethod<void>("openAndroidActivity", "(Ljava/lang/String;ZLjava/util/HashMap;)V", string.object<jstring>(), jBackToScene, hashmap);
|
||||||
if (attachedHere) {
|
if (attachedHere) {
|
||||||
|
|
|
@ -39,6 +39,7 @@ import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import io.highfidelity.hifiinterface.fragment.WebViewFragment;
|
import io.highfidelity.hifiinterface.fragment.WebViewFragment;
|
||||||
import io.highfidelity.hifiinterface.receiver.HeadsetStateReceiver;
|
import io.highfidelity.hifiinterface.receiver.HeadsetStateReceiver;
|
||||||
|
@ -304,14 +305,22 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW
|
||||||
switch (activityName) {
|
switch (activityName) {
|
||||||
case "Home":
|
case "Home":
|
||||||
case "Privacy Policy":
|
case "Privacy Policy":
|
||||||
case "Login": {
|
|
||||||
nativeBeforeEnterBackground();
|
nativeBeforeEnterBackground();
|
||||||
Intent intent = new Intent(this, MainActivity.class);
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
intent.putExtra(MainActivity.EXTRA_FRAGMENT, activityName);
|
intent.putExtra(MainActivity.EXTRA_FRAGMENT, activityName);
|
||||||
intent.putExtra(MainActivity.EXTRA_BACK_TO_SCENE, backToScene);
|
intent.putExtra(MainActivity.EXTRA_BACK_TO_SCENE, backToScene);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
break;
|
break;
|
||||||
|
case "Login":
|
||||||
|
nativeBeforeEnterBackground();
|
||||||
|
Intent loginIntent = new Intent(this, MainActivity.class);
|
||||||
|
loginIntent.putExtra(MainActivity.EXTRA_FRAGMENT, activityName);
|
||||||
|
loginIntent.putExtra(MainActivity.EXTRA_BACK_TO_SCENE, backToScene);
|
||||||
|
if (args != null && args.containsKey(DOMAIN_URL)) {
|
||||||
|
loginIntent.putExtra(DOMAIN_URL, (String) args.get(DOMAIN_URL));
|
||||||
}
|
}
|
||||||
|
startActivity(loginIntent);
|
||||||
|
break;
|
||||||
case "WebView":
|
case "WebView":
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
webSlidingDrawer.setVisibility(View.VISIBLE);
|
webSlidingDrawer.setVisibility(View.VISIBLE);
|
||||||
|
|
|
@ -29,6 +29,9 @@ import android.widget.TextView;
|
||||||
import com.squareup.picasso.Callback;
|
import com.squareup.picasso.Callback;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import io.highfidelity.hifiinterface.fragment.FriendsFragment;
|
import io.highfidelity.hifiinterface.fragment.FriendsFragment;
|
||||||
import io.highfidelity.hifiinterface.fragment.HomeFragment;
|
import io.highfidelity.hifiinterface.fragment.HomeFragment;
|
||||||
import io.highfidelity.hifiinterface.fragment.LoginFragment;
|
import io.highfidelity.hifiinterface.fragment.LoginFragment;
|
||||||
|
@ -48,6 +51,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||||
public static final String DEFAULT_FRAGMENT = "Home";
|
public static final String DEFAULT_FRAGMENT = "Home";
|
||||||
public static final String EXTRA_FRAGMENT = "fragment";
|
public static final String EXTRA_FRAGMENT = "fragment";
|
||||||
public static final String EXTRA_BACK_TO_SCENE = "backToScene";
|
public static final String EXTRA_BACK_TO_SCENE = "backToScene";
|
||||||
|
public static final String EXTRA_BACK_TO_URL = "url";
|
||||||
|
|
||||||
private String TAG = "HighFidelity";
|
private String TAG = "HighFidelity";
|
||||||
|
|
||||||
|
@ -65,6 +69,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||||
private MenuItem mPeopleMenuItem;
|
private MenuItem mPeopleMenuItem;
|
||||||
|
|
||||||
private boolean backToScene;
|
private boolean backToScene;
|
||||||
|
private String backToUrl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -108,9 +113,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||||
loadFragment(DEFAULT_FRAGMENT);
|
loadFragment(DEFAULT_FRAGMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getIntent().hasExtra(EXTRA_BACK_TO_SCENE)) {
|
|
||||||
backToScene = getIntent().getBooleanExtra(EXTRA_BACK_TO_SCENE, false);
|
backToScene = getIntent().getBooleanExtra(EXTRA_BACK_TO_SCENE, false);
|
||||||
}
|
backToUrl = getIntent().getStringExtra(EXTRA_BACK_TO_URL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,7 +319,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
||||||
}
|
}
|
||||||
|
|
||||||
private void goToLastLocation() {
|
private void goToLastLocation() {
|
||||||
goToDomain("");
|
goToDomain(backToUrl != null? backToUrl : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void goToDomain(String domainUrl) {
|
private void goToDomain(String domainUrl) {
|
||||||
|
|
|
@ -1110,7 +1110,36 @@ function moveTableRow(row, move_up) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need to fire a change event on one of the remaining inputs so that the sidebar badge is updated
|
// we need to fire a change event on one of the remaining inputs so that the sidebar badge is updated
|
||||||
badgeForDifferences($(table))
|
badgeForDifferences($(table));
|
||||||
|
|
||||||
|
// figure out which group this row is in
|
||||||
|
var panelParentID = row.closest('.panel').attr('id');
|
||||||
|
|
||||||
|
// get the short name for the setting from the table
|
||||||
|
var tableShortName = row.closest('table').data('short-name');
|
||||||
|
|
||||||
|
var changed = tableHasChanged(panelParentID, tableShortName);
|
||||||
|
$(table).find('.' + Settings.DATA_ROW_CLASS).each(function(){
|
||||||
|
var hiddenInput = $(this).find('td.' + Settings.DATA_COL_CLASS + ' input');
|
||||||
|
if (changed) {
|
||||||
|
hiddenInput.attr('data-changed', true);
|
||||||
|
} else {
|
||||||
|
hiddenInput.removeAttr('data-changed');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function tableHasChanged(panelParentID, tableShortName) {
|
||||||
|
// get a JSON representation of that section
|
||||||
|
var panelSettingJSON = form2js(panelParentID, ".", false, cleanupFormValues, true)[panelParentID][tableShortName]
|
||||||
|
if (Settings.initialValues[panelParentID]) {
|
||||||
|
var initialPanelSettingJSON = Settings.initialValues[panelParentID][tableShortName]
|
||||||
|
} else {
|
||||||
|
var initialPanelSettingJSON = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
return !_.isEqual(panelSettingJSON, initialPanelSettingJSON);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDataChangedForSiblingRows(row, forceTrue) {
|
function updateDataChangedForSiblingRows(row, forceTrue) {
|
||||||
|
@ -1123,16 +1152,8 @@ function updateDataChangedForSiblingRows(row, forceTrue) {
|
||||||
// get the short name for the setting from the table
|
// get the short name for the setting from the table
|
||||||
var tableShortName = row.closest('table').data('short-name')
|
var tableShortName = row.closest('table').data('short-name')
|
||||||
|
|
||||||
// get a JSON representation of that section
|
|
||||||
var panelSettingJSON = form2js(panelParentID, ".", false, cleanupFormValues, true)[panelParentID][tableShortName]
|
|
||||||
if (Settings.initialValues[panelParentID]) {
|
|
||||||
var initialPanelSettingJSON = Settings.initialValues[panelParentID][tableShortName]
|
|
||||||
} else {
|
|
||||||
var initialPanelSettingJSON = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// if they are equal, we don't need data-changed
|
// if they are equal, we don't need data-changed
|
||||||
isTrue = !_.isEqual(panelSettingJSON, initialPanelSettingJSON)
|
isTrue = tableHasChanged(panelParentID, tableShortName);
|
||||||
} else {
|
} else {
|
||||||
isTrue = true
|
isTrue = true
|
||||||
}
|
}
|
||||||
|
@ -1140,9 +1161,9 @@ function updateDataChangedForSiblingRows(row, forceTrue) {
|
||||||
row.siblings('.' + Settings.DATA_ROW_CLASS).each(function(){
|
row.siblings('.' + Settings.DATA_ROW_CLASS).each(function(){
|
||||||
var hiddenInput = $(this).find('td.' + Settings.DATA_COL_CLASS + ' input')
|
var hiddenInput = $(this).find('td.' + Settings.DATA_COL_CLASS + ' input')
|
||||||
if (isTrue) {
|
if (isTrue) {
|
||||||
hiddenInput.attr('data-changed', isTrue)
|
hiddenInput.attr('data-changed', isTrue);
|
||||||
} else {
|
} else {
|
||||||
hiddenInput.removeAttr('data-changed')
|
hiddenInput.removeAttr('data-changed');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ Item {
|
||||||
|
|
||||||
fragmentShader: {
|
fragmentShader: {
|
||||||
"
|
"
|
||||||
|
#version 150 core
|
||||||
varying highp vec2 qt_TexCoord0;
|
varying highp vec2 qt_TexCoord0;
|
||||||
uniform lowp sampler2D source;
|
uniform lowp sampler2D source;
|
||||||
uniform lowp sampler2D mask;
|
uniform lowp sampler2D mask;
|
||||||
|
|
|
@ -552,6 +552,10 @@ Rectangle {
|
||||||
// Alignment
|
// Alignment
|
||||||
horizontalAlignment: Text.AlignLeft;
|
horizontalAlignment: Text.AlignLeft;
|
||||||
verticalAlignment: Text.AlignVCenter;
|
verticalAlignment: Text.AlignVCenter;
|
||||||
|
onLinkActivated: {
|
||||||
|
// Only case is to go to the bank.
|
||||||
|
sendToScript({method: 'gotoBank'});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1107,17 +1111,25 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleBuyAgainLogic() {
|
function handleBuyAgainLogic() {
|
||||||
// If you can buy this item again...
|
// General rules, implemented in various scattered places in this file:
|
||||||
if (canBuyAgain()) {
|
// 1. If you already own the item, a viewInMyPurchasesButton is visible,
|
||||||
|
// and the buyButton is visible (and says "Buy it again") ONLY if it is a type you canBuyAgain.
|
||||||
|
// 2. Separately,
|
||||||
|
// a. If you don't have enough money to buy, the buyText becomes visible and tells you, and the buyButton is disabled.
|
||||||
|
// b. Otherwise, if the item is a content set and you don't have rez permission, the buyText becomes visible and tells you so.
|
||||||
|
|
||||||
// If you can't afford another copy of the item...
|
// If you can't afford another copy of the item...
|
||||||
if (root.balanceAfterPurchase < 0) {
|
if (root.balanceAfterPurchase < 0) {
|
||||||
// If you already own the item...
|
// If you already own the item...
|
||||||
if (root.alreadyOwned) {
|
if (!root.alreadyOwned) {
|
||||||
buyText.text = "<b>Your Wallet does not have sufficient funds to purchase this item again.</b>";
|
|
||||||
// Else if you don't already own the item...
|
|
||||||
} else {
|
|
||||||
buyText.text = "<b>Your Wallet does not have sufficient funds to purchase this item.</b>";
|
buyText.text = "<b>Your Wallet does not have sufficient funds to purchase this item.</b>";
|
||||||
|
// Else if you don't already own the item...
|
||||||
|
} else if (canBuyAgain()) {
|
||||||
|
buyText.text = "<b>Your Wallet does not have sufficient funds to purchase this item again.</b>";
|
||||||
|
} else {
|
||||||
|
buyText.text = "<b>While you do not have sufficient funds to buy this, you already have this item.</b>"
|
||||||
}
|
}
|
||||||
|
buyText.text += " Visit <a href='#'>Bank of High Fidelity</a> to get more HFC."
|
||||||
buyTextContainer.color = "#FFC3CD";
|
buyTextContainer.color = "#FFC3CD";
|
||||||
buyTextContainer.border.color = "#F3808F";
|
buyTextContainer.border.color = "#F3808F";
|
||||||
buyGlyph.text = hifi.glyphs.alert;
|
buyGlyph.text = hifi.glyphs.alert;
|
||||||
|
@ -1127,7 +1139,6 @@ Rectangle {
|
||||||
handleContentSets();
|
handleContentSets();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function refreshBuyUI() {
|
function refreshBuyUI() {
|
||||||
if (root.isCertified) {
|
if (root.isCertified) {
|
||||||
|
|
|
@ -829,6 +829,7 @@ Rectangle {
|
||||||
Commerce.getWalletAuthenticatedStatus(); // before writing security image, ensures that salt/account password is set.
|
Commerce.getWalletAuthenticatedStatus(); // before writing security image, ensures that salt/account password is set.
|
||||||
Commerce.chooseSecurityImage(securityImagePath);
|
Commerce.chooseSecurityImage(securityImagePath);
|
||||||
Commerce.generateKeyPair();
|
Commerce.generateKeyPair();
|
||||||
|
followReferrer({ referrer: walletSetup.referrer });
|
||||||
}
|
}
|
||||||
|
|
||||||
function addLeadingZero(n) {
|
function addLeadingZero(n) {
|
||||||
|
@ -836,7 +837,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
function followReferrer(msg) {
|
function followReferrer(msg) {
|
||||||
if (msg.referrer === '' || msg.referrer === 'marketplace cta') {
|
if (msg.referrer === '') {
|
||||||
root.activeView = "initialize";
|
root.activeView = "initialize";
|
||||||
Commerce.getWalletStatus();
|
Commerce.getWalletStatus();
|
||||||
} else if (msg.referrer === 'purchases') {
|
} else if (msg.referrer === 'purchases') {
|
||||||
|
|
|
@ -28,7 +28,7 @@ Item {
|
||||||
property string activeView: "step_1";
|
property string activeView: "step_1";
|
||||||
property string lastPage;
|
property string lastPage;
|
||||||
property bool hasShownSecurityImageTip: false;
|
property bool hasShownSecurityImageTip: false;
|
||||||
property string referrer;
|
property string referrer: '';
|
||||||
property string keyFilePath;
|
property string keyFilePath;
|
||||||
property date startingTimestamp;
|
property date startingTimestamp;
|
||||||
property string setupAttemptID;
|
property string setupAttemptID;
|
||||||
|
|
|
@ -28,7 +28,7 @@ AndroidHelper::AndroidHelper() {
|
||||||
AndroidHelper::~AndroidHelper() {
|
AndroidHelper::~AndroidHelper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidHelper::requestActivity(const QString &activityName, const bool backToScene, QList<QString> args) {
|
void AndroidHelper::requestActivity(const QString &activityName, const bool backToScene, QMap<QString, QString> args) {
|
||||||
emit androidActivityRequested(activityName, backToScene, args);
|
emit androidActivityRequested(activityName, backToScene, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,8 +52,10 @@ void AndroidHelper::performHapticFeedback(int duration) {
|
||||||
emit hapticFeedbackRequested(duration);
|
emit hapticFeedbackRequested(duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidHelper::showLoginDialog() {
|
void AndroidHelper::showLoginDialog(QUrl url) {
|
||||||
emit androidActivityRequested("Login", true);
|
QMap<QString, QString> args;
|
||||||
|
args["url"] = url.toString();
|
||||||
|
emit androidActivityRequested("Login", true, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AndroidHelper::processURL(const QString &url) {
|
void AndroidHelper::processURL(const QString &url) {
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
#define hifi_Android_Helper_h
|
#define hifi_Android_Helper_h
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QMap>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QtCore/QEventLoop>
|
#include <QtCore/QEventLoop>
|
||||||
|
|
||||||
|
@ -23,7 +26,7 @@ public:
|
||||||
static AndroidHelper instance;
|
static AndroidHelper instance;
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
void requestActivity(const QString &activityName, const bool backToScene, QList<QString> args = QList<QString>());
|
void requestActivity(const QString &activityName, const bool backToScene, QMap<QString, QString> args = QMap<QString, QString>());
|
||||||
void notifyLoadComplete();
|
void notifyLoadComplete();
|
||||||
void notifyEnterForeground();
|
void notifyEnterForeground();
|
||||||
void notifyBeforeEnterBackground();
|
void notifyBeforeEnterBackground();
|
||||||
|
@ -39,12 +42,11 @@ public:
|
||||||
void signup(QString email, QString username, QString password);
|
void signup(QString email, QString username, QString password);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void showLoginDialog();
|
void showLoginDialog(QUrl url);
|
||||||
void signupCompleted(QNetworkReply* reply);
|
void signupCompleted(QNetworkReply* reply);
|
||||||
void signupFailed(QNetworkReply* reply);
|
void signupFailed(QNetworkReply* reply);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void androidActivityRequested(const QString &activityName, const bool backToScene, QList<QString> args = QList<QString>());
|
void androidActivityRequested(const QString &activityName, const bool backToScene, QMap<QString, QString> args = QMap<QString, QString>());
|
||||||
void qtAppLoadComplete();
|
void qtAppLoadComplete();
|
||||||
void enterForeground();
|
void enterForeground();
|
||||||
void beforeEnterBackground();
|
void beforeEnterBackground();
|
||||||
|
|
|
@ -963,7 +963,7 @@ Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context);
|
||||||
|
|
||||||
Setting::Handle<int> sessionRunTime{ "sessionRunTime", 0 };
|
Setting::Handle<int> sessionRunTime{ "sessionRunTime", 0 };
|
||||||
|
|
||||||
const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 70.0f;
|
const float DEFAULT_HMD_TABLET_SCALE_PERCENT = 60.0f;
|
||||||
const float DEFAULT_DESKTOP_TABLET_SCALE_PERCENT = 75.0f;
|
const float DEFAULT_DESKTOP_TABLET_SCALE_PERCENT = 75.0f;
|
||||||
const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true;
|
const bool DEFAULT_DESKTOP_TABLET_BECOMES_TOOLBAR = true;
|
||||||
const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false;
|
const bool DEFAULT_HMD_TABLET_BECOMES_TOOLBAR = false;
|
||||||
|
@ -976,7 +976,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
_window(new MainWindow(desktop())),
|
_window(new MainWindow(desktop())),
|
||||||
_sessionRunTimer(startupTimer),
|
_sessionRunTimer(startupTimer),
|
||||||
_previousSessionCrashed(setupEssentials(argc, argv, runningMarkerExisted)),
|
_previousSessionCrashed(setupEssentials(argc, argv, runningMarkerExisted)),
|
||||||
_undoStackScriptingInterface(&_undoStack),
|
|
||||||
_entitySimulation(new PhysicalEntitySimulation()),
|
_entitySimulation(new PhysicalEntitySimulation()),
|
||||||
_physicsEngine(new PhysicsEngine(Vectors::ZERO)),
|
_physicsEngine(new PhysicsEngine(Vectors::ZERO)),
|
||||||
_entityClipboard(new EntityTree()),
|
_entityClipboard(new EntityTree()),
|
||||||
|
@ -996,7 +995,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
_enableProcessOctreeThread(true),
|
_enableProcessOctreeThread(true),
|
||||||
_lastNackTime(usecTimestampNow()),
|
_lastNackTime(usecTimestampNow()),
|
||||||
_lastSendDownstreamAudioStats(usecTimestampNow()),
|
_lastSendDownstreamAudioStats(usecTimestampNow()),
|
||||||
_aboutToQuit(false),
|
|
||||||
_notifiedPacketVersionMismatchThisDomain(false),
|
_notifiedPacketVersionMismatchThisDomain(false),
|
||||||
_maxOctreePPS(maxOctreePacketsPerSecond.get()),
|
_maxOctreePPS(maxOctreePacketsPerSecond.get()),
|
||||||
_lastFaceTrackerUpdate(0),
|
_lastFaceTrackerUpdate(0),
|
||||||
|
@ -1236,7 +1234,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
connect(accountManager.data(), &AccountManager::authRequired, this, []() {
|
connect(accountManager.data(), &AccountManager::authRequired, this, []() {
|
||||||
AndroidHelper::instance().showLoginDialog();
|
auto addressManager = DependencyManager::get<AddressManager>();
|
||||||
|
AndroidHelper::instance().showLoginDialog(addressManager->currentAddress());
|
||||||
});
|
});
|
||||||
#else
|
#else
|
||||||
connect(accountManager.data(), &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog);
|
connect(accountManager.data(), &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog);
|
||||||
|
@ -3095,7 +3094,6 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) {
|
||||||
surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface);
|
surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface);
|
||||||
surfaceContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
|
surfaceContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
|
||||||
surfaceContext->setContextProperty("AvatarManager", DependencyManager::get<AvatarManager>().data());
|
surfaceContext->setContextProperty("AvatarManager", DependencyManager::get<AvatarManager>().data());
|
||||||
surfaceContext->setContextProperty("UndoStack", &_undoStackScriptingInterface);
|
|
||||||
surfaceContext->setContextProperty("LODManager", DependencyManager::get<LODManager>().data());
|
surfaceContext->setContextProperty("LODManager", DependencyManager::get<LODManager>().data());
|
||||||
surfaceContext->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
|
surfaceContext->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
|
||||||
surfaceContext->setContextProperty("Scene", DependencyManager::get<SceneScriptingInterface>().data());
|
surfaceContext->setContextProperty("Scene", DependencyManager::get<SceneScriptingInterface>().data());
|
||||||
|
@ -6767,8 +6765,6 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe
|
||||||
|
|
||||||
scriptEngine->registerGlobalObject("AvatarManager", DependencyManager::get<AvatarManager>().data());
|
scriptEngine->registerGlobalObject("AvatarManager", DependencyManager::get<AvatarManager>().data());
|
||||||
|
|
||||||
scriptEngine->registerGlobalObject("UndoStack", &_undoStackScriptingInterface);
|
|
||||||
|
|
||||||
scriptEngine->registerGlobalObject("LODManager", DependencyManager::get<LODManager>().data());
|
scriptEngine->registerGlobalObject("LODManager", DependencyManager::get<LODManager>().data());
|
||||||
|
|
||||||
scriptEngine->registerGlobalObject("Paths", DependencyManager::get<PathUtils>().data());
|
scriptEngine->registerGlobalObject("Paths", DependencyManager::get<PathUtils>().data());
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include <QtGui/QImage>
|
#include <QtGui/QImage>
|
||||||
|
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
#include <QtWidgets/QUndoStack>
|
|
||||||
|
|
||||||
#include <ThreadHelpers.h>
|
#include <ThreadHelpers.h>
|
||||||
#include <AbstractScriptingServicesInterface.h>
|
#include <AbstractScriptingServicesInterface.h>
|
||||||
|
@ -70,7 +69,6 @@
|
||||||
#include "ui/OctreeStatsDialog.h"
|
#include "ui/OctreeStatsDialog.h"
|
||||||
#include "ui/OverlayConductor.h"
|
#include "ui/OverlayConductor.h"
|
||||||
#include "ui/overlays/Overlays.h"
|
#include "ui/overlays/Overlays.h"
|
||||||
#include "UndoStackScriptingInterface.h"
|
|
||||||
|
|
||||||
#include "workload/GameWorkload.h"
|
#include "workload/GameWorkload.h"
|
||||||
|
|
||||||
|
@ -189,7 +187,6 @@ public:
|
||||||
|
|
||||||
const OctreePacketProcessor& getOctreePacketProcessor() const { return _octreeProcessor; }
|
const OctreePacketProcessor& getOctreePacketProcessor() const { return _octreeProcessor; }
|
||||||
QSharedPointer<EntityTreeRenderer> getEntities() const { return DependencyManager::get<EntityTreeRenderer>(); }
|
QSharedPointer<EntityTreeRenderer> getEntities() const { return DependencyManager::get<EntityTreeRenderer>(); }
|
||||||
QUndoStack* getUndoStack() { return &_undoStack; }
|
|
||||||
MainWindow* getWindow() const { return _window; }
|
MainWindow* getWindow() const { return _window; }
|
||||||
EntityTreePointer getEntityClipboard() const { return _entityClipboard; }
|
EntityTreePointer getEntityClipboard() const { return _entityClipboard; }
|
||||||
EntityEditPacketSender* getEntityEditPacketSender() { return &_entityEditSender; }
|
EntityEditPacketSender* getEntityEditPacketSender() { return &_entityEditSender; }
|
||||||
|
@ -560,6 +557,8 @@ private:
|
||||||
MainWindow* _window;
|
MainWindow* _window;
|
||||||
QElapsedTimer& _sessionRunTimer;
|
QElapsedTimer& _sessionRunTimer;
|
||||||
|
|
||||||
|
bool _aboutToQuit { false };
|
||||||
|
|
||||||
bool _previousSessionCrashed;
|
bool _previousSessionCrashed;
|
||||||
|
|
||||||
DisplayPluginPointer _displayPlugin;
|
DisplayPluginPointer _displayPlugin;
|
||||||
|
@ -569,9 +568,6 @@ private:
|
||||||
|
|
||||||
bool _activatingDisplayPlugin { false };
|
bool _activatingDisplayPlugin { false };
|
||||||
|
|
||||||
QUndoStack _undoStack;
|
|
||||||
UndoStackScriptingInterface _undoStackScriptingInterface;
|
|
||||||
|
|
||||||
uint32_t _renderFrameCount { 0 };
|
uint32_t _renderFrameCount { 0 };
|
||||||
|
|
||||||
// Frame Rate Measurement
|
// Frame Rate Measurement
|
||||||
|
@ -651,8 +647,6 @@ private:
|
||||||
quint64 _lastNackTime;
|
quint64 _lastNackTime;
|
||||||
quint64 _lastSendDownstreamAudioStats;
|
quint64 _lastSendDownstreamAudioStats;
|
||||||
|
|
||||||
bool _aboutToQuit;
|
|
||||||
|
|
||||||
bool _notifiedPacketVersionMismatchThisDomain;
|
bool _notifiedPacketVersionMismatchThisDomain;
|
||||||
|
|
||||||
ConditionalGuard _settingsGuard;
|
ConditionalGuard _settingsGuard;
|
||||||
|
|
|
@ -90,19 +90,6 @@ Menu::Menu() {
|
||||||
// Edit menu ----------------------------------
|
// Edit menu ----------------------------------
|
||||||
MenuWrapper* editMenu = addMenu("Edit");
|
MenuWrapper* editMenu = addMenu("Edit");
|
||||||
|
|
||||||
// Edit > Undo
|
|
||||||
QUndoStack* undoStack = qApp->getUndoStack();
|
|
||||||
QAction* undoAction = undoStack->createUndoAction(editMenu);
|
|
||||||
undoAction->setShortcut(Qt::CTRL | Qt::Key_Z);
|
|
||||||
addActionToQMenuAndActionHash(editMenu, undoAction);
|
|
||||||
|
|
||||||
// Edit > Redo
|
|
||||||
QAction* redoAction = undoStack->createRedoAction(editMenu);
|
|
||||||
redoAction->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Z);
|
|
||||||
addActionToQMenuAndActionHash(editMenu, redoAction);
|
|
||||||
|
|
||||||
editMenu->addSeparator();
|
|
||||||
|
|
||||||
// Edit > Cut
|
// Edit > Cut
|
||||||
auto cutAction = addActionToQMenuAndActionHash(editMenu, "Cut", QKeySequence::Cut);
|
auto cutAction = addActionToQMenuAndActionHash(editMenu, "Cut", QKeySequence::Cut);
|
||||||
connect(cutAction, &QAction::triggered, [] {
|
connect(cutAction, &QAction::triggered, [] {
|
||||||
|
|
|
@ -529,7 +529,8 @@ void MyAvatar::update(float deltaTime) {
|
||||||
}
|
}
|
||||||
if (_goToFeetAjustment && _skeletonModelLoaded) {
|
if (_goToFeetAjustment && _skeletonModelLoaded) {
|
||||||
auto feetAjustment = getWorldPosition() - getWorldFeetPosition();
|
auto feetAjustment = getWorldPosition() - getWorldFeetPosition();
|
||||||
goToLocation(getWorldPosition() + feetAjustment);
|
_goToPosition = getWorldPosition() + feetAjustment;
|
||||||
|
setWorldPosition(_goToPosition);
|
||||||
_goToFeetAjustment = false;
|
_goToFeetAjustment = false;
|
||||||
}
|
}
|
||||||
if (_physicsSafetyPending && qApp->isPhysicsEnabled() && _characterController.isEnabledAndReady()) {
|
if (_physicsSafetyPending && qApp->isPhysicsEnabled() && _characterController.isEnabledAndReady()) {
|
||||||
|
|
|
@ -57,6 +57,10 @@ class QScriptEngine;
|
||||||
* @property {Uuid} tabletScreenID - The UUID of the tablet's screen overlay.
|
* @property {Uuid} tabletScreenID - The UUID of the tablet's screen overlay.
|
||||||
* @property {Uuid} homeButtonID - The UUID of the tablet's "home" button overlay.
|
* @property {Uuid} homeButtonID - The UUID of the tablet's "home" button overlay.
|
||||||
* @property {Uuid} homeButtonHighlightID - The UUID of the tablet's "home" button highlight overlay.
|
* @property {Uuid} homeButtonHighlightID - The UUID of the tablet's "home" button highlight overlay.
|
||||||
|
* @property {Uuid} miniTabletID - The UUID of the mini tablet's body model overlay. <code>null</code> if not in HMD mode.
|
||||||
|
* @property {Uuid} miniTabletScreenID - The UUID of the mini tablet's screen overlay. <code>null</code> if not in HMD mode.
|
||||||
|
* @property {number} miniTabletHand - The hand that the mini tablet is displayed on: <code>0</code> for left hand,
|
||||||
|
* <code>1</code> for right hand, <code>-1</code> if not in HMD mode.
|
||||||
*/
|
*/
|
||||||
class HMDScriptingInterface : public AbstractHMDScriptingInterface, public Dependency {
|
class HMDScriptingInterface : public AbstractHMDScriptingInterface, public Dependency {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -68,6 +72,9 @@ class HMDScriptingInterface : public AbstractHMDScriptingInterface, public Depen
|
||||||
Q_PROPERTY(QUuid homeButtonID READ getCurrentHomeButtonID WRITE setCurrentHomeButtonID)
|
Q_PROPERTY(QUuid homeButtonID READ getCurrentHomeButtonID WRITE setCurrentHomeButtonID)
|
||||||
Q_PROPERTY(QUuid tabletScreenID READ getCurrentTabletScreenID WRITE setCurrentTabletScreenID)
|
Q_PROPERTY(QUuid tabletScreenID READ getCurrentTabletScreenID WRITE setCurrentTabletScreenID)
|
||||||
Q_PROPERTY(QUuid homeButtonHighlightID READ getCurrentHomeButtonHighlightID WRITE setCurrentHomeButtonHighlightID)
|
Q_PROPERTY(QUuid homeButtonHighlightID READ getCurrentHomeButtonHighlightID WRITE setCurrentHomeButtonHighlightID)
|
||||||
|
Q_PROPERTY(QUuid miniTabletID READ getCurrentMiniTabletID WRITE setCurrentMiniTabletID)
|
||||||
|
Q_PROPERTY(QUuid miniTabletScreenID READ getCurrentMiniTabletScreenID WRITE setCurrentMiniTabletScreenID)
|
||||||
|
Q_PROPERTY(int miniTabletHand READ getCurrentMiniTabletHand WRITE setCurrentMiniTabletHand)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -368,6 +375,15 @@ public:
|
||||||
void setCurrentTabletScreenID(QUuid tabletID) { _tabletScreenID = tabletID; }
|
void setCurrentTabletScreenID(QUuid tabletID) { _tabletScreenID = tabletID; }
|
||||||
QUuid getCurrentTabletScreenID() const { return _tabletScreenID; }
|
QUuid getCurrentTabletScreenID() const { return _tabletScreenID; }
|
||||||
|
|
||||||
|
void setCurrentMiniTabletID(QUuid miniTabletID) { _miniTabletID = miniTabletID; }
|
||||||
|
QUuid getCurrentMiniTabletID() const { return _miniTabletID; }
|
||||||
|
|
||||||
|
void setCurrentMiniTabletScreenID(QUuid miniTabletScreenID) { _miniTabletScreenID = miniTabletScreenID; }
|
||||||
|
QUuid getCurrentMiniTabletScreenID() const { return _miniTabletScreenID; }
|
||||||
|
|
||||||
|
void setCurrentMiniTabletHand(int miniTabletHand) { _miniTabletHand = miniTabletHand; }
|
||||||
|
int getCurrentMiniTabletHand() const { return _miniTabletHand; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _showTablet { false };
|
bool _showTablet { false };
|
||||||
bool _tabletContextualMode { false };
|
bool _tabletContextualMode { false };
|
||||||
|
@ -376,6 +392,9 @@ private:
|
||||||
QUuid _homeButtonID;
|
QUuid _homeButtonID;
|
||||||
QUuid _tabletEntityID;
|
QUuid _tabletEntityID;
|
||||||
QUuid _homeButtonHighlightID;
|
QUuid _homeButtonHighlightID;
|
||||||
|
QUuid _miniTabletID;
|
||||||
|
QUuid _miniTabletScreenID;
|
||||||
|
int _miniTabletHand { -1 };
|
||||||
|
|
||||||
// Get the position of the HMD
|
// Get the position of the HMD
|
||||||
glm::vec3 getPosition() const;
|
glm::vec3 getPosition() const;
|
||||||
|
|
|
@ -134,7 +134,8 @@ void WindowScriptingInterface::openUrl(const QUrl& url) {
|
||||||
DependencyManager::get<AddressManager>()->handleLookupString(url.toString());
|
DependencyManager::get<AddressManager>()->handleLookupString(url.toString());
|
||||||
} else {
|
} else {
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
QList<QString> args = { url.toString() };
|
QMap<QString, QString> args;
|
||||||
|
args["url"] = url.toString();
|
||||||
AndroidHelper::instance().requestActivity("WebView", true, args);
|
AndroidHelper::instance().requestActivity("WebView", true, args);
|
||||||
#else
|
#else
|
||||||
// address manager did not handle - ask QDesktopServices to handle
|
// address manager did not handle - ask QDesktopServices to handle
|
||||||
|
|
|
@ -305,7 +305,7 @@ void EntityRenderer::updateInScene(const ScenePointer& scene, Transaction& trans
|
||||||
}
|
}
|
||||||
|
|
||||||
doRenderUpdateSynchronous(scene, transaction, _entity);
|
doRenderUpdateSynchronous(scene, transaction, _entity);
|
||||||
transaction.updateItem<EntityRenderer>(_renderItemID, [this](EntityRenderer& self) {
|
transaction.updateItem<PayloadProxyInterface>(_renderItemID, [this](PayloadProxyInterface& self) {
|
||||||
if (!isValidRenderItem()) {
|
if (!isValidRenderItem()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,7 @@ EntityItemID EntityTreeElement::findRayIntersection(const glm::vec3& origin, con
|
||||||
bool visibleOnly, bool collidableOnly, QVariantMap& extraInfo, bool precisionPicking) {
|
bool visibleOnly, bool collidableOnly, QVariantMap& extraInfo, bool precisionPicking) {
|
||||||
|
|
||||||
EntityItemID result;
|
EntityItemID result;
|
||||||
BoxFace localFace;
|
BoxFace localFace { UNKNOWN_FACE };
|
||||||
glm::vec3 localSurfaceNormal;
|
glm::vec3 localSurfaceNormal;
|
||||||
|
|
||||||
if (!canPickIntersect()) {
|
if (!canPickIntersect()) {
|
||||||
|
@ -213,7 +213,7 @@ EntityItemID EntityTreeElement::findDetailedRayIntersection(const glm::vec3& ori
|
||||||
// we can use the AABox's ray intersection by mapping our origin and direction into the entity frame
|
// we can use the AABox's ray intersection by mapping our origin and direction into the entity frame
|
||||||
// and testing intersection there.
|
// and testing intersection there.
|
||||||
float localDistance;
|
float localDistance;
|
||||||
BoxFace localFace;
|
BoxFace localFace { UNKNOWN_FACE };
|
||||||
glm::vec3 localSurfaceNormal;
|
glm::vec3 localSurfaceNormal;
|
||||||
if (entityFrameBox.findRayIntersection(entityFrameOrigin, entityFrameDirection, 1.0f / entityFrameDirection, localDistance,
|
if (entityFrameBox.findRayIntersection(entityFrameOrigin, entityFrameDirection, 1.0f / entityFrameDirection, localDistance,
|
||||||
localFace, localSurfaceNormal)) {
|
localFace, localSurfaceNormal)) {
|
||||||
|
|
|
@ -116,32 +116,33 @@ void MessagesClient::handleMessagesPacket(QSharedPointer<ReceivedMessage> receiv
|
||||||
|
|
||||||
void MessagesClient::sendMessage(QString channel, QString message, bool localOnly) {
|
void MessagesClient::sendMessage(QString channel, QString message, bool localOnly) {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
if (localOnly) {
|
|
||||||
QUuid senderID = nodeList->getSessionUUID();
|
QUuid senderID = nodeList->getSessionUUID();
|
||||||
|
if (localOnly) {
|
||||||
emit messageReceived(channel, message, senderID, true);
|
emit messageReceived(channel, message, senderID, true);
|
||||||
} else {
|
} else {
|
||||||
SharedNodePointer messagesMixer = nodeList->soloNodeOfType(NodeType::MessagesMixer);
|
SharedNodePointer messagesMixer = nodeList->soloNodeOfType(NodeType::MessagesMixer);
|
||||||
|
|
||||||
if (messagesMixer) {
|
if (messagesMixer) {
|
||||||
QUuid senderID = nodeList->getSessionUUID();
|
|
||||||
auto packetList = encodeMessagesPacket(channel, message, senderID);
|
auto packetList = encodeMessagesPacket(channel, message, senderID);
|
||||||
nodeList->sendPacketList(std::move(packetList), *messagesMixer);
|
nodeList->sendPacketList(std::move(packetList), *messagesMixer);
|
||||||
|
} else {
|
||||||
|
emit messageReceived(channel, message, senderID, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagesClient::sendData(QString channel, QByteArray data, bool localOnly) {
|
void MessagesClient::sendData(QString channel, QByteArray data, bool localOnly) {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
if (localOnly) {
|
|
||||||
QUuid senderID = nodeList->getSessionUUID();
|
QUuid senderID = nodeList->getSessionUUID();
|
||||||
|
if (localOnly) {
|
||||||
emit dataReceived(channel, data, senderID, true);
|
emit dataReceived(channel, data, senderID, true);
|
||||||
} else {
|
} else {
|
||||||
SharedNodePointer messagesMixer = nodeList->soloNodeOfType(NodeType::MessagesMixer);
|
SharedNodePointer messagesMixer = nodeList->soloNodeOfType(NodeType::MessagesMixer);
|
||||||
|
|
||||||
if (messagesMixer) {
|
if (messagesMixer) {
|
||||||
QUuid senderID = nodeList->getSessionUUID();
|
QUuid senderID = nodeList->getSessionUUID();
|
||||||
auto packetList = encodeMessagesDataPacket(channel, data, senderID);
|
auto packetList = encodeMessagesDataPacket(channel, data, senderID);
|
||||||
nodeList->sendPacketList(std::move(packetList), *messagesMixer);
|
nodeList->sendPacketList(std::move(packetList), *messagesMixer);
|
||||||
|
} else {
|
||||||
|
emit dataReceived(channel, data, senderID, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <NumericalConstants.h>
|
#include <NumericalConstants.h>
|
||||||
#include <shared/NsightHelpers.h>
|
#include <shared/NsightHelpers.h>
|
||||||
#include <gl/QOpenGLContextWrapper.h>
|
#include <gl/QOpenGLContextWrapper.h>
|
||||||
|
#include <gl/GLHelpers.h>
|
||||||
|
|
||||||
#include "../OffscreenSurface.h"
|
#include "../OffscreenSurface.h"
|
||||||
#include "../Logging.h"
|
#include "../Logging.h"
|
||||||
|
@ -67,6 +68,7 @@ SharedObject::SharedObject() {
|
||||||
// so we wait until after its ctor to move object/context to this thread.
|
// so we wait until after its ctor to move object/context to this thread.
|
||||||
QQuickWindow::setDefaultAlphaBuffer(true);
|
QQuickWindow::setDefaultAlphaBuffer(true);
|
||||||
_quickWindow = new QQuickWindow(_renderControl);
|
_quickWindow = new QQuickWindow(_renderControl);
|
||||||
|
_quickWindow->setFormat(getDefaultOpenGLSurfaceFormat());
|
||||||
_quickWindow->setColor(QColor(255, 255, 255, 0));
|
_quickWindow->setColor(QColor(255, 255, 255, 0));
|
||||||
_quickWindow->setClearBeforeRendering(true);
|
_quickWindow->setClearBeforeRendering(true);
|
||||||
|
|
||||||
|
|
|
@ -226,8 +226,9 @@ void CauterizedModel::updateRenderItems() {
|
||||||
bool invalidatePayloadShapeKey = self->shouldInvalidatePayloadShapeKey(meshIndex);
|
bool invalidatePayloadShapeKey = self->shouldInvalidatePayloadShapeKey(meshIndex);
|
||||||
bool useDualQuaternionSkinning = self->getUseDualQuaternionSkinning();
|
bool useDualQuaternionSkinning = self->getUseDualQuaternionSkinning();
|
||||||
|
|
||||||
transaction.updateItem<CauterizedMeshPartPayload>(itemID, [modelTransform, meshState, useDualQuaternionSkinning, cauterizedMeshState, invalidatePayloadShapeKey,
|
transaction.updateItem<ModelMeshPartPayload>(itemID, [modelTransform, meshState, useDualQuaternionSkinning, cauterizedMeshState, invalidatePayloadShapeKey,
|
||||||
isWireframe, renderItemKeyGlobalFlags, enableCauterization](CauterizedMeshPartPayload& data) {
|
isWireframe, renderItemKeyGlobalFlags, enableCauterization](ModelMeshPartPayload& mmppData) {
|
||||||
|
CauterizedMeshPartPayload& data = static_cast<CauterizedMeshPartPayload&>(mmppData);
|
||||||
if (useDualQuaternionSkinning) {
|
if (useDualQuaternionSkinning) {
|
||||||
data.updateClusterBuffer(meshState.clusterDualQuaternions,
|
data.updateClusterBuffer(meshState.clusterDualQuaternions,
|
||||||
cauterizedMeshState.clusterDualQuaternions);
|
cauterizedMeshState.clusterDualQuaternions);
|
||||||
|
|
|
@ -243,7 +243,8 @@ bool RecordingScriptingInterface::saveRecordingToAsset(QScriptValue getClipAtpUr
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto upload = DependencyManager::get<AssetClient>()->createUpload(recording::Clip::toBuffer(_lastClip))) {
|
if (auto upload = DependencyManager::get<AssetClient>()->createUpload(recording::Clip::toBuffer(_lastClip))) {
|
||||||
QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
|
QObject::connect(upload, &AssetUpload::finished,
|
||||||
|
getClipAtpUrl.engine(), [=](AssetUpload* upload, const QString& hash) mutable {
|
||||||
QString clip_atp_url = "";
|
QString clip_atp_url = "";
|
||||||
|
|
||||||
if (upload->getError() == AssetUpload::NoError) {
|
if (upload->getError() == AssetUpload::NoError) {
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
//
|
|
||||||
// UndoStackScriptingInterface.cpp
|
|
||||||
// libraries/script-engine/src
|
|
||||||
//
|
|
||||||
// Created by Ryan Huffman on 10/22/14.
|
|
||||||
// Copyright 2014 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
#include "UndoStackScriptingInterface.h"
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QScriptValue>
|
|
||||||
#include <QScriptValueList>
|
|
||||||
#include <QScriptEngine>
|
|
||||||
|
|
||||||
UndoStackScriptingInterface::UndoStackScriptingInterface(QUndoStack* undoStack) : _undoStack(undoStack) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void UndoStackScriptingInterface::pushCommand(QScriptValue undoFunction, QScriptValue undoData,
|
|
||||||
QScriptValue redoFunction, QScriptValue redoData) {
|
|
||||||
if (undoFunction.engine()) {
|
|
||||||
ScriptUndoCommand* undoCommand = new ScriptUndoCommand(undoFunction, undoData, redoFunction, redoData);
|
|
||||||
undoCommand->moveToThread(undoFunction.engine()->thread());
|
|
||||||
_undoStack->push(undoCommand);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ScriptUndoCommand::ScriptUndoCommand(QScriptValue undoFunction, QScriptValue undoData,
|
|
||||||
QScriptValue redoFunction, QScriptValue redoData) :
|
|
||||||
_hasRedone(false),
|
|
||||||
_undoFunction(undoFunction),
|
|
||||||
_undoData(undoData),
|
|
||||||
_redoFunction(redoFunction),
|
|
||||||
_redoData(redoData) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void ScriptUndoCommand::undo() {
|
|
||||||
QMetaObject::invokeMethod(this, "doUndo");
|
|
||||||
}
|
|
||||||
|
|
||||||
void ScriptUndoCommand::redo() {
|
|
||||||
// QUndoStack will call `redo()` when adding a command to the stack. This
|
|
||||||
// makes it difficult to work with commands that span a period of time - for instance,
|
|
||||||
// the entity duplicate + move command that duplicates an entity and then moves it.
|
|
||||||
// A better implementation might be to properly implement `mergeWith()` and `id()`
|
|
||||||
// so that the two actions in the example would be merged.
|
|
||||||
if (_hasRedone) {
|
|
||||||
QMetaObject::invokeMethod(this, "doRedo");
|
|
||||||
}
|
|
||||||
_hasRedone = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ScriptUndoCommand::doUndo() {
|
|
||||||
QScriptValueList args;
|
|
||||||
args << _undoData;
|
|
||||||
_undoFunction.call(QScriptValue(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ScriptUndoCommand::doRedo() {
|
|
||||||
QScriptValueList args;
|
|
||||||
args << _redoData;
|
|
||||||
_redoFunction.call(QScriptValue(), args);
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
//
|
|
||||||
// UndoStackScriptingInterface.h
|
|
||||||
// libraries/script-engine/src
|
|
||||||
//
|
|
||||||
// Created by Ryan Huffman on 10/22/14.
|
|
||||||
// Copyright 2014 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef hifi_UndoStackScriptingInterface_h
|
|
||||||
#define hifi_UndoStackScriptingInterface_h
|
|
||||||
|
|
||||||
#include <QUndoCommand>
|
|
||||||
#include <QUndoStack>
|
|
||||||
#include <QScriptValue>
|
|
||||||
|
|
||||||
class UndoStackScriptingInterface : public QObject {
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
UndoStackScriptingInterface(QUndoStack* undoStack);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void pushCommand(QScriptValue undoFunction, QScriptValue undoData, QScriptValue redoFunction, QScriptValue redoData);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QUndoStack* _undoStack;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ScriptUndoCommand : public QObject, public QUndoCommand {
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
ScriptUndoCommand(QScriptValue undoFunction, QScriptValue undoData, QScriptValue redoFunction, QScriptValue redoData);
|
|
||||||
|
|
||||||
virtual void undo() override;
|
|
||||||
virtual void redo() override;
|
|
||||||
virtual bool mergeWith(const QUndoCommand* command) override { return false; }
|
|
||||||
virtual int id() const override { return -1; }
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void doUndo();
|
|
||||||
void doRedo();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool _hasRedone;
|
|
||||||
QScriptValue _undoFunction;
|
|
||||||
QScriptValue _undoData;
|
|
||||||
QScriptValue _redoFunction;
|
|
||||||
QScriptValue _redoData;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // hifi_UndoStackScriptingInterface_h
|
|
|
@ -248,7 +248,7 @@ bool TriangleSet::TriangleTreeCell::findRayIntersection(const glm::vec3& origin,
|
||||||
// The distance passed in here is the distance to our bounding box. If !precision, that distance is used
|
// The distance passed in here is the distance to our bounding box. If !precision, that distance is used
|
||||||
{
|
{
|
||||||
float internalDistance = distance;
|
float internalDistance = distance;
|
||||||
BoxFace internalFace;
|
BoxFace internalFace { UNKNOWN_FACE };
|
||||||
Triangle internalTriangle;
|
Triangle internalTriangle;
|
||||||
if (findRayIntersectionInternal(origin, direction, internalDistance, internalFace, internalTriangle, precision, trianglesTouched, allowBackface)) {
|
if (findRayIntersectionInternal(origin, direction, internalDistance, internalFace, internalTriangle, precision, trianglesTouched, allowBackface)) {
|
||||||
bestLocalDistance = internalDistance;
|
bestLocalDistance = internalDistance;
|
||||||
|
|
|
@ -31,7 +31,8 @@ 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",
|
||||||
"system/emote.js"
|
"system/emote.js",
|
||||||
|
"system/miniTablet.js"
|
||||||
];
|
];
|
||||||
var DEFAULT_SCRIPTS_SEPARATE = [
|
var DEFAULT_SCRIPTS_SEPARATE = [
|
||||||
"system/controllers/controllerScripts.js",
|
"system/controllers/controllerScripts.js",
|
||||||
|
|
|
@ -42,8 +42,7 @@ function AppUi(properties) {
|
||||||
that.additionalAppScreens = [];
|
that.additionalAppScreens = [];
|
||||||
that.checkIsOpen = function checkIsOpen(type, tabletUrl) { // Are we active? Value used to set isOpen.
|
that.checkIsOpen = function checkIsOpen(type, tabletUrl) { // Are we active? Value used to set isOpen.
|
||||||
// Actual url may have prefix or suffix.
|
// Actual url may have prefix or suffix.
|
||||||
return (type === that.currentVisibleScreenType) &&
|
return that.currentVisibleUrl &&
|
||||||
that.currentVisibleUrl &&
|
|
||||||
((that.home.indexOf(that.currentVisibleUrl) > -1) ||
|
((that.home.indexOf(that.currentVisibleUrl) > -1) ||
|
||||||
(that.additionalAppScreens.indexOf(that.currentVisibleUrl) > -1));
|
(that.additionalAppScreens.indexOf(that.currentVisibleUrl) > -1));
|
||||||
};
|
};
|
||||||
|
|
BIN
scripts/system/assets/models/miniTabletBlank.fbx
Normal file
BIN
scripts/system/assets/models/miniTabletBlank.fbx
Normal file
Binary file not shown.
BIN
scripts/system/assets/sounds/button-click.wav
Normal file
BIN
scripts/system/assets/sounds/button-click.wav
Normal file
Binary file not shown.
BIN
scripts/system/assets/sounds/button-hover.wav
Normal file
BIN
scripts/system/assets/sounds/button-hover.wav
Normal file
Binary file not shown.
|
@ -25,7 +25,9 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
Script.include("/~/system/libraries/pointersUtils.js");
|
Script.include("/~/system/libraries/pointersUtils.js");
|
||||||
|
|
||||||
var NEAR_MAX_RADIUS = 0.1;
|
var NEAR_MAX_RADIUS = 0.1;
|
||||||
|
var NEAR_TABLET_MAX_RADIUS = 0.05;
|
||||||
|
|
||||||
var TARGET_UPDATE_HZ = 60; // 50hz good enough, but we're using update
|
var TARGET_UPDATE_HZ = 60; // 50hz good enough, but we're using update
|
||||||
var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ;
|
var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ;
|
||||||
|
@ -211,6 +213,24 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
if (controllerLocations[h].valid) {
|
if (controllerLocations[h].valid) {
|
||||||
var nearbyOverlays =
|
var nearbyOverlays =
|
||||||
Overlays.findOverlays(controllerLocations[h].position, NEAR_MAX_RADIUS * sensorScaleFactor);
|
Overlays.findOverlays(controllerLocations[h].position, NEAR_MAX_RADIUS * sensorScaleFactor);
|
||||||
|
|
||||||
|
// Tablet and mini-tablet must be within NEAR_TABLET_MAX_RADIUS in order to be grabbed.
|
||||||
|
// Mini tablet can only be grabbed the hand it's displayed on.
|
||||||
|
var tabletIndex = nearbyOverlays.indexOf(HMD.tabletID);
|
||||||
|
var miniTabletIndex = nearbyOverlays.indexOf(HMD.miniTabletID);
|
||||||
|
if (tabletIndex !== -1 || miniTabletIndex !== -1) {
|
||||||
|
var closebyOverlays =
|
||||||
|
Overlays.findOverlays(controllerLocations[h].position, NEAR_TABLET_MAX_RADIUS * sensorScaleFactor);
|
||||||
|
// Assumes that the tablet and mini-tablet are not displayed at the same time.
|
||||||
|
if (tabletIndex !== -1 && closebyOverlays.indexOf(HMD.tabletID) === -1) {
|
||||||
|
nearbyOverlays.splice(tabletIndex, 1);
|
||||||
|
}
|
||||||
|
if (miniTabletIndex !== -1
|
||||||
|
&& ((closebyOverlays.indexOf(HMD.miniTabletID) === -1) || h !== HMD.miniTabletHand)) {
|
||||||
|
nearbyOverlays.splice(miniTabletIndex, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nearbyOverlays.sort(function (a, b) {
|
nearbyOverlays.sort(function (a, b) {
|
||||||
var aPosition = Overlays.getProperty(a, "position");
|
var aPosition = Overlays.getProperty(a, "position");
|
||||||
var aDistance = Vec3.distance(aPosition, controllerLocations[h].position);
|
var aDistance = Vec3.distance(aPosition, controllerLocations[h].position);
|
||||||
|
@ -218,6 +238,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
var bDistance = Vec3.distance(bPosition, controllerLocations[h].position);
|
var bDistance = Vec3.distance(bPosition, controllerLocations[h].position);
|
||||||
return aDistance - bDistance;
|
return aDistance - bDistance;
|
||||||
});
|
});
|
||||||
|
|
||||||
nearbyOverlayIDs.push(nearbyOverlays);
|
nearbyOverlayIDs.push(nearbyOverlays);
|
||||||
} else {
|
} else {
|
||||||
nearbyOverlayIDs.push([]);
|
nearbyOverlayIDs.push([]);
|
||||||
|
@ -449,14 +470,14 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
filter: Picks.PICK_ENTITIES | Picks.PICK_OVERLAYS,
|
filter: Picks.PICK_ENTITIES | Picks.PICK_OVERLAYS,
|
||||||
enabled: true
|
enabled: true
|
||||||
});
|
});
|
||||||
this.handleHandMessage = function(channel, message, sender) {
|
this.handleHandMessage = function(channel, data, sender) {
|
||||||
var data;
|
var message;
|
||||||
if (sender === MyAvatar.sessionUUID) {
|
if (sender === MyAvatar.sessionUUID) {
|
||||||
try {
|
try {
|
||||||
if (channel === 'Hifi-Hand-RayPick-Blacklist') {
|
if (channel === 'Hifi-Hand-RayPick-Blacklist') {
|
||||||
data = JSON.parse(message);
|
message = JSON.parse(data);
|
||||||
var action = data.action;
|
var action = message.action;
|
||||||
var id = data.id;
|
var id = message.id;
|
||||||
var index = _this.blacklist.indexOf(id);
|
var index = _this.blacklist.indexOf(id);
|
||||||
|
|
||||||
if (action === 'add' && index === -1) {
|
if (action === 'add' && index === -1) {
|
||||||
|
@ -471,9 +492,8 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("WARNING: handControllerGrab.js -- error parsing Hifi-Hand-RayPick-Blacklist message: " + message);
|
print("WARNING: handControllerGrab.js -- error parsing message: " + data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -163,9 +163,12 @@ Script.include("/~/system/libraries/utils.js");
|
||||||
var handPosition = controllerData.controllerLocations[this.hand].position;
|
var handPosition = controllerData.controllerLocations[this.hand].position;
|
||||||
var distance = Vec3.distance(overlayPosition, handPosition);
|
var distance = Vec3.distance(overlayPosition, handPosition);
|
||||||
if (distance <= NEAR_GRAB_RADIUS * sensorScaleFactor) {
|
if (distance <= NEAR_GRAB_RADIUS * sensorScaleFactor) {
|
||||||
|
if (overlays[i] !== HMD.miniTabletID || controllerData.secondaryValues[this.hand] === 0) {
|
||||||
|
// Don't grab mini tablet with grip.
|
||||||
return overlays[i];
|
return overlays[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,13 +35,6 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getEntityDistance(controllerPosition, entityProps) {
|
|
||||||
return {
|
|
||||||
id: entityProps.id,
|
|
||||||
distance: Vec3.distance(entityProps.position, controllerPosition)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function StylusInput(hand) {
|
function StylusInput(hand) {
|
||||||
this.hand = hand;
|
this.hand = hand;
|
||||||
|
|
||||||
|
@ -123,6 +116,14 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the mini tablet.
|
||||||
|
if (HMD.miniTabletScreenID && Overlays.getProperty(HMD.miniTabletScreenID, "visible")) {
|
||||||
|
stylusTarget = getOverlayDistance(controllerPosition, HMD.miniTabletScreenID);
|
||||||
|
if (stylusTarget) {
|
||||||
|
stylusTargets.push(stylusTarget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var WEB_DISPLAY_STYLUS_DISTANCE = 0.5;
|
var WEB_DISPLAY_STYLUS_DISTANCE = 0.5;
|
||||||
var nearStylusTarget = isNearStylusTarget(stylusTargets, WEB_DISPLAY_STYLUS_DISTANCE * sensorScaleFactor);
|
var nearStylusTarget = isNearStylusTarget(stylusTargets, WEB_DISPLAY_STYLUS_DISTANCE * sensorScaleFactor);
|
||||||
|
|
||||||
|
|
|
@ -850,6 +850,7 @@ var toolBar = (function () {
|
||||||
}));
|
}));
|
||||||
isActive = active;
|
isActive = active;
|
||||||
activeButton.editProperties({isActive: isActive});
|
activeButton.editProperties({isActive: isActive});
|
||||||
|
undoHistory.setEnabled(isActive);
|
||||||
|
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
|
||||||
|
@ -1237,6 +1238,19 @@ var originalLightsArePickable = Entities.getLightsArePickable();
|
||||||
|
|
||||||
function setupModelMenus() {
|
function setupModelMenus() {
|
||||||
// adj our menuitems
|
// adj our menuitems
|
||||||
|
Menu.addMenuItem({
|
||||||
|
menuName: "Edit",
|
||||||
|
menuItemName: "Undo",
|
||||||
|
shortcutKey: 'Ctrl+Z',
|
||||||
|
position: 0,
|
||||||
|
});
|
||||||
|
Menu.addMenuItem({
|
||||||
|
menuName: "Edit",
|
||||||
|
menuItemName: "Redo",
|
||||||
|
shortcutKey: 'Ctrl+Shift+Z',
|
||||||
|
position: 1,
|
||||||
|
});
|
||||||
|
|
||||||
Menu.addMenuItem({
|
Menu.addMenuItem({
|
||||||
menuName: "Edit",
|
menuName: "Edit",
|
||||||
menuItemName: "Entities",
|
menuItemName: "Entities",
|
||||||
|
@ -1356,6 +1370,9 @@ function setupModelMenus() {
|
||||||
setupModelMenus(); // do this when first running our script.
|
setupModelMenus(); // do this when first running our script.
|
||||||
|
|
||||||
function cleanupModelMenus() {
|
function cleanupModelMenus() {
|
||||||
|
Menu.removeMenuItem("Edit", "Undo");
|
||||||
|
Menu.removeMenuItem("Edit", "Redo");
|
||||||
|
|
||||||
Menu.removeSeparator("Edit", "Entities");
|
Menu.removeSeparator("Edit", "Entities");
|
||||||
if (modelMenuAddedDelete) {
|
if (modelMenuAddedDelete) {
|
||||||
// delete our menuitems
|
// delete our menuitems
|
||||||
|
@ -1698,6 +1715,10 @@ function handeMenuEvent(menuItem) {
|
||||||
Entities.setLightsArePickable(Menu.isOptionChecked("Allow Selecting of Lights"));
|
Entities.setLightsArePickable(Menu.isOptionChecked("Allow Selecting of Lights"));
|
||||||
} else if (menuItem === "Delete") {
|
} else if (menuItem === "Delete") {
|
||||||
deleteSelectedEntities();
|
deleteSelectedEntities();
|
||||||
|
} else if (menuItem === "Undo") {
|
||||||
|
undoHistory.undo();
|
||||||
|
} else if (menuItem === "Redo") {
|
||||||
|
undoHistory.redo();
|
||||||
} else if (menuItem === "Parent Entity to Last") {
|
} else if (menuItem === "Parent Entity to Last") {
|
||||||
parentSelectedEntities();
|
parentSelectedEntities();
|
||||||
} else if (menuItem === "Unparent Entity") {
|
} else if (menuItem === "Unparent Entity") {
|
||||||
|
@ -1924,6 +1945,86 @@ function recursiveAdd(newParentID, parentData) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var UndoHistory = function(onUpdate) {
|
||||||
|
this.history = [];
|
||||||
|
// The current position is the index of the last executed action in the history array.
|
||||||
|
//
|
||||||
|
// -1 0 1 2 3 <- position
|
||||||
|
// A B C D <- actions in history
|
||||||
|
//
|
||||||
|
// If our lastExecutedIndex is 1, the last executed action is B.
|
||||||
|
// If we undo, we undo B (index 1). If we redo, we redo C (index 2).
|
||||||
|
this.lastExecutedIndex = -1;
|
||||||
|
this.enabled = true;
|
||||||
|
this.onUpdate = onUpdate;
|
||||||
|
};
|
||||||
|
|
||||||
|
UndoHistory.prototype.pushCommand = function(undoFn, undoArgs, redoFn, redoArgs) {
|
||||||
|
if (!this.enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Delete any history following the last executed action.
|
||||||
|
this.history.splice(this.lastExecutedIndex + 1);
|
||||||
|
this.history.push({
|
||||||
|
undoFn: undoFn,
|
||||||
|
undoArgs: undoArgs,
|
||||||
|
redoFn: redoFn,
|
||||||
|
redoArgs: redoArgs
|
||||||
|
});
|
||||||
|
this.lastExecutedIndex++;
|
||||||
|
|
||||||
|
if (this.onUpdate) {
|
||||||
|
this.onUpdate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
UndoHistory.prototype.setEnabled = function(enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
if (this.onUpdate) {
|
||||||
|
this.onUpdate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
UndoHistory.prototype.canUndo = function() {
|
||||||
|
return this.enabled && this.lastExecutedIndex >= 0;
|
||||||
|
};
|
||||||
|
UndoHistory.prototype.canRedo = function() {
|
||||||
|
return this.enabled && this.lastExecutedIndex < this.history.length - 1;
|
||||||
|
};
|
||||||
|
UndoHistory.prototype.undo = function() {
|
||||||
|
if (!this.canUndo()) {
|
||||||
|
console.warn("Cannot undo action");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var command = this.history[this.lastExecutedIndex];
|
||||||
|
command.undoFn(command.undoArgs);
|
||||||
|
this.lastExecutedIndex--;
|
||||||
|
|
||||||
|
if (this.onUpdate) {
|
||||||
|
this.onUpdate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
UndoHistory.prototype.redo = function() {
|
||||||
|
if (!this.canRedo()) {
|
||||||
|
console.warn("Cannot redo action");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var command = this.history[this.lastExecutedIndex + 1];
|
||||||
|
command.redoFn(command.redoArgs);
|
||||||
|
this.lastExecutedIndex++;
|
||||||
|
|
||||||
|
if (this.onUpdate) {
|
||||||
|
this.onUpdate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function updateUndoRedoMenuItems() {
|
||||||
|
Menu.setMenuEnabled("Edit > Undo", undoHistory.canUndo());
|
||||||
|
Menu.setMenuEnabled("Edit > Redo", undoHistory.canRedo());
|
||||||
|
}
|
||||||
|
var undoHistory = new UndoHistory(updateUndoRedoMenuItems);
|
||||||
|
updateUndoRedoMenuItems();
|
||||||
|
|
||||||
// When an entity has been deleted we need a way to "undo" this deletion. Because it's not currently
|
// When an entity has been deleted we need a way to "undo" this deletion. Because it's not currently
|
||||||
// possible to create an entity with a specific id, earlier undo commands to the deleted entity
|
// possible to create an entity with a specific id, earlier undo commands to the deleted entity
|
||||||
// will fail if there isn't a way to find the new entity id.
|
// will fail if there isn't a way to find the new entity id.
|
||||||
|
@ -2011,7 +2112,7 @@ function pushCommandForSelections(createdEntityData, deletedEntityData, doNotSav
|
||||||
properties: currentProperties
|
properties: currentProperties
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
UndoStack.pushCommand(applyEntityProperties, undoData, applyEntityProperties, redoData);
|
undoHistory.pushCommand(applyEntityProperties, undoData, applyEntityProperties, redoData);
|
||||||
}
|
}
|
||||||
|
|
||||||
var ServerScriptStatusMonitor = function(entityID, statusCallback) {
|
var ServerScriptStatusMonitor = function(entityID, statusCallback) {
|
||||||
|
|
5
scripts/system/html/css/img/mt-expand-hover.svg
Normal file
5
scripts/system/html/css/img/mt-expand-hover.svg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="50" height="50" viewBox="0 0 50.00 50.00" enable-background="new 0 0 50.00 50.00" xml:space="preserve">
|
||||||
|
<ellipse fill="#303030" fill-opacity="1" stroke-width="2" stroke-linejoin="round" stroke="#1FC6A6" stroke-opacity="1" cx="25" cy="25" rx="24" ry="24"/>
|
||||||
|
</svg>
|
5
scripts/system/html/css/img/mt-expand-normal.svg
Normal file
5
scripts/system/html/css/img/mt-expand-normal.svg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="50" height="50" viewBox="0 0 50.00 50.00" enable-background="new 0 0 50.00 50.00" xml:space="preserve">
|
||||||
|
<ellipse fill="#303030" fill-opacity="1" stroke-width="2" stroke-linejoin="round" stroke="#606060" stroke-opacity="1" cx="25" cy="25" rx="24" ry="24"/>
|
||||||
|
</svg>
|
5
scripts/system/html/css/img/mt-goto-hover.svg
Normal file
5
scripts/system/html/css/img/mt-goto-hover.svg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="115.966" height="84.0209" viewBox="0 0 115.97 84.02" enable-background="new 0 0 115.97 84.02" xml:space="preserve">
|
||||||
|
<path fill="#303030" fill-opacity="1" stroke-width="2" stroke-linejoin="round" stroke="#1FC6A6" stroke-opacity="1" d="M 8.72651,1L 107.239,1C 111.507,1 114.966,4.33753 114.966,8.45455L 114.928,47.1459C 114.928,47.6244 109.928,44.6459 100.928,46.3959C 95.7749,47.3979 90.1783,50.1459 87.6783,52.3959C 85.9019,53.9946 81.0533,57.5209 78.1783,66.3959C 75.1445,75.7609 78.2986,83.0209 77.8032,83.0209L 8.72651,83C 4.45927,83 1,79.6625 1,75.5454L 1,8.45455C 1,4.33753 4.45927,1 8.72651,1 Z "/>
|
||||||
|
</svg>
|
5
scripts/system/html/css/img/mt-goto-normal.svg
Normal file
5
scripts/system/html/css/img/mt-goto-normal.svg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="115.966" height="84.0209" viewBox="0 0 115.97 84.02" enable-background="new 0 0 115.97 84.02" xml:space="preserve">
|
||||||
|
<path fill="#303030" fill-opacity="1" stroke-width="2" stroke-linejoin="round" stroke="#606060" stroke-opacity="1" d="M 8.72651,1L 107.239,1C 111.507,1 114.966,4.33753 114.966,8.45455L 114.928,47.1459C 114.928,47.6244 109.928,44.6459 100.928,46.3959C 95.7749,47.3979 90.1783,50.1459 87.6783,52.3959C 85.9019,53.9946 81.0533,57.5209 78.1783,66.3959C 75.1445,75.7609 78.2986,83.0209 77.8032,83.0209L 8.72651,83C 4.45927,83 1,79.6625 1,75.5454L 1,8.45455C 1,4.33753 4.45927,1 8.72651,1 Z "/>
|
||||||
|
</svg>
|
5
scripts/system/html/css/img/mt-mute-hover.svg
Normal file
5
scripts/system/html/css/img/mt-mute-hover.svg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="116" height="84" viewBox="0 0 116.00 84.00" enable-background="new 0 0 116.00 84.00" xml:space="preserve">
|
||||||
|
<path fill="#303030" fill-opacity="1" stroke-width="2" stroke-linejoin="round" stroke="#1FC6A6" stroke-opacity="1" d="M 9,1L 107,1C 111.418,1 115,4.58173 115,9L 115,75C 115,79.4183 111.418,83 107,83L 9,83C 4.58172,83 1,79.4183 1,75L 1,9C 1,4.58173 4.58172,1 9,1 Z "/>
|
||||||
|
</svg>
|
5
scripts/system/html/css/img/mt-mute-normal.svg
Normal file
5
scripts/system/html/css/img/mt-mute-normal.svg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="116" height="84" viewBox="0 0 116.00 84.00" enable-background="new 0 0 116.00 84.00" xml:space="preserve">
|
||||||
|
<path fill="#303030" fill-opacity="1" stroke-width="2" stroke-linejoin="round" stroke="#606060" stroke-opacity="1" d="M 9.00003,1L 107,1C 111.419,1 115,4.58173 115,9L 115,75C 115,79.4183 111.419,83 107,83L 9.00003,83C 4.58173,83 0.999996,79.4183 0.999996,75L 0.999996,9C 0.999996,4.58173 4.58173,1 9.00003,1 Z "/>
|
||||||
|
</svg>
|
92
scripts/system/html/css/miniTablet.css
Normal file
92
scripts/system/html/css/miniTablet.css
Normal file
|
@ -0,0 +1,92 @@
|
||||||
|
/*
|
||||||
|
miniTablet.css
|
||||||
|
|
||||||
|
Created by David Rowe on 20 Aug 2018.
|
||||||
|
Copyright 2018 High Fidelity, Inc.
|
||||||
|
|
||||||
|
Distributed under the Apache License, Version 2.0.
|
||||||
|
See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
background-color: #404040;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
section {
|
||||||
|
background-color: #404040;
|
||||||
|
position: relative;
|
||||||
|
padding: 16px 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
width: 116px;
|
||||||
|
height: 84px;
|
||||||
|
margin-top: 16px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mute {
|
||||||
|
padding-top: 19px;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-image: url("./img/mt-mute-normal.svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
#mute:hover {
|
||||||
|
background-image: url("./img/mt-mute-hover.svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
#goto {
|
||||||
|
padding-top: 19px;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-image: url("./img/mt-goto-normal.svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
#goto:hover {
|
||||||
|
background-image: url("./img/mt-goto-hover.svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
#goto:hover.unhover {
|
||||||
|
background-image: url("./img/mt-goto-normal.svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
#expand {
|
||||||
|
position: absolute;
|
||||||
|
right: 1px;
|
||||||
|
bottom: -1px;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-image: url("./img/mt-expand-normal.svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
#expand:hover {
|
||||||
|
background-image: url("./img/mt-expand-hover.svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
#expand:hover.unhover {
|
||||||
|
background-image: url("./img/mt-expand-normal.svg");
|
||||||
|
}
|
||||||
|
|
||||||
|
#expand img {
|
||||||
|
width:34px;
|
||||||
|
margin-top: 7px;
|
||||||
|
}
|
85
scripts/system/html/img/expand.svg
Normal file
85
scripts/system/html/img/expand.svg
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="Layer_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 50 49.999999"
|
||||||
|
xml:space="preserve"
|
||||||
|
sodipodi:docname="expandIcon.svg"
|
||||||
|
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||||
|
width="50"
|
||||||
|
height="50"><metadata
|
||||||
|
id="metadata21"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs19" /><sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="980"
|
||||||
|
inkscape:window-height="792"
|
||||||
|
id="namedview17"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="2"
|
||||||
|
inkscape:cx="12.25"
|
||||||
|
inkscape:cy="62.4"
|
||||||
|
inkscape:window-x="249"
|
||||||
|
inkscape:window-y="99"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="Layer_1"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
showguides="false" />
|
||||||
|
<style
|
||||||
|
type="text/css"
|
||||||
|
id="style2">
|
||||||
|
.st0{opacity:0.7;fill:#1B1B1B;stroke:#FFFFFF;stroke-width:4.6505;stroke-miterlimit:10;}
|
||||||
|
.st1{fill:#FFFFFF;}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<g
|
||||||
|
id="g14"
|
||||||
|
transform="matrix(0.25,0,0,0.25,-214.575,-109.6)">
|
||||||
|
<path
|
||||||
|
class="st1"
|
||||||
|
d="m 919.2,490.4 h 8.5 c 3.9,0 7.1,-3.2 7.1,-7.1 0,-3.9 -3.2,-7.1 -7.1,-7.1 H 902 c 0,0 0,0 -0.1,0 -0.4,0 -0.9,0 -1.3,0.1 -0.2,0 -0.4,0.1 -0.6,0.2 -0.2,0.1 -0.5,0.1 -0.7,0.2 -0.2,0.1 -0.5,0.2 -0.7,0.4 -0.2,0.1 -0.4,0.2 -0.5,0.3 -0.4,0.3 -0.7,0.5 -1.1,0.9 0,0 0,0 0,0 0,0 0,0 0,0 -0.1,0.1 -0.1,0.2 -0.2,0.3 -1.5,1.3 -2.4,3.2 -2.4,5.3 v 25.7 c 0,3.9 3.2,7.1 7.1,7.1 3.9,0 7.1,-3.2 7.1,-7.1 v -9.7 l 24.1,24.1 c 1.4,1.4 3.2,2.1 5,2.1 1.8,0 3.7,-0.7 5,-2.1 2.8,-2.8 2.8,-7.3 0,-10.1 z"
|
||||||
|
id="path6"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#ffffff" />
|
||||||
|
<path
|
||||||
|
class="st1"
|
||||||
|
d="m 932.6,554.6 -24.1,24.1 V 569 c 0,-3.9 -3.2,-7.1 -7.1,-7.1 -3.9,0 -7.1,3.2 -7.1,7.1 v 25.7 c 0,2.1 0.9,4 2.4,5.3 0.4,0.5 0.8,0.9 1.3,1.2 0.2,0.1 0.4,0.2 0.5,0.3 0.2,0.1 0.5,0.3 0.7,0.4 0.2,0.1 0.5,0.1 0.7,0.2 0.2,0.1 0.4,0.1 0.6,0.2 0.5,0.1 0.9,0.1 1.4,0.1 h 25.7 c 3.9,0 7.1,-3.2 7.1,-7.1 0,-3.9 -3.2,-7.1 -7.1,-7.1 h -8.5 l 23.5,-23.5 c 2.8,-2.8 2.8,-7.3 0,-10.1 -2.7,-2.8 -7.2,-2.8 -10,0 z"
|
||||||
|
id="path8"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#ffffff" />
|
||||||
|
<path
|
||||||
|
class="st1"
|
||||||
|
d="m 1018.7,561.9 c -3.9,0 -7.1,3.2 -7.1,7.1 v 9.7 l -24.1,-24.1 c -2.8,-2.8 -7.3,-2.8 -10.1,0 -2.8,2.8 -2.8,7.3 0,10.1 l 23.5,23.5 h -8.5 c -3.9,0 -7.1,3.2 -7.1,7.1 0,3.9 3.2,7.1 7.1,7.1 h 25.7 c 0.5,0 0.9,0 1.4,-0.1 0.2,0 0.4,-0.1 0.6,-0.2 0.2,-0.1 0.5,-0.1 0.7,-0.2 0.3,-0.1 0.5,-0.2 0.7,-0.4 0.2,-0.1 0.3,-0.2 0.5,-0.3 0.5,-0.3 0.9,-0.8 1.4,-1.2 1.5,-1.3 2.4,-3.2 2.4,-5.3 V 569 c 0,-3.9 -3.1,-7.1 -7.1,-7.1 z"
|
||||||
|
id="path10"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#ffffff" />
|
||||||
|
<path
|
||||||
|
class="st1"
|
||||||
|
d="m 982.2,526 c 1.8,0 3.6,-0.7 5,-2.1 l 24.1,-24.1 v 9.7 c 0,3.9 3.2,7.1 7.1,7.1 3.9,0 7.1,-3.2 7.1,-7.1 v -25.7 c 0,-2.1 -0.9,-4 -2.4,-5.3 -0.4,-0.5 -0.8,-0.9 -1.3,-1.2 -0.2,-0.1 -0.3,-0.2 -0.5,-0.3 -0.2,-0.1 -0.5,-0.3 -0.7,-0.4 -0.2,-0.1 -0.5,-0.1 -0.7,-0.2 -0.2,-0.1 -0.4,-0.1 -0.6,-0.2 -0.5,-0.1 -0.9,-0.1 -1.4,-0.1 h -25.7 c -3.9,0 -7.1,3.2 -7.1,7.1 0,3.9 3.2,7.1 7.1,7.1 h 8.5 l -23.5,23.5 c -2.8,2.8 -2.8,7.3 0,10.1 1.4,1.4 3.2,2.1 5,2.1 z"
|
||||||
|
id="path12"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#ffffff" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.9 KiB |
|
@ -96,7 +96,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var emitWalletSetupEvent = function () {
|
emitWalletSetupEvent = function () {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
type: "WALLET_SETUP"
|
type: "WALLET_SETUP"
|
||||||
}));
|
}));
|
||||||
|
@ -316,12 +316,16 @@
|
||||||
if ($this.text() === buyString || $this.text() === getString) {
|
if ($this.text() === buyString || $this.text() === getString) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ($this.text() === 'invalidated') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this.data('initialHtml', $this.html());
|
$this.data('initialHtml', $this.html());
|
||||||
|
|
||||||
var cost = $(this).parent().siblings().text();
|
var cost = $(this).parent().siblings().text();
|
||||||
if (parseInt(cost) > 0) {
|
if (parseInt(cost) > 0) {
|
||||||
$this.text(buyString);
|
$this.text(buyString);
|
||||||
} else {
|
}
|
||||||
|
if (parseInt(cost) == 0) {
|
||||||
$this.text(getString);
|
$this.text(getString);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -333,6 +337,9 @@
|
||||||
|
|
||||||
|
|
||||||
$('.grid-item').find('#price-or-edit').find('a').on('click', function () {
|
$('.grid-item').find('#price-or-edit').find('a').on('click', function () {
|
||||||
|
if ($(this).closest('.grid-item').find('.price').text() === 'invalidated') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
buyButtonClicked($(this).closest('.grid-item').attr('data-item-id'),
|
buyButtonClicked($(this).closest('.grid-item').attr('data-item-id'),
|
||||||
$(this).closest('.grid-item').find('.item-title').text(),
|
$(this).closest('.grid-item').find('.item-title').text(),
|
||||||
$(this).closest('.grid-item').find('.creator').find('.value').text(),
|
$(this).closest('.grid-item').find('.creator').find('.value').text(),
|
||||||
|
|
157
scripts/system/html/js/miniTablet.js
Normal file
157
scripts/system/html/js/miniTablet.js
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
//
|
||||||
|
// miniTablet.js
|
||||||
|
//
|
||||||
|
// Created by David Rowe on 20 Aug 2018.
|
||||||
|
// Copyright 2018 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
/* global EventBridge */
|
||||||
|
/* eslint-env browser */
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var // EventBridge
|
||||||
|
READY_MESSAGE = "ready", // Engine <== Dialog
|
||||||
|
HOVER_MESSAGE = "hover", // Engine <== Dialog
|
||||||
|
UNHOVER_MESSAGE = "unhover", // Engine <== Dialog
|
||||||
|
MUTE_MESSAGE = "mute", // Engine <=> Dialog
|
||||||
|
GOTO_MESSAGE = "goto", // Engine <=> Dialog
|
||||||
|
EXPAND_MESSAGE = "expand", // Engine <== Dialog
|
||||||
|
|
||||||
|
muteButton,
|
||||||
|
muteImage,
|
||||||
|
gotoButton,
|
||||||
|
gotoImage,
|
||||||
|
expandButton,
|
||||||
|
|
||||||
|
// Work around buttons staying hovered when mini tablet is replaced by tablet proper then subsequently redisplayed.
|
||||||
|
isUnhover = true;
|
||||||
|
|
||||||
|
|
||||||
|
function setUnhover() {
|
||||||
|
if (!isUnhover) {
|
||||||
|
gotoButton.classList.add("unhover");
|
||||||
|
expandButton.classList.add("unhover");
|
||||||
|
isUnhover = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearUnhover() {
|
||||||
|
if (isUnhover) {
|
||||||
|
gotoButton.classList.remove("unhover");
|
||||||
|
expandButton.classList.remove("unhover");
|
||||||
|
isUnhover = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function onScriptEventReceived(data) {
|
||||||
|
var message;
|
||||||
|
|
||||||
|
try {
|
||||||
|
message = JSON.parse(data);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("EventBridge message error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (message.type) {
|
||||||
|
case MUTE_MESSAGE:
|
||||||
|
muteImage.src = message.icon;
|
||||||
|
break;
|
||||||
|
case GOTO_MESSAGE:
|
||||||
|
gotoImage.src = message.icon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onBodyHover() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: HOVER_MESSAGE,
|
||||||
|
target: "body"
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function onBodyUnhover() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: UNHOVER_MESSAGE,
|
||||||
|
target: "body"
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function onButtonHover() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: HOVER_MESSAGE,
|
||||||
|
target: "button"
|
||||||
|
}));
|
||||||
|
clearUnhover();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onMuteButtonClick() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: MUTE_MESSAGE
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function onGotoButtonClick() {
|
||||||
|
setUnhover();
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: GOTO_MESSAGE
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function onExpandButtonClick() {
|
||||||
|
setUnhover();
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: EXPAND_MESSAGE
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectEventBridge() {
|
||||||
|
EventBridge.scriptEventReceived.connect(onScriptEventReceived);
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
type: READY_MESSAGE
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function disconnectEventBridge() {
|
||||||
|
EventBridge.scriptEventReceived.disconnect(onScriptEventReceived);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function onUnload() {
|
||||||
|
disconnectEventBridge();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLoad() {
|
||||||
|
muteButton = document.getElementById("mute");
|
||||||
|
muteImage = document.getElementById("mute-img");
|
||||||
|
gotoButton = document.getElementById("goto");
|
||||||
|
gotoImage = document.getElementById("goto-img");
|
||||||
|
expandButton = document.getElementById("expand");
|
||||||
|
|
||||||
|
connectEventBridge();
|
||||||
|
|
||||||
|
document.body.addEventListener("mouseenter", onBodyHover, false);
|
||||||
|
document.body.addEventListener("mouseleave", onBodyUnhover, false);
|
||||||
|
|
||||||
|
muteButton.addEventListener("mouseenter", onButtonHover, false);
|
||||||
|
gotoButton.addEventListener("mouseenter", onButtonHover, false);
|
||||||
|
expandButton.addEventListener("mouseenter", onButtonHover, false);
|
||||||
|
muteButton.addEventListener("click", onMuteButtonClick, true);
|
||||||
|
gotoButton.addEventListener("click", onGotoButtonClick, true);
|
||||||
|
expandButton.addEventListener("click", onExpandButtonClick, true);
|
||||||
|
|
||||||
|
document.body.onunload = function () {
|
||||||
|
onUnload();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoad();
|
||||||
|
|
||||||
|
}());
|
32
scripts/system/html/miniTablet.html
Normal file
32
scripts/system/html/miniTablet.html
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<!--
|
||||||
|
miniTablet.html
|
||||||
|
|
||||||
|
Created by David Rowe on 20 Aug 2018.
|
||||||
|
Copyright 2018 High Fidelity, Inc.
|
||||||
|
|
||||||
|
Distributed under the Apache License, Version 2.0.
|
||||||
|
See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="css/miniTablet.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<section>
|
||||||
|
<div id="mute" class="button">
|
||||||
|
<img id="mute-img" />
|
||||||
|
</div>
|
||||||
|
<div id="goto" class="button">
|
||||||
|
<img id="goto-img" />
|
||||||
|
</div>
|
||||||
|
<div id="expand" class="button">
|
||||||
|
<img src="./img/expand.svg" />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<script src="js/miniTablet.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -356,13 +356,14 @@ getTabletWidthFromSettings = function () {
|
||||||
var DEFAULT_TABLET_WIDTH = 0.4375;
|
var DEFAULT_TABLET_WIDTH = 0.4375;
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
var toolbarMode = tablet.toolbarMode;
|
var toolbarMode = tablet.toolbarMode;
|
||||||
var DEFAULT_TABLET_SCALE = 70;
|
var DEFAULT_DESKTOP_TABLET_SCALE = 75;
|
||||||
var tabletScalePercentage = DEFAULT_TABLET_SCALE;
|
var DEFAULT_HMD_TABLET_SCALE = 60;
|
||||||
|
var tabletScalePercentage = DEFAULT_HMD_TABLET_SCALE;
|
||||||
if (!toolbarMode) {
|
if (!toolbarMode) {
|
||||||
if (HMD.active) {
|
if (HMD.active) {
|
||||||
tabletScalePercentage = Settings.getValue("hmdTabletScale") || DEFAULT_TABLET_SCALE;
|
tabletScalePercentage = Settings.getValue("hmdTabletScale") || DEFAULT_HMD_TABLET_SCALE;
|
||||||
} else {
|
} else {
|
||||||
tabletScalePercentage = Settings.getValue("desktopTabletScale") || DEFAULT_TABLET_SCALE;
|
tabletScalePercentage = Settings.getValue("desktopTabletScale") || DEFAULT_DESKTOP_TABLET_SCALE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return DEFAULT_TABLET_WIDTH * (tabletScalePercentage / 100);
|
return DEFAULT_TABLET_WIDTH * (tabletScalePercentage / 100);
|
||||||
|
|
|
@ -88,6 +88,49 @@ function setTabletVisibleInSecondaryCamera(visibleInSecondaryCam) {
|
||||||
function openWallet() {
|
function openWallet() {
|
||||||
ui.open(MARKETPLACE_WALLET_QML_PATH);
|
ui.open(MARKETPLACE_WALLET_QML_PATH);
|
||||||
}
|
}
|
||||||
|
function setupWallet(referrer) {
|
||||||
|
// Needs to be done within the QML page in order to get access to QmlCommerce
|
||||||
|
openWallet();
|
||||||
|
var ALLOWANCE_FOR_EVENT_BRIDGE_SETUP = 0;
|
||||||
|
Script.setTimeout(function () {
|
||||||
|
ui.tablet.sendToQml({
|
||||||
|
method: 'updateWalletReferrer',
|
||||||
|
referrer: referrer
|
||||||
|
});
|
||||||
|
}, ALLOWANCE_FOR_EVENT_BRIDGE_SETUP);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onMarketplaceOpen(referrer) {
|
||||||
|
var cta = referrer, match;
|
||||||
|
if (Account.loggedIn && walletNeedsSetup()) {
|
||||||
|
if (referrer === MARKETPLACE_URL_INITIAL) {
|
||||||
|
setupWallet('marketplace cta');
|
||||||
|
} else {
|
||||||
|
match = referrer.match(/\/item\/(\w+)$/);
|
||||||
|
if (match && match[1]) {
|
||||||
|
setupWallet(match[1]);
|
||||||
|
} else if (referrer.indexOf(METAVERSE_SERVER_URL) === -1) { // not a url
|
||||||
|
setupWallet(referrer);
|
||||||
|
} else {
|
||||||
|
print("WARNING: opening marketplace to", referrer, "without wallet setup.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openMarketplace(optionalItemOrUrl) {
|
||||||
|
// This is a bit of a kluge, but so is the whole file.
|
||||||
|
// If given a whole path, use it with no cta.
|
||||||
|
// If given an id, build the appropriate url and use the id as the cta.
|
||||||
|
// Otherwise, use home and 'marketplace cta'.
|
||||||
|
// AND... if call onMarketplaceOpen to setupWallet if we need to.
|
||||||
|
var url = optionalItemOrUrl || MARKETPLACE_URL_INITIAL;
|
||||||
|
// If optionalItemOrUrl contains the metaverse base, then it's a url, not an item id.
|
||||||
|
if (optionalItemOrUrl && optionalItemOrUrl.indexOf(METAVERSE_SERVER_URL) === -1) {
|
||||||
|
url = MARKETPLACE_URL + '/items/' + optionalItemOrUrl;
|
||||||
|
}
|
||||||
|
ui.open(url, MARKETPLACES_INJECT_SCRIPT_URL);
|
||||||
|
}
|
||||||
|
|
||||||
// Function Name: wireQmlEventBridge()
|
// Function Name: wireQmlEventBridge()
|
||||||
//
|
//
|
||||||
|
@ -134,10 +177,14 @@ function setCertificateInfo(currentEntityWithContextOverlay, itemCertificateId)
|
||||||
|
|
||||||
function onUsernameChanged() {
|
function onUsernameChanged() {
|
||||||
if (onMarketplaceScreen) {
|
if (onMarketplaceScreen) {
|
||||||
ui.open(MARKETPLACE_URL_INITIAL, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function walletNeedsSetup() {
|
||||||
|
return Wallet.walletStatus === 1;
|
||||||
|
}
|
||||||
|
|
||||||
function sendCommerceSettings() {
|
function sendCommerceSettings() {
|
||||||
ui.sendToHtml({
|
ui.sendToHtml({
|
||||||
type: "marketplaces",
|
type: "marketplaces",
|
||||||
|
@ -145,7 +192,7 @@ function sendCommerceSettings() {
|
||||||
data: {
|
data: {
|
||||||
commerceMode: Settings.getValue("commerce", true),
|
commerceMode: Settings.getValue("commerce", true),
|
||||||
userIsLoggedIn: Account.loggedIn,
|
userIsLoggedIn: Account.loggedIn,
|
||||||
walletNeedsSetup: Wallet.walletStatus === 1,
|
walletNeedsSetup: walletNeedsSetup(),
|
||||||
metaverseServerURL: Account.metaverseServerURL,
|
metaverseServerURL: Account.metaverseServerURL,
|
||||||
messagesWaiting: shouldShowDot
|
messagesWaiting: shouldShowDot
|
||||||
}
|
}
|
||||||
|
@ -626,6 +673,8 @@ var filterText; // Used for updating Purchases QML
|
||||||
function onWebEventReceived(message) {
|
function onWebEventReceived(message) {
|
||||||
message = JSON.parse(message);
|
message = JSON.parse(message);
|
||||||
if (message.type === GOTO_DIRECTORY) {
|
if (message.type === GOTO_DIRECTORY) {
|
||||||
|
// This is the chooser between marketplaces. Only OUR markteplace
|
||||||
|
// requires/makes-use-of wallet, so doesn't go through openMarketplace bottleneck.
|
||||||
ui.open(MARKETPLACES_URL, MARKETPLACES_INJECT_SCRIPT_URL);
|
ui.open(MARKETPLACES_URL, MARKETPLACES_INJECT_SCRIPT_URL);
|
||||||
} else if (message.type === QUERY_CAN_WRITE_ASSETS) {
|
} else if (message.type === QUERY_CAN_WRITE_ASSETS) {
|
||||||
ui.sendToHtml(CAN_WRITE_ASSETS + " " + Entities.canWriteAssets());
|
ui.sendToHtml(CAN_WRITE_ASSETS + " " + Entities.canWriteAssets());
|
||||||
|
@ -667,12 +716,7 @@ function onWebEventReceived(message) {
|
||||||
} else if (message.type === "LOGIN") {
|
} else if (message.type === "LOGIN") {
|
||||||
openLoginWindow();
|
openLoginWindow();
|
||||||
} else if (message.type === "WALLET_SETUP") {
|
} else if (message.type === "WALLET_SETUP") {
|
||||||
wireQmlEventBridge(true);
|
setupWallet('marketplace cta');
|
||||||
ui.tablet.sendToQml({
|
|
||||||
method: 'updateWalletReferrer',
|
|
||||||
referrer: "marketplace cta"
|
|
||||||
});
|
|
||||||
openWallet();
|
|
||||||
} else if (message.type === "MY_ITEMS") {
|
} else if (message.type === "MY_ITEMS") {
|
||||||
referrerURL = MARKETPLACE_URL_INITIAL;
|
referrerURL = MARKETPLACE_URL_INITIAL;
|
||||||
filterText = "";
|
filterText = "";
|
||||||
|
@ -780,6 +824,14 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (message.method) {
|
switch (message.method) {
|
||||||
|
case 'gotoBank':
|
||||||
|
ui.close();
|
||||||
|
if (Account.metaverseServerURL.indexOf("staging") >= 0) {
|
||||||
|
Window.location = "hifi://hifiqa-master-metaverse-staging"; // So that we can test in staging.
|
||||||
|
} else {
|
||||||
|
Window.location = "hifi://BankOfHighFidelity";
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'purchases_openWallet':
|
case 'purchases_openWallet':
|
||||||
case 'checkout_openWallet':
|
case 'checkout_openWallet':
|
||||||
case 'checkout_setUpClicked':
|
case 'checkout_setUpClicked':
|
||||||
|
@ -802,7 +854,7 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) {
|
||||||
openWallet();
|
openWallet();
|
||||||
break;
|
break;
|
||||||
case 'checkout_cancelClicked':
|
case 'checkout_cancelClicked':
|
||||||
ui.open(MARKETPLACE_URL + '/items/' + message.params, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace(message.params);
|
||||||
break;
|
break;
|
||||||
case 'header_goToPurchases':
|
case 'header_goToPurchases':
|
||||||
case 'checkout_goToPurchases':
|
case 'checkout_goToPurchases':
|
||||||
|
@ -811,15 +863,15 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) {
|
||||||
ui.open(MARKETPLACE_PURCHASES_QML_PATH);
|
ui.open(MARKETPLACE_PURCHASES_QML_PATH);
|
||||||
break;
|
break;
|
||||||
case 'checkout_itemLinkClicked':
|
case 'checkout_itemLinkClicked':
|
||||||
ui.open(MARKETPLACE_URL + '/items/' + message.itemId, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace(message.itemId);
|
||||||
break;
|
break;
|
||||||
case 'checkout_continueShopping':
|
case 'checkout_continueShopping':
|
||||||
ui.open(MARKETPLACE_URL_INITIAL, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace();
|
||||||
break;
|
break;
|
||||||
case 'purchases_itemInfoClicked':
|
case 'purchases_itemInfoClicked':
|
||||||
var itemId = message.itemId;
|
var itemId = message.itemId;
|
||||||
if (itemId && itemId !== "") {
|
if (itemId && itemId !== "") {
|
||||||
ui.open(MARKETPLACE_URL + '/items/' + itemId, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace(itemId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'checkout_rezClicked':
|
case 'checkout_rezClicked':
|
||||||
|
@ -840,20 +892,20 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) {
|
||||||
break;
|
break;
|
||||||
case 'header_marketplaceImageClicked':
|
case 'header_marketplaceImageClicked':
|
||||||
case 'purchases_backClicked':
|
case 'purchases_backClicked':
|
||||||
ui.open(message.referrerURL, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace(message.referrerURL);
|
||||||
break;
|
break;
|
||||||
case 'purchases_goToMarketplaceClicked':
|
case 'purchases_goToMarketplaceClicked':
|
||||||
ui.open(MARKETPLACE_URL_INITIAL, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace();
|
||||||
break;
|
break;
|
||||||
case 'updateItemClicked':
|
case 'updateItemClicked':
|
||||||
ui.open(message.upgradeUrl + "?edition=" + message.itemEdition,
|
openMarketplace(message.upgradeUrl + "?edition=" + message.itemEdition);
|
||||||
MARKETPLACES_INJECT_SCRIPT_URL);
|
|
||||||
break;
|
break;
|
||||||
case 'giftAsset':
|
case 'giftAsset':
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'passphrasePopup_cancelClicked':
|
case 'passphrasePopup_cancelClicked':
|
||||||
case 'needsLogIn_cancelClicked':
|
case 'needsLogIn_cancelClicked':
|
||||||
|
// Should/must NOT check for wallet setup.
|
||||||
ui.open(MARKETPLACE_URL_INITIAL, MARKETPLACES_INJECT_SCRIPT_URL);
|
ui.open(MARKETPLACE_URL_INITIAL, MARKETPLACES_INJECT_SCRIPT_URL);
|
||||||
break;
|
break;
|
||||||
case 'needsLogIn_loginClicked':
|
case 'needsLogIn_loginClicked':
|
||||||
|
@ -883,7 +935,7 @@ var onQmlMessageReceived = function onQmlMessageReceived(message) {
|
||||||
ContextOverlay.requestOwnershipVerification(message.entity);
|
ContextOverlay.requestOwnershipVerification(message.entity);
|
||||||
break;
|
break;
|
||||||
case 'inspectionCertificate_showInMarketplaceClicked':
|
case 'inspectionCertificate_showInMarketplaceClicked':
|
||||||
ui.open(message.marketplaceUrl, MARKETPLACES_INJECT_SCRIPT_URL);
|
openMarketplace(message.marketplaceUrl);
|
||||||
break;
|
break;
|
||||||
case 'header_myItemsClicked':
|
case 'header_myItemsClicked':
|
||||||
referrerURL = MARKETPLACE_URL_INITIAL;
|
referrerURL = MARKETPLACE_URL_INITIAL;
|
||||||
|
@ -1024,12 +1076,7 @@ var onTabletScreenChanged = function onTabletScreenChanged(type, url) {
|
||||||
onCommerceScreen = onCommerceScreenNow;
|
onCommerceScreen = onCommerceScreenNow;
|
||||||
onWalletScreen = onWalletScreenNow;
|
onWalletScreen = onWalletScreenNow;
|
||||||
onMarketplaceItemTesterScreen = onMarketplaceItemTesterScreenNow;
|
onMarketplaceItemTesterScreen = onMarketplaceItemTesterScreenNow;
|
||||||
|
wireQmlEventBridge(onCommerceScreen || onWalletScreen || onMarketplaceItemTesterScreen);
|
||||||
wireQmlEventBridge(
|
|
||||||
onMarketplaceScreen ||
|
|
||||||
onCommerceScreen ||
|
|
||||||
onWalletScreen ||
|
|
||||||
onMarketplaceItemTesterScreen);
|
|
||||||
|
|
||||||
if (url === MARKETPLACE_PURCHASES_QML_PATH) {
|
if (url === MARKETPLACE_PURCHASES_QML_PATH) {
|
||||||
// FIXME? Is there a race condition here in which the event
|
// FIXME? Is there a race condition here in which the event
|
||||||
|
@ -1066,6 +1113,9 @@ var onTabletScreenChanged = function onTabletScreenChanged(type, url) {
|
||||||
isWired = true;
|
isWired = true;
|
||||||
Wallet.refreshWalletStatus();
|
Wallet.refreshWalletStatus();
|
||||||
} else {
|
} else {
|
||||||
|
if (onMarketplaceScreen) {
|
||||||
|
onMarketplaceOpen('marketplace cta');
|
||||||
|
}
|
||||||
ui.tablet.sendToQml({
|
ui.tablet.sendToQml({
|
||||||
method: 'inspectionCertificate_resetCert'
|
method: 'inspectionCertificate_resetCert'
|
||||||
});
|
});
|
||||||
|
|
1036
scripts/system/miniTablet.js
Normal file
1036
scripts/system/miniTablet.js
Normal file
File diff suppressed because it is too large
Load diff
|
@ -19,11 +19,12 @@
|
||||||
var tabletRezzed = false;
|
var tabletRezzed = false;
|
||||||
var activeHand = null;
|
var activeHand = null;
|
||||||
var DEFAULT_WIDTH = 0.4375;
|
var DEFAULT_WIDTH = 0.4375;
|
||||||
var DEFAULT_TABLET_SCALE = 70;
|
var DEFAULT_DESKTOP_TABLET_SCALE = 75;
|
||||||
|
var DEFAULT_HMD_TABLET_SCALE = 60;
|
||||||
var preMakeTime = Date.now();
|
var preMakeTime = Date.now();
|
||||||
var validCheckTime = Date.now();
|
var validCheckTime = Date.now();
|
||||||
var debugTablet = false;
|
var debugTablet = false;
|
||||||
var tabletScalePercentage = 70.0;
|
var tabletScalePercentage = DEFAULT_HMD_TABLET_SCALE;
|
||||||
var UIWebTablet = null;
|
var UIWebTablet = null;
|
||||||
var MSECS_PER_SEC = 1000.0;
|
var MSECS_PER_SEC = 1000.0;
|
||||||
var MUTE_MICROPHONE_MENU_ITEM = "Mute Microphone";
|
var MUTE_MICROPHONE_MENU_ITEM = "Mute Microphone";
|
||||||
|
@ -66,14 +67,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTabletScalePercentageFromSettings() {
|
function getTabletScalePercentageFromSettings() {
|
||||||
checkTablet()
|
checkTablet();
|
||||||
var toolbarMode = gTablet.toolbarMode;
|
var toolbarMode = gTablet.toolbarMode;
|
||||||
var tabletScalePercentage = DEFAULT_TABLET_SCALE;
|
var tabletScalePercentage = DEFAULT_HMD_TABLET_SCALE;
|
||||||
if (!toolbarMode) {
|
if (!toolbarMode) {
|
||||||
if (HMD.active) {
|
if (HMD.active) {
|
||||||
tabletScalePercentage = Settings.getValue("hmdTabletScale") || DEFAULT_TABLET_SCALE;
|
tabletScalePercentage = Settings.getValue("hmdTabletScale") || DEFAULT_HMD_TABLET_SCALE;
|
||||||
} else {
|
} else {
|
||||||
tabletScalePercentage = Settings.getValue("desktopTabletScale") || DEFAULT_TABLET_SCALE;
|
tabletScalePercentage = Settings.getValue("desktopTabletScale") || DEFAULT_DESKTOP_TABLET_SCALE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tabletScalePercentage;
|
return tabletScalePercentage;
|
||||||
|
|
Loading…
Reference in a new issue