diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-26 18:40:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-26 18:40:02 +0300 |
commit | 537b66dbab370463a4a8d0d860a98626f73b4635 (patch) | |
tree | b57561ba706939d73ecce4f3242cdca6ed515b46 /src | |
parent | 2f345a6bf8385bf0874b976d0da9790faa4ee0ff (diff) | |
download | ManaVerse-537b66dbab370463a4a8d0d860a98626f73b4635.tar.gz ManaVerse-537b66dbab370463a4a8d0d860a98626f73b4635.tar.bz2 ManaVerse-537b66dbab370463a4a8d0d860a98626f73b4635.tar.xz ManaVerse-537b66dbab370463a4a8d0d860a98626f73b4635.zip |
Move chat command /disconnect into actions.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/actions.cpp | 7 | ||||
-rw-r--r-- | src/actions/actions.h | 1 | ||||
-rw-r--r-- | src/commands.cpp | 6 | ||||
-rw-r--r-- | src/commands.h | 5 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 9 | ||||
-rw-r--r-- | src/input/pages/other.cpp | 6 |
7 files changed, 25 insertions, 10 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index dba8da43f..3a8aeaa4a 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -71,6 +71,7 @@ #include "render/graphics.h" #include "net/chathandler.h" +#include "net/gamehandler.h" #include "net/ipc.h" #include "net/net.h" #include "net/playerhandler.h" @@ -674,4 +675,10 @@ impHandler0(cacheInfo) return true; } +impHandler0(disconnect) +{ + Net::getGameHandler()->disconnect2(); + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index 691892bd8..9e7e9f12c 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -64,6 +64,7 @@ namespace Actions decHandler(priceLoad); decHandler(priceSave); decHandler(cacheInfo); + decHandler(disconnect); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 859eff8e4..a8aa3a661 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -157,12 +157,6 @@ impHandler(hack) return true; } -impHandler0(disconnect) -{ - Net::getGameHandler()->disconnect2(); - return true; -} - impHandler(undress) { if (!actorManager) diff --git a/src/commands.h b/src/commands.h index 832895ba2..9af069bc9 100644 --- a/src/commands.h +++ b/src/commands.h @@ -52,7 +52,6 @@ struct CommandInfo final namespace Commands { decHandler(hack); - decHandler(disconnect); decHandler(undress); decHandler(attack); decHandler(dirs); @@ -99,8 +98,7 @@ namespace Commands enum { - COMMAND_DISCONNECT = 0, - COMMAND_UNDRESS, + COMMAND_UNDRESS = 0, COMMAND_ATTACK, COMMAND_DIRS, COMMAND_INFO, @@ -147,7 +145,6 @@ enum static const CommandInfo commands[] = { - {"disconnect", &Commands::disconnect, -1, false}, {"undress", &Commands::undress, -1, true}, {"attack", &Commands::attack, -1, true}, {"dirs", &Commands::dirs, -1, false}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index f1c7becea..403433064 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -383,6 +383,7 @@ namespace InputAction PRICE_LOAD, PRICE_SAVE, CACHE_INFO, + DISCONNECT, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index c6fb36f1f..0dde3f848 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3216,6 +3216,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "cacheinfo", + false}, + {"keyDisconnect", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::disconnect, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "disconnect", false} }; diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index 52970cd8e..4c28e5a3b 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -256,6 +256,12 @@ SetupActionData setupActionDataOther[] = "", }, { + // TRANSLATORS: input action name + N_("Quick disconnect from server"), + InputAction::DISCONNECT, + "", + }, + { "", InputAction::NO_VALUE, "" |