Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the mouse interaction in the Editor's spell selection and castle properties windows #9357

Merged
merged 7 commits into from
Dec 22, 2024
9 changes: 6 additions & 3 deletions src/fheroes2/editor/editor_spell_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,17 @@ namespace
return false;
}

if ( eventProcessor.MouseClickLeft() ) {
assert( static_cast<size_t>( spellIndex ) < _spellRoi.size() );
assert( static_cast<size_t>( spellIndex ) < _spellRoi.size() );

const fheroes2::Rect spellRoi = _spellRoi[spellIndex];
Districh-ru marked this conversation as resolved.
Show resolved Hide resolved

if ( eventProcessor.MouseClickLeft( spellRoi ) ) {
_spells[spellIndex].second = !_spells[spellIndex].second;

return true;
}

if ( eventProcessor.isMouseRightButtonPressed() ) {
if ( eventProcessor.isMouseRightButtonPressedInArea( spellRoi ) ) {
fheroes2::SpellDialogElement( _spells[spellIndex].first, nullptr ).showPopup( Dialog::ZERO );
}

Expand Down
Loading