Actor_gump.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2000 The Exult Team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (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 _ACTOR_GUMP_H_
00020 #define _ACTOR_GUMP_H_
00021 
00022 #include "Gump.h"
00023 
00024 class Heart_button;
00025 class Disk_button;
00026 class Combat_button;
00027 class Halo_button;
00028 class Combat_mode_button;
00029 
00030 /*
00031  *  A rectangular area showing a character and his/her possessions:
00032  */
00033 class Actor_gump : public Gump
00034 {
00035   UNREPLICATABLE_CLASS(Actor_gump);
00036 
00037 protected:
00038   Heart_button *heart_button;// For bringing up stats.
00039   Disk_button *disk_button; // For bringing up 'save' box.
00040   Combat_button *combat_button;
00041   Halo_button *halo_button;
00042   Combat_mode_button *cmode_button;
00043   static short coords[24];  // Coords. of where to draw things,
00044           //   indexed by spot # (0-11).
00045   static int spotx(int i) { return coords[2*i]; }
00046   static int spoty(int i) { return coords[2*i + 1]; }
00047           // Find index of closest spot.
00048   int find_closest(int mx, int my, int only_empty = 0);
00049   void set_to_spot(Game_object *obj, int index);
00050   static short diskx, disky;  // Where to show 'diskette' button.
00051   static short heartx, hearty;  // Where to show 'stats' button.
00052   static short combatx, combaty;  // Combat button.
00053   static short halox, haloy;  // "Protected" halo.
00054   static short cmodex, cmodey;  // Combat mode.
00055 
00056 public:
00057   Actor_gump(Container_game_object *cont, int initx, int inity, 
00058                 int shnum);
00059   ~Actor_gump();
00060           // Is a given point on a button?
00061   virtual Gump_button *on_button(int mx, int my);
00062           // Add object.
00063   virtual int add(Game_object *obj, int mx = -1, int my = -1,
00064       int sx = -1, int sy = -1, bool dont_check = false,
00065             bool combine = false);
00066           // Paint it and its contents.
00067   virtual void paint();
00068 
00069   virtual Container_game_object *find_actor(int mx, int my);
00070 };
00071 
00072 #endif

Generated on Mon Jul 9 14:42:46 2007 for ExultEngine by  doxygen 1.5.1