Showing the changes to interface/src/scripting/SelectionScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -77,11 +77,36 @@ bool SelectionScriptingInterface::clearSelectedItemsList(const QString& listName · 76 unmodified lines | ||
| 77 | 77 | return true; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | −bool SelectionScriptingInterface::enableListHighlight(const QString& listName, const QVariantMap& highlightStyle) { | |
| 80 | +bool SelectionScriptingInterface::enableListHighlight(const QString& listName, const QVariantMap& highlightStyleValues) { | |
| 81 | + auto highlightStyle = _highlightedListMap.value(listName); | |
| 82 | + if (!highlightStyle.isBoundToList()) { | |
| 83 | + GameplayObjects currentList = _selectedItemsListMap.value(listName); | |
| 84 | + if (!currentList.getContainsData()) { | |
| 85 | + _selectedItemsListMap.insert(listName, currentList); | |
| 86 | + } | |
| 87 | + } | |
| 88 | + | |
| 89 | + highlightStyle.fromVariantMap(highlightStyleValues); | |
| 90 | + highlightStyle.setBoundToList(true); | |
| 91 | + | |
| 92 | + _highlightedListMap.insert(listName, highlightStyle); | |
| 93 | + | |
| 94 | + | |
| 95 | + emit selectedItemsListChanged(listName); | |
| 81 | 96 | return true; |
| 82 | 97 | } |
| 83 | 98 | |
| 84 | 99 | bool SelectionScriptingInterface::disableListHighlight(const QString& listName) { |
| 100 | + auto highlightStyle = _highlightedListMap.find(listName); | |
| 101 | + if (highlightStyle != _highlightedListMap.end()) { | |
| 102 | + if ((*highlightStyle).isBoundToList()) { | |
| 103 | + GameplayObjects currentList = _selectedItemsListMap.value(listName); | |
| 104 | + if (currentList.getContainsData()) { | |
| 105 | + } | |
| 106 | + _highlightedListMap.erase(highlightStyle); | |
| 107 | + } | |
| 108 | + } | |
| 109 | + | |
| 85 | 110 | return true; |
| 86 | 111 | } |
| 87 | 112 | |
| @@ -211,3 +236,11 @@ void SelectionToSceneHandler::updateSceneFromSelectedList() { · 123 unmodified lines | ||
| 211 | 236 | qWarning() << "SelectionToSceneHandler::updateRendererSelectedList(), Unexpected null scene, possibly during application shutdown"; |
| 212 | 237 | } |
| 213 | 238 | } |
| 239 | + | |
| 240 | + | |
| 241 | +bool SelectionHighlightStyle::fromVariantMap(const QVariantMap& properties) { | |
| 242 | + return true; | |
| 243 | +} | |
| 244 | +QVariantMap SelectionHighlightStyle::toVariantMap() const { | |
| 245 | + return QVariantMap(); | |
| 246 | +} | |