Skip to content

Commit

Permalink
Add popup dialogs for some buttons (#4170)
Browse files Browse the repository at this point in the history
missing even in the original game
  • Loading branch information
ihhub authored Sep 5, 2021
1 parent 91f9899 commit 6756923
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/fheroes2/dialog/dialog_selectfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,19 @@ std::string SelectFileListSimple( const std::string & header, const std::string
listbox.Unselect();
isListboxSelected = false;
}

if ( le.MousePressRight( buttonCancel.area() ) ) {
Dialog::Message( _( "Cancel" ), _( "Exit this menu without doing anything." ), Font::BIG );
}
else if ( le.MousePressRight( buttonOk.area() ) ) {
if ( isEditing ) {
Dialog::Message( _( "OK" ), _( "Click to save the current game." ), Font::BIG );
}
else {
Dialog::Message( _( "OK" ), _( "Click to load a previously saved game." ), Font::BIG );
}
}

if ( !isEditing && le.KeyPress( KEY_DELETE ) && isListboxSelected ) {
std::string msg( _( "Are you sure you want to delete file:" ) );
msg.append( "\n \n" );
Expand Down
7 changes: 7 additions & 0 deletions src/fheroes2/game/game_highscores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,13 @@ fheroes2::GameMode Game::HighScores()
if ( le.MouseClickLeft( buttonExit.area() ) || HotKeyCloseWindow )
return fheroes2::GameMode::MAIN_MENU;

if ( le.MousePressRight( buttonExit.area() ) ) {
Dialog::Message( _( "Exit" ), _( "Exit this menu." ), Font::BIG );
}
else if ( le.MousePressRight( buttonCampain.area() ) ) {
Dialog::Message( _( "Campaign" ), _( "View High Scores for Campaigns." ), Font::BIG );
}

if ( Game::validateAnimationDelay( Game::MAPS_DELAY ) ) {
hgs.RedrawList( top.x, top.y );
display.render();
Expand Down

0 comments on commit 6756923

Please sign in to comment.