MCPcopy Create free account
hub / github.com/MyGUI/mygui / updateFrames

Method updateFrames

Tools/SkinEditor/SeparatorTextureController.cpp:186–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 8

getChildSelectedMethod · 0.80
setCoordValueMethod · 0.80
clearCoordValueMethod · 0.80
setViewSelectorsMethod · 0.80
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected