From 744861120b90dc7b46e793cdb3cc1062a3987526 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Sun, 25 Apr 2021 19:42:39 +0200 Subject: [PATCH] filter attempt. (tested on mp) --- src/client/component/command.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client/component/command.cpp b/src/client/component/command.cpp index ce652b5..7180519 100644 --- a/src/client/component/command.cpp +++ b/src/client/component/command.cpp @@ -325,7 +325,7 @@ namespace command { if (params.size() < 2) { - console::info("listassetpool : list all the assets in the specified pool\n"); + console::info("listassetpool [filter]: list all the assets in the specified pool\n"); for (auto i = 0; i < game::XAssetType::ASSET_TYPE_COUNT; i++) { @@ -344,12 +344,19 @@ namespace command console::info("Listing assets in pool %s\n", game::g_assetNames[type]); - enum_assets(type, [type](const game::XAssetHeader header) + const std::string filter = params.get(2); + enum_assets(type, [type, filter](const game::XAssetHeader header) { const auto asset = game::XAsset{ type, header }; const auto* const asset_name = game::DB_GetXAssetName(&asset); //const auto entry = game::DB_FindXAssetEntry(type, asset_name); //TODO: display which zone the asset is from + + if (!filter.empty() && !game_console::match_compare(filter, asset_name, false)) + { + return; + } + console::info("%s\n", asset_name); }, true); }