mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Add "Next Macro" temp var to Sequence actions when setting index
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
This commit is contained in:
parent
e64f2d195e
commit
2405b6dbbf
|
|
@ -2358,6 +2358,8 @@ AdvSceneSwitcher.tempVar.replay.lastSavePath.description="The file path of the l
|
||||||
|
|
||||||
AdvSceneSwitcher.tempVar.sequence.macro="Macro"
|
AdvSceneSwitcher.tempVar.sequence.macro="Macro"
|
||||||
AdvSceneSwitcher.tempVar.sequence.macro.description="The name of the macro executed by the \"Sequence\" action.\nIf no macro was executed the returned value is the empty string."
|
AdvSceneSwitcher.tempVar.sequence.macro.description="The name of the macro executed by the \"Sequence\" action.\nIf no macro was executed the returned value is the empty string."
|
||||||
|
AdvSceneSwitcher.tempVar.sequence.nextMacro="Next Macro"
|
||||||
|
AdvSceneSwitcher.tempVar.sequence.nextMacro.description="The name of the macro which will be executed next after the index was set.\nIf no macro will be executed the returned value is the empty string."
|
||||||
|
|
||||||
AdvSceneSwitcher.tempVar.random.macro="Macro"
|
AdvSceneSwitcher.tempVar.random.macro="Macro"
|
||||||
AdvSceneSwitcher.tempVar.random.macro.description="The name of the macro executed by the \"Random\" action.\nIf no macro was executed the returned value is the empty string."
|
AdvSceneSwitcher.tempVar.random.macro.description="The name of the macro executed by the \"Random\" action.\nIf no macro was executed the returned value is the empty string."
|
||||||
|
|
|
||||||
|
|
@ -105,18 +105,21 @@ bool MacroActionSequence::RunSequence()
|
||||||
return RunMacroActions(macro.get());
|
return RunMacroActions(macro.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroActionSequence::SetSequenceIndex() const
|
bool MacroActionSequence::SetSequenceIndex()
|
||||||
{
|
{
|
||||||
auto macro = _macro.GetMacro();
|
auto macro = _macro.GetMacro();
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
|
SetTempVarValue("nextMacro", "");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto actions = GetMacroActions(macro.get());
|
auto actions = GetMacroActions(macro.get());
|
||||||
if (!actions) {
|
if (!actions) {
|
||||||
|
SetTempVarValue("nextMacro", "");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string nextMacroName;
|
||||||
for (const auto &action : *actions) {
|
for (const auto &action : *actions) {
|
||||||
if (action->GetId() != id) {
|
if (action->GetId() != id) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -130,7 +133,10 @@ bool MacroActionSequence::SetSequenceIndex() const
|
||||||
// -2 is needed since the _lastIndex starts at -1 and the reset
|
// -2 is needed since the _lastIndex starts at -1 and the reset
|
||||||
// index starts at 1
|
// index starts at 1
|
||||||
sequenceAction->_lastIdx = _resetIndex - 2;
|
sequenceAction->_lastIdx = _resetIndex - 2;
|
||||||
|
nextMacroName = GetMacroName(
|
||||||
|
sequenceAction->GetNextMacro(false).GetMacro().get());
|
||||||
}
|
}
|
||||||
|
SetTempVarValue("nextMacro", nextMacroName);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -138,15 +144,21 @@ void MacroActionSequence::SetupTempVars()
|
||||||
{
|
{
|
||||||
MacroAction::SetupTempVars();
|
MacroAction::SetupTempVars();
|
||||||
|
|
||||||
if (_action != Action::RUN_SEQUENCE) {
|
if (_action == Action::RUN_SEQUENCE) {
|
||||||
return;
|
AddTempvar(
|
||||||
|
"macro",
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.tempVar.sequence.macro"),
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.tempVar.sequence.macro.description"));
|
||||||
|
} else if (_action == Action::SET_INDEX) {
|
||||||
|
AddTempvar(
|
||||||
|
"nextMacro",
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.tempVar.sequence.nextMacro"),
|
||||||
|
obs_module_text(
|
||||||
|
"AdvSceneSwitcher.tempVar.sequence.nextMacro.description"));
|
||||||
}
|
}
|
||||||
|
|
||||||
AddTempvar(
|
|
||||||
"macro",
|
|
||||||
obs_module_text("AdvSceneSwitcher.tempVar.sequence.macro"),
|
|
||||||
obs_module_text(
|
|
||||||
"AdvSceneSwitcher.tempVar.sequence.macro.description"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroActionSequence::PerformAction()
|
bool MacroActionSequence::PerformAction()
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool RunSequence();
|
bool RunSequence();
|
||||||
bool SetSequenceIndex() const;
|
bool SetSequenceIndex();
|
||||||
|
|
||||||
void SetupTempVars();
|
void SetupTempVars();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user