| 123 | } |
| 124 | |
| 125 | void StateTextureController::notifyChangeScope(std::string_view _scope) |
| 126 | { |
| 127 | if (mControl == nullptr) |
| 128 | return; |
| 129 | |
| 130 | if (_scope == mScopeName) |
| 131 | { |
| 132 | if (!mActivated) |
| 133 | { |
| 134 | mControl->eventChangeValue.connect(this, &StateTextureController::notifyChangeValue); |
| 135 | mControl->clearAll(); |
| 136 | |
| 137 | DataSelectorManager::getInstance() |
| 138 | .getEvent(mParentTypeName) |
| 139 | ->connect(this, &StateTextureController::notifyChangeDataSelector); |
| 140 | mParentData = DataUtility::getSelectedDataByType(mParentTypeName); |
| 141 | notifyChangeDataSelector(mParentData, false); |
| 142 | |
| 143 | mControl->getRoot()->setUserString("CurrentScopeController", mScopeName); |
| 144 | |
| 145 | mActivated = true; |
| 146 | } |
| 147 | } |
| 148 | else |
| 149 | { |
| 150 | if (mActivated) |
| 151 | { |
| 152 | mControl->eventChangeValue.disconnect(this); |
| 153 | |
| 154 | DataSelectorManager::getInstance().getEvent(mParentTypeName)->disconnect(this); |
| 155 | mParentData = nullptr; |
| 156 | |
| 157 | // мы еще владельцы контрола сбрасываем его |
| 158 | std::string_view value = mControl->getRoot()->getUserString("CurrentScopeController"); |
| 159 | if (value == mScopeName) |
| 160 | { |
| 161 | mControl->getRoot()->setUserString("CurrentScopeController", std::string_view{}); |
| 162 | notifyChangeDataSelector(mParentData, false); |
| 163 | |
| 164 | mControl->clearAll(); |
| 165 | } |
| 166 | |
| 167 | mActivated = false; |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | void StateTextureController::updateCoords(std::string_view _value) |
| 173 | { |
nothing calls this directly
no test coverage detected