| 89 | } |
| 90 | |
| 91 | void SkinTextureController::notifyChangeScope(std::string_view _scope) |
| 92 | { |
| 93 | if (mControl == nullptr) |
| 94 | return; |
| 95 | |
| 96 | if (_scope == mScopeName) |
| 97 | { |
| 98 | if (!mActivated) |
| 99 | { |
| 100 | mControl->eventChangeValue.connect(this, &SkinTextureController::notifyChangeValue); |
| 101 | mControl->clearAll(); |
| 102 | |
| 103 | DataSelectorManager::getInstance() |
| 104 | .getEvent(mParentTypeName) |
| 105 | ->connect(this, &SkinTextureController::notifyChangeDataSelector); |
| 106 | mParentData = DataUtility::getSelectedDataByType(mParentTypeName); |
| 107 | notifyChangeDataSelector(mParentData, false); |
| 108 | |
| 109 | mControl->getRoot()->setUserString("CurrentScopeController", mScopeName); |
| 110 | |
| 111 | mActivated = true; |
| 112 | } |
| 113 | } |
| 114 | else |
| 115 | { |
| 116 | if (mActivated) |
| 117 | { |
| 118 | mControl->eventChangeValue.disconnect(this); |
| 119 | |
| 120 | DataSelectorManager::getInstance().getEvent(mParentTypeName)->disconnect(this); |
| 121 | mParentData = nullptr; |
| 122 | |
| 123 | // мы еще владельцы контрола сбрасываем его |
| 124 | std::string_view value = mControl->getRoot()->getUserString("CurrentScopeController"); |
| 125 | if (value == mScopeName) |
| 126 | { |
| 127 | mControl->getRoot()->setUserString("CurrentScopeController", std::string_view{}); |
| 128 | notifyChangeDataSelector(mParentData, false); |
| 129 | |
| 130 | mControl->clearAll(); |
| 131 | } |
| 132 | |
| 133 | mActivated = false; |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | void SkinTextureController::updateCoords(std::string_view _value) |
| 139 | { |
nothing calls this directly
no test coverage detected