mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-23 02:27:29 -05:00
Fix temp var references not being resolved on macro copy and import
This commit is contained in:
parent
6cbfc48736
commit
aa1b10425f
|
|
@ -561,9 +561,7 @@ void SwitcherData::LoadSettings(obs_data_t *obj)
|
|||
LoadHotkeys(obj);
|
||||
LoadUISettings(obj);
|
||||
|
||||
for (const auto &func : postLoadSteps) {
|
||||
func();
|
||||
}
|
||||
RunPostLoadSteps();
|
||||
|
||||
// Reset on startup and scene collection change
|
||||
switcher->lastOpenedTab = -1;
|
||||
|
|
|
|||
|
|
@ -449,6 +449,7 @@ void AdvSceneSwitcher::ImportMacros()
|
|||
for (const auto ¯o : importedMacros) {
|
||||
macro->PostLoad();
|
||||
}
|
||||
RunPostLoadSteps();
|
||||
|
||||
ui->macros->Reset(GetMacros(),
|
||||
GetGlobalMacroProperties()._highlightExecuted);
|
||||
|
|
@ -995,6 +996,7 @@ void AdvSceneSwitcher::CopyMacro()
|
|||
newMacro->Load(data);
|
||||
newMacro->PostLoad();
|
||||
newMacro->SetName(name);
|
||||
RunPostLoadSteps();
|
||||
Macro::PrepareMoveToGroup(macro->Parent(), newMacro);
|
||||
|
||||
ui->macros->Add(newMacro, macro);
|
||||
|
|
|
|||
|
|
@ -179,6 +179,14 @@ void SwitcherData::AddIntervalResetStep(std::function<void()> function,
|
|||
resetIntervalSteps.emplace_back(function);
|
||||
}
|
||||
|
||||
void SwitcherData::RunPostLoadSteps()
|
||||
{
|
||||
for (const auto &func : postLoadSteps) {
|
||||
func();
|
||||
}
|
||||
postLoadSteps.clear();
|
||||
}
|
||||
|
||||
void SwitcherData::AddPluginInitStep(std::function<void()> function)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(switcher->m);
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ public:
|
|||
void AddLoadStep(std::function<void(obs_data_t *)>);
|
||||
void AddPostLoadStep(std::function<void()>);
|
||||
void AddIntervalResetStep(std::function<void()>, bool lock = true);
|
||||
void RunPostLoadSteps();
|
||||
void AddPluginInitStep(std::function<void()>);
|
||||
void AddPluginPostLoadStep(std::function<void()>);
|
||||
void AddPluginCleanupStep(std::function<void()>);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ void AddIntervalResetStep(std::function<void()> step, bool lock)
|
|||
GetSwitcher()->AddIntervalResetStep(step, lock);
|
||||
}
|
||||
|
||||
void RunPostLoadSteps()
|
||||
{
|
||||
GetSwitcher()->RunPostLoadSteps();
|
||||
}
|
||||
|
||||
void AddPluginInitStep(std::function<void()> step)
|
||||
{
|
||||
GetSwitcher()->AddPluginInitStep(step);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ EXPORT void AddSaveStep(std::function<void(obs_data_t *)>);
|
|||
EXPORT void AddLoadStep(std::function<void(obs_data_t *)>);
|
||||
EXPORT void AddPostLoadStep(std::function<void()>);
|
||||
EXPORT void AddIntervalResetStep(std::function<void()>, bool lock = true);
|
||||
EXPORT void RunPostLoadSteps();
|
||||
|
||||
EXPORT void AddPluginInitStep(std::function<void()>);
|
||||
EXPORT void AddPluginPostLoadStep(std::function<void()>);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user