00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef EQUIPMENTWINDOW_H
00023 #define EQUIPMENTWINDOW_H
00024 
00025 #include "gui/widgets/window.h"
00026 
00027 #include <guichan/actionlistener.hpp>
00028 
00029 class Equipment;
00030 class Inventory;
00031 class Item;
00032 class ItemPopup;
00033 
00039 class EquipmentWindow : public Window, public gcn::ActionListener
00040 {
00041     public:
00045 #ifdef TMWSERV_SUPPORT
00046         EquipmentWindow(Equipment *equipment);
00047 #else
00048         EquipmentWindow();
00049 #endif
00050 
00054         ~EquipmentWindow();
00055 
00059         void draw(gcn::Graphics *graphics);
00060 
00061         void action(const gcn::ActionEvent &event);
00062 
00063         void mousePressed(gcn::MouseEvent& mouseEvent);
00064 
00065 #ifdef TMWSERV_SUPPORT
00066         enum EquipmentSlots
00067         {
00068             EQUIP_TORSO_SLOT = 0,
00069             EQUIP_ARMS_SLOT = 1,
00070             EQUIP_HEAD_SLOT = 2,
00071             EQUIP_LEGS_SLOT = 3,
00072             EQUIP_FEET_SLOT = 4,
00073             EQUIP_RING1_SLOT = 5,
00074             EQUIP_RING2_SLOT = 6,
00075             EQUIP_NECKLACE_SLOT = 7,
00076             EQUIP_FIGHT1_SLOT = 8,
00077             EQUIP_FIGHT2_SLOT = 9,
00078             EQUIP_PROJECTILE_SLOT = 10,
00079             EQUIP_VECTOREND
00080         };
00081 #else
00082         enum EquipmentSlots
00083         {
00084             EQUIP_LEGS_SLOT = 0,
00085             EQUIP_FIGHT1_SLOT,
00086             EQUIP_GLOVES_SLOT,
00087             EQUIP_RING2_SLOT,
00088             EQUIP_RING1_SLOT,
00089             EQUIP_FIGHT2_SLOT,
00090             EQUIP_FEET_SLOT,
00091             EQUIP_CAPE_SLOT,
00092             EQUIP_HEAD_SLOT,
00093             EQUIP_TORSO_SLOT,
00094             EQUIP_AMMO_SLOT,
00095             EQUIP_VECTOREND
00096         };
00097 #endif
00098 
00099     private:
00100         void mouseExited(gcn::MouseEvent &event);
00101         void mouseMoved(gcn::MouseEvent &event);
00102 
00103         Item *getItem(int x, int y) const;
00104 
00105         Equipment *mEquipment;
00106 #ifdef EATHENA_SUPPORT
00107         Inventory *mInventory;
00108 #endif
00109 
00113         struct EquipBox
00114         {
00115             int posX;
00116             int posY;
00117         };
00118 
00119         EquipBox mEquipBox[EQUIP_VECTOREND];    
00121         ItemPopup *mItemPopup;
00122 
00123         int mSelected;                          
00124 };
00125 
00126 extern EquipmentWindow *equipmentWindow;
00127 
00128 #endif