1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-05 13:04:54 +02:00

- better fix for button borders

This commit is contained in:
Ivan Savenko 2012-09-26 13:50:15 +00:00
parent 15a7f43e11
commit 4ceb6cd272
2 changed files with 6 additions and 6 deletions

View File

@ -434,12 +434,12 @@ void CAdventureMapButton::setPlayerColor(int player)
image->playerColored(player);
}
void CAdventureMapButton::show(SDL_Surface * to)
void CAdventureMapButton::showAll(SDL_Surface * to)
{
CIntObject::show(to);
CIntObject::showAll(to);
if (borderEnabled && borderColor.unused == 0)
CSDL_Ext::drawBorder(to, pos.x, pos.y, pos.w, pos.h, int3(borderColor.r, borderColor.g, borderColor.b));
CSDL_Ext::drawBorder(to, pos.x-1, pos.y-1, pos.w+2, pos.h+2, int3(borderColor.r, borderColor.g, borderColor.b));
}
void CHighlightableButton::select(bool on)
@ -447,15 +447,15 @@ void CHighlightableButton::select(bool on)
selected = on;
if (on)
{
borderEnabled = true;
setState(HIGHLIGHTED);
callback();
borderEnabled = true;
}
else
{
borderEnabled = false;
setState(NORMAL);
callback2();
borderEnabled = false;
}
if(hoverTexts.size()>1)

View File

@ -148,7 +148,7 @@ public:
void setIndex(size_t index, bool playerColoredButton=false);
void setImage(CAnimation* anim, bool playerColoredButton=false, int animFlags=0);
void setPlayerColor(int player);
void show(SDL_Surface * to);
void showAll(SDL_Surface * to);
};
/// A button which can be selected/deselected