diff options
author | Sven G. Brönstrup | 2021-12-19 19:13:29 +0100 |
---|---|---|
committer | Sven G. Brönstrup | 2021-12-19 19:13:29 +0100 |
commit | 9bc7b9bdbb044815712d75b969e7325b388a0f72 (patch) | |
tree | 07c50a3060c377ad7925a3f92aaa440cd9612fc5 /lib | |
parent | 22ff0a5b31900bc761a25a10db7dcbb197f44e94 (diff) |
Only suggert door properties on variables
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Properties.hs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs index 65f1822..4a16927 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -261,16 +261,16 @@ checkObjectProperty obj p@(Property name _) = case name of "default" -> do isBool p - requireProperty "door" + suggestProperty "door" "persist" -> do isBool p - requireProperty "door" + suggestProperty "door" "openLayer" -> do isString p - requireProperty "door" + suggestProperty "door" "closeLayer" -> do isString p - requireProperty "door" + suggestProperty "door" "openSound" -> do isString p @@ -278,10 +278,10 @@ checkObjectProperty obj p@(Property name _) = case name of (dependsOn . Link) (dependsOn . Local) - unless (containsProperty obj "soundRadius") - $ suggest "set \"soundRadius\" to a limit the door sound to a certain area\"." + unless (containsProperty obj "soundRadius") $ + suggest "set \"soundRadius\" to a limit the door sound to a certain area\"." - requireProperty "door" + suggestProperty "door" "closeSound" -> do isString p @@ -289,21 +289,21 @@ checkObjectProperty obj p@(Property name _) = case name of (dependsOn . Link) (dependsOn . Local) - requireProperty "door" + unless (containsProperty obj "soundRadius") $ + -- Do not suggest again if already suggested for openSound + unless (containsProperty obj "openSound") $ + suggest "set \"soundRadius\" to a limit the door sound to a certain area\"." + + suggestProperty "door" "soundRadius" -> do isInt p - unless (containsProperty obj "soundRadius") - $ suggest "set \"soundRadius\" to a limit the door sound to a certain area\"." - - requireProperty "door" _ -> warn $ "unknown object property " <> prettyprint name <> "." where - requireProperty req = do + suggestProperty req = do unless (containsProperty obj req) $ - complain( "property " <> prettyprint req <> " is required by property " <> prettyprint name <> ".") - + suggest( "property " <> prettyprint req <> " is suggested for property " <> prettyprint name <> ".") -- | Checks a single (custom) property of an objectgroup layer checkObjectGroupProperty :: Property -> LintWriter Layer |