#include <PaperdollGump.h>
Inheritance diagram for PaperdollGump:
Public Member Functions | |
ENABLE_RUNTIME_CLASSTYPE () | |
PaperdollGump () | |
PaperdollGump (Shape *shape, uint32 framenum, uint16 owner, uint32 _Flags=FLAG_DRAGGABLE, sint32 layer=LAYER_NORMAL) | |
virtual | ~PaperdollGump (void) |
virtual void | InitGump (Gump *newparent, bool take_focus=true) |
virtual void | Close (bool no_del=false) |
virtual void | PaintThis (RenderSurface *, sint32 lerp_factor, bool scaled) |
virtual void | ChildNotify (Gump *child, uint32 message) |
virtual uint16 | TraceObjId (int mx, int my) |
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 | DropItem (Item *item, int mx, int my) |
bool | loadData (IDataSource *ids, uint32 version) |
Protected Member Functions | |
virtual void | saveData (ODataSource *ods) |
void | PaintStats (RenderSurface *, sint32 lerp_factor) |
void | PaintStat (RenderSurface *surf, unsigned int n, std::string text, int val) |
Protected Attributes | |
RenderedText * | cached_text [14] |
int | cached_val [7] |
uint16 | statbuttongid |
Definition at line 26 of file PaperdollGump.h.
PaperdollGump::PaperdollGump | ( | ) |
PaperdollGump::~PaperdollGump | ( | void | ) | [virtual] |
This function is used by our children to notifty us of 'something' Think of it as a generic call back function
Reimplemented from Gump.
Definition at line 395 of file PaperdollGump.cpp.
References Gump::BOTTOM_RIGHT, ButtonWidget::BUTTON_CLICK, GUIApp::get_instance(), GUIApp::getDesktopGump(), Object::getObjId(), Gump::InitGump(), and statbuttongid.
void PaperdollGump::Close | ( | bool | no_del = false |
) | [virtual] |
Close the gump
no_del | If true, do not delete after closing |
Reimplemented from ContainerGump.
Definition at line 121 of file PaperdollGump.cpp.
References Item::clearGump(), Gump::Close(), Container::contents, getContainer(), getItem(), and Gump::owner.
Referenced by PaintThis().
bool PaperdollGump::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 ContainerGump.
Definition at line 322 of file PaperdollGump.cpp.
References backpack_rect, Container::CanAddItem(), ContainerGump::display_dragging, ContainerGump::dragging_flags, ContainerGump::dragging_frame, ContainerGump::dragging_shape, ContainerGump::dragging_x, ContainerGump::dragging_y, equipcoords, ShapeInfo::equiptype, getActor(), getContainer(), Actor::getEquip(), Item::getFlags(), Item::getFrame(), Item::getShape(), Item::getShapeInfo(), Pentagram::Rect::h, Pentagram::Rect::InRect(), ContainerGump::itemarea, Gump::owner, Pentagram::Rect::w, equipcoords_struct::x, Pentagram::Rect::x, equipcoords_struct::y, and Pentagram::Rect::y.
void PaperdollGump::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 ContainerGump.
Definition at line 372 of file PaperdollGump.cpp.
References backpack_rect, ContainerGump::display_dragging, ShapeInfo::equiptype, getActor(), getContainer(), Actor::getEquip(), Item::getShapeInfo(), Pentagram::Rect::InRect(), ContainerGump::itemarea, Item::moveToContainer(), Gump::owner, Item::randomGumpLocation(), Pentagram::Rect::x, and Pentagram::Rect::y.
PaperdollGump::ENABLE_RUNTIME_CLASSTYPE | ( | ) |
Reimplemented from ContainerGump.
bool PaperdollGump::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 ContainerGump.
Definition at line 273 of file PaperdollGump.cpp.
References backpack_rect, equipcoords, getItem(), Object::getObjId(), Item::getParentAsContainer(), Item::getShape(), Item::getZ(), ContainerGump::itemarea, Gump::owner, Gump::parent, equipcoords_struct::x, Pentagram::Rect::x, equipcoords_struct::y, and Pentagram::Rect::y.
void PaperdollGump::InitGump | ( | Gump * | newparent, | |
bool | take_focus = true | |||
) | [virtual] |
Init the gump and add it to parent; call after construction When newparent is 0, this will call GUIApp::addGump().
newparent | The Gump's new parent or 0. | |
takefocus | If true, set parent's focus_child to this |
Reimplemented from ContainerGump.
Definition at line 108 of file PaperdollGump.cpp.
References Object::getObjId(), GameData::GUMPS, Gump::InitGump(), ContainerGump::InitGump(), statbuttongid, statbuttonshape, statbuttonx, and statbuttony.
bool PaperdollGump::loadData | ( | IDataSource * | ids, | |
uint32 | version | |||
) |
Reimplemented from ContainerGump.
Definition at line 418 of file PaperdollGump.cpp.
References ContainerGump::loadData(), and statbuttongid.
void PaperdollGump::PaintStat | ( | RenderSurface * | surf, | |
unsigned int | n, | |||
std::string | text, | |||
int | val | |||
) | [protected] |
Paint a single stat.
Definition at line 145 of file PaperdollGump.cpp.
References cached_text, cached_val, RenderedText::draw(), font, FontManager::get_instance(), FontManager::getGameFont(), Pentagram::Font::renderText(), statcoords, statdescfont, statdescwidth, statfont, statheight, statwidth, Pentagram::Font::TEXT_RIGHT, Gump::x, and Gump::y.
Referenced by PaintStats().
void PaperdollGump::PaintStats | ( | RenderSurface * | , | |
sint32 | lerp_factor | |||
) | [protected] |
Paint the stats.
Definition at line 174 of file PaperdollGump.cpp.
References getActor(), Actor::getArmourClass(), Actor::getDex(), Actor::getHP(), Actor::getInt(), Actor::getMana(), Actor::getStr(), Container::getTotalWeight(), Gump::owner, and PaintStat().
Referenced by PaintThis().
void PaperdollGump::PaintThis | ( | RenderSurface * | , | |
sint32 | lerp_factor, | |||
bool | scaled | |||
) | [virtual] |
Overloadable method to Paint just this Gump (RenderSurface is relative to this).
Reimplemented from ContainerGump.
Definition at line 188 of file PaperdollGump.cpp.
References Close(), ContainerGump::display_dragging, ContainerGump::dragging_flags, ContainerGump::dragging_frame, ContainerGump::dragging_shape, ContainerGump::dragging_x, ContainerGump::dragging_y, equipcoords, Item::FLG_FLIPPED, frame, GameData::get_instance(), getActor(), Actor::getEquip(), getItem(), GameData::getMainShapes(), ContainerGump::itemarea, Gump::owner, RenderSurface::Paint(), RenderSurface::PaintInvisible(), PaintStats(), Gump::PaintThis(), Pentagram::Rect::x, equipcoords_struct::x, Pentagram::Rect::y, and equipcoords_struct::y.
void PaperdollGump::saveData | ( | ODataSource * | ods | ) | [protected, virtual] |
save the actual Object data
Reimplemented from ContainerGump.
Definition at line 411 of file PaperdollGump.cpp.
References ContainerGump::saveData(), statbuttongid, and ODataSource::write2().
bool PaperdollGump::StartDraggingItem | ( | Item * | item, | |
int | mx, | |||
int | my | |||
) | [virtual] |
This will be called when an item in this gump starts to be dragged.
Reimplemented from ContainerGump.
Definition at line 300 of file PaperdollGump.cpp.
References frame, GUIApp::get_instance(), Item::getFrame(), Shape::getFrame(), Item::getShape(), Item::getShapeObject(), ShapeFrame::height, GUIApp::setDraggingOffset(), ContainerGump::StartDraggingItem(), ShapeFrame::width, ShapeFrame::xoff, and ShapeFrame::yoff.
uint16 PaperdollGump::TraceObjId | ( | int | mx, | |
int | my | |||
) | [virtual] |
Trace a click, and return ObjId.
Reimplemented from ContainerGump.
Definition at line 231 of file PaperdollGump.cpp.
References backpack_rect, equipcoords, frame, getActor(), Actor::getEquip(), Shape::getFrame(), getItem(), Object::getObjId(), ShapeFrame::hasPoint(), Pentagram::Rect::InRect(), ContainerGump::itemarea, Object::objid, Gump::owner, ItemRelativeGump::ParentToGump(), Gump::TraceObjId(), Pentagram::Rect::x, equipcoords_struct::x, Pentagram::Rect::y, and equipcoords_struct::y.
RenderedText* PaperdollGump::cached_text[14] [protected] |
Definition at line 70 of file PaperdollGump.h.
Referenced by PaintStat(), PaperdollGump(), and ~PaperdollGump().
int PaperdollGump::cached_val[7] [protected] |
uint16 PaperdollGump::statbuttongid [protected] |
Definition at line 73 of file PaperdollGump.h.
Referenced by ChildNotify(), InitGump(), loadData(), PaperdollGump(), and saveData().