1 /*
2 Copyright (C) 2000-2013 The Exult Team
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17 */
18 
19 #ifndef MISC_BUTTONS_H
20 #define MISC_BUTTONS_H
21 
22 #include "Gump_button.h"
23 
24 class Actor;
25 
26 /*
27  *  A checkmark for closing its parent:
28  */
29 class Checkmark_button : public Gump_button {
30 public:
31 	Checkmark_button(Gump *par, int px, int py);
clone(Gump * par)32 	Gump_widget *clone(Gump *par) override {
33 		return new Checkmark_button(par, x, y);
34 	}
35 	// What to do when 'clicked':
36 	bool activate(int button = 1) override;
is_checkmark()37 	bool is_checkmark() const override {
38 		return true;
39 	}
40 };
41 
42 /*
43  *  A 'heart' button for bringing up stats.
44  */
45 class Heart_button : public Gump_button {
46 public:
47 	Heart_button(Gump *par, int px, int py);
clone(Gump * par)48 	Gump_widget *clone(Gump *par) override {
49 		return new Heart_button(par, x, y);
50 	}
51 	// What to do when 'clicked':
52 	bool activate(int button = 1) override;
53 };
54 
55 /*
56  *  A diskette for bringing up the 'save' box.
57  */
58 class Disk_button : public Gump_button {
59 public:
60 	Disk_button(Gump *par, int px, int py);
clone(Gump * par)61 	Gump_widget *clone(Gump *par) override {
62 		return new Disk_button(par, x, y);
63 	}
64 	// What to do when 'clicked':
65 	bool activate(int button = 1) override;
66 };
67 
68 /*
69  *  The combat toggle button.
70  */
71 class Combat_button : public Gump_button {
72 public:
73 	Combat_button(Gump *par, int px, int py);
clone(Gump * par)74 	Gump_widget *clone(Gump *par) override {
75 		return new Combat_button(par, x, y);
76 	}
77 	// What to do when 'clicked':
78 	bool activate(int button = 1) override;
79 	void paint() override;
80 };
81 
82 /*
83  *  The halo button.
84  */
85 class Halo_button : public Gump_button {
86 	Actor *actor;           // Who this represents.
87 public:
88 	Halo_button(Gump *par, int px, int py, Actor *a);
clone(Gump * par)89 	Gump_widget *clone(Gump *par) override {
90 		return new Halo_button(par, x, y, actor);
91 	}
92 	// What to do when 'clicked':
93 	bool activate(int button = 1) override;
94 };
95 
96 /*
97  *  Combat mode.  Has 10 frames corresponding to Actor::Attack_mode.
98  */
99 class Combat_mode_button : public Gump_button {
100 	Actor *actor;           // Who this represents.
101 public:
102 	Combat_mode_button(Gump *par, int px, int py, Actor *a);
clone(Gump * par)103 	Gump_widget *clone(Gump *par) override {
104 		return new Combat_mode_button(par, x, y, actor);
105 	}
106 	// What to do when 'clicked':
107 	bool activate(int button = 1) override;
108 };
109 
110 /*
111  *  The Serpent Isle Combat Stats Button
112  */
113 class Cstats_button : public Gump_button {
114 public:
115 	Cstats_button(Gump *par, int px, int py);
clone(Gump * par)116 	Gump_widget *clone(Gump *par) override {
117 		return new Cstats_button(par, x, y);
118 	}
119 
120 	// What to do when 'clicked':
121 	bool activate(int button = 1) override;
122 };
123 
124 #endif
125 
126