summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven G. Brönstrup2021-12-19 19:14:12 +0100
committerSven G. Brönstrup2021-12-19 19:14:12 +0100
commit864235b3222563dceace6e8981cba6e7145585f9 (patch)
tree9573236f928ac35879890dbde24b6af5819d10ac
parent9bc7b9bdbb044815712d75b969e7325b388a0f72 (diff)
Added bell properties
-rw-r--r--lib/Properties.hs40
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