summaryrefslogtreecommitdiff
path: root/src/gui/widgets/itemcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-18 15:29:59 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-19 15:12:20 +0300
commit255facfa0c5c272e6f9416eb74c184ff615e2c07 (patch)
treefb15effa7613b180d91c9b7d441e12214cf01f25 /src/gui/widgets/itemcontainer.cpp
parent128f88cf592a3dadf7580201e4ff3f7509c1f7a6 (diff)
downloadplus-255facfa0c5c272e6f9416eb74c184ff615e2c07.tar.gz
plus-255facfa0c5c272e6f9416eb74c184ff615e2c07.tar.bz2
plus-255facfa0c5c272e6f9416eb74c184ff615e2c07.tar.xz
plus-255facfa0c5c272e6f9416eb74c184ff615e2c07.zip
Remove unused functions from itemcontainer.
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;