summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/widgets/itemcontainer.cpp77
-rw-r--r--src/gui/widgets/itemcontainer.h12
2 files changed, 0 insertions, 89 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;
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index 65d54f373..14acc6bfb 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -156,18 +156,6 @@ class ItemContainer final : public gcn::Widget,
};
/**
- * Execute all the functionality associated with the action key.
- */
- void keyAction();
-
- /**
- * Moves the highlight in the direction specified.
- *
- * @param direction The move direction of the highlighter.
- */
- void moveHighlight(const Direction direction);
-
- /**
* Sets the currently selected item.
*/
void setSelectedIndex(const int index);