/*
Copyright (C) 2001 The Exult Team

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#ifndef FACE_STATS_H
#define FACE_STATS_H

#include "Configuration.h"
#include "Gump.h"

class Actor;
class Portrait_button;

class Face_stats : public Gump {
	UNREPLICATABLE_CLASS_I(Face_stats, Gump(0, 0, 0, 0, SF_GUMPS_VGA))
	// Only allow for one to be made
	static Face_stats   *self;
	static int      mode;
	Face_stats();

	int     party_size;
	Portrait_button *party[8];
	int     npc_nums[8];

	int     resx;
	int     resy;
	int     gamex;
	int     gamey;

	void        create_buttons();
	void        delete_buttons();

	Rectangle   region;

public:
	virtual ~Face_stats();
	// Is a given point on a button?
	virtual Gump_button *on_button(int mx, int my);
	virtual void paint();
	// Don't close on end_gump_mode
	virtual bool is_persistent() const {
		return true;
	}
	// Can't be dragged with mouse
	virtual bool is_draggable() const {
		return false;
	}
	// Show the hand cursor
	virtual bool no_handcursor() const {
		return true;
	}

	virtual Rectangle get_rect() const {
		return region;
	}
	virtual bool has_point(int x, int y) const;

	// add dirty region, if dirty
	virtual void update_gump();

	virtual int add(Game_object *obj, int mx = -1, int my = -1,
	                int sx = -1, int sy = -1, bool dont_check = false,
	                bool combine = false);

	virtual Container_game_object *find_actor(int mx, int my);

	static int get_state() {
		return self ? mode : -1;
	}
	static void CreateGump();
	static void RemoveGump();
	static void AdvanceState();
	static void UpdateButtons();
	static void save_config(Configuration *config);
	static void load_config(Configuration *config);
};


#endif //FACE_STATS_H
