canceling a toolbar click don't trigger other action on release
This commit is contained in:
@@ -1546,7 +1546,8 @@ bool handle_action(const sf::Event& event, cFramerateLimiter& fps_limiter) {
|
||||
|
||||
// MARK: Then, handle a button being hit.
|
||||
switch(button_hit) {
|
||||
case TOOLBAR_NONE: break;
|
||||
case TOOLBAR_NONE: case TOOLBAR_CANCEL:
|
||||
break;
|
||||
case TOOLBAR_MAGE: case TOOLBAR_PRIEST:
|
||||
handle_spellcast(button_hit == TOOLBAR_MAGE ? eSkill::MAGE_SPELLS : eSkill::PRIEST_SPELLS, did_something, need_redraw, need_reprint);
|
||||
break;
|
||||
|
@@ -91,6 +91,7 @@ eToolbarButton cToolbar::button_hit(sf::RenderWindow& win, location click, cFram
|
||||
play_sound(37, time_in_ticks(5));
|
||||
redraw_screen(REFRESH_NONE);
|
||||
if(clicked) return toolbar[i].btn;
|
||||
return TOOLBAR_CANCEL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ enum eToolbarButton {
|
||||
TOOLBAR_MAGE, TOOLBAR_PRIEST, TOOLBAR_LOOK, TOOLBAR_CAMP, TOOLBAR_SCROLL, TOOLBAR_SAVE,
|
||||
TOOLBAR_SHIELD, TOOLBAR_BAG, TOOLBAR_TALK, TOOLBAR_HAND, TOOLBAR_SWORD, TOOLBAR_LOAD,
|
||||
TOOLBAR_WAIT, TOOLBAR_END, TOOLBAR_SHOOT, TOOLBAR_ACT, TOOLBAR_USE, TOOLBAR_MAP,
|
||||
TOOLBAR_CANCEL,
|
||||
TOOLBAR_NONE = -1 // Keep this last
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user