History

drafting the interface

Sam Gateau committed 8 years ago

Commit fc53c261 parent 02c60c42 files · +41 −2Browse files

Showing the changes to interface/src/scripting/SelectionScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/scripting/SelectionScriptingInterface.cpp+34−1
@@ -77,11 +77,36 @@ bool SelectionScriptingInterface::clearSelectedItemsList(const QString& listName · 76 unmodified lines
7777 return true;
7878 }
7979
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);
8196 return true;
8297 }
8398
8499 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+
85110 return true;
86111 }
87112
@@ -211,3 +236,11 @@ void SelectionToSceneHandler::updateSceneFromSelectedList() { · 123 unmodified lines
211236 qWarning() << "SelectionToSceneHandler::updateRendererSelectedList(), Unexpected null scene, possibly during application shutdown";
212237 }
213238 }
239+
240+
241+bool SelectionHighlightStyle::fromVariantMap(const QVariantMap& properties) {
242+ return true;
243+}
244+QVariantMap SelectionHighlightStyle::toVariantMap() const {
245+ return QVariantMap();
246+}