From ad951eb9af20cd1a784fab39c41ade1c19dff2ca Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 4 Mar 2013 15:59:45 -0500 Subject: [PATCH] fix being able to toggle disabled buttons (fixes save browser issue with this) --- src/game/GameView.cpp | 2 +- src/interface/Button.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index a1f3fca13..d302dce06 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -1942,7 +1942,7 @@ void GameView::OnDraw() { string message = (*iter); startY -= 13; - g->fillrect(startX-3, startY-3, Graphics::textwidth((char*)message.c_str())+6 , 14, 0, 0, 0, 100); + g->fillrect(startX-3, startY-3, Graphics::textwidth((char*)message.c_str())+6, 14, 0, 0, 0, 100); g->drawtext(startX, startY, message.c_str(), 255, 255, 255, startAlpha); startAlpha-=14; } diff --git a/src/interface/Button.cpp b/src/interface/Button.cpp index 4b9c5d951..95de0e8e2 100644 --- a/src/interface/Button.cpp +++ b/src/interface/Button.cpp @@ -176,6 +176,8 @@ void Button::OnMouseUnclick(int x, int y, unsigned int button) void Button::OnMouseClick(int x, int y, unsigned int button) { + if(!Enabled) + return; if(button == 1) { if(isTogglable)