| 355 | //----------------------------------------------------------------------------- |
| 356 | |
| 357 | void GuiControl::awaken() |
| 358 | { |
| 359 | PROFILE_SCOPE( GuiControl_awaken ); |
| 360 | |
| 361 | #ifdef DEBUG_SPEW |
| 362 | Platform::outputDebugString( "[GuiControl] Waking up %i:%s (%s:%s) awake=%s", |
| 363 | getId(), getClassName(), getName(), getInternalName(), |
| 364 | mAwake ? "true" : "false" ); |
| 365 | #endif |
| 366 | |
| 367 | if( mAwake ) |
| 368 | return; |
| 369 | |
| 370 | // Wake up visible children. |
| 371 | |
| 372 | for( GuiControl::iterator iter = begin(); iter != end(); ++ iter ) |
| 373 | { |
| 374 | GuiControl* ctrl = static_cast< GuiControl* >( *iter ); |
| 375 | |
| 376 | if( ctrl->isVisible() && !ctrl->isAwake() ) |
| 377 | ctrl->awaken(); |
| 378 | } |
| 379 | |
| 380 | if( !mAwake && !onWake() ) |
| 381 | { |
| 382 | Con::errorf( ConsoleLogEntry::General, "GuiControl::awaken: failed onWake for obj: %i:%s (%s)", |
| 383 | getId(), getClassName(), getName() ); |
| 384 | mAwake = false; |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | //----------------------------------------------------------------------------- |
| 389 | |