summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index bbb3e68f..5839204f 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -2053,37 +2053,35 @@ std::optional<std::string> CConfigManager::handleAnimation(const std::string& co
if (enabledInt != 0 && enabledInt != 1)
return "invalid animation on/off state";
- if (enabledInt) {
- int64_t speed = -1;
+ int64_t speed = -1;
- // speed
- if (isNumber(ARGS[2], true)) {
- speed = std::stof(ARGS[2]);
+ // speed
+ if (isNumber(ARGS[2], true)) {
+ speed = std::stof(ARGS[2]);
- if (speed <= 0) {
- speed = 1.f;
- return "invalid speed";
- }
- } else {
- speed = 10.f;
+ if (speed <= 0) {
+ speed = 1.f;
return "invalid speed";
}
+ } else {
+ speed = 10.f;
+ return "invalid speed";
+ }
- std::string bezierName = ARGS[3];
- m_AnimationTree.setConfigForNode(ANIMNAME, enabledInt, speed, ARGS[3], ARGS[4]);
+ std::string bezierName = ARGS[3];
+ m_AnimationTree.setConfigForNode(ANIMNAME, enabledInt, speed, ARGS[3], ARGS[4]);
- if (!g_pAnimationManager->bezierExists(bezierName)) {
- const auto PANIMNODE = m_AnimationTree.getConfig(ANIMNAME);
- PANIMNODE->internalBezier = "default";
- return "no such bezier";
- }
+ if (!g_pAnimationManager->bezierExists(bezierName)) {
+ const auto PANIMNODE = m_AnimationTree.getConfig(ANIMNAME);
+ PANIMNODE->internalBezier = "default";
+ return "no such bezier";
+ }
- if (ARGS[4] != "") {
- auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, ARGS[4]);
+ if (ARGS[4] != "") {
+ auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, ARGS[4]);
- if (ERR != "")
- return ERR;
- }
+ if (ERR != "")
+ return ERR;
}
return {};