mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 04:11:06 -05:00
Enable getting variable values from cursor condition
This commit is contained in:
@@ -54,6 +54,8 @@ bool MacroConditionCursor::CheckCondition()
|
||||
case Condition::REGION:
|
||||
ret = cursorPos.first >= _minX && cursorPos.second >= _minY &&
|
||||
cursorPos.first <= _maxX && cursorPos.second <= _maxY;
|
||||
SetVariableValue(std::to_string(cursorPos.first) + " " +
|
||||
std::to_string(cursorPos.second));
|
||||
break;
|
||||
case Condition::MOVING:
|
||||
ret = switcher->cursorPosChanged;
|
||||
@@ -63,6 +65,10 @@ bool MacroConditionCursor::CheckCondition()
|
||||
break;
|
||||
}
|
||||
_lastCheckTime = std::chrono::high_resolution_clock::now();
|
||||
|
||||
if (GetVariableValue().empty()) {
|
||||
SetVariableValue(ret ? "true" : "false");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
class MacroConditionCursor : public MacroCondition {
|
||||
public:
|
||||
MacroConditionCursor(Macro *m) : MacroCondition(m) {}
|
||||
MacroConditionCursor(Macro *m) : MacroCondition(m, true) {}
|
||||
bool CheckCondition();
|
||||
bool Save(obs_data_t *obj) const;
|
||||
bool Load(obs_data_t *obj);
|
||||
|
||||
Reference in New Issue
Block a user