Don't highlight menus when the mouse button is down.
This commit is contained in:
parent
58763f0900
commit
0e394ed62e
@ -446,7 +446,8 @@ public:
|
||||
MenuAction(GameView * _v, Menu * menu_) { v = _v; menu = menu_; }
|
||||
void MouseEnterCallback(ui::Button * sender)
|
||||
{
|
||||
v->c->SetActiveMenu(menu);
|
||||
if(!ui::Engine::Ref().GetMouseButton())
|
||||
v->c->SetActiveMenu(menu);
|
||||
}
|
||||
void ActionCallback(ui::Button * sender)
|
||||
{
|
||||
|
@ -16,6 +16,7 @@ Engine::Engine():
|
||||
state_(NULL),
|
||||
maxWidth(0),
|
||||
maxHeight(0),
|
||||
mouseb_(0),
|
||||
mousex_(0),
|
||||
mousey_(0),
|
||||
mousexp_(0),
|
||||
@ -260,12 +261,14 @@ void Engine::onKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool
|
||||
|
||||
void Engine::onMouseClick(int x, int y, unsigned button)
|
||||
{
|
||||
mouseb_ |= button;
|
||||
if(state_)
|
||||
state_->DoMouseDown(x, y, button);
|
||||
}
|
||||
|
||||
void Engine::onMouseUnclick(int x, int y, unsigned button)
|
||||
{
|
||||
mouseb_ &= ~button;
|
||||
if(state_)
|
||||
state_->DoMouseUp(x, y, button);
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ namespace ui
|
||||
void SetFps(float fps);
|
||||
inline float GetFps() { return fps; };
|
||||
|
||||
inline int GetMouseButton() { return mouseb_; }
|
||||
inline int GetMouseX() { return mousex_; }
|
||||
inline int GetMouseY() { return mousey_; }
|
||||
inline int GetWidth() { return width_; }
|
||||
@ -89,6 +90,7 @@ namespace ui
|
||||
bool break_;
|
||||
|
||||
int lastTick;
|
||||
int mouseb_;
|
||||
int mousex_;
|
||||
int mousey_;
|
||||
int mousexp_;
|
||||
|
Loading…
Reference in New Issue
Block a user