NodeHitbox::~NodeHitbox() { if (mNodeTarget) { mNodeTarget->release(); } removeListeners(this); }
void ofxSimpleGuiToo::setDraw(bool b) { if(doDraw != b) { doDraw = b; if(doDraw) addListeners(); else removeListeners(); if(doAutoSave) saveToXML(); } }
void FboMaskManager::update(){ if(!hasAutoloaded){ editing = false; if(autoload){ mask.load(loadPath); drawToFboBlending(); } hasAutoloaded = true; } //if(drawToOutputs){ // drawToFboBlending(); // drawToOutputs = false; // } if (_editing != editing) { _editing = editing; if (_editing) { addListeners(); } else { removeListeners(); } } if(editing){ if(!blankOutput){ blankOutput = true; drawToFboBlending(); } if(hideMouseWhileEditing){ ofHideCursor(); } else { ofShowCursor(); } if(load){ mask.load(loadPath); load = false; } if(save){ mask.save(loadPath); save = false; } } else { ofShowCursor(); if(blankOutput){ blankOutput = false; drawToFboBlending(); } } }
void StoreScreen::setStore(game::Store *store) { if (mStore) { removeListeners(mStore); } mStore = store; if (mStore) { addListeners(mStore); } setStoreInventoryIndex(0); }
ofxColorPicker :: ~ofxColorPicker() { try // this is a safe guard for a small bug in OF when removing events when the app quits. { removeListeners(); colorWheel.disableMouseEvents(); colorScaleBar.disableMouseEvents(); } catch( Poco::SystemException ) { // do nothing. } }
void PropertiesPanel::setVocabulary( Vocabulary* vocab ) { removeListeners(); editedVocab = vocab; mainLayout->setContentsMargins( 8, 8, 8, 8 ); descriptionMultiLineEdit->setText( editedVocab->getDescription() ); authorField->setText( editedVocab->getAuthor() ); creationDateValueLabel->setText( editedVocab->getCreationDate().toString() ); modificationDateValueLabel->setText( editedVocab->getModificationDate().toString() ); updateCounters(); addListeners(); }
void PropertiesPanel::setFolder( Folder* folder ) { removeListeners(); editedFolder = folder; mainLayout->setContentsMargins( 0, 0, 0, 0 ); descriptionMultiLineEdit->setText( editedFolder->getDescription() ); authorField->setText( editedFolder->getAuthor() ); creationDateValueLabel->setText( editedFolder->getCreationDate().toString() ); modificationDateValueLabel->setText( editedFolder->getModificationDate().toString() ); updateCounters(); addListeners(); }
void ofxSimpleGuiToo::setDraw(bool b) { if(doDraw != b) { doDraw = b; if(doDraw){ addListeners(); //mark: enable current page if(currentPage >= 0 & currentPage < pages.size()){ pages[currentPage]->enable(); } } else { //mark: disable all pages for(int i=0; i<pages.size(); i++) pages[i]->disable(); removeListeners(); } if(doAutoSave) saveToXML(); } }
void LmGameManager::runNextInteraction() { //if its the last interactionscene the app finished if (m_iIndexInteractionScene >= m_aInteractionSceneOfTheGame.size()) { CCLOG("END"); Director::getInstance()->end(); } else { //if yes we need to init the scene if (!m_bBackToDashboard) { //we pass the local user if (!m_aInteractionSceneOfTheGame.at(m_iIndexInteractionScene)->init( m_pUser1)) { CCLOG("Interaction scene init failed"); } } //enable the back button of the interaction because it was disable before the back action (LmInteractionScene::backToDashboard) m_aInteractionSceneOfTheGame.at(m_iIndexInteractionScene)->setBBackPressed( false); CCLOG("pushscene"); removeListeners(true); Director::getInstance()->pushScene( TransitionFade::create(s_fTimeBetweenLmLayer, m_aInteractionSceneOfTheGame.at( m_iIndexInteractionScene))); //it was a back if (m_bBackToDashboard) { m_aInteractionSceneOfTheGame.at(m_iIndexInteractionScene)->restart(); } } }
void LightningManager::remove() { if (!mCreated) { return; } for(Ogre::uint32 k = 0; k < mLightnings.size(); k++) { delete mLightnings.at(k); mVClouds->getSceneManager()->destroySceneNode(mSceneNodes.at(k)); } mLightnings.clear(); mSceneNodes.clear(); removeListeners(); mVolCloudsLightningMaterial.setNull(); mLightningMaterial.setNull(); mCreated = false; }
Menu::~Menu(void){ // Remove the listeners removeListeners(); }
void Menu::hide(){ visible = false; removeListeners(); }
bool LmGameManager::init() { if (!m_pLmServerManager->init()) { CCLOG("Initialization Server Manager failed"); return false; } //init splashscreen if (!initSplashScreen()) { CCLOG("Initialization splash screen failed"); return false; } //get the vector of scene through the serverManager and indicate if it's for child or parent m_aInteractionSceneOfTheGame = m_pLmServerManager->getInteractionSceneOfTheGame( m_pUser1->isBParent()); //init callback method of the custom event (use to know when an interactionScene want to communicate with this) auto InteractionSceneFinished = [=](EventCustom * event) { //TODO //check if t's done and win etc and update sprite (for now its everytime done) m_aSpritesInteractions.at(m_iIndexInteractionScene)->setTexture("Ludomuse/GUIElements/interactionDone.png"); m_iInteractionDone++; //update index m_iIndexInteractionScene++; //update label of dashboard updateDashboard(); //it's not a back to dashboard m_bBackToDashboard=false; //reset touch enable removeListeners(false); }; auto BackToDashboard = [=](EventCustom * event) { m_bBackToDashboard=true; //reset touch enable removeListeners(false); }; //add the custom event to the event dispatcher Director::getInstance()->getEventDispatcher()->addCustomEventListener( "InteractionSceneFinished", InteractionSceneFinished); Director::getInstance()->getEventDispatcher()->addCustomEventListener( "BackToDashboard", BackToDashboard); return true; }