Game.cpp 786 B

123456789101112131415161718192021222324252627
  1. #include "Game.h"
  2. #include "Initialisierung.h"
  3. #include "Globals.h"
  4. Game::Game( Bildschirm *zScreen )
  5. : Menu( zScreen )
  6. {
  7. logout = initKnopf( 10, 10, 200, 20, Knopf::Style::Normal, "Verlassen" );
  8. elements.add( logout );
  9. logout->setMausEreignis( [this]( void *p, void *o, MausEreignis me )
  10. {
  11. if( me.id == ME_RLinks )
  12. {
  13. logout->removeStyle( Knopf::Style::Erlaubt );
  14. if( network->leaveGame() )
  15. {
  16. currentGame->release();
  17. currentGame = 0;
  18. hide();
  19. menuRegister->get( "directConnect" )->show();
  20. }
  21. logout->addStyle( Knopf::Style::Erlaubt );
  22. }
  23. return 1;
  24. } );
  25. elements.add( logout );
  26. }