diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-03-24 04:26:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-03-26 21:45:24 +0300 |
commit | 36e5d21fe06709ba4d12a8619af07b86a676cf8c (patch) | |
tree | a9209e16e6f31cd74047f86ef1e642f467e128e2 /src/gui | |
parent | 0921a130f0241a17ffcedf92d602808e18f1614b (diff) | |
download | plus-36e5d21fe06709ba4d12a8619af07b86a676cf8c.tar.gz plus-36e5d21fe06709ba4d12a8619af07b86a676cf8c.tar.bz2 plus-36e5d21fe06709ba4d12a8619af07b86a676cf8c.tar.xz plus-36e5d21fe06709ba4d12a8619af07b86a676cf8c.zip |
Redesign input handling.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/botcheckerwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/outfitwindow.cpp | 34 | ||||
-rw-r--r-- | src/gui/outfitwindow.h | 4 |
3 files changed, 6 insertions, 34 deletions
diff --git a/src/gui/botcheckerwindow.cpp b/src/gui/botcheckerwindow.cpp index 2739978cb..a1ad9cc2a 100644 --- a/src/gui/botcheckerwindow.cpp +++ b/src/gui/botcheckerwindow.cpp @@ -20,7 +20,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "botcheckerwindow.h" +#include "gui/botcheckerwindow.h" #include <SDL.h> #include <SDL_thread.h> diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index 4f5f07445..009b92e73 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -23,10 +23,12 @@ #include "gui/outfitwindow.h" #include "configuration.h" +#include "emoteshortcut.h" #include "equipment.h" #include "graphics.h" #include "inventory.h" #include "item.h" +#include "keyboardconfig.h" #include "localplayer.h" #include "logger.h" #include "playerinfo.h" @@ -497,37 +499,11 @@ void OutfitWindow::unequipNotInOutfit(int outfit) } } -static const SDLKey numsTbl[] = -{ - SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6, SDLK_7, SDLK_8, SDLK_9, - SDLK_0, SDLK_MINUS, SDLK_EQUALS, SDLK_BACKSPACE, SDLK_INSERT, SDLK_HOME, - SDLK_q, SDLK_w, SDLK_e, SDLK_r, SDLK_t, SDLK_y, SDLK_u, SDLK_i, SDLK_o, - SDLK_p, SDLK_LEFTBRACKET, SDLK_RIGHTBRACKET, SDLK_BACKSLASH, SDLK_a, - SDLK_s, SDLK_d, SDLK_f, SDLK_g, SDLK_h, SDLK_j, SDLK_k, SDLK_l, - SDLK_SEMICOLON, SDLK_QUOTE, SDLK_z, SDLK_x, SDLK_c, SDLK_v, SDLK_b, SDLK_n, - SDLK_m, SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH -}; - -int OutfitWindow::keyToNumber(SDLKey key) const -{ - for (unsigned f = 0; f < sizeof(numsTbl) / sizeof(SDLKey); f ++) - { - if (numsTbl[f] == key) - return f; - } - return -1; -} - -SDLKey OutfitWindow::numberToKey(unsigned number) const -{ - if (number >= sizeof(numsTbl) / sizeof(SDLKey)) - return SDLK_UNKNOWN; - return numsTbl[number]; -} - std::string OutfitWindow::keyName(int number) { - return SDL_GetKeyName(numberToKey(number)); + if (number < 0 || number >= SHORTCUT_EMOTES) + return ""; + return keyboard.getKeyStringLong(KeyboardConfig::KEY_EMOTE_1 + number); } void OutfitWindow::next() diff --git a/src/gui/outfitwindow.h b/src/gui/outfitwindow.h index 6f67c472d..6881bdbc6 100644 --- a/src/gui/outfitwindow.h +++ b/src/gui/outfitwindow.h @@ -88,10 +88,6 @@ class OutfitWindow : public Window, gcn::ActionListener void unequipNotInOutfit(int outfit); - int keyToNumber(SDLKey key) const A_PURE; - - SDLKey numberToKey(unsigned number) const A_PURE; - void next(); void previous(); |