From 421376d12d1847246b5840460ea1643c5e22e650 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 15 Apr 2012 20:48:30 +0300 Subject: Simplify emote shortcuts logic. --- src/actionmanager.cpp | 19 ++++------ src/keyboarddata.h | 96 +++++++++++++++++++++++++-------------------------- 2 files changed, 55 insertions(+), 60 deletions(-) diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index 2c9dd775f..91773983e 100644 --- a/src/actionmanager.cpp +++ b/src/actionmanager.cpp @@ -132,18 +132,14 @@ impHandler0(moveRight) impHandler(emote) { - if (inputManager.isActionActive(Input::KEY_EMOTE)) + int emotion = 1 + event.action - Input::KEY_EMOTE_1; + if (emotion > 0) { - // emote keys - int emotion = 1 + event.action - Input::KEY_EMOTE_1; - if (emotion > 0) - { - if (emoteShortcut) - emoteShortcut->useEmote(emotion); - if (Game::instance()) - Game::instance()->setValidSpeed(); - return true; - } + if (emoteShortcut) + emoteShortcut->useEmote(emotion); + if (Game::instance()) + Game::instance()->setValidSpeed(); + return true; } return false; @@ -151,7 +147,6 @@ impHandler(emote) impHandler(moveToPoint) { - // move to point keys int num = event.action - Input::KEY_MOVE_TO_POINT_1; if (socialWindow && num >= 0) { diff --git a/src/keyboarddata.h b/src/keyboarddata.h index e975abe89..8c3df1878 100644 --- a/src/keyboarddata.h +++ b/src/keyboarddata.h @@ -530,336 +530,336 @@ static KeyData const keyData[Input::KEY_TOTAL] = { INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut2", INPUT_KEYBOARD, SDLK_2, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut3", INPUT_KEYBOARD, SDLK_3, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut4", INPUT_KEYBOARD, SDLK_4, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut5", INPUT_KEYBOARD, SDLK_5, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut6", INPUT_KEYBOARD, SDLK_6, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut7", INPUT_KEYBOARD, SDLK_7, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut8", INPUT_KEYBOARD, SDLK_8, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut9", INPUT_KEYBOARD, SDLK_9, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut10", INPUT_KEYBOARD, SDLK_0, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut11", INPUT_KEYBOARD, SDLK_MINUS, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut12", INPUT_KEYBOARD, SDLK_EQUALS, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut13", INPUT_KEYBOARD, SDLK_BACKSPACE, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut14", INPUT_KEYBOARD, SDLK_INSERT, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut15", INPUT_KEYBOARD, SDLK_HOME, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut16", INPUT_KEYBOARD, SDLK_q, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut17", INPUT_KEYBOARD, SDLK_w, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut18", INPUT_KEYBOARD, SDLK_e, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut19", INPUT_KEYBOARD, SDLK_r, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut20", INPUT_KEYBOARD, SDLK_t, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut21", INPUT_KEYBOARD, SDLK_y, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut22", INPUT_KEYBOARD, SDLK_u, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut23", INPUT_KEYBOARD, SDLK_i, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut24", INPUT_KEYBOARD, SDLK_o, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut25", INPUT_KEYBOARD, SDLK_p, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut26", INPUT_KEYBOARD, SDLK_LEFTBRACKET, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut27", INPUT_KEYBOARD, SDLK_RIGHTBRACKET, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut28", INPUT_KEYBOARD, SDLK_BACKSLASH, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut29", INPUT_KEYBOARD, SDLK_a, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut30", INPUT_KEYBOARD, SDLK_s, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut31", INPUT_KEYBOARD, SDLK_d, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut32", INPUT_KEYBOARD, SDLK_f, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut33", INPUT_KEYBOARD, SDLK_g, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut34", INPUT_KEYBOARD, SDLK_h, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut35", INPUT_KEYBOARD, SDLK_j, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut36", INPUT_KEYBOARD, SDLK_k, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut37", INPUT_KEYBOARD, SDLK_l, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut38", INPUT_KEYBOARD, SDLK_SEMICOLON, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut39", INPUT_KEYBOARD, SDLK_QUOTE, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut40", INPUT_KEYBOARD, SDLK_z, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut41", INPUT_KEYBOARD, SDLK_x, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut42", INPUT_KEYBOARD, SDLK_c, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut43", INPUT_KEYBOARD, SDLK_v, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut44", INPUT_KEYBOARD, SDLK_b, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut45", INPUT_KEYBOARD, SDLK_n, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut46", INPUT_KEYBOARD, SDLK_m, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut47", INPUT_KEYBOARD, SDLK_COMMA, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyEmoteShortcut48", INPUT_KEYBOARD, SDLK_PERIOD, INPUT_UNKNOWN, Input::KEY_NO_VALUE, Input::GRP_EMOTION, &ActionManager::emote, - Input::KEY_NO_VALUE, 100, + Input::KEY_EMOTE, 100, COND_GAME}, {"keyWearOutfit", INPUT_KEYBOARD, SDLK_RCTRL, -- cgit v1.2.3-70-g09d2