//-------------------------------------------------------------- void Animation::M_zeroAll() { mp_script = 0; mp_obj = 0; m_isAutoClear = true; mp_UIcanvas = 0; mp_UIcanvas01 = 0; mp_UIVolumeTh = 0; m_volValuesMeanTh = 0.5f; mp_lblVolValues = 0; mp_teConfigName = 0; mp_togglePitchBound = 0; mp_UIPitch = 0; m_bHandlePitch = false; m_bPitchBound = false; m_pitchLast = 0.0f; m_bPitchManual = false; m_pitchManualValue = 0.0f; m_isColor = false; m_isColorFromDevice = false; m_bResetOnEnter = false; setDrawBackground(true); }
//------------------------------------------------------------------------- MapWidget::MapWidget( int x, int y, int width, int height, Widget* parentPtr ) //------------------------------------------------------------------------- : Widget( x, y, width, height, parentPtr ), mViewport( NULL ) { setDrawBackground( false ); }
//! Reads attributes of the element void CGUITab::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) { IGUITab::deserializeAttributes(in,options); setNumber(in->getAttributeAsInt("TabNumber")); setDrawBackground(in->getAttributeAsBool("DrawBackground")); setBackgroundColor(in->getAttributeAsColor("BackColor")); if (Parent && Parent->getType() == EGUIET_TAB_CONTROL) { ((CGUITabControl*)Parent)->addTab(this); if (isVisible()) ((CGUITabControl*)Parent)->setActiveTab(this); } }
Label::Label(int x, int y, int width, int height, Widget* parent) : Widget(x, y, width, height, parent), mustCalcStrSize(true), caption(""), font(NULL), autoSizeX(false), autoSizeY(false), multiLine(false), horizontalAlignment(HA_LEFT), verticalAlignment(VA_TOP) { if(!font) { this->font = Engine::getSingleton().getDefaultFont(); } else { this->font = font; } //calcStrSize(); setDrawBackground(); setBackgroundColor(0xffff00ff); }
void MainMenu::update() { if ( bDrawBackground || MPlayer || LogisticsData::instance->isSingleMission() ) { getButton( MM_MSG_SAVE )->disable( true ); } else getButton( MM_MSG_SAVE )->disable( false ); getButton( MM_MSG_MULTIPLAYER )->disable( true ); if ( introMovie ) { userInput->mouseOff(); if (userInput->getKeyDown(KEY_SPACE) || userInput->getKeyDown(KEY_ESCAPE) || userInput->getKeyDown(KEY_LMOUSE)) { introMovie->stop(); } bool result = introMovie->update(); if (result) { //Movie's Over. //Whack it. delete introMovie; introMovie = NULL; } return; } if (!musicStarted) { musicStarted = true; soundSystem->setMusicVolume( prefs.MusicVolume ); soundSystem->playDigitalMusic(tuneId); } if ( endAnim.isDone() ) { status = endResult; } if ( bDrawMechlopedia ) { mechlopedia->update(); if ( mechlopedia->getStatus() == NEXT ) { beginFadeIn( 0 ); bDrawMechlopedia = 0; if ( !bDrawBackground ) status = NEXT; } return; } if ( bOptions ) { OptionsScreenWrapper::status_type result = optionsScreenWrapper->update(); if (result == OptionsScreenWrapper::opt_DONE) { optionsScreenWrapper->end(); bOptions = 0; } return; } if ( (bSave || bLoad || bLoadCampaign) && endAnim.isDone() ) { LogisticsSaveDialog::instance()->update(); if ( LogisticsSaveDialog::instance()->getStatus() == LogisticsScreen::YES && LogisticsSaveDialog::instance()->isDone() ) { char name[1024]; strcpy( name, savePath ); strcat( name, LogisticsSaveDialog::instance()->getFileName() ); int index = strlen( name ) - 4; if ( _stricmp( &name[index], ".fit" ) !=0 ) strcat( name, ".fit" ); FitIniFile file; if ( bSave ) { // make sure the save game directory exists, if not create it CreateDirectory( savePath, NULL ); if ( NO_ERR != file.createWithCase( name ) ) { char errorStr[1024]; sprintf( errorStr, "couldn't open the file %s", name ); Assert( 0, 0, errorStr ); } else { LogisticsData::instance->save( file ); LogisticsSaveDialog::instance()->end(); file.close(); } bSave = bLoad = 0; status = NEXT; } else if ( bLoadCampaign ) { LogisticsData::instance->startNewCampaign( LogisticsSaveDialog::instance()->getFileName()); status = endResult = RESTART; // background.beginFadeOut( 1.0f ); // beginFadeOut( 1.0f ); bLoadCampaign = 0; } else { if ( NO_ERR != file.open( name ) ) { char errorStr[1024]; sprintf( errorStr, "couldn't open the file %s", name ); Assert( 0, 0, errorStr ); } else LogisticsData::instance->load( file ); LogisticsSaveDialog::instance()->end(); bSave = bLoad = 0; status = RESTART; file.close(); } } else if ( LogisticsSaveDialog::instance()->getStatus() == LogisticsScreen::NO && LogisticsSaveDialog::instance()->isDone()) { LogisticsSaveDialog::instance()->end(); bSave = bLoad = bLoadCampaign = 0 ; if ( !bDrawBackground ) status = NEXT; else { beginAnim.begin(); endAnim.end(); } } return; } else if ( bLoadSingle && endAnim.isDone()) { singleLoadDlg.update(); if ( singleLoadDlg.isDone() ) { if ( singleLoadDlg.getStatus() == YES ) { const char* pName = singleLoadDlg.getMapFileName(); if (pName) { LogisticsData::instance->setSingleMission( pName ); status = SKIPONENEXT; } } bLoadSingle = 0; beginAnim.begin(); endAnim.end(); } } else if ( promptToQuit ) { LogisticsOKDialog::instance()->update(); { if ( LogisticsOKDialog::instance()->getStatus() == LogisticsScreen::YES ) { soundSystem->playDigitalSample( LOG_EXITGAME ); gos_TerminateApplication(); promptToQuit = 0; } else if ( LogisticsOKDialog::instance()->getStatus() == LogisticsScreen::NO) { if ( LogisticsOKDialog::instance()->isDone() ) promptToQuit = 0; } } } else if ( bLegal ) { LogisticsLegalDialog::instance()->update(); if ( LogisticsLegalDialog::instance()->isDone() ) { LogisticsLegalDialog::instance()->end(); bLegal = 0; } } else if ( bHostLeftDlg ) { LogisticsOneButtonDialog::instance()->update(); if ( LogisticsOneButtonDialog::instance()->isDone() ) { LogisticsOneButtonDialog::instance()->end(); bHostLeftDlg = 0; } if ( MPlayer ) // has to be done, but can't be done when initialized { MPlayer->closeSession(); delete MPlayer; MPlayer = NULL; } } else if ( promptToDisconnect ) { LogisticsOKDialog::instance()->update(); if ( LogisticsOKDialog::instance()->isDone() ) { if ( YES == LogisticsOKDialog::instance()->getStatus() ) { if ( MPlayer ) { MPlayer->closeSession(); delete MPlayer; MPlayer = NULL; } long oldRes = endResult; endResult = 0; handleMessage( oldRes, oldRes ); setDrawBackground( true ); } else handleMessage( NEXT, NEXT ); promptToDisconnect = 0; } } else { if ( bDrawBackground ) { if ( !intro.animObjects[0].isDone() ) { intro.update(); background.update(); if (userInput->getKeyDown(KEY_ESCAPE) || (Environment.Renderer == 3)) { introOver = true; userInput->mouseOn(); soundSystem->playDigitalSample( LOG_MAINMENUBUTTON ); } else if ( !introOver ) return; } else { background.update(); if ( !introOver ) soundSystem->playDigitalSample( LOG_MAINMENUBUTTON ); introOver = true; userInput->mouseOn(); } } beginAnim.update(); endAnim.update(); LogisticsScreen::update(); if ( (!bLoadSingle) && userInput->isLeftClick() && !inside( userInput->getMouseX(), userInput->getMouseY() ) ) { handleMessage( 0, MM_MSG_RETURN_TO_GAME ); } } }
//-------------------------------------------------------------- void AnimationLinesFF::VM_enter() { setDrawBackground(); if (m_bResetOnEnter) deleteElements(); }
//-------------------------------------------------------------- void AnimationParticlesMega2::VM_enter() { setDrawBackground(); }