diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-26 23:48:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-26 23:48:31 +0300 |
commit | 1b496351f779d4a897cd882a9928a18bab5ba622 (patch) | |
tree | 0076bfd5ffb3d3f623e5898dcf929181b313e743 /src | |
parent | 84edefedf8e3688f618f0dde8169d6ee18624e6e (diff) | |
download | manaplus-1b496351f779d4a897cd882a9928a18bab5ba622.tar.gz manaplus-1b496351f779d4a897cd882a9928a18bab5ba622.tar.bz2 manaplus-1b496351f779d4a897cd882a9928a18bab5ba622.tar.xz manaplus-1b496351f779d4a897cd882a9928a18bab5ba622.zip |
Move chat command /dumpg into actions.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions/actions.cpp | 41 | ||||
-rw-r--r-- | src/actions/actions.h | 1 | ||||
-rw-r--r-- | src/commands.cpp | 41 | ||||
-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, 59 insertions, 45 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index d803de671..397b0225d 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -891,4 +891,45 @@ impHandler0(error) exit(1); } +impHandler(dumpGraphics) +{ + std::string str = strprintf("%s,%s,%dX%dX%d,", PACKAGE_OS, SMALL_VERSION, + mainGraphics->getWidth(), mainGraphics->getHeight(), + mainGraphics->getBpp()); + + if (mainGraphics->getFullScreen()) + str.append("F"); + else + str.append("W"); + if (mainGraphics->getHWAccel()) + str.append("H"); + else + str.append("S"); + + if (mainGraphics->getDoubleBuffer()) + str.append("D"); + else + str.append("_"); + +#if defined USE_OPENGL + str.append(strprintf(",%d", mainGraphics->getOpenGL())); +#else + str.append(",0"); +#endif + + str.append(strprintf(",%f,", static_cast<double>(settings.guiAlpha))) + .append(config.getBoolValue("adjustPerfomance") ? "1" : "0") + .append(config.getBoolValue("alphaCache") ? "1" : "0") + .append(config.getBoolValue("enableMapReduce") ? "1" : "0") + .append(config.getBoolValue("beingopacity") ? "1" : "0") + .append(",") + .append(config.getBoolValue("enableAlphaFix") ? "1" : "0") + .append(config.getBoolValue("disableAdvBeingCaching") ? "1" : "0") + .append(config.getBoolValue("disableBeingCaching") ? "1" : "0") + .append(config.getBoolValue("particleeffects") ? "1" : "0") + .append(strprintf(",%d-%d", fps, config.getIntValue("fpslimit"))); + outStringNormal(event.tab, str, str); + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index b773f9992..d1225a424 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -72,6 +72,7 @@ namespace Actions decHandler(serverIgnoreAll); decHandler(serverUnIgnoreAll); decHandler(error) __attribute__ ((noreturn)); + decHandler(dumpGraphics); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 283b07e78..bb2bbe813 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -157,47 +157,6 @@ impHandler(hack) return true; } -impHandler(dumpGraphics) -{ - std::string str = strprintf("%s,%s,%dX%dX%d,", PACKAGE_OS, SMALL_VERSION, - mainGraphics->getWidth(), mainGraphics->getHeight(), - mainGraphics->getBpp()); - - if (mainGraphics->getFullScreen()) - str.append("F"); - else - str.append("W"); - if (mainGraphics->getHWAccel()) - str.append("H"); - else - str.append("S"); - - if (mainGraphics->getDoubleBuffer()) - str.append("D"); - else - str.append("_"); - -#if defined USE_OPENGL - str.append(strprintf(",%d", mainGraphics->getOpenGL())); -#else - str.append(",0"); -#endif - - str.append(strprintf(",%f,", static_cast<double>(settings.guiAlpha))) - .append(config.getBoolValue("adjustPerfomance") ? "1" : "0") - .append(config.getBoolValue("alphaCache") ? "1" : "0") - .append(config.getBoolValue("enableMapReduce") ? "1" : "0") - .append(config.getBoolValue("beingopacity") ? "1" : "0") - .append(",") - .append(config.getBoolValue("enableAlphaFix") ? "1" : "0") - .append(config.getBoolValue("disableAdvBeingCaching") ? "1" : "0") - .append(config.getBoolValue("disableBeingCaching") ? "1" : "0") - .append(config.getBoolValue("particleeffects") ? "1" : "0") - .append(strprintf(",%d-%d", fps, config.getIntValue("fpslimit"))); - outStringNormal(event.tab, str, str); - return true; -} - impHandler0(dumpEnvironment) { logger->log1("Start environment variables"); diff --git a/src/commands.h b/src/commands.h index 9cfb87d98..3c9437c37 100644 --- a/src/commands.h +++ b/src/commands.h @@ -54,7 +54,6 @@ namespace Commands decHandler(hack); decHandler(url); decHandler(open); - decHandler(dumpGraphics); decHandler(dumpEnvironment); decHandler(dumpTests); decHandler(dumpOGL); @@ -83,8 +82,7 @@ namespace Commands enum { - COMMAND_DUMPG = 0, - COMMAND_DUMPE, + COMMAND_DUMPE = 0, COMMAND_DUMPT, COMMAND_DUMPOGL, COMMAND_DUMPGL, @@ -114,7 +112,6 @@ enum static const CommandInfo commands[] = { - {"dumpg", &Commands::dumpGraphics, -1, false}, {"dumpe", &Commands::dumpEnvironment, -1, false}, {"dumpt", &Commands::dumpTests, -1, false}, {"dumpogl", &Commands::dumpOGL, -1, false}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index aa69f4a19..87cb80914 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -398,6 +398,7 @@ namespace InputAction SERVER_UNIGNORE_ALL, SET_DROP, ERROR, + DUMP_GRAPHICS, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 4b9150aa8..7d80d63fe 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3351,6 +3351,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "error", + false}, + {"keyDumpg", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::dumpGraphics, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "dumpg", false} }; diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index 8bae75449..658c368f2 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -292,6 +292,12 @@ SetupActionData setupActionDataOther[] = "", }, { + // TRANSLATORS: input action name + N_("Dump graphics info into chat"), + InputAction::DUMP_GRAPHICS, + "", + }, + { "", InputAction::NO_VALUE, "" |