Game.cpp 757 B

1234567891011121314151617181920212223242526
  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. logout->setMausEreignis( [this]( void *p, void *o, MausEreignis me )
  9. {
  10. if( me.id == ME_RLinks )
  11. {
  12. logout->removeStyle( Knopf::Style::Erlaubt );
  13. if( network->leaveGame() )
  14. {
  15. currentGame->release();
  16. currentGame = 0;
  17. hide();
  18. menuRegister->get( "directConnect" )->show();
  19. }
  20. logout->addStyle( Knopf::Style::Erlaubt );
  21. }
  22. return 1;
  23. } );
  24. elements.add( logout );
  25. }