mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-24 14:58:19 -05:00
Add macro count member
Used to indicate the number of times the actions were executed.
This commit is contained in:
parent
069b0f89d0
commit
77642c54d8
|
|
@ -71,6 +71,8 @@ public:
|
|||
void SetName(const std::string &name) { _name = name; }
|
||||
void SetPaused(bool pause = true) { _paused = pause; }
|
||||
bool Paused() { return _paused; }
|
||||
int GetCount() { return _count; };
|
||||
void ResetCount() { _count = 0; };
|
||||
std::deque<std::shared_ptr<MacroCondition>> &Conditions()
|
||||
{
|
||||
return _conditions;
|
||||
|
|
@ -89,6 +91,7 @@ private:
|
|||
std::deque<std::shared_ptr<MacroAction>> _actions;
|
||||
bool _matched = false;
|
||||
bool _paused = false;
|
||||
int _count = 0;
|
||||
};
|
||||
|
||||
Macro *GetMacroByName(const char *name);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@
|
|||
#include "headers/macro-condition-edit.hpp"
|
||||
#include "headers/macro-action-scene-switch.hpp"
|
||||
|
||||
#include <limits>
|
||||
#undef max
|
||||
|
||||
const std::map<LogicType, LogicTypeInfo> MacroCondition::logicTypes = {
|
||||
{LogicType::NONE, {"AdvSceneSwitcher.logic.none"}},
|
||||
{LogicType::AND, {"AdvSceneSwitcher.logic.and"}},
|
||||
|
|
@ -85,7 +88,9 @@ bool Macro::PerformAction()
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret && _count != std::numeric_limits<int>::max()) {
|
||||
_count++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user