summaryrefslogtreecommitdiff
path: root/src/gui/widgets/itemcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r--src/gui/widgets/itemcontainer.cpp77
1 files changed, 0 insertions, 77 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 38db36e85..217e30735 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -741,83 +741,6 @@ int ItemContainer::getSlotIndex(const int x, const int y) const
return Inventory::NO_SLOT_INDEX;
}
-void ItemContainer::keyAction()
-{
- // If there is no highlight then return.
- if (mHighlightedIndex == -1)
- return;
-
- // If the highlight is on the selected item, then deselect it.
- if (mHighlightedIndex == mSelectedIndex)
- {
- selectNone();
- }
- // Check and swap items if necessary.
- else if (mSwapItems && mSelectedIndex != -1 && mHighlightedIndex != -1)
- {
- Net::getInventoryHandler()->moveItem(
- mSelectedIndex, mHighlightedIndex);
- setSelectedIndex(mHighlightedIndex);
- }
- // If the highlight is on an item then select it.
- else if (mHighlightedIndex != -1)
- {
- setSelectedIndex(mHighlightedIndex);
- mSelectionStatus = SEL_SELECTED;
- }
- // If the highlight is on a blank space then move it.
- else if (mSelectedIndex != -1)
- {
- Net::getInventoryHandler()->moveItem(
- mSelectedIndex, mHighlightedIndex);
- selectNone();
- }
-}
-
-void ItemContainer::moveHighlight(const Direction direction)
-{
- if (mHighlightedIndex == -1)
- {
- if (mSelectedIndex != -1)
- mHighlightedIndex = mSelectedIndex;
- else
- mHighlightedIndex = 0;
- return;
- }
-
- switch (direction)
- {
- case Left:
- if (mHighlightedIndex % mGridColumns == 0)
- mHighlightedIndex += mGridColumns;
- mHighlightedIndex--;
- break;
- case Right:
- if ((mHighlightedIndex % mGridColumns) ==
- (mGridColumns - 1))
- {
- mHighlightedIndex -= mGridColumns;
- }
- mHighlightedIndex++;
- break;
- case Up:
- if (mHighlightedIndex / mGridColumns == 0)
- mHighlightedIndex += (mGridColumns * mGridRows);
- mHighlightedIndex -= mGridColumns;
- break;
- case Down:
- if ((mHighlightedIndex / mGridColumns) ==
- (mGridRows - 1))
- {
- mHighlightedIndex -= (mGridColumns * mGridRows);
- }
- mHighlightedIndex += mGridColumns;
- break;
- default:
- break;
- }
-}
-
void ItemContainer::setFilter(const int tag)
{
mTag = tag;