CreditsGump.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) 2005  The Pentagram Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifndef CREDITSGUMP_H
00020 #define CREDITSGUMP_H
00021 
00022 #include "ModalGump.h"
00023 
00024 class RenderedText;
00025 
00026 class CreditsGump : public ModalGump
00027 {
00028 public:
00029         ENABLE_RUNTIME_CLASSTYPE();
00030 
00031         CreditsGump();
00032         CreditsGump(const std::string& text, int parskip=24,
00033                                 uint32 _Flags = 0, sint32 layer = LAYER_MODAL);
00034         virtual ~CreditsGump(void);
00035 
00036         // Init the gump, call after construction
00037         virtual void InitGump(Gump* newparent, bool take_focus=true);
00038 
00039         // Set a configuration option to true when user watches entire sequence
00040         void SetFlagWhenFinished(std::string configkey_) { configkey=configkey_; }
00041 
00042         virtual void Close(bool no_del = false);
00043 
00044         virtual bool Run(const uint32 framenum);
00045 
00046         // Paint the Gump
00047         virtual void PaintThis(RenderSurface*, sint32 lerp_factor, bool scaled);
00048 
00049         virtual bool OnKeyDown(int key, int mod);
00050 
00051 protected:
00052 
00053         void extractLine(std::string& text, char& modifier, std::string& line);
00054 
00055         std::string text;
00056         int parskip;
00057 
00058         enum CreditsState {
00059                 CS_PLAYING,
00060                 CS_FINISHING,
00061                 CS_CLOSING
00062         } state;
00063 
00064         int timer;
00065 
00066         RenderedText* title;
00067         RenderedText* nexttitle;
00068         int nexttitlesurf;
00069 
00070         RenderSurface* scroll[4];
00071         int scrollheight[4];
00072         int currentsurface;
00073         int currenty;
00074 
00075         std::string configkey;
00076 };
00077 
00078 #endif

Generated on Fri Jul 27 22:27:13 2007 for pentagram by  doxygen 1.4.7