Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
etorth committed Dec 10, 2023
1 parent 17ab3a3 commit 91adce5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
21 changes: 21 additions & 0 deletions client/src/menubutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,24 @@ MenuButton::MenuButton(dir8_t argDir,
setSize(m_margin[2] + std::max<int>(m_gfxWidget->w() + m_margin[3], m_menuBoard->w()),
m_margin[0] + m_gfxWidget->h() + std::max<int>(m_margin[1], m_menuBoard->h()));
}

bool MenuButton::processEvent(const SDL_Event &event, bool valid)
{
if(!valid){
return consumeFocus(false);
}

if(!show()){
return consumeFocus(false);
}

if(Widget::processEvent(event, valid)){
return true;
}

if(ButtonBase::processEvent(event, valid)){
return true;
}

return false;
}
10 changes: 5 additions & 5 deletions client/src/menubutton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class MenuButton: public ButtonBase
std::pair<Widget *, bool>,
std::pair<Widget *, bool>,

std::array<int, 4>,
std::array<int, 4> = {},

Widget *,
bool);
Widget * = nullptr,
bool = false);

// public:
// bool processEvent(const SDL_Event &, bool) override;
public:
bool processEvent(const SDL_Event&, bool) override;
};

0 comments on commit 91adce5

Please sign in to comment.