mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-21 12:06:49 +02:00
Fixed Puzzle Map hotkey not working due to having inactive button in
world view mode
This commit is contained in:
parent
0db8266495
commit
dd337dba7b
@ -492,7 +492,7 @@ void InterfaceObjectConfigurable::loadButtonHotkey(std::shared_ptr<CButton> butt
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
button->addCallback(target->second.callback);
|
button->addCallback(target->second.callback);
|
||||||
target->second.assignedToButton = true;
|
target->second.assignedButtons.push_back(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<CLabelGroup> InterfaceObjectConfigurable::buildLabelGroup(const JsonNode & config) const
|
std::shared_ptr<CLabelGroup> InterfaceObjectConfigurable::buildLabelGroup(const JsonNode & config) const
|
||||||
@ -821,7 +821,8 @@ void InterfaceObjectConfigurable::keyPressed(EShortcut key)
|
|||||||
if (target == shortcuts.end())
|
if (target == shortcuts.end())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (target->second.assignedToButton)
|
for (auto const & button :target->second.assignedButtons)
|
||||||
|
if (button->isActive())
|
||||||
return; // will be handled by button instance
|
return; // will be handled by button instance
|
||||||
|
|
||||||
if (target->second.blocked)
|
if (target->second.blocked)
|
||||||
|
@ -118,7 +118,7 @@ private:
|
|||||||
struct ShortcutState
|
struct ShortcutState
|
||||||
{
|
{
|
||||||
std::function<void()> callback;
|
std::function<void()> callback;
|
||||||
mutable bool assignedToButton = false;
|
mutable std::vector<std::shared_ptr<CButton>> assignedButtons;
|
||||||
bool blocked = false;
|
bool blocked = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user