mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
Merge pull request #12823 from druiz17/fix-selection-api
fix enableHighlightList and disableHihglightList function for Selection API
This commit is contained in:
commit
ae0af3ab62
3 changed files with 10 additions and 4 deletions
|
@ -110,6 +110,7 @@ bool SelectionScriptingInterface::enableListHighlight(const QString& listName, c
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(*highlightStyle).isBoundToList()) {
|
if (!(*highlightStyle).isBoundToList()) {
|
||||||
|
enableListToScene(listName);
|
||||||
(*highlightStyle).setBoundToList(true);
|
(*highlightStyle).setBoundToList(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +134,7 @@ bool SelectionScriptingInterface::disableListHighlight(const QString& listName)
|
||||||
auto highlightStyle = _highlightStyleMap.find(listName);
|
auto highlightStyle = _highlightStyleMap.find(listName);
|
||||||
if (highlightStyle != _highlightStyleMap.end()) {
|
if (highlightStyle != _highlightStyleMap.end()) {
|
||||||
if ((*highlightStyle).isBoundToList()) {
|
if ((*highlightStyle).isBoundToList()) {
|
||||||
|
disableListToScene(listName);
|
||||||
}
|
}
|
||||||
|
|
||||||
_highlightStyleMap.erase(highlightStyle);
|
_highlightStyleMap.erase(highlightStyle);
|
||||||
|
@ -476,4 +478,4 @@ QVariantMap SelectionHighlightStyle::toVariantMap() const {
|
||||||
properties["isOutlineSmooth"] = _style._isOutlineSmooth;
|
properties["isOutlineSmooth"] = _style._isOutlineSmooth;
|
||||||
|
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,6 +165,8 @@ public:
|
||||||
* @param listName {string} name of the selection
|
* @param listName {string} name of the selection
|
||||||
* @param highlightStyle {jsObject} highlight style fields (see Selection.getListHighlightStyle for a detailed description of the highlightStyle).
|
* @param highlightStyle {jsObject} highlight style fields (see Selection.getListHighlightStyle for a detailed description of the highlightStyle).
|
||||||
* @returns {bool} true if the selection was successfully enabled for highlight.
|
* @returns {bool} true if the selection was successfully enabled for highlight.
|
||||||
|
*
|
||||||
|
* Note: This function will implicitly call Selection.enableListToScene
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE bool enableListHighlight(const QString& listName, const QVariantMap& highlightStyle);
|
Q_INVOKABLE bool enableListHighlight(const QString& listName, const QVariantMap& highlightStyle);
|
||||||
|
|
||||||
|
@ -175,8 +177,10 @@ public:
|
||||||
* @function Selection.disableListHighlight
|
* @function Selection.disableListHighlight
|
||||||
* @param listName {string} name of the selection
|
* @param listName {string} name of the selection
|
||||||
* @returns {bool} true if the selection was successfully disabled for highlight, false otherwise.
|
* @returns {bool} true if the selection was successfully disabled for highlight, false otherwise.
|
||||||
|
*
|
||||||
|
* Note: This function will implicitly call Selection.disableListToScene
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE bool disableListHighlight(const QString& listName);
|
Q_INVOKABLE bool disableListHighlight(const QString& listName);
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Enable scene selection for the named selection.
|
* Enable scene selection for the named selection.
|
||||||
* If the Selection doesn't exist, it will be created.
|
* If the Selection doesn't exist, it will be created.
|
||||||
|
@ -246,7 +250,7 @@ private:
|
||||||
void setupHandler(const QString& selectionName);
|
void setupHandler(const QString& selectionName);
|
||||||
void removeHandler(const QString& selectionName);
|
void removeHandler(const QString& selectionName);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_SelectionScriptingInterface_h
|
#endif // hifi_SelectionScriptingInterface_h
|
||||||
|
|
|
@ -157,7 +157,7 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
Pointers.removePointer(ray);
|
Pointers.removePointer(laser);
|
||||||
Selection.disableListHighlight(HoveringList)
|
Selection.disableListHighlight(HoveringList)
|
||||||
Selection.removeListFromMap(HoveringList)
|
Selection.removeListFromMap(HoveringList)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue