Move loading / saving of global macro properties

This commit is contained in:
WarmUpTill
2023-12-24 01:32:45 +01:00
committed by WarmUpTill
parent 2147f6d3bf
commit 71e20c4983
3 changed files with 23 additions and 0 deletions

View File

@@ -512,6 +512,7 @@ void SwitcherData::LoadSettings(obs_data_t *obj)
}
LoadMacros(obj);
LoadGlobalMacroProperties(obj);
loadWindowTitleSwitches(obj);
loadScreenRegionSwitches(obj);
loadPauseSwitches(obj);
@@ -548,6 +549,7 @@ void SwitcherData::SaveSettings(obs_data_t *obj)
saveSceneGroups(obj);
SaveMacros(obj);
SaveGlobalMacroProperties(obj);
SaveVariables(obj);
saveWindowTitleSwitches(obj);
saveScreenRegionSwitches(obj);

View File

@@ -9,6 +9,8 @@
namespace advss {
static MacroProperties macroProperties;
void MacroProperties::Save(obs_data_t *obj) const
{
auto data = obs_data_create();
@@ -325,4 +327,19 @@ bool MacroPropertiesDialog::AskForSettings(QWidget *parent,
return true;
}
MacroProperties &GetGlobalMacroProperties()
{
return macroProperties;
}
void SaveGlobalMacroProperties(obs_data_t *obj)
{
macroProperties.Save(obj);
}
void LoadGlobalMacroProperties(obs_data_t *obj)
{
macroProperties.Load(obj);
}
} // namespace advss

View File

@@ -68,4 +68,8 @@ private:
int _conditionsFalseTextRow = -1;
};
MacroProperties &GetGlobalMacroProperties();
void SaveGlobalMacroProperties(obs_data_t *obj);
void LoadGlobalMacroProperties(obs_data_t *obj);
} // namespace advss