mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Add SetTempVarValue() overload to support boolean values
This commit is contained in:
parent
39327be88e
commit
f641c20564
|
|
@ -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<typename T, typename = std::enable_if_t<
|
||||
std::is_same<std::decay_t<T>, bool>::value>>
|
||||
void SetTempVarValue(const std::string &id, T value)
|
||||
{
|
||||
SetTempVarValue(id, value ? std::string("true")
|
||||
: std::string("false"));
|
||||
}
|
||||
|
||||
private:
|
||||
void ClearAvailableTempvars();
|
||||
std::optional<const TempVariable>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user