void CAudioSource::onEnabled() { restoreInternal(); if (mPlayOnStart) play(); }
void KviDefaultScriptManager::restore() { QString szGlobal, szError, szLocal; g_pApp->getGlobalKvircDirectory(szGlobal, KviApplication::DefScript, "default.kvc"); m_pDialog = new KviDefaultScriptDialog(); if(m_pDialog->exec() == QDialog::Rejected) { delete m_pDialog; return; } // Check data if(!compareVersions(szGlobal, &szError)) { QMessageBox::warning(nullptr, __tr2qs("Restore Default - KVIrc"), szError, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return; } if(m_bNoNeedToRestore) { if(QMessageBox::warning(nullptr, __tr2qs("Restore Default - KVIrc"), szError, QMessageBox::Yes, QMessageBox::No) != QMessageBox::Yes) return; } restoreInternal(); }
bool CAnimation::_togglePreviewMode(bool enabled) { bool isRunning = SceneManager::instance().isRunning(); if(enabled) { // Cannot enable preview while running if (isRunning) return false; if(!mPreviewMode) { // Make sure not to re-enable preview mode if already enabled because it rebuilds the internal Animation // component, changing its ID. If animation evaluation is async then the new ID will not have any animation // attached for one frame. This can look weird when sampling the animation for preview purposes // (e.g. scrubbing in editor), in which case animation will reset to T pose for a single frame before // settling on the chosen frame. restoreInternal(true); mPreviewMode = true; } return true; } else { if (!isRunning) destroyInternal(); mPreviewMode = false; return false; } }
void CAnimation::onEnabled() { if(mPreviewMode) { destroyInternal(); mPreviewMode = false; } if(SceneManager::instance().isRunning()) restoreInternal(false); }
void CCollider::onEnabled() { restoreInternal(); }