diff --git a/README.md b/README.md index da1cf519..91a7194c 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ To use the `iw4x.dll`, you must have a valid Modern Warfare 2 installation with | `-nosteam` | Disable friends feature and do not update Steam about the game's current status just like an invisible mode. | | `-unprotect-dvars` | Allow the server to modify saved/archive dvars. | | `-zonebuilder` | Start the interactive zonebuilder tool console instead of starting the game. | +| `-original-str-parsing` | (ZoneBuilder mode only) Parse .str files in the same manner as the CoD4 Mod Tools. | | `-disable-notifies` | Disable "Anti-CFG" checks | | `-disable-mongoose` | Disable Mongoose HTTP server | | `-disable-rate-limit-check` | Disable RCon rate limit checks | diff --git a/src/Components/Modules/AssetInterfaces/ILocalizeEntry.cpp b/src/Components/Modules/AssetInterfaces/ILocalizeEntry.cpp index 1e0519df..bb7f78ea 100644 --- a/src/Components/Modules/AssetInterfaces/ILocalizeEntry.cpp +++ b/src/Components/Modules/AssetInterfaces/ILocalizeEntry.cpp @@ -54,32 +54,34 @@ namespace Assets } void ILocalizeEntry::ParseLocalizedStringsFile(Components::ZoneBuilder::Zone* builder, const std::string& name, const std::string& filename) - { - std::vector assets; - const auto _0 = gsl::finally([] + { + if (Components::Flags::HasFlag("-original-str-parsing")) { - Components::Localization::ParseOutput(nullptr); - Components::Localization::PrefixOverride = {}; - }); - - Components::Localization::PrefixOverride = Utils::String::ToUpper(name) + "_"; - Components::Localization::ParseOutput([&assets](Game::LocalizeEntry* asset) - { - assets.push_back(asset); - }); + Components::Localization::PrefixOverride = Utils::String::ToUpper(name) + "_"; + } const auto* psLoadedFile = Game::SE_Load(filename.data(), false); if (psLoadedFile) { Game::Com_PrintError(Game::CON_CHANNEL_SYSTEM, "^1Localization ERROR: %s\n", psLoadedFile); + Components::Localization::PrefixOverride = {}; return; } + std::vector assets; + Components::Localization::ParseOutput([&assets](Game::LocalizeEntry* asset) + { + assets.push_back(asset); + }); + auto type = Game::DB_GetXAssetNameType("localize"); for (const auto& entry : assets) { builder->addRawAsset(type, entry); } + + Components::Localization::ParseOutput(nullptr); + Components::Localization::PrefixOverride = {}; } void ILocalizeEntry::ParseLocalizedStringsJSON(Components::ZoneBuilder::Zone* builder, Components::FileSystem::File& file)