////////////////////////////////////////////////////////////////////// // fe_MultiplayerSetup::OnCreate() // \author Logan Jones //////////////////////////////////// \date 7/31/2002 // //==================================================================== // Return: BOOL - // BOOL fe_MultiplayerSetup::OnCreate() { gadget_Button* pButton; gadget_Pic* pPic; BYTE* pBuf = NULL; DWORD Size; // Load the gui file if( bFAILED(LoadGui("Lounge2")) ) return FALSE; // Load the background if( bFAILED(LoadPanel("BattleRoom")) ) return FALSE; // Load up the custom image gaf file Size = theFileTree.DumpFileToBuffer( "anims/Lounge2.gaf", &pBuf ); if( (pBuf!=NULL) && (Size!=0) ) { //if( pButton = (gadget_Button*)GetGadget("SIDEx") ) // gfx->CreateSurfacesFromGAF( pBuf, "SIDEx", 1, 5, SideSurfaces ), // pButton->SetButtonImages( SideSurfaces, SideSurfaces[3], SideSurfaces[4] ), // pButton->SetActive( TRUE ), pButton->SetVisible(TRUE); if( pPic = (gadget_Pic*)GetGadget("battlestart") ) gfx->CreateSurfacesFromGAF( pBuf, "battlestart", 1, 9, m_BattleStartAnim ), pPic->SetFrames( m_BattleStartAnim, 9 ); delete [] pBuf; } // Load up the custom image gaf file Size = theFileTree.DumpFileToBuffer( "anims/Logos.gaf", &pBuf ); if( (pBuf!=NULL) && (Size!=0) ) { gfx->CreateSurfacesFromGAF( pBuf, "32xlogos", 1, 10, m_Logos ); delete [] pBuf; } gadget_ListBox* pBox = (gadget_ListBox*)GetGadget("Output"); pBox->SetSort( FALSE ); pButton = (gadget_Button*)GetGadget("PLAYERx"); m_FirstPos = pButton->GetWndPos(); ResetPlayers(); return TRUE; }
void GameState::DoRestart(void) { // Reset local variables ResetPlayers(); ResetCastleHealth(); AI::Instance()->Init(); // Prepare our array of random perks FillPerksArray(); /* castleDoorLight->Deactivate(); */ currentState = GAME_IN_PROGRESS; // Same as NULL since castle health > 0 lastTransmitSetCastleHealth=-1.0f; timeToNextCastleHealthTransmission=TIME_BETWEEN_CASTLE_HEALTH_TRANSIMSSIONS; gameMessage[0]=0; }