Add temp var for last replay buffer save path
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:
WarmUpTill 2025-11-11 18:59:32 +01:00 committed by WarmUpTill
parent 555f7c1381
commit e6e9f3a831
3 changed files with 23 additions and 6 deletions

View File

@ -2317,6 +2317,9 @@ AdvSceneSwitcher.tempVar.mqtt.message="Message"
AdvSceneSwitcher.tempVar.cursor.x="Cursor position (X)"
AdvSceneSwitcher.tempVar.cursor.y="Cursor position (Y)"
AdvSceneSwitcher.tempVar.replay.lastSavePath="Last save path"
AdvSceneSwitcher.tempVar.replay.lastSavePath.description="The file path of the last replay buffer saved."
AdvSceneSwitcher.selectScene="--select scene--"
AdvSceneSwitcher.selectCanvas="--select canvas--"
AdvSceneSwitcher.selectPreviousScene="Previous Scene"

View File

@ -58,6 +58,10 @@ bool MacroConditionReplayBuffer::ReplayBufferWasSaved()
bool MacroConditionReplayBuffer::CheckCondition()
{
char *lastSavePath = obs_frontend_get_last_replay();
SetTempVarValue("lastSavePath", lastSavePath ? lastSavePath : "");
bfree(lastSavePath);
switch (_state) {
case Condition::STOP:
return !obs_frontend_replay_buffer_active();
@ -85,6 +89,16 @@ bool MacroConditionReplayBuffer::Load(obs_data_t *obj)
return true;
}
void MacroConditionReplayBuffer::SetupTempVars()
{
MacroCondition::SetupTempVars();
AddTempvar(
"lastSavePath",
obs_module_text("AdvSceneSwitcher.tempVar.replay.lastSavePath"),
obs_module_text(
"AdvSceneSwitcher.tempVar.replay.lastSavePath.description"));
}
static inline void populateStateSelection(QComboBox *list)
{
for (const auto &entry : conditions) {

View File

@ -6,7 +6,7 @@
namespace advss {
class MacroConditionReplayBuffer : public MacroCondition {
class MacroConditionReplayBuffer final : public MacroCondition {
public:
MacroConditionReplayBuffer(Macro *m) : MacroCondition(m) {}
bool CheckCondition();
@ -27,6 +27,7 @@ public:
Condition _state = Condition::STOP;
private:
void SetupTempVars();
bool ReplayBufferWasSaved();
bool _saveTimeInitialized = false;
@ -35,7 +36,7 @@ private:
static const std::string id;
};
class MacroConditionReplayBufferEdit : public QWidget {
class MacroConditionReplayBufferEdit final : public QWidget {
Q_OBJECT
public:
@ -55,11 +56,10 @@ public:
private slots:
void StateChanged(int value);
protected:
QComboBox *_state;
std::shared_ptr<MacroConditionReplayBuffer> _entryData;
private:
QComboBox *_state;
std::shared_ptr<MacroConditionReplayBuffer> _entryData;
bool _loading = true;
};