| 184 | } |
| 185 | |
| 186 | void SeparatorTextureController::updateFrames() |
| 187 | { |
| 188 | mFrames.clear(); |
| 189 | |
| 190 | if (mParentData != nullptr) |
| 191 | { |
| 192 | DataPtr selected = mParentData->getChildSelected(); |
| 193 | for (Data::VectorData::const_iterator child = mParentData->getChilds().begin(); |
| 194 | child != mParentData->getChilds().end(); |
| 195 | child++) |
| 196 | { |
| 197 | if ((*child)->getType()->getName() != mThisType) |
| 198 | continue; |
| 199 | |
| 200 | bool visible = (*child)->getPropertyValue<bool>("Visible"); |
| 201 | int offset = (*child)->getPropertyValue<int>("Offset"); |
| 202 | |
| 203 | std::string name = (*child)->getPropertyValue("Name"); |
| 204 | MyGUI::IntCoord value = getCoordByName(name, offset); |
| 205 | ScopeTextureControl::SelectorType type = getTypeByName(name); |
| 206 | |
| 207 | if (selected == *child) |
| 208 | { |
| 209 | if (visible) |
| 210 | mControl->setCoordValue(value, type); |
| 211 | else |
| 212 | mControl->clearCoordValue(); |
| 213 | } |
| 214 | else |
| 215 | { |
| 216 | if (visible) |
| 217 | { |
| 218 | mFrames.emplace_back(value, type); |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | if (selected == nullptr) |
| 224 | { |
| 225 | mControl->clearCoordValue(); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | if (mControl != nullptr) |
| 230 | mControl->setViewSelectors(mFrames); |
| 231 | } |
| 232 | |
| 233 | ScopeTextureControl::SelectorType SeparatorTextureController::getTypeByName(std::string_view _name) |
| 234 | { |
nothing calls this directly
no test coverage detected