mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Add temp variable support to window condition
This commit is contained in:
parent
f89bb1a750
commit
c16a7b93ea
|
|
@ -1411,6 +1411,9 @@ AdvSceneSwitcher.tempVar.audio.sync_offset="Source audio sync offset"
|
|||
AdvSceneSwitcher.tempVar.audio.monitor="Source audio monitor type"
|
||||
AdvSceneSwitcher.tempVar.audio.balance="Source audio balance"
|
||||
|
||||
AdvSceneSwitcher.tempVar.window.window="Window title"
|
||||
AdvSceneSwitcher.tempVar.window.window.description="The window title of the current foreground window."
|
||||
|
||||
AdvSceneSwitcher.selectScene="--select scene--"
|
||||
AdvSceneSwitcher.selectPreviousScene="Previous Scene"
|
||||
AdvSceneSwitcher.selectCurrentScene="Current Scene"
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ bool MacroConditionWindow::WindowRegexMatches(
|
|||
void MacroConditionWindow::SetVariableValueBasedOnMatch(
|
||||
const std::string &matchWindow)
|
||||
{
|
||||
SetTempVarValue("window", matchWindow);
|
||||
if (!IsReferencedInVars()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -173,6 +174,15 @@ std::string MacroConditionWindow::GetShortDesc() const
|
|||
return _window;
|
||||
}
|
||||
|
||||
void MacroConditionWindow::SetupTempVars()
|
||||
{
|
||||
AddTempvar(
|
||||
"window",
|
||||
obs_module_text("AdvSceneSwitcher.tempVar.window.window"),
|
||||
obs_module_text(
|
||||
"AdvSceneSwitcher.tempVar.window.window.description"));
|
||||
}
|
||||
|
||||
MacroConditionWindowEdit::MacroConditionWindowEdit(
|
||||
QWidget *parent, std::shared_ptr<MacroConditionWindow> entryData)
|
||||
: QWidget(parent),
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ public:
|
|||
return std::make_shared<MacroConditionWindow>(m);
|
||||
}
|
||||
|
||||
public:
|
||||
StringVariable _window;
|
||||
RegexConfig _windowRegex;
|
||||
bool _checkTitle = true;
|
||||
|
|
@ -40,6 +39,7 @@ private:
|
|||
bool WindowMatches(const std::vector<std::string> &windowList);
|
||||
bool WindowRegexMatches(const std::vector<std::string> &windowList);
|
||||
void SetVariableValueBasedOnMatch(const std::string &matchWindow);
|
||||
void SetupTempVars();
|
||||
|
||||
static bool _registered;
|
||||
static const std::string id;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user