mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 08:40:11 +02:00
merge from upstream
This commit is contained in:
commit
621e6a62d6
47 changed files with 202 additions and 176 deletions
|
@ -33,8 +33,6 @@ Item {
|
|||
width: parent.width
|
||||
height: parent.height
|
||||
}
|
||||
|
||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
||||
|
||||
Timer {
|
||||
id: updateList
|
||||
|
|
|
@ -109,9 +109,9 @@ CheckBox {
|
|||
|
||||
contentItem: Text {
|
||||
id: root
|
||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
||||
font.pixelSize: hifi.fontSizes.inputLabel
|
||||
font.family: ralewaySemiBold.name
|
||||
font.family: "Raleway"
|
||||
font.weight: Font.DemiBold
|
||||
text: checkBox.text
|
||||
color: checkBox.color
|
||||
x: 2
|
||||
|
|
|
@ -125,8 +125,7 @@ Rectangle {
|
|||
TextInput {
|
||||
id: mirrorText
|
||||
visible: showMirrorText
|
||||
FontLoader { id: font; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
||||
font.family: font.name
|
||||
font.family: "Fira Sans"
|
||||
font.pixelSize: 20
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
@ -165,8 +164,6 @@ Rectangle {
|
|||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 0
|
||||
|
||||
FontLoader { id: hiFiGlyphs; source: "qrc:/fonts/hifi-glyphs.ttf"; }
|
||||
|
||||
Column {
|
||||
id: columnAlpha
|
||||
width: keyboardWidth
|
||||
|
@ -250,7 +247,7 @@ Rectangle {
|
|||
Key { width: 43; glyph: ","; }
|
||||
Key { width: 43; glyph: "."; }
|
||||
Key {
|
||||
fontFamily: hiFiGlyphs.name;
|
||||
fontFamily: "hifi-glyphs";
|
||||
fontPixelSize: 48;
|
||||
letterAnchors.topMargin: -4;
|
||||
verticalAlignment: Text.AlignVCenter;
|
||||
|
@ -343,7 +340,7 @@ Rectangle {
|
|||
Key { width: 43; glyph: ","; }
|
||||
Key { width: 43; glyph: "."; }
|
||||
Key {
|
||||
fontFamily: hiFiGlyphs.name;
|
||||
fontFamily: "hifi-glyphs";
|
||||
fontPixelSize: 48;
|
||||
letterAnchors.topMargin: -4;
|
||||
verticalAlignment: Text.AlignVCenter;
|
||||
|
|
|
@ -25,8 +25,7 @@ SpinBox {
|
|||
property color colorLabelInside: hifi.colors.white
|
||||
property real controlHeight: height + (spinBoxLabel.visible ? spinBoxLabel.height + spinBoxLabel.anchors.bottomMargin : 0)
|
||||
|
||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
font.family: firaSansSemiBold.name
|
||||
font.family: "Fira Sans SemiBold"
|
||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||
height: hifi.fontSizes.textFieldInput + 13 // Match height of TextField control.
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@ import "../styles-uit"
|
|||
TextEdit {
|
||||
|
||||
property real size: 32
|
||||
|
||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
||||
font.family: ralewaySemiBold.name
|
||||
|
||||
font.family: "Raleway"
|
||||
font.weight: Font.DemiBold
|
||||
font.pointSize: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
|
|
|
@ -34,9 +34,7 @@ TextField {
|
|||
|
||||
placeholderText: textField.placeholderText
|
||||
|
||||
FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
||||
FontLoader { id: hifiGlyphs; source: "qrc:/fonts/hifi-glyphs.ttf"; }
|
||||
font.family: firaSansRegular.name
|
||||
font.family: "Fira Sans"
|
||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||
height: implicitHeight + 3 // Make surrounding box higher so that highlight is vertically centered.
|
||||
property alias textFieldLabel: textFieldLabel
|
||||
|
|
|
@ -4,13 +4,12 @@ import QtQuick.Controls.Styles 1.3
|
|||
|
||||
Text {
|
||||
id: root
|
||||
FontLoader { id: iconFont; source: "qrc:/fonts/fontawesome-webfont.ttf"; }
|
||||
property int size: 32
|
||||
width: size
|
||||
height: size
|
||||
font.pixelSize: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font.family: iconFont.name
|
||||
font.family: "FontAwesome"
|
||||
}
|
||||
|
||||
|
|
|
@ -532,9 +532,6 @@ ModalWindow {
|
|||
itemDelegate: Item {
|
||||
clip: true
|
||||
|
||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
||||
|
||||
FiraSansSemiBold {
|
||||
text: getText();
|
||||
elide: styleData.elideMode
|
||||
|
@ -548,7 +545,7 @@ ModalWindow {
|
|||
size: hifi.fontSizes.tableText
|
||||
color: hifi.colors.baseGrayHighlight
|
||||
font.family: (styleData.row !== -1 && fileTableView.model.get(styleData.row).fileIsDir)
|
||||
? firaSansSemiBold.name : firaSansRegular.name
|
||||
? "Fira Sans SemiBold" : "Fira Sans"
|
||||
|
||||
function getText() {
|
||||
if (styleData.row === -1) {
|
||||
|
|
|
@ -496,9 +496,6 @@ TabletModalWindow {
|
|||
itemDelegate: Item {
|
||||
clip: true
|
||||
|
||||
//FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
//FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
||||
|
||||
FiraSansSemiBold {
|
||||
text: getText();
|
||||
elide: styleData.elideMode
|
||||
|
@ -512,7 +509,7 @@ TabletModalWindow {
|
|||
size: hifi.fontSizes.tableText
|
||||
color: hifi.colors.baseGrayHighlight
|
||||
//font.family: (styleData.row !== -1 && fileTableView.model.get(styleData.row).fileIsDir)
|
||||
//? firaSansSemiBold.name : firaSansRegular.name
|
||||
//? "Fira Sans SemiBold" : "Fira Sans"
|
||||
|
||||
function getText() {
|
||||
if (styleData.row === -1) {
|
||||
|
|
|
@ -345,9 +345,6 @@ Item {
|
|||
itemDelegate: Item {
|
||||
clip: true
|
||||
|
||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
||||
|
||||
FiraSansSemiBold {
|
||||
text: styleData.value
|
||||
elide: styleData.elideMode
|
||||
|
@ -361,7 +358,7 @@ Item {
|
|||
size: hifi.fontSizes.tableText
|
||||
color: hifi.colors.baseGrayHighlight
|
||||
font.family: (styleData.row !== -1 && assetTableView.model.get(styleData.row).fileIsDir)
|
||||
? firaSansSemiBold.name : firaSansRegular.name
|
||||
? "Fira Sans SemiBold" : "Fira Sans"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -660,8 +660,7 @@ Windows.ScrollingWindow {
|
|||
|
||||
text: styleData.value
|
||||
|
||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
font.family: firaSansSemiBold.name
|
||||
font.family: "Fira Sans SemiBold"
|
||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||
height: hifi.dimensions.tableRowHeight
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@ Item {
|
|||
property int dialogHeight;
|
||||
property int comboOptionTextSize: 16;
|
||||
property int comboBodyTextSize: 16;
|
||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
||||
visible: false;
|
||||
id: combo;
|
||||
anchors.fill: parent;
|
||||
|
|
|
@ -24,8 +24,6 @@ Item {
|
|||
property real headerTextMargin: -5
|
||||
property real headerGlyphMargin: -15
|
||||
property bool isDesktop: false
|
||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
||||
visible: false
|
||||
id: letterbox
|
||||
anchors.fill: parent
|
||||
|
@ -78,7 +76,8 @@ Item {
|
|||
// Text Size
|
||||
font.pixelSize: headerTextPixelSize
|
||||
// Style
|
||||
font.family: ralewaySemiBold.name
|
||||
font.family: "Raleway"
|
||||
font.weight: Font.DemiBold
|
||||
color: hifi.colors.darkGray
|
||||
horizontalAlignment: Text.AlignHLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
@ -101,7 +100,7 @@ Item {
|
|||
horizontalAlignment: Text.AlignHLeft
|
||||
// Style
|
||||
font.pixelSize: popupTextPixelSize
|
||||
font.family: ralewayRegular.name
|
||||
font.family: "Raleway"
|
||||
color: hifi.colors.darkGray
|
||||
wrapMode: Text.WordWrap
|
||||
textFormat: Text.StyledText
|
||||
|
|
|
@ -23,8 +23,6 @@ Item {
|
|||
property real popupTextPixelSize: 16
|
||||
property real headerTextMargin: -5
|
||||
property real headerGlyphMargin: -15
|
||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
||||
visible: false
|
||||
id: letterbox
|
||||
anchors.fill: parent
|
||||
|
@ -82,7 +80,8 @@ Item {
|
|||
// Text Size
|
||||
font.pixelSize: headerTextPixelSize
|
||||
// Style
|
||||
font.family: ralewaySemiBold.name
|
||||
font.family: "Raleway"
|
||||
font.weight: Font.DemiBold
|
||||
color: hifi.colors.darkGray
|
||||
horizontalAlignment: Text.AlignHLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
@ -127,7 +126,7 @@ Item {
|
|||
horizontalAlignment: Text.AlignHLeft
|
||||
// Style
|
||||
font.pixelSize: popupTextPixelSize
|
||||
font.family: ralewayRegular.name
|
||||
font.family: "Raleway"
|
||||
color: hifi.colors.darkGray
|
||||
wrapMode: Text.WordWrap
|
||||
textFormat: Text.StyledText
|
||||
|
|
|
@ -177,8 +177,7 @@ Item {
|
|||
anchors.right: parent.right
|
||||
anchors.rightMargin: editGlyph.width + editGlyph.anchors.rightMargin
|
||||
// Style
|
||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
font.family: firaSansSemiBold.name
|
||||
font.family: "Fira Sans SemiBold"
|
||||
font.pixelSize: displayNameTextPixelSize
|
||||
selectionColor: hifi.colors.blueAccent
|
||||
selectedTextColor: "black"
|
||||
|
|
|
@ -908,7 +908,6 @@ Rectangle {
|
|||
anchors.horizontalCenter: parent.horizontalCenter;
|
||||
}
|
||||
|
||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
||||
Text {
|
||||
id: connectionHelpText;
|
||||
// Anchors
|
||||
|
@ -923,7 +922,7 @@ Rectangle {
|
|||
horizontalAlignment: Text.AlignHLeft
|
||||
// Style
|
||||
font.pixelSize: 18;
|
||||
font.family: ralewayRegular.name
|
||||
font.family: "Raleway"
|
||||
color: hifi.colors.darkGray
|
||||
wrapMode: Text.WordWrap
|
||||
textFormat: Text.StyledText;
|
||||
|
|
|
@ -147,8 +147,7 @@ Rectangle {
|
|||
} else if (root.itemHref.indexOf('.json') > -1) {
|
||||
root.itemType = "entity"; // "wearable" type handled later
|
||||
} else {
|
||||
console.log("WARNING - Item type is UNKNOWN!");
|
||||
root.itemType = "entity";
|
||||
root.itemType = "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -141,10 +141,9 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
||||
TextMetrics {
|
||||
id: textMetrics;
|
||||
font.family: ralewayRegular.name
|
||||
font.family: "Raleway"
|
||||
text: usernameText.text;
|
||||
}
|
||||
|
||||
|
|
|
@ -174,11 +174,12 @@ Rectangle {
|
|||
WalletChoice {
|
||||
id: walletChoice;
|
||||
proceedFunction: function (isReset) {
|
||||
console.log(isReset ? "Reset wallet." : "Trying again with new wallet.");
|
||||
console.log("WalletChoice", isReset ? "Reset wallet." : "Trying again with new wallet.");
|
||||
Commerce.setSoftReset();
|
||||
if (isReset) {
|
||||
walletResetSetup();
|
||||
} else {
|
||||
Commerce.clearWallet();
|
||||
var msg = { referrer: walletChoice.referrer }
|
||||
followReferrer(msg);
|
||||
}
|
||||
|
|
|
@ -997,14 +997,13 @@ Item {
|
|||
anchors.right: parent.right;
|
||||
anchors.rightMargin: 20;
|
||||
height: 95;
|
||||
|
||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
|
||||
TextArea {
|
||||
id: optionalMessage;
|
||||
property int maximumLength: 72;
|
||||
property string previousText: text;
|
||||
placeholderText: "<i>Optional Public Message (" + maximumLength + " character limit)</i>";
|
||||
font.family: firaSansSemiBold.name;
|
||||
font.family: "Fira Sans SemiBold";
|
||||
font.pixelSize: 20;
|
||||
// Anchors
|
||||
anchors.fill: parent;
|
||||
|
|
|
@ -659,8 +659,7 @@ Rectangle {
|
|||
|
||||
text: styleData.value
|
||||
|
||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
font.family: firaSansSemiBold.name
|
||||
font.family: "Fira Sans SemiBold"
|
||||
font.pixelSize: hifi.fontSizes.textFieldInput
|
||||
height: hifi.dimensions.tableRowHeight
|
||||
|
||||
|
|
|
@ -478,9 +478,6 @@ Rectangle {
|
|||
itemDelegate: Item {
|
||||
clip: true
|
||||
|
||||
//FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
//FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
||||
|
||||
FiraSansSemiBold {
|
||||
text: getText();
|
||||
elide: styleData.elideMode
|
||||
|
@ -494,7 +491,7 @@ Rectangle {
|
|||
size: hifi.fontSizes.tableText
|
||||
color: hifi.colors.baseGrayHighlight
|
||||
//font.family: (styleData.row !== -1 && fileTableView.model.get(styleData.row).fileIsDir)
|
||||
//? firaSansSemiBold.name : firaSansRegular.name
|
||||
//? "Fira Sans SemiBold" : "Fira Sans"
|
||||
|
||||
function getText() {
|
||||
if (styleData.row === -1) {
|
||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
|||
|
||||
Text {
|
||||
id: root
|
||||
FontLoader { id: anonymousProRegular; source: "qrc:/fonts/AnonymousPro-Regular.ttf"; }
|
||||
property real size: 32
|
||||
font.pixelSize: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font.family: anonymousProRegular.name
|
||||
font.family: "Anonymous Pro"
|
||||
}
|
||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
|||
|
||||
Text {
|
||||
id: root
|
||||
FontLoader { id: firaSansRegular; source: "qrc:/fonts/FiraSans-Regular.ttf"; }
|
||||
property real size: 32
|
||||
font.pixelSize: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font.family: firaSansRegular.name
|
||||
font.family: "Fira Sans"
|
||||
}
|
||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
|||
|
||||
Text {
|
||||
id: root
|
||||
FontLoader { id: firaSansSemiBold; source: "qrc:/fonts/FiraSans-SemiBold.ttf"; }
|
||||
property real size: 32
|
||||
font.pixelSize: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font.family: firaSansSemiBold.name
|
||||
font.family: "Fira Sans SemiBold"
|
||||
}
|
||||
|
|
|
@ -12,12 +12,11 @@ import QtQuick 2.5
|
|||
|
||||
Text {
|
||||
id: root
|
||||
FontLoader { id: hiFiGlyphs; source: "qrc:/fonts/hifi-glyphs.ttf"; }
|
||||
property int size: 32
|
||||
font.pixelSize: size
|
||||
width: size
|
||||
height: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font.family: hiFiGlyphs.name
|
||||
font.family: "hifi-glyphs"
|
||||
}
|
||||
|
|
|
@ -14,11 +14,10 @@ import QtQuick.Controls.Styles 1.4
|
|||
|
||||
Text {
|
||||
id: root
|
||||
FontLoader { id: ralewayBold; source: "qrc:/fonts/Raleway-Bold.ttf"; }
|
||||
property real size: 32
|
||||
font.pixelSize: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font.family: ralewayBold.name
|
||||
font.bold: true // Font seems to need this in order to display bold.
|
||||
font.family: "Raleway"
|
||||
font.bold: true
|
||||
}
|
||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
|||
|
||||
Text {
|
||||
id: root
|
||||
FontLoader { id: ralewayLight; source: "qrc:/fonts/Raleway-Light.ttf"; }
|
||||
property real size: 32
|
||||
font.pixelSize: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font.family: ralewayLight.name
|
||||
font.family: "Raleway Light"
|
||||
}
|
||||
|
|
|
@ -14,10 +14,9 @@ import QtQuick.Controls.Styles 1.4
|
|||
|
||||
Text {
|
||||
id: root
|
||||
FontLoader { id: ralewayRegular; source: "qrc:/fonts/Raleway-Regular.ttf"; }
|
||||
property real size: 32
|
||||
font.pixelSize: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font.family: ralewayRegular.name
|
||||
font.family: "Raleway"
|
||||
}
|
||||
|
|
|
@ -14,10 +14,10 @@ import QtQuick.Controls.Styles 1.4
|
|||
|
||||
Text {
|
||||
id: root
|
||||
FontLoader { id: ralewaySemiBold; source: "qrc:/fonts/Raleway-SemiBold.ttf"; }
|
||||
property real size: 32
|
||||
font.pixelSize: size
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
font.family: ralewaySemiBold.name
|
||||
font.family: "Raleway"
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
|
|
|
@ -1000,6 +1000,15 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
qInstallMessageHandler(messageHandler);
|
||||
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "styles/Inconsolata.otf");
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/fontawesome-webfont.ttf");
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/hifi-glyphs.ttf");
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/AnonymousPro-Regular.ttf");
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/FiraSans-Regular.ttf");
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/FiraSans-SemiBold.ttf");
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Light.ttf");
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Regular.ttf");
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-Bold.ttf");
|
||||
QFontDatabase::addApplicationFont(PathUtils::resourcesPath() + "fonts/Raleway-SemiBold.ttf");
|
||||
_window->setWindowTitle("High Fidelity Interface");
|
||||
|
||||
Model::setAbstractViewStateInterface(this); // The model class will sometimes need to know view state details from us
|
||||
|
@ -6726,17 +6735,17 @@ void Application::addAssetToWorld(QString path, QString zipFile, bool isZip, boo
|
|||
|
||||
addAssetToWorldInfo(filename, "Adding " + mapping.mid(1) + " to the Asset Server.");
|
||||
|
||||
addAssetToWorldWithNewMapping(path, mapping, 0);
|
||||
addAssetToWorldWithNewMapping(path, mapping, 0, isZip, isBlocks);
|
||||
}
|
||||
|
||||
void Application::addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy) {
|
||||
void Application::addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy, bool isZip, bool isBlocks) {
|
||||
auto request = DependencyManager::get<AssetClient>()->createGetMappingRequest(mapping);
|
||||
|
||||
QObject::connect(request, &GetMappingRequest::finished, this, [=](GetMappingRequest* request) mutable {
|
||||
const int MAX_COPY_COUNT = 100; // Limit number of duplicate assets; recursion guard.
|
||||
auto result = request->getError();
|
||||
if (result == GetMappingRequest::NotFound) {
|
||||
addAssetToWorldUpload(filePath, mapping);
|
||||
addAssetToWorldUpload(filePath, mapping, isZip, isBlocks);
|
||||
} else if (result != GetMappingRequest::NoError) {
|
||||
QString errorInfo = "Could not map asset name: "
|
||||
+ mapping.left(mapping.length() - QString::number(copy).length() - 1);
|
||||
|
@ -6748,7 +6757,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin
|
|||
}
|
||||
copy++;
|
||||
mapping = mapping.insert(mapping.lastIndexOf("."), "-" + QString::number(copy));
|
||||
addAssetToWorldWithNewMapping(filePath, mapping, copy);
|
||||
addAssetToWorldWithNewMapping(filePath, mapping, copy, isZip, isBlocks);
|
||||
} else {
|
||||
QString errorInfo = "Too many copies of asset name: "
|
||||
+ mapping.left(mapping.length() - QString::number(copy).length() - 1);
|
||||
|
@ -6761,7 +6770,7 @@ void Application::addAssetToWorldWithNewMapping(QString filePath, QString mappin
|
|||
request->start();
|
||||
}
|
||||
|
||||
void Application::addAssetToWorldUpload(QString filePath, QString mapping) {
|
||||
void Application::addAssetToWorldUpload(QString filePath, QString mapping, bool isZip, bool isBlocks) {
|
||||
qInfo(interfaceapp) << "Uploading" << filePath << "to Asset Server as" << mapping;
|
||||
auto upload = DependencyManager::get<AssetClient>()->createUpload(filePath);
|
||||
QObject::connect(upload, &AssetUpload::finished, this, [=](AssetUpload* upload, const QString& hash) mutable {
|
||||
|
@ -6770,7 +6779,7 @@ void Application::addAssetToWorldUpload(QString filePath, QString mapping) {
|
|||
qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
|
||||
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
||||
} else {
|
||||
addAssetToWorldSetMapping(filePath, mapping, hash);
|
||||
addAssetToWorldSetMapping(filePath, mapping, hash, isZip, isBlocks);
|
||||
}
|
||||
|
||||
// Remove temporary directory created by Clara.io market place download.
|
||||
|
@ -6787,7 +6796,7 @@ void Application::addAssetToWorldUpload(QString filePath, QString mapping) {
|
|||
upload->start();
|
||||
}
|
||||
|
||||
void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash) {
|
||||
void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash, bool isZip, bool isBlocks) {
|
||||
auto request = DependencyManager::get<AssetClient>()->createSetMappingRequest(mapping, hash);
|
||||
connect(request, &SetMappingRequest::finished, this, [=](SetMappingRequest* request) mutable {
|
||||
if (request->getError() != SetMappingRequest::NoError) {
|
||||
|
@ -6795,9 +6804,10 @@ void Application::addAssetToWorldSetMapping(QString filePath, QString mapping, Q
|
|||
qWarning(interfaceapp) << "Error downloading model: " + errorInfo;
|
||||
addAssetToWorldError(filenameFromPath(filePath), errorInfo);
|
||||
} else {
|
||||
// to prevent files that aren't models from being loaded into world automatically
|
||||
if (filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION) ||
|
||||
filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) {
|
||||
// to prevent files that aren't models or texture files from being loaded into world automatically
|
||||
if ((filePath.toLower().endsWith(OBJ_EXTENSION) || filePath.toLower().endsWith(FBX_EXTENSION)) ||
|
||||
((filePath.toLower().endsWith(JPG_EXTENSION) || filePath.toLower().endsWith(PNG_EXTENSION)) &&
|
||||
((!isBlocks) && (!isZip)))) {
|
||||
addAssetToWorldAddEntity(filePath, mapping);
|
||||
} else {
|
||||
qCDebug(interfaceapp) << "Zipped contents are not supported entity files";
|
||||
|
|
|
@ -322,11 +322,11 @@ public slots:
|
|||
// FIXME: Move addAssetToWorld* methods to own class?
|
||||
void addAssetToWorldFromURL(QString url);
|
||||
void addAssetToWorldFromURLRequestFinished();
|
||||
void addAssetToWorld(QString filePath, QString zipFile, bool isZip, bool isBlocks);
|
||||
void addAssetToWorld(QString filePath, QString zipFile, bool isZip = false, bool isBlocks = false);
|
||||
void addAssetToWorldUnzipFailure(QString filePath);
|
||||
void addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy);
|
||||
void addAssetToWorldUpload(QString filePath, QString mapping);
|
||||
void addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash);
|
||||
void addAssetToWorldWithNewMapping(QString filePath, QString mapping, int copy, bool isZip = false, bool isBlocks = false);
|
||||
void addAssetToWorldUpload(QString filePath, QString mapping, bool isZip = false, bool isBlocks = false);
|
||||
void addAssetToWorldSetMapping(QString filePath, QString mapping, QString hash, bool isZip = false, bool isBlocks = false);
|
||||
void addAssetToWorldAddEntity(QString filePath, QString mapping);
|
||||
|
||||
void handleUnzip(QString sourceFile, QStringList destinationFile, bool autoAdd, bool isZip, bool isBlocks);
|
||||
|
|
|
@ -80,9 +80,13 @@ void Ledger::signedSend(const QString& propertyName, const QByteArray& text, con
|
|||
|
||||
void Ledger::keysQuery(const QString& endpoint, const QString& success, const QString& fail, QJsonObject& requestParams) {
|
||||
auto wallet = DependencyManager::get<Wallet>();
|
||||
requestParams["public_keys"] = QJsonArray::fromStringList(wallet->listPublicKeys());
|
||||
|
||||
send(endpoint, success, fail, QNetworkAccessManager::PostOperation, AccountManagerAuth::Required, requestParams);
|
||||
QStringList cachedPublicKeys = wallet->listPublicKeys();
|
||||
if (!cachedPublicKeys.isEmpty()) {
|
||||
requestParams["public_keys"] = QJsonArray::fromStringList(cachedPublicKeys);
|
||||
send(endpoint, success, fail, QNetworkAccessManager::PostOperation, AccountManagerAuth::Required, requestParams);
|
||||
} else {
|
||||
qDebug(commerce) << "User attempted to call keysQuery, but cachedPublicKeys was empty!";
|
||||
}
|
||||
}
|
||||
|
||||
void Ledger::keysQuery(const QString& endpoint, const QString& success, const QString& fail) {
|
||||
|
@ -296,14 +300,18 @@ void Ledger::updateLocation(const QString& asset_id, const QString location, con
|
|||
emit walletScriptingInterface->walletNotSetup();
|
||||
qDebug(commerce) << "User attempted to update the location of a certificate, but their wallet wasn't ready. Status:" << walletStatus;
|
||||
} else {
|
||||
QStringList keys = wallet->listPublicKeys();
|
||||
QString key = keys[0];
|
||||
QJsonObject transaction;
|
||||
transaction["certificate_id"] = asset_id;
|
||||
transaction["place_name"] = location;
|
||||
QJsonDocument transactionDoc{ transaction };
|
||||
auto transactionString = transactionDoc.toJson(QJsonDocument::Compact);
|
||||
signedSend("transaction", transactionString, key, "location", "updateLocationSuccess", "updateLocationFailure", controlledFailure);
|
||||
QStringList cachedPublicKeys = wallet->listPublicKeys();
|
||||
if (!cachedPublicKeys.isEmpty()) {
|
||||
QString key = cachedPublicKeys[0];
|
||||
QJsonObject transaction;
|
||||
transaction["certificate_id"] = asset_id;
|
||||
transaction["place_name"] = location;
|
||||
QJsonDocument transactionDoc{ transaction };
|
||||
auto transactionString = transactionDoc.toJson(QJsonDocument::Compact);
|
||||
signedSend("transaction", transactionString, key, "location", "updateLocationSuccess", "updateLocationFailure", controlledFailure);
|
||||
} else {
|
||||
qDebug(commerce) << "User attempted to update the location of a certificate, but cachedPublicKeys was empty!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,7 +367,12 @@ void Ledger::alreadyOwned(const QString& marketplaceId) {
|
|||
auto wallet = DependencyManager::get<Wallet>();
|
||||
QString endpoint = "already_owned";
|
||||
QJsonObject request;
|
||||
request["public_keys"] = QJsonArray::fromStringList(wallet->listPublicKeys());
|
||||
request["marketplace_item_id"] = marketplaceId;
|
||||
send(endpoint, "alreadyOwnedSuccess", "alreadyOwnedFailure", QNetworkAccessManager::PutOperation, AccountManagerAuth::Required, request);
|
||||
QStringList cachedPublicKeys = wallet->listPublicKeys();
|
||||
if (!cachedPublicKeys.isEmpty()) {
|
||||
request["public_keys"] = QJsonArray::fromStringList(wallet->listPublicKeys());
|
||||
request["marketplace_item_id"] = marketplaceId;
|
||||
send(endpoint, "alreadyOwnedSuccess", "alreadyOwnedFailure", QNetworkAccessManager::PutOperation, AccountManagerAuth::Required, request);
|
||||
} else {
|
||||
qDebug(commerce) << "User attempted to use the alreadyOwned endpoint, but cachedPublicKeys was empty!";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,6 +138,11 @@ void QmlCommerce::setSoftReset() {
|
|||
wallet->setSoftReset();
|
||||
}
|
||||
|
||||
void QmlCommerce::clearWallet() {
|
||||
auto wallet = DependencyManager::get<Wallet>();
|
||||
wallet->clear();
|
||||
}
|
||||
|
||||
void QmlCommerce::setPassphrase(const QString& passphrase) {
|
||||
auto wallet = DependencyManager::get<Wallet>();
|
||||
wallet->setPassphrase(passphrase);
|
||||
|
|
|
@ -67,6 +67,7 @@ protected:
|
|||
Q_INVOKABLE void setPassphrase(const QString& passphrase);
|
||||
Q_INVOKABLE void changePassphrase(const QString& oldPassphrase, const QString& newPassphrase);
|
||||
Q_INVOKABLE void setSoftReset();
|
||||
Q_INVOKABLE void clearWallet();
|
||||
|
||||
Q_INVOKABLE void buy(const QString& assetId, int cost, const bool controlledFailure = false);
|
||||
Q_INVOKABLE void balance();
|
||||
|
|
|
@ -343,19 +343,23 @@ Wallet::Wallet() {
|
|||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
connect(accountManager.data(), &AccountManager::usernameChanged, this, [&]() {
|
||||
getWalletStatus();
|
||||
_publicKeys.clear();
|
||||
|
||||
if (_securityImage) {
|
||||
delete _securityImage;
|
||||
}
|
||||
_securityImage = nullptr;
|
||||
|
||||
// tell the provider we got nothing
|
||||
updateImageProvider();
|
||||
_passphrase->clear();
|
||||
clear();
|
||||
});
|
||||
}
|
||||
|
||||
void Wallet::clear() {
|
||||
_publicKeys.clear();
|
||||
|
||||
if (_securityImage) {
|
||||
delete _securityImage;
|
||||
}
|
||||
_securityImage = nullptr;
|
||||
|
||||
// tell the provider we got nothing
|
||||
updateImageProvider();
|
||||
_passphrase->clear();
|
||||
}
|
||||
|
||||
Wallet::~Wallet() {
|
||||
if (_securityImage) {
|
||||
delete _securityImage;
|
||||
|
|
|
@ -49,8 +49,9 @@ public:
|
|||
bool getPassphraseIsCached() { return !(_passphrase->isEmpty()); }
|
||||
bool walletIsAuthenticatedWithPassphrase();
|
||||
bool changePassphrase(const QString& newPassphrase);
|
||||
void setSoftReset() { _isOverridingServer = true; }
|
||||
void setSoftReset() { _isOverridingServer = true; }
|
||||
bool wasSoftReset() { bool was = _isOverridingServer; _isOverridingServer = false; return was; }
|
||||
void clear();
|
||||
|
||||
void getWalletStatus();
|
||||
enum WalletStatus {
|
||||
|
|
|
@ -259,7 +259,6 @@ void WindowScriptingInterface::browseAsync(const QString& title, const QString&
|
|||
setPreviousBrowseLocation(QFileInfo(result).absolutePath());
|
||||
}
|
||||
emit browseChanged(result);
|
||||
emit openFileChanged(result); // Deprecated signal; to be removed in due course.
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -179,7 +179,6 @@ public slots:
|
|||
* Prompt the user to choose a file. Displays a non-modal dialog that navigates the directory tree. A
|
||||
* {@link Window.browseChanged|browseChanged} signal is emitted when a file is chosen; no signal is emitted if the user
|
||||
* cancels the dialog.
|
||||
* @deprecated A deprecated {@link Window.openFileChanged|openFileChanged} signal is also emitted when a file is chosen.
|
||||
* @function Window.browseAsync
|
||||
* @param {string} title="" - The title to display at the top of the dialog.
|
||||
* @param {string} directory="" - The initial directory to start browsing at.
|
||||
|
@ -660,15 +659,6 @@ signals:
|
|||
*/
|
||||
void browseChanged(QString filename);
|
||||
|
||||
/**jsdoc
|
||||
* Triggered when the user chooses a file in a {@link Window.browseAsync|browseAsync} dialog.
|
||||
* @function Window.openFileChanged
|
||||
* @deprecated This signal is being replaced with {@link Window.browseChanged|browseChanged} and will be removed.
|
||||
* @param {string} filename - The path and name of the file the user chose in the dialog.
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void openFileChanged(QString filename);
|
||||
|
||||
/**jsdoc
|
||||
* Triggered when the user OKs a {@link Window.promptAsync|promptAsync} dialog.
|
||||
* @function Window.promptTextChanged
|
||||
|
|
|
@ -41,8 +41,10 @@ const QString SETTINGS_CURRENT_ADDRESS_KEY = "address";
|
|||
|
||||
Setting::Handle<QUrl> currentAddressHandle(QStringList() << ADDRESS_MANAGER_SETTINGS_GROUP << "address", DEFAULT_HIFI_ADDRESS);
|
||||
|
||||
QString AddressManager::protocolVersion() {
|
||||
return protocolVersionsSignatureBase64();
|
||||
AddressManager::AddressManager() :
|
||||
_port(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool AddressManager::isConnected() {
|
||||
|
|
|
@ -69,15 +69,6 @@ class AddressManager : public QObject, public Dependency {
|
|||
Q_PROPERTY(QString domainID READ getDomainID)
|
||||
Q_PROPERTY(QString domainId READ getDomainID)
|
||||
public:
|
||||
|
||||
/**jsdoc
|
||||
* Get Interface's protocol version.
|
||||
* @function location.protocolVersion
|
||||
* @returns {string} A string uniquely identifying the version of the metaverse protocol that Interface is using.
|
||||
* @deprecated This function is deprecated and will be removed. Use {@link Window.protocolSignature} instead.
|
||||
*/
|
||||
Q_INVOKABLE QString protocolVersion();
|
||||
|
||||
using PositionGetter = std::function<glm::vec3()>;
|
||||
using OrientationGetter = std::function<glm::quat()>;
|
||||
|
||||
|
|
|
@ -68,6 +68,10 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool
|
|||
if (path.contains("vr.google.com/downloads")) {
|
||||
isZip = true;
|
||||
}
|
||||
if (!hasModel(fileList)) {
|
||||
isZip = false;
|
||||
}
|
||||
|
||||
emit unzipResult(path, fileList, autoAdd, isZip, isBlocks);
|
||||
|
||||
}
|
||||
|
@ -107,6 +111,15 @@ bool FileScriptingInterface::isTempDir(QString tempDir) {
|
|||
return (testContainer == tempContainer);
|
||||
}
|
||||
|
||||
bool FileScriptingInterface::hasModel(QStringList fileList) {
|
||||
for (int i = 0; i < fileList.size(); i++) {
|
||||
if (fileList.at(i).toLower().contains(".fbx") || fileList.at(i).toLower().contains(".obj")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString FileScriptingInterface::getTempDir() {
|
||||
QTemporaryDir dir;
|
||||
dir.setAutoRemove(false);
|
||||
|
|
|
@ -32,6 +32,7 @@ signals:
|
|||
|
||||
private:
|
||||
bool isTempDir(QString tempDir);
|
||||
bool hasModel(QStringList fileList);
|
||||
QStringList unzipFile(QString path, QString tempDir);
|
||||
void recursiveFileScan(QFileInfo file, QString* dirName);
|
||||
void downloadZip(QString path, const QString link);
|
||||
|
|
|
@ -272,17 +272,19 @@ SelectionDisplay = (function() {
|
|||
var STRETCH_SPHERE_OFFSET = 0.06;
|
||||
var STRETCH_SPHERE_CAMERA_DISTANCE_MULTIPLE = 0.01;
|
||||
var STRETCH_MINIMUM_DIMENSION = 0.001;
|
||||
var STRETCH_DIRECTION_ALL_CAMERA_DISTANCE_MULTIPLE = 2;
|
||||
var STRETCH_ALL_MINIMUM_DIMENSION = 0.01;
|
||||
var STRETCH_DIRECTION_ALL_CAMERA_DISTANCE_MULTIPLE = 6;
|
||||
var STRETCH_PANEL_WIDTH = 0.01;
|
||||
|
||||
var SCALE_CUBE_OFFSET = 0.5;
|
||||
var SCALE_CUBE_CAMERA_DISTANCE_MULTIPLE = 0.015;
|
||||
var SCALE_MINIMUM_DIMENSION = 0.02;
|
||||
|
||||
var CLONER_OFFSET = { x:0.9, y:-0.9, z:0.9 };
|
||||
|
||||
var CTRL_KEY_CODE = 16777249;
|
||||
|
||||
var AVATAR_COLLISIONS_OPTION = "Enable Avatar Collisions";
|
||||
|
||||
var TRANSLATE_DIRECTION = {
|
||||
X : 0,
|
||||
Y : 1,
|
||||
|
@ -336,6 +338,8 @@ SelectionDisplay = (function() {
|
|||
|
||||
var ctrlPressed = false;
|
||||
|
||||
var handleStretchCollisionOverride = false;
|
||||
|
||||
var handlePropertiesTranslateArrowCones = {
|
||||
shape: "Cone",
|
||||
solid: true,
|
||||
|
@ -458,12 +462,12 @@ SelectionDisplay = (function() {
|
|||
borderSize: 1.4
|
||||
};
|
||||
var handleScaleLBNCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // (-x, -y, -z)
|
||||
var handleScaleRBNCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // (-x, -y, z)
|
||||
var handleScaleLBFCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // ( x, -y, -z)
|
||||
var handleScaleRBNCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // ( x, -y, -z)
|
||||
var handleScaleLBFCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // (-x, -y, z)
|
||||
var handleScaleRBFCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // ( x, -y, z)
|
||||
var handleScaleLTNCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // (-x, y, -z)
|
||||
var handleScaleRTNCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // (-x, y, z)
|
||||
var handleScaleLTFCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // ( x, y, -z)
|
||||
var handleScaleRTNCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // ( x, y, -z)
|
||||
var handleScaleLTFCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // (-x, y, z)
|
||||
var handleScaleRTFCube = Overlays.addOverlay("cube", handlePropertiesScaleCubes); // ( x, y, z)
|
||||
|
||||
var handlePropertiesScaleEdge = {
|
||||
|
@ -597,6 +601,11 @@ SelectionDisplay = (function() {
|
|||
var activeTool = null;
|
||||
var handleTools = {};
|
||||
|
||||
that.shutdown = function() {
|
||||
that.restoreAvatarCollisionsFromStretch();
|
||||
}
|
||||
Script.scriptEnding.connect(that.shutdown);
|
||||
|
||||
// We get mouseMoveEvents from the handControllers, via handControllerPointer.
|
||||
// But we dont' get mousePressEvents.
|
||||
that.triggerMapping = Controller.newMapping(Script.resolvePath('') + '-click');
|
||||
|
@ -1021,7 +1030,6 @@ SelectionDisplay = (function() {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
if (SelectionManager.hasSelection()) {
|
||||
var position = SelectionManager.worldPosition;
|
||||
var rotation = spaceMode === SPACE_LOCAL ? SelectionManager.localRotation : SelectionManager.worldRotation;
|
||||
|
@ -1147,14 +1155,14 @@ SelectionDisplay = (function() {
|
|||
rotation: scaleCubeRotation,
|
||||
dimensions: scaleCubeDimensions
|
||||
});
|
||||
var scaleRBNCubePosition = { x:-scaleCubeOffsetX, y:-scaleCubeOffsetY, z:scaleCubeOffsetZ };
|
||||
var scaleRBNCubePosition = { x:scaleCubeOffsetX, y:-scaleCubeOffsetY, z:-scaleCubeOffsetZ };
|
||||
scaleRBNCubePosition = Vec3.sum(position, Vec3.multiplyQbyV(rotation, scaleRBNCubePosition));
|
||||
Overlays.editOverlay(handleScaleRBNCube, {
|
||||
position: scaleRBNCubePosition,
|
||||
rotation: scaleCubeRotation,
|
||||
dimensions: scaleCubeDimensions
|
||||
});
|
||||
var scaleLBFCubePosition = { x:scaleCubeOffsetX, y:-scaleCubeOffsetY, z:-scaleCubeOffsetZ };
|
||||
var scaleLBFCubePosition = { x:-scaleCubeOffsetX, y:-scaleCubeOffsetY, z:scaleCubeOffsetZ };
|
||||
scaleLBFCubePosition = Vec3.sum(position, Vec3.multiplyQbyV(rotation, scaleLBFCubePosition));
|
||||
Overlays.editOverlay(handleScaleLBFCube, {
|
||||
position: scaleLBFCubePosition,
|
||||
|
@ -1175,14 +1183,14 @@ SelectionDisplay = (function() {
|
|||
rotation: scaleCubeRotation,
|
||||
dimensions: scaleCubeDimensions
|
||||
});
|
||||
var scaleRTNCubePosition = { x:-scaleCubeOffsetX, y:scaleCubeOffsetY, z:scaleCubeOffsetZ };
|
||||
var scaleRTNCubePosition = { x:scaleCubeOffsetX, y:scaleCubeOffsetY, z:-scaleCubeOffsetZ };
|
||||
scaleRTNCubePosition = Vec3.sum(position, Vec3.multiplyQbyV(rotation, scaleRTNCubePosition));
|
||||
Overlays.editOverlay(handleScaleRTNCube, {
|
||||
position: scaleRTNCubePosition,
|
||||
rotation: scaleCubeRotation,
|
||||
dimensions: scaleCubeDimensions
|
||||
});
|
||||
var scaleLTFCubePosition = { x:scaleCubeOffsetX, y:scaleCubeOffsetY, z:-scaleCubeOffsetZ };
|
||||
var scaleLTFCubePosition = { x:-scaleCubeOffsetX, y:scaleCubeOffsetY, z:scaleCubeOffsetZ };
|
||||
scaleLTFCubePosition = Vec3.sum(position, Vec3.multiplyQbyV(rotation, scaleLTFCubePosition));
|
||||
Overlays.editOverlay(handleScaleLTFCube, {
|
||||
position: scaleLTFCubePosition,
|
||||
|
@ -1236,9 +1244,11 @@ SelectionDisplay = (function() {
|
|||
});
|
||||
|
||||
// UPDATE STRETCH HIGHLIGHT PANELS
|
||||
var scaleLTFCubePositionRotated = Vec3.multiplyQbyV(rotationInverse, scaleLTFCubePosition);
|
||||
var scaleRBFCubePositionRotated = Vec3.multiplyQbyV(rotationInverse, scaleRBFCubePosition);
|
||||
var stretchPanelXDimensions = Vec3.subtract(scaleLTFCubePositionRotated, scaleRBFCubePositionRotated);
|
||||
var scaleRTFCubePositionRotated = Vec3.multiplyQbyV(rotationInverse, scaleRTFCubePosition);
|
||||
var scaleLTNCubePositionRotated = Vec3.multiplyQbyV(rotationInverse, scaleLTNCubePosition);
|
||||
var scaleRTNCubePositionRotated = Vec3.multiplyQbyV(rotationInverse, scaleRTNCubePosition);
|
||||
var stretchPanelXDimensions = Vec3.subtract(scaleRTNCubePositionRotated, scaleRBFCubePositionRotated);
|
||||
var tempY = Math.abs(stretchPanelXDimensions.y);
|
||||
stretchPanelXDimensions.x = STRETCH_PANEL_WIDTH;
|
||||
stretchPanelXDimensions.y = Math.abs(stretchPanelXDimensions.z);
|
||||
|
@ -1249,8 +1259,6 @@ SelectionDisplay = (function() {
|
|||
rotation: rotationZ,
|
||||
dimensions: stretchPanelXDimensions
|
||||
});
|
||||
var scaleLTNCubePositionRotated = Vec3.multiplyQbyV(rotationInverse, scaleLTNCubePosition);
|
||||
var scaleRTFCubePositionRotated = Vec3.multiplyQbyV(rotationInverse, scaleRTFCubePosition);
|
||||
var stretchPanelYDimensions = Vec3.subtract(scaleLTNCubePositionRotated, scaleRTFCubePositionRotated);
|
||||
var tempX = Math.abs(stretchPanelYDimensions.x);
|
||||
stretchPanelYDimensions.x = Math.abs(stretchPanelYDimensions.z);
|
||||
|
@ -1262,9 +1270,7 @@ SelectionDisplay = (function() {
|
|||
rotation: rotationY,
|
||||
dimensions: stretchPanelYDimensions
|
||||
});
|
||||
var scaleRTFCubePositionRotated = Vec3.multiplyQbyV(rotationInverse, scaleRTFCubePosition);
|
||||
var scaleRBNCubePositionRotated = Vec3.multiplyQbyV(rotationInverse, scaleRBNCubePosition);
|
||||
var stretchPanelZDimensions = Vec3.subtract(scaleRTFCubePositionRotated, scaleRBNCubePositionRotated);
|
||||
var stretchPanelZDimensions = Vec3.subtract(scaleLTNCubePositionRotated, scaleRBFCubePositionRotated);
|
||||
var tempX = Math.abs(stretchPanelZDimensions.x);
|
||||
stretchPanelZDimensions.x = Math.abs(stretchPanelZDimensions.y);
|
||||
stretchPanelZDimensions.y = tempX;
|
||||
|
@ -1743,6 +1749,13 @@ SelectionDisplay = (function() {
|
|||
};
|
||||
};
|
||||
|
||||
that.restoreAvatarCollisionsFromStretch = function() {
|
||||
if (handleStretchCollisionOverride) {
|
||||
Menu.setIsOptionChecked(AVATAR_COLLISIONS_OPTION, true);
|
||||
handleStretchCollisionOverride = false;
|
||||
}
|
||||
}
|
||||
|
||||
// TOOL DEFINITION: HANDLE STRETCH TOOL
|
||||
function makeStretchTool(stretchMode, directionEnum, directionVec, pivot, offset, stretchPanel, scaleHandle) {
|
||||
var directionFor3DStretch = directionVec;
|
||||
|
@ -1945,6 +1958,10 @@ SelectionDisplay = (function() {
|
|||
if (scaleHandle != null) {
|
||||
Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE_SELECTED });
|
||||
}
|
||||
if (Menu.isOptionChecked(AVATAR_COLLISIONS_OPTION)) {
|
||||
Menu.setIsOptionChecked(AVATAR_COLLISIONS_OPTION, false);
|
||||
handleStretchCollisionOverride = true;
|
||||
}
|
||||
};
|
||||
|
||||
var onEnd = function(event, reason) {
|
||||
|
@ -1954,11 +1971,12 @@ SelectionDisplay = (function() {
|
|||
if (scaleHandle != null) {
|
||||
Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE });
|
||||
}
|
||||
that.restoreAvatarCollisionsFromStretch();
|
||||
pushCommandForSelections();
|
||||
};
|
||||
|
||||
var onMove = function(event) {
|
||||
var proportional = (spaceMode === SPACE_WORLD) || event.isShifted || directionEnum === STRETCH_DIRECTION.ALL;
|
||||
var proportional = (spaceMode === SPACE_WORLD) || directionEnum === STRETCH_DIRECTION.ALL;
|
||||
|
||||
var position, dimensions, rotation;
|
||||
if (spaceMode === SPACE_LOCAL) {
|
||||
|
@ -1999,10 +2017,10 @@ SelectionDisplay = (function() {
|
|||
vector = grid.snapToSpacing(vector);
|
||||
|
||||
var changeInDimensions = Vec3.multiply(NEGATE_VECTOR, vec3Mult(localSigns, vector));
|
||||
if (directionEnum === STRETCH_DIRECTION.ALL) {
|
||||
var toCameraDistance = getDistanceToCamera(position);
|
||||
var dimensionsMultiple = toCameraDistance * STRETCH_DIRECTION_ALL_CAMERA_DISTANCE_MULTIPLE;
|
||||
changeInDimensions = Vec3.multiply(changeInDimensions, dimensionsMultiple);
|
||||
if (directionEnum === STRETCH_DIRECTION.ALL) {
|
||||
var toCameraDistance = getDistanceToCamera(position);
|
||||
var dimensionsMultiple = toCameraDistance * STRETCH_DIRECTION_ALL_CAMERA_DISTANCE_MULTIPLE;
|
||||
changeInDimensions = Vec3.multiply(changeInDimensions, dimensionsMultiple);
|
||||
}
|
||||
|
||||
var newDimensions;
|
||||
|
@ -2027,9 +2045,11 @@ SelectionDisplay = (function() {
|
|||
newDimensions = Vec3.sum(initialDimensions, changeInDimensions);
|
||||
}
|
||||
|
||||
newDimensions.x = Math.max(newDimensions.x, STRETCH_MINIMUM_DIMENSION);
|
||||
newDimensions.y = Math.max(newDimensions.y, STRETCH_MINIMUM_DIMENSION);
|
||||
newDimensions.z = Math.max(newDimensions.z, STRETCH_MINIMUM_DIMENSION);
|
||||
var minimumDimension = directionEnum === STRETCH_DIRECTION.ALL ? STRETCH_ALL_MINIMUM_DIMENSION :
|
||||
STRETCH_MINIMUM_DIMENSION;
|
||||
newDimensions.x = Math.max(newDimensions.x, minimumDimension);
|
||||
newDimensions.y = Math.max(newDimensions.y, minimumDimension);
|
||||
newDimensions.z = Math.max(newDimensions.z, minimumDimension);
|
||||
|
||||
var changeInPosition = Vec3.multiplyQbyV(rotation, vec3Mult(localDeltaPivot, changeInDimensions));
|
||||
if (directionEnum === STRETCH_DIRECTION.ALL) {
|
||||
|
@ -2089,10 +2109,10 @@ SelectionDisplay = (function() {
|
|||
directionVector = { x:1, y:1, z:1 };
|
||||
selectedHandle = handleScaleLBNCube;
|
||||
} else if (directionEnum === SCALE_DIRECTION.RBN) {
|
||||
directionVector = { x:1, y:1, z:-1 };
|
||||
directionVector = { x:-1, y:1, z:1 };
|
||||
selectedHandle = handleScaleRBNCube;
|
||||
} else if (directionEnum === SCALE_DIRECTION.LBF) {
|
||||
directionVector = { x:-1, y:1, z:1 };
|
||||
directionVector = { x:1, y:1, z:-1 };
|
||||
selectedHandle = handleScaleLBFCube;
|
||||
} else if (directionEnum === SCALE_DIRECTION.RBF) {
|
||||
directionVector = { x:-1, y:1, z:-1 };
|
||||
|
@ -2101,10 +2121,10 @@ SelectionDisplay = (function() {
|
|||
directionVector = { x:1, y:-1, z:1 };
|
||||
selectedHandle = handleScaleLTNCube;
|
||||
} else if (directionEnum === SCALE_DIRECTION.RTN) {
|
||||
directionVector = { x:1, y:-1, z:-1 };
|
||||
directionVector = { x:-1, y:-1, z:1 };
|
||||
selectedHandle = handleScaleRTNCube;
|
||||
} else if (directionEnum === SCALE_DIRECTION.LTF) {
|
||||
directionVector = { x:-1, y:-1, z:1 };
|
||||
directionVector = { x:1, y:-1, z:-1 };
|
||||
selectedHandle = handleScaleLTFCube;
|
||||
} else if (directionEnum === SCALE_DIRECTION.RTF) {
|
||||
directionVector = { x:-1, y:-1, z:-1 };
|
||||
|
|
|
@ -439,8 +439,9 @@ HifiEntityUI.prototype = {
|
|||
|
||||
|
||||
$colPickContainer.colpick({
|
||||
colorScheme: 'dark',
|
||||
layout: 'hex',
|
||||
colorScheme: (group.layoutColorScheme === undefined ? 'dark' : group.layoutColorScheme),
|
||||
layout: (group.layoutType === undefined ? 'hex' : group.layoutType),
|
||||
submit: (group.useSubmitButton === undefined ? true : group.useSubmitButton),
|
||||
color: {
|
||||
r: domArray[0].value,
|
||||
g: domArray[1].value,
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
<link rel="stylesheet" type="text/css" href="../html/css/hifi-style.css">
|
||||
<link rel="stylesheet" type="text/css" href="../html/css/edit-style.css">
|
||||
<link rel="stylesheet" type="text/css" href="../html/css/colpick.css">
|
||||
<link rel="stylesheet" type="text/css" href="particle-style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -236,7 +236,10 @@
|
|||
red: 255,
|
||||
green: 255,
|
||||
blue: 255
|
||||
}
|
||||
},
|
||||
layoutType: "hex",
|
||||
layoutColorScheme: "dark",
|
||||
useSubmitButton: false
|
||||
},
|
||||
{
|
||||
type: "Row"
|
||||
|
@ -249,7 +252,10 @@
|
|||
red: 0,
|
||||
green: 0,
|
||||
blue: 0
|
||||
}
|
||||
},
|
||||
layoutType: "hex",
|
||||
layoutColorScheme: "dark",
|
||||
useSubmitButton: false
|
||||
},
|
||||
{
|
||||
type: "Row"
|
||||
|
@ -262,7 +268,10 @@
|
|||
red: 255,
|
||||
green: 255,
|
||||
blue: 255
|
||||
}
|
||||
},
|
||||
layoutType: "hex",
|
||||
layoutColorScheme: "dark",
|
||||
useSubmitButton: false
|
||||
},
|
||||
{
|
||||
type: "Row"
|
||||
|
@ -275,7 +284,10 @@
|
|||
red: 255,
|
||||
green: 255,
|
||||
blue: 255
|
||||
}
|
||||
},
|
||||
layoutType: "hex",
|
||||
layoutColorScheme: "dark",
|
||||
useSubmitButton: false
|
||||
},
|
||||
{
|
||||
type: "Row"
|
||||
|
|
Loading…
Reference in a new issue