An item container.
More...
#include <itemcontainer.h>
An item container.
Used to show items in inventory and trade dialog.
Definition at line 46 of file itemcontainer.h.
◆ Direction
◆ SelectionState
Enumerator |
---|
SEL_NONE | |
SEL_SELECTED | |
SEL_SELECTING | |
SEL_DESELECTING | |
SEL_DRAGGING | |
Definition at line 133 of file itemcontainer.h.
◆ ItemContainer()
ItemContainer::ItemContainer |
( |
Inventory * |
inventory | ) |
|
Constructor.
Initializes the graphic.
- Parameters
-
Definition at line 46 of file itemcontainer.cpp.
◆ ~ItemContainer()
ItemContainer::~ItemContainer |
( |
| ) |
|
|
override |
◆ addSelectionListener()
void ItemContainer::addSelectionListener |
( |
gcn::SelectionListener * |
listener | ) |
|
|
inline |
Adds a listener to the list that's notified each time a change to the selection occurs.
Definition at line 110 of file itemcontainer.h.
◆ adjustHeight()
void ItemContainer::adjustHeight |
( |
| ) |
|
|
private |
◆ distributeValueChangedEvent()
void ItemContainer::distributeValueChangedEvent |
( |
| ) |
|
|
private |
Sends out selection events to the list of selection listeners.
Definition at line 207 of file itemcontainer.cpp.
◆ draw()
void ItemContainer::draw |
( |
gcn::Graphics * |
graphics | ) |
|
|
override |
◆ drawFrame()
void ItemContainer::drawFrame |
( |
gcn::Graphics * |
graphics | ) |
|
|
inlineoverride |
◆ getItemAt()
Item * ItemContainer::getItemAt |
( |
int |
index | ) |
const |
|
private |
◆ getSelectedItem()
Item * ItemContainer::getSelectedItem |
( |
| ) |
const |
◆ getSlotIndex()
int ItemContainer::getSlotIndex |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
|
private |
Gets the slot index based on the cursor position.
- Parameters
-
x | The X coordinate position. |
y | The Y coordinate position. |
- Returns
- The slot index on success, -1 on failure.
Definition at line 393 of file itemcontainer.cpp.
◆ hidePopup()
void ItemContainer::hidePopup |
( |
| ) |
|
◆ keyAction()
void ItemContainer::keyAction |
( |
| ) |
|
|
private |
Execute all the functionality associated with the action key.
Definition at line 408 of file itemcontainer.cpp.
◆ keyPressed()
void ItemContainer::keyPressed |
( |
gcn::KeyEvent & |
event | ) |
|
|
override |
◆ keyReleased()
void ItemContainer::keyReleased |
( |
gcn::KeyEvent & |
event | ) |
|
|
override |
◆ logic()
void ItemContainer::logic |
( |
| ) |
|
|
override |
Necessary for checking how full the inventory is.
Definition at line 62 of file itemcontainer.cpp.
◆ mouseDragged()
void ItemContainer::mouseDragged |
( |
gcn::MouseEvent & |
event | ) |
|
|
override |
◆ mouseExited()
void ItemContainer::mouseExited |
( |
gcn::MouseEvent & |
event | ) |
|
|
override |
◆ mouseMoved()
void ItemContainer::mouseMoved |
( |
gcn::MouseEvent & |
event | ) |
|
|
override |
◆ mousePressed()
void ItemContainer::mousePressed |
( |
gcn::MouseEvent & |
event | ) |
|
|
override |
◆ mouseReleased()
void ItemContainer::mouseReleased |
( |
gcn::MouseEvent & |
event | ) |
|
|
override |
◆ moveHighlight()
void ItemContainer::moveHighlight |
( |
Direction |
direction | ) |
|
|
private |
Moves the highlight in the direction specified.
- Parameters
-
direction | The move direction of the highlighter. |
Definition at line 449 of file itemcontainer.cpp.
◆ removeSelectionListener()
void ItemContainer::removeSelectionListener |
( |
gcn::SelectionListener * |
listener | ) |
|
|
inline |
Removes a listener from the list that's notified each time a change to the selection occurs.
Definition at line 119 of file itemcontainer.h.
◆ selectNone()
void ItemContainer::selectNone |
( |
| ) |
|
◆ setFilter()
void ItemContainer::setFilter |
( |
const std::string & |
filter | ) |
|
◆ setSelectedIndex()
void ItemContainer::setSelectedIndex |
( |
int |
index | ) |
|
|
private |
◆ widgetResized()
void ItemContainer::widgetResized |
( |
const gcn::Event & |
event | ) |
|
|
override |
◆ mDescItems
bool ItemContainer::mDescItems = false |
|
private |
◆ mDragPosX
int ItemContainer::mDragPosX = 0 |
|
private |
◆ mDragPosY
int ItemContainer::mDragPosY = 0 |
|
private |
◆ mFilter
std::string ItemContainer::mFilter |
|
private |
◆ mFilteredMap
std::map<int, Item*> ItemContainer::mFilteredMap |
|
private |
◆ mGridColumns
int ItemContainer::mGridColumns = 1 |
|
private |
◆ mGridRows
int ItemContainer::mGridRows = 1 |
|
private |
◆ mHighlightedIndex
int ItemContainer::mHighlightedIndex = -1 |
|
private |
◆ mInventory
◆ mItemPopup
◆ mLastUsedSlot
int ItemContainer::mLastUsedSlot = -1 |
|
private |
◆ mSelectedIndex
int ItemContainer::mSelectedIndex = -1 |
|
private |
◆ mSelectionListeners
std::list<gcn::SelectionListener *> ItemContainer::mSelectionListeners |
|
private |
◆ mSelectionStatus
◆ mSwapItems
bool ItemContainer::mSwapItems = false |
|
private |
The documentation for this class was generated from the following files: