| 28 | |
| 29 | |
| 30 | void MessageBoxFadeControl::notifyFrameStart(float _time) |
| 31 | { |
| 32 | const float coef = 1; |
| 33 | |
| 34 | bool visible = MessageBoxManager::getInstance().hasAny(); |
| 35 | |
| 36 | if (visible) |
| 37 | { |
| 38 | if (!mMainWidget->getVisible()) |
| 39 | { |
| 40 | mMainWidget->setVisible(true); |
| 41 | mMainWidget->setAlpha(0); |
| 42 | } |
| 43 | else |
| 44 | { |
| 45 | float alpha = mMainWidget->getAlpha(); |
| 46 | if (alpha < mMaxAlpha) |
| 47 | { |
| 48 | alpha += _time * coef; |
| 49 | if (alpha > mMaxAlpha) |
| 50 | alpha = mMaxAlpha; |
| 51 | mMainWidget->setAlpha(alpha); |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | else |
| 56 | { |
| 57 | if (mMainWidget->getVisible()) |
| 58 | { |
| 59 | float alpha = mMainWidget->getAlpha(); |
| 60 | alpha -= _time * coef; |
| 61 | if (alpha <= 0) |
| 62 | { |
| 63 | mMainWidget->setVisible(false); |
| 64 | } |
| 65 | else |
| 66 | { |
| 67 | mMainWidget->setAlpha(alpha); |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | } |
nothing calls this directly
no test coverage detected