diff options
Diffstat (limited to '')
-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 |