From f641c205647d9a55455dee2f7af57641bcc2a5a9 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Sun, 13 Oct 2024 11:39:07 +0200 Subject: [PATCH] Add SetTempVarValue() overload to support boolean values --- lib/macro/macro-segment.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/macro/macro-segment.hpp b/lib/macro/macro-segment.hpp index f0d1f751..8532d263 100644 --- a/lib/macro/macro-segment.hpp +++ b/lib/macro/macro-segment.hpp @@ -51,8 +51,17 @@ protected: virtual void SetupTempVars(); void AddTempvar(const std::string &id, const std::string &name, const std::string &description = ""); + void SetTempVarValue(const std::string &id, const std::string &value); + template, bool>::value>> + void SetTempVarValue(const std::string &id, T value) + { + SetTempVarValue(id, value ? std::string("true") + : std::string("false")); + } + private: void ClearAvailableTempvars(); std::optional