From 2c1130c1a8acb1c3df42ba904589d01b6a459017 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 21 Aug 2014 18:50:54 +0300 Subject: Move move related actions into separate file. --- src/actions/actions.cpp | 194 ------------------------------------------------ 1 file changed, 194 deletions(-) (limited to 'src/actions/actions.cpp') diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 142eea6e1..32bdd44ca 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -95,73 +95,6 @@ extern QuitDialog *quitDialog; namespace Actions { -static bool closeMoveNpcDialog(bool focus) -{ - NpcDialog *const dialog = NpcDialog::getActive(); - if (dialog) - { - if (dialog->isCloseState()) - { - dialog->closeDialog(); - return true; - } - else if (focus) - { - dialog->refocus(); - } - } - return false; -} - -impHandler(moveUp) -{ - if (inputManager.isActionActive(InputAction::EMOTE)) - return directUp(event); - return closeMoveNpcDialog(false); -} - -impHandler(moveDown) -{ - if (inputManager.isActionActive(InputAction::EMOTE)) - return directDown(event); - return closeMoveNpcDialog(false); -} - -impHandler(moveLeft) -{ - if (outfitWindow && inputManager.isActionActive(InputAction::WEAR_OUTFIT)) - { - outfitWindow->wearPreviousOutfit(); - if (Game::instance()) - Game::instance()->setValidSpeed(); - return true; - } - if (inputManager.isActionActive(InputAction::EMOTE)) - return directLeft(event); - return closeMoveNpcDialog(false); -} - -impHandler(moveRight) -{ - if (outfitWindow && inputManager.isActionActive(InputAction::WEAR_OUTFIT)) - { - outfitWindow->wearNextOutfit(); - if (Game::instance()) - Game::instance()->setValidSpeed(); - return true; - } - if (inputManager.isActionActive(InputAction::EMOTE)) - return directRight(event); - return closeMoveNpcDialog(false); -} - -impHandler(moveForward) -{ - if (inputManager.isActionActive(InputAction::EMOTE)) - return directRight(event); - return closeMoveNpcDialog(false); -} - impHandler(emote) { const int emotion = 1 + event.action - InputAction::EMOTE_1; @@ -177,18 +110,6 @@ impHandler(emote) return false; } -impHandler(moveToPoint) -{ - const int num = event.action - InputAction::MOVE_TO_POINT_1; - if (socialWindow && num >= 0) - { - socialWindow->selectPortal(num); - return true; - } - - return false; -} - impHandler(outfit) { if (inputManager.isActionActive(InputAction::WEAR_OUTFIT)) @@ -356,16 +277,6 @@ impHandler0(heal) return false; } -impHandler0(crazyMoves) -{ - if (localPlayer) - { - localPlayer->crazyMove(); - return true; - } - return false; -} - impHandler0(itenplz) { if (actorManager) @@ -390,30 +301,6 @@ impHandler0(changePickupType) callYellowBar(changePickUpType); } -impHandler0(moveToTarget) -{ - if (localPlayer && !inputManager.isActionActive(InputAction::TARGET_ATTACK) - && !inputManager.isActionActive(InputAction::ATTACK)) - { - localPlayer->moveToTarget(); - return true; - } - return false; -} - -impHandler0(moveToHome) -{ - if (localPlayer && !inputManager.isActionActive(InputAction::TARGET_ATTACK) - && !inputManager.isActionActive(InputAction::ATTACK)) - { - localPlayer->moveToHome(); - if (Game::instance()) - Game::instance()->setValidSpeed(); - return true; - } - return false; -} - impHandler0(setHome) { if (localPlayer) @@ -607,87 +494,6 @@ impHandler0(ignoreInput) return true; } -impHandler0(directUp) -{ - if (localPlayer) - { - if (localPlayer->getDirection() != BeingDirection::UP) - { -// if (PacketLimiter::limitPackets(PACKET_DIRECTION)) - { - localPlayer->setDirection(BeingDirection::UP); - if (Net::getPlayerHandler()) - Net::getPlayerHandler()->setDirection(BeingDirection::UP); - } - } - return true; - } - return false; -} - -impHandler0(directDown) -{ - if (localPlayer) - { - if (localPlayer->getDirection() != BeingDirection::DOWN) - { -// if (PacketLimiter::limitPackets(PACKET_DIRECTION)) - { - localPlayer->setDirection(BeingDirection::DOWN); - if (Net::getPlayerHandler()) - { - Net::getPlayerHandler()->setDirection( - BeingDirection::DOWN); - } - } - } - return true; - } - return false; -} - -impHandler0(directLeft) -{ - if (localPlayer) - { - if (localPlayer->getDirection() != BeingDirection::LEFT) - { -// if (PacketLimiter::limitPackets(PACKET_DIRECTION)) - { - localPlayer->setDirection(BeingDirection::LEFT); - if (Net::getPlayerHandler()) - { - Net::getPlayerHandler()->setDirection( - BeingDirection::LEFT); - } - } - } - return true; - } - return false; -} - -impHandler0(directRight) -{ - if (localPlayer) - { - if (localPlayer->getDirection() != BeingDirection::RIGHT) - { -// if (PacketLimiter::limitPackets(PACKET_DIRECTION)) - { - localPlayer->setDirection(BeingDirection::RIGHT); - if (Net::getPlayerHandler()) - { - Net::getPlayerHandler()->setDirection( - BeingDirection::RIGHT); - } - } - } - return true; - } - return false; -} - impHandler0(talk) { if (localPlayer) -- cgit v1.2.3-70-g09d2