Hide Editor's system message if the game's language has been changed (#10973)

This commit is contained in:
Ihar Hubchyk
2026-09-14 22:03:21 +08:00
committed by GitHub
parent b712a21b9a
commit 3fd5f62e00
2 changed files with 13 additions and 3 deletions
+5
View File
@@ -119,6 +119,11 @@ namespace Interface
static fheroes2::Rect getObjectOccupiedArea( const Maps::ObjectGroup group, const int32_t objectType );
void clearWarningMessage()
{
_warningMessage.reset( {} );
}
private:
class WarningMessage final
{
+8 -3
View File
@@ -271,7 +271,14 @@ namespace Editor
const std::vector<fheroes2::SupportedLanguage> supportedLanguages = fheroes2::getSupportedLanguages();
if ( supportedLanguages.size() > 1 ) {
selectLanguage( supportedLanguages, fheroes2::getLanguageFromAbbreviation( conf.getGameLanguage() ), true );
const fheroes2::SupportedLanguage languageBefore = fheroes2::getLanguageFromAbbreviation( conf.getGameLanguage() );
const fheroes2::SupportedLanguage languageAfter = selectLanguage( supportedLanguages, languageBefore, true );
if ( languageAfter != languageBefore ) {
Interface::EditorInterface::Get().clearWarningMessage();
redrawEditor();
saveConfiguration = true;
}
}
else {
assert( supportedLanguages.front() == fheroes2::SupportedLanguage::English );
@@ -282,8 +289,6 @@ namespace Editor
Dialog::OK );
}
redrawEditor();
saveConfiguration = true;
action = DialogAction::Configuration;
break;
}