00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef GAMEMAPGUMP_H_INCLUDED
00020 #define GAMEMAPGUMP_H_INCLUDED
00021
00022 #include "Gump.h"
00023 #include <vector>
00024
00025 class ItemSorter;
00026 class CameraProcess;
00027
00028 class GameMapGump : public Gump
00029 {
00030 protected:
00031 ItemSorter *display_list;
00032
00033 public:
00034 ENABLE_RUNTIME_CLASSTYPE();
00035
00036 GameMapGump();
00037 GameMapGump(int x, int y, int w, int h);
00038 virtual ~GameMapGump();
00039
00040 virtual bool Run(const uint32 framenum);
00041
00042 virtual void PaintThis(RenderSurface *surf, sint32 lerp_factor, bool scaled);
00043
00044 void GetCameraLocation(sint32& x, sint32& y, sint32& z,
00045 int lerp_factor=256);
00046
00047
00048 virtual uint16 TraceObjId(int mx, int my);
00049
00050
00051 virtual uint16 TraceCoordinates(int mx, int my, sint32 coords[3],
00052 int offsetx = 0, int offsety = 0,
00053 Item* item = 0);
00054
00055
00056
00057 virtual bool GetLocationOfItem(uint16 itemid, int &gx, int &gy,
00058 sint32 lerp_factor = 256);
00059
00060 virtual bool StartDraggingItem(Item* item, int mx, int my);
00061 virtual bool DraggingItem(Item* item, int mx, int my);
00062 virtual void DraggingItemLeftGump(Item* item);
00063 virtual void StopDraggingItem(Item* item, bool moved);
00064 virtual void DropItem(Item* item, int mx, int my);
00065
00066 virtual Gump * OnMouseDown(int button, int mx, int my);
00067 virtual void OnMouseUp(int button, int mx, int my);
00068 virtual void OnMouseClick(int button, int mx, int my);
00069 virtual void OnMouseDouble(int button, int mx, int my);
00070
00071 void IncSortOrder(int count);
00072
00073 bool loadData(IDataSource* ids, uint32 version);
00074
00075 static void SetHighlightItems(bool highlight) { highlightItems = highlight; }
00076 static bool isHighlightItems() { return highlightItems; }
00077
00078 static void ConCmd_toggleHighlightItems(const Console::ArgvType &argv);
00079 static void ConCmd_dumpMap(const Console::ArgvType &argv);
00080
00081 virtual void RenderSurfaceChanged();
00082
00083 protected:
00084 virtual void saveData(ODataSource* ods);
00085
00086 bool display_dragging;
00087 uint32 dragging_shape;
00088 uint32 dragging_frame;
00089 uint32 dragging_flags;
00090 sint32 dragging_pos[3];
00091
00092 static bool highlightItems;
00093
00094 };
00095
00096 #endif //GameMapGUMP_H_INCLUDED
00097