00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _PAPERDOLL_GUMP_H_
00020 #define _PAPERDOLL_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 Cstats_button;
00029 class Combat_mode_button;
00030
00031
00032
00033
00034
00035 class Paperdoll_gump : public Gump
00036 {
00037 public:
00038 enum Object_type
00039 {
00040 OT_Normal = 0,
00041 OT_Single = 1,
00042 OT_Double = 2,
00043 OT_Staff = 3,
00044 OT_Bow = 4,
00045 OT_Crossbow = 5,
00046 OT_Shield = 6,
00047 OT_Helm = 7,
00048 OT_Musket = 8
00049 };
00050
00051
00052 struct Paperdoll_item
00053 {
00054 int world_shape;
00055 int world_frame;
00056 int spot;
00057
00058 Object_type type;
00059
00060 bool gender;
00061
00062 ShapeFile file;
00063 int shape;
00064 int frame;
00065 int frame2;
00066 int frame3;
00067 int frame4;
00068 };
00069
00070
00071 struct Paperdoll_npc
00072 {
00073 int npc_shape;
00074 bool is_female;
00075 ShapeFile file;
00076
00077
00078 int body_shape;
00079 int body_frame;
00080
00081 int head_shape;
00082 int head_frame;
00083 int head_frame_helm;
00084
00085 int arms_shape;
00086 int arms_frame;
00087 int arms_frame_2h;
00088 int arms_frame_staff;
00089 };
00090
00091 private:
00092 UNREPLICATABLE_CLASS(Paperdoll_gump);
00093
00094 protected:
00095
00096
00097
00098
00099 static Paperdoll_npc Characters[];
00100 static Paperdoll_item Items[];
00101
00102
00103 static Paperdoll_npc Characters_BG[];
00104 static Paperdoll_item Items_BG[];
00105
00106 static short coords[36];
00107 static short coords_blue[36];
00108 static short shapes_blue[36];
00109 static short coords_hot[36];
00110
00111 static short diskx, disky;
00112 static short heartx, hearty;
00113 static short combatx, combaty;
00114 static short cstatx, cstaty;
00115 static short halox, haloy;
00116 static short cmodex, cmodey;
00117
00118 static short bodyx, bodyy;
00119 static short headx, heady;
00120 static short beltfx, beltfy;
00121 static short neckfx, neckfy;
00122 static short beltmx, beltmy;
00123 static short neckmx, neckmy;
00124 static short legsx, legsy;
00125 static short feetx, feety;
00126 static short handsx, handsy;
00127 static short lhandx, lhandy;
00128 static short rhandx, rhandy;
00129 static short ahandx, ahandy;
00130 static short ammox, ammoy;
00131
00132 static short backfx, backfy;
00133 static short backmx, backmy;
00134 static short back2fx, back2fy;
00135 static short back2mx, back2my;
00136 static short shieldfx, shieldfy;
00137 static short shieldmx, shieldmy;
00138
00139
00140
00141
00142 Heart_button *heart_button;
00143 Disk_button *disk_button;
00144 Combat_button *combat_button;
00145 Cstats_button *cstats_button;
00146 Halo_button *halo_button;
00147 Combat_mode_button *cmode_button;
00148
00149
00150
00151
00152
00153 static int spotx(int i) { return coords[2*i]; }
00154 static int spoty(int i) { return coords[2*i + 1]; }
00155
00156
00157
00158
00159 int find_closest(int mx, int my, int only_empty = 0);
00160
00161
00162 void set_to_spot(Game_object *obj, int index);
00163
00164 public:
00165
00166
00167
00168 inline static bool IsObjectAllowed(int shape, int frame, int spot)
00169 { return GetItemInfo(shape, frame, spot)!=NULL?true:false; }
00170
00171 inline static int GetFaceShape(int shape, int frame, int spot)
00172 { return GetItemInfo(shape, frame, spot)!=NULL?true:false; }
00173
00174 inline static bool IsNPCFemale(int shape)
00175 { return GetCharacterInfo(shape)?GetCharacterInfoSafe(shape)->is_female:true; }
00176
00177
00178 static Paperdoll_npc *GetCharacterInfoSafe(int shape);
00179 static Paperdoll_npc *GetCharacterInfo(int shape);
00180 static Paperdoll_item *GetItemInfo(int shape, int frame = -1, int spot = -1);
00181
00182
00183
00184 Paperdoll_gump(Container_game_object *cont, int initx, int inity,
00185 int shnum);
00186
00187 ~Paperdoll_gump();
00188
00189
00190 virtual Gump_button *on_button(int mx, int my);
00191
00192
00193 virtual Game_object *find_object(int mx, int my);
00194
00195
00196 virtual int add(Game_object *obj, int mx = -1, int my = -1,
00197 int sx = -1, int sy = -1, bool dont_check = false,
00198 bool combine = false);
00199
00200
00201 virtual void paint();
00202
00203
00204
00205
00206
00207
00208
00209 void paint_object(const Rectangle &box, Paperdoll_npc *info, int spot,
00210 int sx, int sy, int frame = 0, int itemtype = -1, int checkspot = -1, int checktype = -1);
00211
00212
00213 void paint_object_arms(const Rectangle &box, Paperdoll_npc *info, int spot,
00214 int sx, int sy, int start = 0, int itemtype = -1);
00215
00216
00217 void paint_body (const Rectangle &box, Paperdoll_npc *info);
00218 void paint_belt (const Rectangle &box, Paperdoll_npc *info);
00219 void paint_head (const Rectangle &box, Paperdoll_npc *info);
00220 void paint_arms (const Rectangle &box, Paperdoll_npc *info);
00221
00222
00223 Object_type get_arm_type (void);
00224
00225
00226
00227
00228
00229
00230
00231 Game_object *check_object (int mx, int my, Paperdoll_npc *info, int spot,
00232 int sx, int sy, int frame = 0, int itemtype = -1, int checkspot = -1, int checktype = -1);
00233
00234
00235
00236 Game_object *check_object_arms (int mx, int my, Paperdoll_npc *info, int spot,
00237 int sx, int sy, int start = 0, int itemtype = -1);
00238
00239
00240 bool check_body (int mx, int my, Paperdoll_npc *info);
00241 bool check_belt (int mx, int my, Paperdoll_npc *info);
00242 bool check_head (int mx, int my, Paperdoll_npc *info);
00243 bool check_arms (int mx, int my, Paperdoll_npc *info);
00244
00245
00246 bool check_shape (int px, int py, int shape, int frame, ShapeFile file);
00247
00248 virtual Container_game_object *find_actor(int mx, int my);
00249 };
00250
00251 #endif