diff options
-rw-r--r-- | lib/Properties.hs | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs index 4a16927..7fc58c9 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -295,8 +295,27 @@ checkObjectProperty obj p@(Property name _) = case name of suggest "set \"soundRadius\" to a limit the door sound to a certain area\"." suggestProperty "door" + + -- | these properties are used by the extended script to allow doors + "bell" -> do + isBool p + unless (objectType obj == "variable") $ + complain "Bell variables must be of type \"variable\"" + when (null (objectName obj) || objectName obj == Just mempty) $ + complain "Bell variables objects must have a name given" + "bellSound" -> do + isString p + + unwrapURI (Proxy @"audio") p + (dependsOn . Link) + (dependsOn . Local) + + suggestProperty "bell" + + -- | Applies to doors and bells as well "soundRadius" -> do isInt p + -- requireAnyProperty "door" "bell" _ -> warn $ "unknown object property " <> prettyprint name <> "." @@ -451,19 +470,32 @@ checkTileLayerProperty p@(Property name _value) = case name of requireProperty "zone" "autoOpen" -> do isBool p - requireProperty "zone" + requireProperty "doorVariable" "autoClose" -> do isBool p - requireProperty "zone" + requireProperty "doorVariable" "code" -> do isString p - requireProperty "zone" + requireProperty "doorVariable" "openTriggerMessage" -> do isString p - requireProperty "zone" + requireProperty "doorVariable" "closeTriggerMessage" -> do isString p + requireProperty "doorVariable" + + -- | these properties are used by the extended script to allow bells + + "bellVariable" -> do + isString p requireProperty "zone" + "bellButtonText" -> do + isString p + requireProperty "bellVariable" + "bellPopup" -> do + isString p + requireProperty "bellVariable" + -- name on tile layer unsupported "name" -> isUnsupported |