mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-05 00:49:09 +02:00
* Reverted previously changed PreGame code
* Added the missing AB video resource file in linux code, AB campaign selection videos should now play BUT they don't => it seems that ffmpeg can't handle older BINK videos * Fixed a visual glitch which could be seen at the WOG animation in the main menu on a linux machine * Fixed the random crashes bug on mouse centering at startup on linux * Fixed a visual bug at the bonus selection screen when starting a campaign-map * Changed some positions in the bonus selection screen, no bonus pre selection, you cannot start the campaign when no bonus is selected (like in h3) * Added a border functionality to the AdventureMapButton * InfoWindow buttons and some other buttons have now the border which heroes 3 buttons have * Fixed a app crash when you start a campaign two times in one session
This commit is contained in:
@ -107,7 +107,8 @@ void CButtonBase::block(bool on)
|
||||
|
||||
AdventureMapButton::AdventureMapButton ()
|
||||
{
|
||||
hoverable = actOnDown = false;
|
||||
hoverable = actOnDown = borderEnabled = false;
|
||||
borderColor.x = -1;
|
||||
used = LCLICK | RCLICK | HOVER | KEYBOARD;
|
||||
}
|
||||
|
||||
@ -208,7 +209,8 @@ void AdventureMapButton::init(const CFunctionList<void()> &Callback, const std::
|
||||
currentImage = -1;
|
||||
used = LCLICK | RCLICK | HOVER | KEYBOARD;
|
||||
callback = Callback;
|
||||
actOnDown = hoverable = false;
|
||||
actOnDown = hoverable = borderEnabled = false;
|
||||
borderColor.x = -1;
|
||||
assignedKeys.insert(key);
|
||||
hoverTexts = Name;
|
||||
helpBox=HelpBox;
|
||||
@ -256,14 +258,34 @@ void AdventureMapButton::setPlayerColor(int player)
|
||||
image->playerColored(player);
|
||||
}
|
||||
|
||||
void AdventureMapButton::show(SDL_Surface *to)
|
||||
{
|
||||
showAll(to);
|
||||
}
|
||||
|
||||
void AdventureMapButton::showAll(SDL_Surface *to)
|
||||
{
|
||||
CIntObject::showAll(to);
|
||||
|
||||
if (borderEnabled && borderColor.x >= 0)
|
||||
CSDL_Ext::drawBorder(to, pos.x - 1, pos.y - 1, pos.w + 2, pos.h + 2, borderColor);
|
||||
}
|
||||
|
||||
void CHighlightableButton::select(bool on)
|
||||
{
|
||||
setState(on?HIGHLIGHTED:NORMAL);
|
||||
|
||||
if(on)
|
||||
if (on)
|
||||
{
|
||||
setState(HIGHLIGHTED);
|
||||
callback();
|
||||
else
|
||||
borderEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
setState(NORMAL);
|
||||
callback2();
|
||||
borderEnabled = false;
|
||||
}
|
||||
|
||||
if(hoverTexts.size()>1)
|
||||
{
|
||||
hover(false);
|
||||
|
Reference in New Issue
Block a user