2023-01-06 18:52:18 +02:00
|
|
|
/*
|
|
|
|
* ClientCommandManager.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-01-07 13:47:00 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
2023-01-06 18:52:18 +02:00
|
|
|
class PlayerColor;
|
2023-01-07 13:47:00 +02:00
|
|
|
VCMI_LIB_NAMESPACE_END
|
2023-01-06 18:52:18 +02:00
|
|
|
class CIntObject;
|
|
|
|
|
2023-01-08 21:30:57 +02:00
|
|
|
class ClientCommandManager //take mantis #2292 issue about account if thinking about handling cheats from command-line
|
2023-01-06 18:52:18 +02:00
|
|
|
{
|
2023-04-16 18:29:31 +02:00
|
|
|
bool currentCallFromIngameConsole = false; // commands can come from 2 sources: ingame console (chat) and client console
|
|
|
|
|
|
|
|
// Quits the game (die, fool command)
|
|
|
|
void handleQuitCommand();
|
2023-01-06 22:01:00 +02:00
|
|
|
|
2023-04-16 18:29:31 +02:00
|
|
|
// Saves current game under the given filename
|
|
|
|
void handleSaveCommand(std::istringstream & singleWordBuffer);
|
|
|
|
|
|
|
|
// Loads a game with the given filename
|
|
|
|
void handleLoadCommand(std::istringstream & singleWordBuffer);
|
|
|
|
|
|
|
|
// AI takes over until the end of turn (unlike original H3 currently causes AI to take over until typed again)
|
|
|
|
void handleGoSoloCommand();
|
|
|
|
|
|
|
|
// Toggles autoskip mode on and off. In this mode, player turns are automatically skipped and only AI moves.
|
|
|
|
// However, GUI is still present and allows to observe AI moves. After this option is activated, you need to end first turn manually.
|
|
|
|
// Press [Shift] before your turn starts to not skip it.
|
|
|
|
void handleAutoskipCommand();
|
|
|
|
|
|
|
|
// Gives you control over specified AI player. If none is specified gives you control over all AI players
|
|
|
|
void handleControlaiCommand(std::istringstream& singleWordBuffer);
|
|
|
|
|
|
|
|
// Change battle AI used by neutral creatures to the one specified. Persists through game quit
|
|
|
|
void handleSetBattleAICommand(std::istringstream& singleWordBuffer);
|
|
|
|
|
|
|
|
// Redraw the current screen
|
|
|
|
void handleRedrawCommand();
|
|
|
|
|
2024-04-08 12:16:23 +02:00
|
|
|
// Extracts all translateable game texts into Translation directory, separating files on per-mod basis
|
2024-10-26 13:50:08 +02:00
|
|
|
void handleTranslateGameCommand(bool onlyMissing);
|
2024-04-08 12:16:23 +02:00
|
|
|
|
|
|
|
// Extracts all translateable texts from maps and campaigns into Translation directory, separating files on per-mod basis
|
|
|
|
void handleTranslateMapsCommand();
|
2023-04-16 18:29:31 +02:00
|
|
|
|
|
|
|
// Saves current game configuration into extracted/configuration folder
|
|
|
|
void handleGetConfigCommand();
|
|
|
|
|
|
|
|
// Dumps all scripts in Extracted/Scripts
|
|
|
|
void handleGetScriptsCommand();
|
|
|
|
|
|
|
|
// Dumps all .txt files from DATA into Extracted/DATA
|
|
|
|
void handleGetTextCommand();
|
|
|
|
|
|
|
|
// Extract .def animation as BMP files
|
|
|
|
void handleDef2bmpCommand(std::istringstream& singleWordBuffer);
|
|
|
|
|
|
|
|
// Export file into Extracted directory
|
|
|
|
void handleExtractCommand(std::istringstream& singleWordBuffer);
|
|
|
|
|
2024-06-24 03:23:26 +02:00
|
|
|
// Print in console the current bonuses for current army
|
2023-04-16 18:29:31 +02:00
|
|
|
void handleBonusesCommand(std::istringstream & singleWordBuffer);
|
|
|
|
|
|
|
|
// Get what artifact is present on artifact slot with specified ID for hero with specified ID
|
|
|
|
void handleTellCommand(std::istringstream& singleWordBuffer);
|
|
|
|
|
|
|
|
// Show current movement points, max movement points on land / max movement points on water.
|
|
|
|
void handleMpCommand();
|
|
|
|
|
|
|
|
// set <command> <on/off> - sets special temporary settings that reset on game quit.
|
|
|
|
void handleSetCommand(std::istringstream& singleWordBuffer);
|
|
|
|
|
|
|
|
// Crashes the game forcing an exception
|
|
|
|
void handleCrashCommand();
|
|
|
|
|
2024-02-03 12:19:48 +02:00
|
|
|
// shows object graph
|
|
|
|
void handleVsLog(std::istringstream & singleWordBuffer);
|
|
|
|
|
2024-08-29 00:37:39 +02:00
|
|
|
// generate all assets
|
|
|
|
void handleGenerateAssets();
|
|
|
|
|
2023-04-16 18:29:31 +02:00
|
|
|
// Prints in Chat the given message
|
2023-01-15 02:09:58 +02:00
|
|
|
void printCommandMessage(const std::string &commandMessage, ELogLevel::ELogLevel messageType = ELogLevel::NOT_SET);
|
2023-04-16 18:29:31 +02:00
|
|
|
void giveTurn(const PlayerColor &color);
|
2023-01-06 22:01:00 +02:00
|
|
|
|
|
|
|
public:
|
2023-01-15 02:09:58 +02:00
|
|
|
ClientCommandManager() = default;
|
2023-04-16 18:29:31 +02:00
|
|
|
void processCommand(const std::string & message, bool calledFromIngameConsole);
|
2023-01-06 18:52:18 +02:00
|
|
|
};
|