mirror of
https://github.com/ihhub/fheroes2.git
synced 2026-10-12 02:16:11 +00:00
Hide Editor's system message if the game's language has been changed (#10973)
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user