mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -05:00
Enable getting variable values from date condition
This commit is contained in:
parent
23e2fb8d5a
commit
87ed11d3bf
|
|
@ -59,6 +59,7 @@ static std::map<MacroConditionDate::Day, std::string> dayOfWeekNames = {
|
|||
bool MacroConditionDate::CheckDayOfWeek(int64_t msSinceLastCheck)
|
||||
{
|
||||
QDateTime cur = QDateTime::currentDateTime();
|
||||
SetVariableValue(cur.toString().toStdString());
|
||||
if (_dayOfWeek != Day::ANY &&
|
||||
cur.date().dayOfWeek() != static_cast<int>(_dayOfWeek)) {
|
||||
return false;
|
||||
|
|
@ -131,6 +132,8 @@ bool MacroConditionDate::CheckRegularDate(int64_t msSinceLastCheck)
|
|||
{
|
||||
bool match = false;
|
||||
QDateTime cur = QDateTime::currentDateTime();
|
||||
SetVariableValue(cur.toString().toStdString());
|
||||
|
||||
if (_ignoreDate) {
|
||||
_dateTime.setDate(cur.date());
|
||||
_dateTime2.setDate(cur.date());
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
class MacroConditionDate : public MacroCondition {
|
||||
public:
|
||||
MacroConditionDate(Macro *m) : MacroCondition(m) {}
|
||||
MacroConditionDate(Macro *m) : MacroCondition(m, true) {}
|
||||
bool CheckCondition();
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user