/* $Id: creditswindow.cpp,v 1.2 2005/11/30 21:36:06 chfreund Exp $ */ #include "creditswindow.hpp" #include "textarea.h" CreditsWindow::CreditsWindow() { m_content = new WidgetComposite(); VerticalLayout* layout = new VerticalLayout( m_content ); m_content->setLayout( layout ); SDL_Color black = {0, 0, 0, 0}; TextArea* area = new TextArea( 540, 320 ); area->setFont( "tahoma.ttf", 16 ); area->setColor( black ); area->appendLine( "WoP: Wörms of Prey" ); area->appendLine( "" ); area->appendLine( "(C) 2004-2005 Uwe Fabricius, Thomas Pohl and Christoph Freundl" ); area->appendLine( "" ); area->appendLine( "WoP comes with ABSOLUTELY NO WARRANTY." ); area->appendLine( "" ); area->appendText( "This is free software, and you are welcome to redistribute it " "under certain conditions; see the file LICENSE that comes with this distribution." ); area->appendLine( "" ); area->appendText( "Intro tune by dK (http://www.endk.com) - original soundtrack of " "\"Lost in the Underflow\" by Radiant (http://www.pouet.net/prod.php?which=12246). " "Thanks to Team17 for the permission to use the original Worms(TM) sounds." ); area->appendLine( "" ); m_content->add( area ); m_backButton = new TextButton( "Back" ); m_backButton->setHighlightable( true ); m_backButton->addActionListener( this ); m_backButton->setMinWidth( 540 ); m_content->add( m_backButton ); setTitle( "Credits" ); setWidget( m_content ); } void CreditsWindow::actionPerformed( Uint32 cmd, void* source ) { if ( source == m_backButton && cmd == Button::BUTTON_PRESSED ) { fireAction( BACK_PRESSED, this ); } } bool CreditsWindow::handleEvent( SDL_Event* event ) { if ( event->type == SDL_KEYDOWN ) { if ( event->key.keysym.sym == SDLK_ESCAPE ) { fireAction( BACK_PRESSED, this ); return true; } } return WopWindow::handleEvent( event ); }