mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:48:56 +02:00
Merge branch 'parents' of github.com:sethalves/hifi into parents
This commit is contained in:
commit
f94655bce2
4 changed files with 24 additions and 8 deletions
|
@ -33,8 +33,8 @@
|
||||||
const int PREFERENCES_HEIGHT_PADDING = 20;
|
const int PREFERENCES_HEIGHT_PADDING = 20;
|
||||||
|
|
||||||
PreferencesDialog::PreferencesDialog(QWidget* parent) :
|
PreferencesDialog::PreferencesDialog(QWidget* parent) :
|
||||||
QDialog(parent) {
|
QDialog(parent)
|
||||||
|
{
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
@ -48,10 +48,8 @@ PreferencesDialog::PreferencesDialog(QWidget* parent) :
|
||||||
connect(ui.buttonReloadDefaultScripts, &QPushButton::clicked, qApp, &Application::loadDefaultScripts);
|
connect(ui.buttonReloadDefaultScripts, &QPushButton::clicked, qApp, &Application::loadDefaultScripts);
|
||||||
|
|
||||||
connect(ui.buttonChangeAppearance, &QPushButton::clicked, this, &PreferencesDialog::openFullAvatarModelBrowser);
|
connect(ui.buttonChangeAppearance, &QPushButton::clicked, this, &PreferencesDialog::openFullAvatarModelBrowser);
|
||||||
connect(ui.appearanceDescription, &QLineEdit::textChanged, this, [this](const QString& url) {
|
connect(ui.appearanceDescription, &QLineEdit::editingFinished, this, &PreferencesDialog::changeFullAvatarURL);
|
||||||
DependencyManager::get<AvatarManager>()->getMyAvatar()->useFullAvatarURL(url, "");
|
|
||||||
this->fullAvatarURLChanged(url, "");
|
|
||||||
});
|
|
||||||
connect(qApp, &Application::fullAvatarURLChanged, this, &PreferencesDialog::fullAvatarURLChanged);
|
connect(qApp, &Application::fullAvatarURLChanged, this, &PreferencesDialog::fullAvatarURLChanged);
|
||||||
|
|
||||||
// move dialog to left side
|
// move dialog to left side
|
||||||
|
@ -61,6 +59,11 @@ PreferencesDialog::PreferencesDialog(QWidget* parent) :
|
||||||
UIUtil::scaleWidgetFontSizes(this);
|
UIUtil::scaleWidgetFontSizes(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PreferencesDialog::changeFullAvatarURL() {
|
||||||
|
DependencyManager::get<AvatarManager>()->getMyAvatar()->useFullAvatarURL(ui.appearanceDescription->text(), "");
|
||||||
|
this->fullAvatarURLChanged(ui.appearanceDescription->text(), "");
|
||||||
|
}
|
||||||
|
|
||||||
void PreferencesDialog::fullAvatarURLChanged(const QString& newValue, const QString& modelName) {
|
void PreferencesDialog::fullAvatarURLChanged(const QString& newValue, const QString& modelName) {
|
||||||
ui.appearanceDescription->setText(newValue);
|
ui.appearanceDescription->setText(newValue);
|
||||||
const QString APPEARANCE_LABEL_TEXT("Appearance: ");
|
const QString APPEARANCE_LABEL_TEXT("Appearance: ");
|
||||||
|
@ -69,9 +72,17 @@ void PreferencesDialog::fullAvatarURLChanged(const QString& newValue, const QStr
|
||||||
|
|
||||||
void PreferencesDialog::accept() {
|
void PreferencesDialog::accept() {
|
||||||
MyAvatar* myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
MyAvatar* myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||||
|
|
||||||
|
// if there is an attempted change to the full avatar URL, apply it now
|
||||||
|
if (QUrl(ui.appearanceDescription->text()) != myAvatar->getFullAvatarURLFromPreferences()) {
|
||||||
|
changeFullAvatarURL();
|
||||||
|
}
|
||||||
|
|
||||||
_lastGoodAvatarURL = myAvatar->getFullAvatarURLFromPreferences();
|
_lastGoodAvatarURL = myAvatar->getFullAvatarURLFromPreferences();
|
||||||
_lastGoodAvatarName = myAvatar->getFullAvatarModelName();
|
_lastGoodAvatarName = myAvatar->getFullAvatarModelName();
|
||||||
|
|
||||||
savePreferences();
|
savePreferences();
|
||||||
|
|
||||||
close();
|
close();
|
||||||
delete _marketplaceWindow;
|
delete _marketplaceWindow;
|
||||||
_marketplaceWindow = NULL;
|
_marketplaceWindow = NULL;
|
||||||
|
|
|
@ -49,6 +49,7 @@ private slots:
|
||||||
void openFullAvatarModelBrowser();
|
void openFullAvatarModelBrowser();
|
||||||
void openSnapshotLocationBrowser();
|
void openSnapshotLocationBrowser();
|
||||||
void openScriptsLocationBrowser();
|
void openScriptsLocationBrowser();
|
||||||
|
void changeFullAvatarURL();
|
||||||
void fullAvatarURLChanged(const QString& newValue, const QString& modelName);
|
void fullAvatarURLChanged(const QString& newValue, const QString& modelName);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -206,10 +206,13 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties&
|
||||||
// All of parentID, parentJointIndex, position, rotation are needed to make sense of any of them.
|
// All of parentID, parentJointIndex, position, rotation are needed to make sense of any of them.
|
||||||
// If any of these changed, pull any missing properties from the entity.
|
// If any of these changed, pull any missing properties from the entity.
|
||||||
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);
|
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);
|
||||||
if (entity && !scriptSideProperties.parentIDChanged()) {
|
if (!entity) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!scriptSideProperties.parentIDChanged()) {
|
||||||
properties.setParentID(entity->getParentID());
|
properties.setParentID(entity->getParentID());
|
||||||
}
|
}
|
||||||
if (entity && !scriptSideProperties.parentJointIndexChanged()) {
|
if (!scriptSideProperties.parentJointIndexChanged()) {
|
||||||
properties.setParentJointIndex(entity->getParentJointIndex());
|
properties.setParentJointIndex(entity->getParentJointIndex());
|
||||||
}
|
}
|
||||||
if (!scriptSideProperties.localPositionChanged() && !scriptSideProperties.positionChanged()) {
|
if (!scriptSideProperties.localPositionChanged() && !scriptSideProperties.positionChanged()) {
|
||||||
|
|
|
@ -544,6 +544,7 @@ void Model::removeFromScene(std::shared_ptr<render::Scene> scene, render::Pendin
|
||||||
pendingChanges.removeItem(item);
|
pendingChanges.removeItem(item);
|
||||||
}
|
}
|
||||||
_renderItems.clear();
|
_renderItems.clear();
|
||||||
|
_renderItemsSet.clear();
|
||||||
_readyWhenAdded = false;
|
_readyWhenAdded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue