1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Miscellaneous fixes:

- proper block of "back" button in campaign menu.
- proper block of AI switch in battles
- vertical garrisons can now be attacked from top
- better UI logging, vcmi will print to log file all pressed buttons
- server will not try to build already existing building
This commit is contained in:
Ivan Savenko
2014-01-13 17:44:21 +00:00
parent fb5c9fc972
commit c5b74a2dce
6 changed files with 31 additions and 7 deletions

View File

@ -309,6 +309,22 @@ CAdventureMapButton::CAdventureMapButton( const std::pair<std::string, std::stri
pom[0] = help.first;
init(Callback, pom, help.second, playerColoredButton, defName, add, x, y, key);
}
void CAdventureMapButton::onButtonClicked()
{
// debug logging to figure out pressed button (and as result - player actions) in case of crash
logAnim->traceStream() << "Button clicked at " << pos.x << "x" << pos.y;
CIntObject * parent = this->parent;
std::string prefix = "Parent is";
while (parent)
{
logAnim->traceStream() << prefix << typeid(*parent).name() << " at " << parent->pos.x << "x" << parent->pos.y;
parent = parent->parent;
prefix = '\t' + prefix;
}
callback();
}
void CAdventureMapButton::clickLeft(tribool down, bool previousState)
{
if(isBlocked())
@ -327,11 +343,11 @@ void CAdventureMapButton::clickLeft(tribool down, bool previousState)
if (actOnDown && down)
{
callback();
onButtonClicked();
}
else if (!actOnDown && previousState && (down==false))
{
callback();
onButtonClicked();
}
}