00001 /* 00002 Copyright (C) 2001 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 PARTY_PORTRAIT_H 00020 #define PARTY_PORTRAIT_H 00021 00022 #include "Configuration.h" 00023 #include "Gump.h" 00024 00025 class Actor; 00026 class Portrait_button; 00027 00028 class Face_stats : public Gump 00029 { 00030 // Only allow for one to be made 00031 static Face_stats *self; 00032 static int mode; 00033 Face_stats(); 00034 00035 int party_size; 00036 Portrait_button *party[8]; 00037 int npc_nums[8]; 00038 00039 int resx; 00040 int resy; 00041 00042 bool has_changed(); 00043 void create_buttons(); 00044 void delete_buttons(); 00045 00046 Rectangle region; 00047 00048 public: 00049 virtual ~Face_stats(); 00050 // Is a given point on a button? 00051 virtual Gump_button *on_button(int mx, int my); 00052 virtual void paint(); 00053 // Don't close on end_gump_mode 00054 virtual bool is_persistent() const { return true; } 00055 // Can't be dragged with mouse 00056 virtual bool is_draggable() const { return false; } 00057 // Show the hand cursor 00058 virtual bool no_handcursor() const { return true; } 00059 00060 virtual Rectangle get_rect() { return region; } 00061 virtual bool has_point(int x, int y); 00062 00063 // add dirty region, if dirty 00064 virtual void update_gump(); 00065 00066 virtual int add(Game_object *obj, int mx = -1, int my = -1, 00067 int sx = -1, int sy = -1, bool dont_check = false, 00068 bool combine = false); 00069 00070 virtual Container_game_object *find_actor(int mx, int my); 00071 00072 static int get_state() { 00073 return self ? mode : -1; 00074 } 00075 static void CreateGump(); 00076 static void RemoveGump(); 00077 static void AdvanceState(); 00078 static void save_config(Configuration *config); 00079 static void load_config(Configuration *config); 00080 }; 00081 00082 00083 #endif //PARTY_PORTRAIT