1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

generate assets only when necessary

This commit is contained in:
Laserlicht
2024-08-29 00:37:39 +02:00
parent f327224d45
commit c6f0f8de03
8 changed files with 29 additions and 14 deletions

View File

@@ -18,6 +18,7 @@
#include "gui/CGuiHandler.h"
#include "gui/WindowHandler.h"
#include "render/IRenderHandler.h"
#include "render/AssetGenerator.h"
#include "ClientNetPackVisitors.h"
#include "../lib/CConfigHandler.h"
#include "../lib/gameState/CGameState.h"
@@ -502,6 +503,12 @@ void ClientCommandManager::handleVsLog(std::istringstream & singleWordBuffer)
logVisual->setKey(key);
}
void ClientCommandManager::handleGenerateAssets()
{
AssetGenerator::generateAll();
printCommandMessage("All assets generated");
}
void ClientCommandManager::printCommandMessage(const std::string &commandMessage, ELogLevel::ELogLevel messageType)
{
switch(messageType)
@@ -624,6 +631,9 @@ void ClientCommandManager::processCommand(const std::string & message, bool call
else if(commandName == "vslog")
handleVsLog(singleWordBuffer);
else if(message=="generate assets")
handleGenerateAssets();
else
{
if (!commandName.empty() && !vstd::iswithin(commandName[0], 0, ' ')) // filter-out debugger/IDE noise