From 97055c935f99afdd85a11c8ae074731876e6cca6 Mon Sep 17 00:00:00 2001 From: Ihar Hubchyk Date: Sat, 29 Jun 2024 19:12:15 +0800 Subject: [PATCH] Add popup messages for right clicking on special map conditions relates to #8717 --- src/fheroes2/editor/editor_map_specs_window.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/fheroes2/editor/editor_map_specs_window.cpp b/src/fheroes2/editor/editor_map_specs_window.cpp index 02443e6587..cc9b17e525 100644 --- a/src/fheroes2/editor/editor_map_specs_window.cpp +++ b/src/fheroes2/editor/editor_map_specs_window.cpp @@ -280,9 +280,14 @@ namespace _isClicked = true; } - void ActionListPressRight( uint8_t & /* item */ ) override + void ActionListPressRight( uint8_t & condition ) override { - // Do nothing. + if ( _isLossList ) { + fheroes2::showStandardTextMessage( _( "Special Loss Condition" ), getLossConditionText( condition ), Dialog::ZERO ); + } + else { + fheroes2::showStandardTextMessage( _( "Special Victory Condition" ), getVictoryConditionText( condition ), Dialog::ZERO ); + } } fheroes2::Rect getArea() const @@ -1021,6 +1026,12 @@ namespace Editor else if ( le.isMouseRightButtonPressedInArea( descriptionTextRoi ) ) { fheroes2::showStandardTextMessage( _( "Map Description" ), _( "Click to change the description of the current map." ), Dialog::ZERO ); } + else if ( le.isMouseRightButtonPressedInArea( victoryDroplistButtonRoi ) ) { + fheroes2::showStandardTextMessage( _( "Special Victory Condition" ), _( "Click to change victory condition of the current map." ), Dialog::ZERO ); + } + else if ( le.isMouseRightButtonPressedInArea( lossDroplistButtonRoi ) ) { + fheroes2::showStandardTextMessage( _( "Special Loss Condition" ), _( "Click to change loss condition of the current map." ), Dialog::ZERO ); + } for ( int32_t i = 0; i < availablePlayersCount; ++i ) { if ( le.MouseClickLeft( playerRects[i] ) ) {