Showing the changes to interface/src/scripting/SelectionScriptingInterface.cpp (1 of 3 files). Show all
Unified · Split
| @@ -80,6 +80,20 @@ bool SelectionScriptingInterface::clearSelectedItemsList(const QString& listName · 79 unmodified lines | |||
| 80 | return true; | 80 | return true; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | QStringList SelectionScriptingInterface::getListNames() const { | ||
| 84 | QStringList list; | ||
| 85 | QReadLocker lock(&_selectionListsLock); | ||
| 86 | list = _selectedItemsListMap.keys(); | ||
| 87 | return list; | ||
| 88 | } | ||
| 89 | |||
| 90 | QStringList SelectionScriptingInterface::getHighlightedListNames() const { | ||
| 91 | QStringList list; | ||
| 92 | QReadLocker lock(&_highlightStylesLock); | ||
| 93 | list = _highlightStyleMap.keys(); | ||
| 94 | return list; | ||
| 95 | } | ||
| 96 | |||
| 83 | bool SelectionScriptingInterface::enableListHighlight(const QString& listName, const QVariantMap& highlightStyleValues) { | 97 | bool SelectionScriptingInterface::enableListHighlight(const QString& listName, const QVariantMap& highlightStyleValues) { |
| 84 | QWriteLocker lock(&_highlightStylesLock); | 98 | QWriteLocker lock(&_highlightStylesLock); |
| 85 | 99 | ||
| @@ -146,14 +160,6 @@ QVariantMap SelectionScriptingInterface::getListHighlightStyle(const QString& li · 60 unmodified lines | |||
| 146 | } | 160 | } |
| 147 | } | 161 | } |
| 148 | 162 | ||
| 149 | |||
| 150 | QStringList SelectionScriptingInterface::getHighlightStyles() const { | ||
| 151 | QStringList list; | ||
| 152 | QReadLocker lock(&_highlightStylesLock); | ||
| 153 | list = _highlightStyleMap.keys(); | ||
| 154 | return list; | ||
| 155 | } | ||
| 156 | |||
| 157 | render::HighlightStyle SelectionScriptingInterface::getHighlightStyle(const QString& listName) const { | 163 | render::HighlightStyle SelectionScriptingInterface::getHighlightStyle(const QString& listName) const { |
| 158 | QReadLocker lock(&_highlightStylesLock); | 164 | QReadLocker lock(&_highlightStylesLock); |
| 159 | auto highlightStyle = _highlightStyleMap.find(listName); | 165 | auto highlightStyle = _highlightStyleMap.find(listName); |
| @@ -234,6 +240,43 @@ void SelectionScriptingInterface::printList(const QString& listName) { · 74 unmodified lines | |||
| 234 | } | 240 | } |
| 235 | } | 241 | } |
| 236 | 242 | ||
| 243 | QVariantMap SelectionScriptingInterface::getSelectedItemsList(const QString& listName) const { | ||
| 244 | QReadLocker lock(&_selectionListsLock); | ||
| 245 | QVariantMap list; | ||
| 246 | auto currentList = _selectedItemsListMap.find(listName); | ||
| 247 | if (currentList != _selectedItemsListMap.end()) { | ||
| 248 | if ((*currentList).getContainsData()) { | ||
| 249 | |||
| 250 | if (!(*currentList).getAvatarIDs().empty()) { | ||
| 251 | QList<QUuid> avatarIDs = QList<QUuid>::fromVector(QVector<QUuid>::fromStdVector((*currentList).getAvatarIDs())); | ||
| 252 | list["avatars"].fromValue( avatarIDs); | ||
| 253 | } | ||
| 254 | if (!(*currentList).getEntityIDs().empty()) { | ||
| 255 | // QList<EntityItemID> entityIDs = QList<EntityItemID>::fromVector(QVector<EntityItemID>::fromStdVector((*currentList).getEntityIDs())); | ||
| 256 | QList<QVariant> entityIDs; | ||
| 257 | for (auto j : (*currentList).getEntityIDs()) { | ||
| 258 | entityIDs.push_back( j ); | ||
| 259 | } | ||
| 260 | list["entities"] = (entityIDs); | ||
| 261 | } | ||
| 262 | if (!(*currentList).getOverlayIDs().empty()) { | ||
| 263 | QList<OverlayID> overlayIDs = QList<OverlayID>::fromVector(QVector<OverlayID>::fromStdVector((*currentList).getOverlayIDs())); | ||
| 264 | list["overlays"].fromValue(overlayIDs); | ||
| 265 | } | ||
| 266 | |||
| 267 | return list; | ||
| 268 | } | ||
| 269 | else { | ||
| 270 | //qDebug() << "List named " << listName << " empty"; | ||
| 271 | return list; | ||
| 272 | } | ||
| 273 | } | ||
| 274 | else { | ||
| 275 | // qDebug() << "List named " << listName << " doesn't exist."; | ||
| 276 | return list; | ||
| 277 | } | ||
| 278 | } | ||
| 279 | |||
| 237 | bool SelectionScriptingInterface::removeListFromMap(const QString& listName) { | 280 | bool SelectionScriptingInterface::removeListFromMap(const QString& listName) { |
| 238 | bool removed = false; | 281 | bool removed = false; |
| 239 | { | 282 | { |