mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-21 16:55:29 -05:00
do not switch if entry is uninitialized for window, time, region, random
This commit is contained in:
@@ -47,6 +47,9 @@ void SwitcherData::checkRandom(bool &match, OBSWeakSource &scene,
|
||||
std::mt19937 urng(rng());
|
||||
std::shuffle(rs.begin(), rs.end(), urng);
|
||||
for (RandomSwitch &r : rs) {
|
||||
if (!r.initialized())
|
||||
continue;
|
||||
|
||||
if (r.scene == lastRandomScene)
|
||||
continue;
|
||||
scene = r.scene;
|
||||
|
||||
@@ -129,6 +129,9 @@ void SwitcherData::checkScreenRegionSwitch(bool &match, OBSWeakSource &scene,
|
||||
int minRegionSize = 99999;
|
||||
|
||||
for (auto &s : screenRegionSwitches) {
|
||||
if (!s.initialized())
|
||||
continue;
|
||||
|
||||
if (cursorPos.first >= s.minX && cursorPos.second >= s.minY &&
|
||||
cursorPos.first <= s.maxX && cursorPos.second <= s.maxY) {
|
||||
int regionSize = (s.maxX - s.minX) + (s.maxY - s.minY);
|
||||
|
||||
@@ -113,6 +113,9 @@ void SwitcherData::checkTimeSwitch(bool &match, OBSWeakSource &scene,
|
||||
return;
|
||||
|
||||
for (TimeSwitch &s : timeSwitches) {
|
||||
if (!s.initialized())
|
||||
continue;
|
||||
|
||||
if (s.trigger == LIVE)
|
||||
match = checkLiveTime(s, liveTime, interval);
|
||||
else
|
||||
|
||||
@@ -215,6 +215,9 @@ void SwitcherData::checkWindowTitleSwitch(bool &match, OBSWeakSource &scene,
|
||||
|
||||
// Check for match
|
||||
for (WindowSwitch &s : windowSwitches) {
|
||||
if (!s.initialized())
|
||||
continue;
|
||||
|
||||
// True if fullscreen is disabled OR current window is fullscreen
|
||||
bool fullscreen = (!s.fullscreen || isFullscreen(s.window));
|
||||
// True if maximized is disabled OR current window is maximized
|
||||
|
||||
Reference in New Issue
Block a user