summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven G. Brönstrup2021-12-19 19:13:29 +0100
committerSven G. Brönstrup2021-12-19 19:13:29 +0100
commit9bc7b9bdbb044815712d75b969e7325b388a0f72 (patch)
tree07c50a3060c377ad7925a3f92aaa440cd9612fc5
parent22ff0a5b31900bc761a25a10db7dcbb197f44e94 (diff)
Only suggert door properties on variables
Diffstat (limited to '')
-rw-r--r--lib/Properties.hs30
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