Fix hotkeys not being registered for new macros

This commit is contained in:
WarmUpTill 2022-06-22 22:18:42 +02:00 committed by WarmUpTill
parent 4d2c3e0f80
commit 925729e6b8
3 changed files with 7 additions and 3 deletions

View File

@ -16,7 +16,7 @@ constexpr auto macro_func = 10;
class Macro {
public:
Macro(const std::string &name = "");
Macro(const std::string &name = "", const bool addHotkey = false);
virtual ~Macro();
bool CeckMatch();

View File

@ -58,7 +58,8 @@ bool AdvSceneSwitcher::addNewMacro(std::string &name, std::string format)
{
std::lock_guard<std::mutex> lock(switcher->m);
switcher->macros.emplace_back(std::make_shared<Macro>(name));
switcher->macros.emplace_back(
std::make_shared<Macro>(name, true));
}
return true;
}

View File

@ -11,9 +11,12 @@
constexpr int perfLogThreshold = 300;
Macro::Macro(const std::string &name)
Macro::Macro(const std::string &name, const bool addHotkey)
{
SetName(name);
if (addHotkey) {
SetupHotkeys();
}
}
Macro::~Macro()