1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

CCastleInterface: Enable right click on Hero Info

This commit is contained in:
Sandy Carter 2015-08-24 13:31:03 -04:00
parent d1ebf24b55
commit ae6d3c9138
2 changed files with 10 additions and 1 deletions

View File

@ -393,6 +393,14 @@ void CHeroGSlot::clickLeft(tribool down, bool previousState)
} }
} }
void CHeroGSlot::clickRight(tribool down, bool previousState)
{
if(down && hero)
{
GH.pushInt(new CInfoBoxPopup(Point(pos.x + 175, pos.y + 100), hero));
}
}
void CHeroGSlot::deactivate() void CHeroGSlot::deactivate()
{ {
vstd::clear_pointer(selection); vstd::clear_pointer(selection);
@ -411,7 +419,7 @@ CHeroGSlot::CHeroGSlot(int x, int y, int updown, const CGHeroInstance *h, HeroSl
image = nullptr; image = nullptr;
set(h); set(h);
addUsedEvents(LCLICK | HOVER); addUsedEvents(LCLICK | RCLICK | HOVER);
} }
CHeroGSlot::~CHeroGSlot() CHeroGSlot::~CHeroGSlot()

View File

@ -90,6 +90,7 @@ public:
void hover (bool on); void hover (bool on);
void clickLeft(tribool down, bool previousState); void clickLeft(tribool down, bool previousState);
void clickRight(tribool down, bool previousState);
void deactivate(); void deactivate();
CHeroGSlot(int x, int y, int updown, const CGHeroInstance *h, HeroSlots * Owner); //c-tor CHeroGSlot(int x, int y, int updown, const CGHeroInstance *h, HeroSlots * Owner); //c-tor
~CHeroGSlot(); //d-tor ~CHeroGSlot(); //d-tor