diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-25 00:50:33 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-25 00:50:33 -0700 |
commit | d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971 (patch) | |
tree | fbb0b461bd151cbf3ad5aeedb80257140253f57c /src/gui/table.cpp | |
parent | a1e483913672e55704e8fbafeff5ea0ccc0c9b07 (diff) | |
download | mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.tar.gz mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.tar.bz2 mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.tar.xz mana-d8bc3a6418c5027d7f6c42ce8f8dceca8dee8971.zip |
Fixed up NPC list dialogs to be navigatable by keyboard (scrolling
through the list requires the use of the mouse wheel at the moment),
fixed wrapping behavior for wrapping around lists to actually wrap
around lists properly, and placed a few checks for current_npc where
they were assumed before which could cause the client to hang or crash
in case the NPC is no longer around.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/table.cpp')
-rw-r--r-- | src/gui/table.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gui/table.cpp b/src/gui/table.cpp index 8acbc4f4..29a33b7a 100644 --- a/src/gui/table.cpp +++ b/src/gui/table.cpp @@ -402,25 +402,21 @@ void GuiTable::keyPressed(gcn::KeyEvent& keyEvent) else if (key.getValue() == gcn::Key::UP) { setSelectedRow(mSelectedRow - 1); - keyEvent.consume(); } else if (key.getValue() == gcn::Key::DOWN) { setSelectedRow(mSelectedRow + 1); - keyEvent.consume(); } else if (key.getValue() == gcn::Key::LEFT) { setSelectedColumn(mSelectedColumn - 1); - keyEvent.consume(); } else if (key.getValue() == gcn::Key::RIGHT) { setSelectedColumn(mSelectedColumn + 1); - keyEvent.consume(); } else if (key.getValue() == gcn::Key::HOME) @@ -460,7 +456,7 @@ void GuiTable::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) { if (isFocused()) { - if (getSelectedRow() >= 0 ) + if (getSelectedRow() > 0 || (getSelectedRow() == 0 && mWrappingEnabled)) { setSelectedRow(getSelectedRow() - 1); } |