diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-10-18 15:29:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-10-19 15:12:20 +0300 |
commit | 255facfa0c5c272e6f9416eb74c184ff615e2c07 (patch) | |
tree | fb15effa7613b180d91c9b7d441e12214cf01f25 /src | |
parent | 128f88cf592a3dadf7580201e4ff3f7509c1f7a6 (diff) | |
download | manaverse-255facfa0c5c272e6f9416eb74c184ff615e2c07.tar.gz manaverse-255facfa0c5c272e6f9416eb74c184ff615e2c07.tar.bz2 manaverse-255facfa0c5c272e6f9416eb74c184ff615e2c07.tar.xz manaverse-255facfa0c5c272e6f9416eb74c184ff615e2c07.zip |
Remove unused functions from itemcontainer.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 77 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.h | 12 |
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); |