mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
- better fix for button borders
This commit is contained in:
@ -434,12 +434,12 @@ void CAdventureMapButton::setPlayerColor(int player)
|
|||||||
image->playerColored(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)
|
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)
|
void CHighlightableButton::select(bool on)
|
||||||
@ -447,15 +447,15 @@ void CHighlightableButton::select(bool on)
|
|||||||
selected = on;
|
selected = on;
|
||||||
if (on)
|
if (on)
|
||||||
{
|
{
|
||||||
|
borderEnabled = true;
|
||||||
setState(HIGHLIGHTED);
|
setState(HIGHLIGHTED);
|
||||||
callback();
|
callback();
|
||||||
borderEnabled = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
borderEnabled = false;
|
||||||
setState(NORMAL);
|
setState(NORMAL);
|
||||||
callback2();
|
callback2();
|
||||||
borderEnabled = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hoverTexts.size()>1)
|
if(hoverTexts.size()>1)
|
||||||
|
@ -148,7 +148,7 @@ public:
|
|||||||
void setIndex(size_t index, bool playerColoredButton=false);
|
void setIndex(size_t index, bool playerColoredButton=false);
|
||||||
void setImage(CAnimation* anim, bool playerColoredButton=false, int animFlags=0);
|
void setImage(CAnimation* anim, bool playerColoredButton=false, int animFlags=0);
|
||||||
void setPlayerColor(int player);
|
void setPlayerColor(int player);
|
||||||
void show(SDL_Surface * to);
|
void showAll(SDL_Surface * to);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A button which can be selected/deselected
|
/// A button which can be selected/deselected
|
||||||
|
Reference in New Issue
Block a user