| 89 | } |
| 90 | |
| 91 | void AnimationViewControl::rebuildAnimations() |
| 92 | { |
| 93 | mAnimation.setTextureName(std::string_view{}); |
| 94 | mAnimation.clearFrames(); |
| 95 | mCurrentFrame = 0; |
| 96 | mTime = 0; |
| 97 | |
| 98 | if (mParentData != nullptr) |
| 99 | { |
| 100 | mAnimation.setTextureName(mParentData->getParent()->getPropertyValue("Texture")); |
| 101 | mAnimation.setSize(mParentData->getParent()->getPropertyValue<MyGUI::IntCoord>("Size").size()); |
| 102 | mAnimation.setRate(mParentData->getPropertyValue<float>("Rate")); |
| 103 | |
| 104 | for (Data::VectorData::const_iterator child = mParentData->getChilds().begin(); |
| 105 | child != mParentData->getChilds().end(); |
| 106 | child++) |
| 107 | { |
| 108 | size_t count = (*child)->getPropertyValue<size_t>("Count"); |
| 109 | MyGUI::IntPoint point = (*child)->getPropertyValue<MyGUI::IntPoint>("Point"); |
| 110 | mAnimation.addFrame(point, count); |
| 111 | } |
| 112 | |
| 113 | if (!mPlay) |
| 114 | updateSelectedFrame(); |
| 115 | } |
| 116 | |
| 117 | mImage->setImageTexture(mAnimation.getTextureName()); |
| 118 | |
| 119 | if (mAnimation.getFrames().empty()) |
| 120 | mImage->setImageCoord(MyGUI::IntCoord()); |
| 121 | else |
| 122 | updateFrame(); |
| 123 | |
| 124 | mFrameInfo->setCaption(MyGUI::utility::toString(mCurrentFrame, " : ", mAnimation.getFrames().size())); |
| 125 | |
| 126 | updateImageCoord(); |
| 127 | } |
| 128 | |
| 129 | void AnimationViewControl::notifyChangeProperty(PropertyPtr _sender) |
| 130 | { |
nothing calls this directly
no test coverage detected