#include <GameMapGump.h>
Inheritance diagram for GameMapGump:
Public Member Functions | |
ENABLE_RUNTIME_CLASSTYPE () | |
GameMapGump () | |
GameMapGump (int x, int y, int w, int h) | |
virtual | ~GameMapGump () |
virtual bool | Run (const uint32 framenum) |
virtual void | PaintThis (RenderSurface *surf, sint32 lerp_factor, bool scaled) |
void | GetCameraLocation (sint32 &x, sint32 &y, sint32 &z, int lerp_factor=256) |
virtual uint16 | TraceObjId (int mx, int my) |
virtual uint16 | TraceCoordinates (int mx, int my, sint32 coords[3], int offsetx=0, int offsety=0, Item *item=0) |
virtual bool | GetLocationOfItem (uint16 itemid, int &gx, int &gy, sint32 lerp_factor=256) |
virtual bool | StartDraggingItem (Item *item, int mx, int my) |
virtual bool | DraggingItem (Item *item, int mx, int my) |
virtual void | DraggingItemLeftGump (Item *item) |
virtual void | StopDraggingItem (Item *item, bool moved) |
virtual void | DropItem (Item *item, int mx, int my) |
virtual Gump * | OnMouseDown (int button, int mx, int my) |
virtual void | OnMouseUp (int button, int mx, int my) |
virtual void | OnMouseClick (int button, int mx, int my) |
virtual void | OnMouseDouble (int button, int mx, int my) |
void | IncSortOrder (int count) |
bool | loadData (IDataSource *ids, uint32 version) |
virtual void | RenderSurfaceChanged () |
Static Public Member Functions | |
static void | SetHighlightItems (bool highlight) |
static bool | isHighlightItems () |
static void | ConCmd_toggleHighlightItems (const Console::ArgvType &argv) |
static void | ConCmd_dumpMap (const Console::ArgvType &argv) |
Protected Member Functions | |
virtual void | saveData (ODataSource *ods) |
Protected Attributes | |
ItemSorter * | display_list |
bool | display_dragging |
uint32 | dragging_shape |
uint32 | dragging_frame |
uint32 | dragging_flags |
sint32 | dragging_pos [3] |
Static Protected Attributes | |
static bool | highlightItems = false |
Definition at line 28 of file GameMapGump.h.
GameMapGump::GameMapGump | ( | ) |
Definition at line 60 of file GameMapGump.cpp.
References display_list.
Referenced by ConCmd_dumpMap().
GameMapGump::GameMapGump | ( | int | x, | |
int | y, | |||
int | w, | |||
int | h | |||
) |
Definition at line 66 of file GameMapGump.cpp.
References Gump::dims, display_list, Pentagram::Rect::h, pout, Pentagram::Rect::w, Pentagram::Rect::x, and Pentagram::Rect::y.
GameMapGump::~GameMapGump | ( | ) | [virtual] |
void GameMapGump::ConCmd_dumpMap | ( | const Console::ArgvType & | argv | ) | [static] |
Definition at line 595 of file GameMapGump.cpp.
References Texture::buffer, Item::clearFlag(), RenderSurface::CreateSecondaryRenderSurface(), PNGWriter::finish(), Item::FLG_INVISIBLE, RenderSurface::format, GameMapGump(), FileSystem::get_instance(), World::get_instance(), World::getCurrentMap(), Item::getFlags(), getMainActor(), RenderSurface::GetSurfaceAsTexture(), PNGWriter::init(), Gump::Paint(), pout, CameraProcess::SetCameraProcess(), Item::setFlag(), RenderSurface::SetOrigin(), CurrentMap::setWholeMapFast(), FileSystem::WriteFile(), PNGWriter::writeRows(), Gump::x, xpos, and Gump::y.
Referenced by GUIApp::GUIApp(), and GUIApp::~GUIApp().
void GameMapGump::ConCmd_toggleHighlightItems | ( | const Console::ArgvType & | argv | ) | [static] |
Definition at line 590 of file GameMapGump.cpp.
References isHighlightItems(), and SetHighlightItems().
Referenced by GUIApp::GUIApp(), and GUIApp::~GUIApp().
bool GameMapGump::DraggingItem | ( | Item * | item, | |
int | mx, | |||
int | my | |||
) | [virtual] |
Called when an item is being dragged over the gump. Note: this may be called on a different gump than StartDraggingItem.
Reimplemented from Gump.
Definition at line 453 of file GameMapGump.cpp.
References Container::CanAddItem(), Item::canExistAt(), Item::canReach(), display_dragging, dragging_flags, dragging_frame, dragging_pos, dragging_shape, GUIApp::get_instance(), getContainer(), GUIApp::getDraggingOffset(), Actor::getEquip(), Item::getFlags(), Item::getFrame(), Item::getLocation(), getMainActor(), Item::getShape(), Actor::getStr(), Item::getThrowRange(), Item::getTotalWeight(), MissileTracker::isPathClear(), GUIApp::MOUSE_TARGET, GUIApp::setMouseCursor(), and TraceCoordinates().
void GameMapGump::DraggingItemLeftGump | ( | Item * | item | ) | [virtual] |
Called when an item that was being dragged over the gump left the gump.
Reimplemented from Gump.
Definition at line 511 of file GameMapGump.cpp.
References display_dragging.
void GameMapGump::DropItem | ( | Item * | item, | |
int | mx, | |||
int | my | |||
) | [virtual] |
Called when an item has been dropped on a gump. This is called after StopDraggingItem has been called, but possibly on a different gump. It's guaranteed that a gump will only receive a DropItem at a location if a DraggingItem there returned true.
Reimplemented from Gump.
Definition at line 527 of file GameMapGump.cpp.
References Item::canReach(), Item::collideMove(), display_dragging, Actor::doAnim(), dragging_pos, Item::fall(), GUIApp::get_instance(), Get_WorldDirection(), getContainer(), Actor::getDex(), GUIApp::getDraggingOffset(), Actor::getEquip(), Item::getLocation(), getMainActor(), Actor::getStr(), Item::getTotalWeight(), MissileTracker::launchItem(), Item::move(), Item::moveToContainer(), pout, Item::randomGumpLocation(), Animation::stand, and TraceCoordinates().
GameMapGump::ENABLE_RUNTIME_CLASSTYPE | ( | ) |
Reimplemented from Gump.
Definition at line 91 of file GameMapGump.cpp.
References CameraProcess::GetCameraLocation(), CameraProcess::GetCameraProcess(), and CameraProcess::GetLerped().
Referenced by drawbox(), drawdot(), drawedge(), PaintThis(), and TraceCoordinates().
bool GameMapGump::GetLocationOfItem | ( | uint16 | itemid, | |
int & | gx, | |||
int & | gy, | |||
sint32 | lerp_factor = 256 | |||
) | [virtual] |
Get the location of an item in the gump (coords relative to this).
Reimplemented from Gump.
Definition at line 256 of file GameMapGump.cpp.
References Item::doLerp(), Kernel::get_instance(), CameraProcess::GetCameraLocation(), CameraProcess::GetCameraProcess(), getItem(), CameraProcess::GetLerped(), Item::getLerped(), Item::getParentAsContainer(), and Item::setupLerp().
Referenced by StartDraggingItem().
void GameMapGump::IncSortOrder | ( | int | count | ) |
Definition at line 430 of file GameMapGump.cpp.
References ItemSorter::DecSortLimit(), display_list, and ItemSorter::IncSortLimit().
Referenced by GUIApp::handleEvent().
static bool GameMapGump::isHighlightItems | ( | ) | [inline, static] |
Definition at line 76 of file GameMapGump.h.
References highlightItems.
Referenced by ConCmd_toggleHighlightItems().
bool GameMapGump::loadData | ( | IDataSource * | ids, | |
uint32 | version | |||
) |
void GameMapGump::OnMouseClick | ( | int | button, | |
int | mx, | |||
int | my | |||
) | [virtual] |
Reimplemented from Gump.
Definition at line 320 of file GameMapGump.cpp.
References Kernel::addProcess(), BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, Item::callUsecodeEvent_look(), Animation::die, Item::dumpInfo(), Item::EXT_HIGHLIGHT, Item::FLG_HANGING, World::get_instance(), Kernel::get_instance(), GUIApp::get_instance(), getActor(), World::getCurrentMap(), getItem(), Item::getLocation(), getMainActor(), UCList::getSize(), UCList::getuint16(), Actor::isInCombat(), pout, Item::setExtFlag(), CurrentMap::surfaceSearch(), TraceObjId(), Gump::x, and Gump::y.
void GameMapGump::OnMouseDouble | ( | int | button, | |
int | mx, | |||
int | my | |||
) | [virtual] |
Reimplemented from Gump.
Definition at line 392 of file GameMapGump.cpp.
References BUTTON_LEFT, BUTTON_RIGHT, Item::canReach(), Item::dumpInfo(), GUIApp::flashCrossCursor(), GUIApp::get_instance(), getItem(), Item::getLocation(), getMainActor(), Actor::isInCombat(), pout, TraceObjId(), Gump::x, and Gump::y.
Gump * GameMapGump::OnMouseDown | ( | int | button, | |
int | mx, | |||
int | my | |||
) | [virtual] |
Reimplemented from Gump.
Definition at line 291 of file GameMapGump.cpp.
References BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, GUIApp::get_instance(), GUIApp::getAvatarMoverProcess(), Gump::GumpToScreenSpace(), AvatarMoverProcess::OnMouseDown(), and Gump::ParentToGump().
void GameMapGump::OnMouseUp | ( | int | button, | |
int | mx, | |||
int | my | |||
) | [virtual] |
Reimplemented from Gump.
Definition at line 312 of file GameMapGump.cpp.
References BUTTON_LEFT, BUTTON_RIGHT, GUIApp::get_instance(), GUIApp::getAvatarMoverProcess(), and AvatarMoverProcess::OnMouseUp().
void GameMapGump::PaintThis | ( | RenderSurface * | surf, | |
sint32 | lerp_factor, | |||
bool | scaled | |||
) | [virtual] |
Overloadable method to Paint just this Gump (RenderSurface is relative to this).
Reimplemented from Gump.
Definition at line 106 of file GameMapGump.cpp.
References ItemSorter::AddItem(), ItemSorter::BeginDisplayList(), display_dragging, display_list, dragging_flags, dragging_frame, dragging_pos, dragging_shape, Item::EXT_TRANSPARENT, CameraProcess::FindRoof(), Item::FLG_INVISIBLE, GUIApp::get_instance(), Kernel::get_instance(), World::get_instance(), GetCameraLocation(), CameraProcess::GetCameraProcess(), World::getCurrentMap(), Item::getFootpadWorld(), Kernel::getFrameNum(), getItem(), CurrentMap::getItemList(), Item::getLocation(), getMainActor(), Item::getZ(), highlightItems, CurrentMap::isChunkFast(), GUIApp::isPaintEditorItems(), CurrentMap::isValidPosition(), and ItemSorter::PaintDisplayList().
void GameMapGump::RenderSurfaceChanged | ( | ) | [virtual] |
Reimplemented from Gump.
Definition at line 740 of file GameMapGump.cpp.
References Gump::dims, Gump::GetDims(), Pentagram::Rect::h, Gump::parent, Gump::RenderSurfaceChanged(), Pentagram::Rect::w, Pentagram::Rect::x, and Pentagram::Rect::y.
bool GameMapGump::Run | ( | const uint32 | framenum | ) | [virtual] |
Run the gump
Reimplemented from Gump.
Definition at line 83 of file GameMapGump.cpp.
References Gump::Run().
void GameMapGump::saveData | ( | ODataSource * | ods | ) | [protected, virtual] |
save the actual Object data
Reimplemented from Gump.
Definition at line 757 of file GameMapGump.cpp.
static void GameMapGump::SetHighlightItems | ( | bool | highlight | ) | [inline, static] |
Definition at line 75 of file GameMapGump.h.
References highlightItems.
Referenced by ConCmd_toggleHighlightItems().
bool GameMapGump::StartDraggingItem | ( | Item * | item, | |
int | mx, | |||
int | my | |||
) | [virtual] |
This will be called when an item in this gump starts to be dragged.
Reimplemented from Gump.
Definition at line 436 of file GameMapGump.cpp.
References Item::canDrag(), Item::canReach(), GUIApp::get_instance(), GetLocationOfItem(), getMainActor(), Object::getObjId(), and GUIApp::setDraggingOffset().
void GameMapGump::StopDraggingItem | ( | Item * | item, | |
bool | moved | |||
) | [virtual] |
Called when a drag operation finished. This is called on the same gump that received StartDraggingItem
moved | If true, the item was actually dragged somewhere else. If false, the drag was cancelled. |
Reimplemented from Gump.
Definition at line 517 of file GameMapGump.cpp.
References display_dragging, and Item::grab().
uint16 GameMapGump::TraceCoordinates | ( | int | mx, | |
int | my, | |||
sint32 | coords[3], | |||
int | offsetx = 0 , |
|||
int | offsety = 0 , |
|||
Item * | item = 0 | |||
) | [virtual] |
Definition at line 203 of file GameMapGump.cpp.
References display_list, GetCameraLocation(), Item::getFootpadWorld(), getItem(), Item::getLocation(), ItemSorter::Trace(), ItemSorter::X_FACE, ItemSorter::Y_FACE, and ItemSorter::Z_FACE.
Referenced by DraggingItem(), DropItem(), and AvatarMoverProcess::jump().
uint16 GameMapGump::TraceObjId | ( | int | mx, | |
int | my | |||
) | [virtual] |
Trace a click, and return ObjId.
Reimplemented from Gump.
Definition at line 194 of file GameMapGump.cpp.
References display_list, highlightItems, Object::objid, Gump::ParentToGump(), ItemSorter::Trace(), and Gump::TraceObjId().
Referenced by OnMouseClick(), and OnMouseDouble().
bool GameMapGump::display_dragging [protected] |
Definition at line 86 of file GameMapGump.h.
Referenced by DraggingItem(), DraggingItemLeftGump(), DropItem(), PaintThis(), and StopDraggingItem().
ItemSorter* GameMapGump::display_list [protected] |
Definition at line 31 of file GameMapGump.h.
Referenced by GameMapGump(), IncSortOrder(), PaintThis(), TraceCoordinates(), TraceObjId(), and ~GameMapGump().
uint32 GameMapGump::dragging_flags [protected] |
uint32 GameMapGump::dragging_frame [protected] |
sint32 GameMapGump::dragging_pos[3] [protected] |
Definition at line 90 of file GameMapGump.h.
Referenced by DraggingItem(), DropItem(), and PaintThis().
uint32 GameMapGump::dragging_shape [protected] |
bool GameMapGump::highlightItems = false [static, protected] |
Definition at line 92 of file GameMapGump.h.
Referenced by isHighlightItems(), PaintThis(), SetHighlightItems(), and TraceObjId().