From 255facfa0c5c272e6f9416eb74c184ff615e2c07 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Oct 2013 15:29:59 +0300 Subject: Remove unused functions from itemcontainer. --- src/gui/widgets/itemcontainer.cpp | 77 --------------------------------------- src/gui/widgets/itemcontainer.h | 12 ------ 2 files changed, 89 deletions(-) (limited to 'src') 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 @@ -155,18 +155,6 @@ class ItemContainer final : public gcn::Widget, SEL_DRAGGING }; - /** - * 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. */ -- cgit v1.2.3-70-g09d2