Skip to content
Snippets Groups Projects
Commit c82e15ae authored by Sven G. Brönstrup's avatar Sven G. Brönstrup
Browse files

Fixed types of extended scripts properties

parent f3d0f937
Branches extended-scripts
No related tags found
1 merge request!1Extended scripts support
...@@ -261,10 +261,14 @@ checkObjectProperty p@(Property name _) = do ...@@ -261,10 +261,14 @@ checkObjectProperty p@(Property name _) = do
$ complain "property \"soundRadius\" can only be set on objects with \ $ complain "property \"soundRadius\" can only be set on objects with \
\either property \"bell\" or \"door\" also set." \either property \"bell\" or \"door\" also set."
_ | name `elem` [ "default", "persist", "openLayer", "closeLayer" ] -> do _ | name `elem` [ "default", "persist" ] -> do
isBool p isBool p
suggestPropertyName' "door" suggestPropertyName' "door"
-- extended API for doors and bells -- extended API for doors and bells
| name `elem` [ "openLayer", "closeLayer" ] -> do
isString p
suggestPropertyName' "door"
-- extended API for doors and bells
| name `elem` ["door", "bell"] -> do | name `elem` ["door", "bell"] -> do
isBool p isBool p
unless (objectType obj == "variable") $ unless (objectType obj == "variable") $
...@@ -441,9 +445,10 @@ checkTileLayerProperty p@(Property name _value) = case name of ...@@ -441,9 +445,10 @@ checkTileLayerProperty p@(Property name _value) = case name of
"name" -> isUnsupported "name" -> isUnsupported
_ | name `elem` [ "doorVariable", "bindVariable", "bellVariable" ] _ | name `elem` [ "doorVariable", "bindVariable", "bellVariable" ]
-> do { isString p; requireProperty "zone" } -> do { isString p; requireProperty "zone" }
| name `elem` [ "autoOpen", "autoClose", "code" | name `elem` [ "code", "openTriggerMessage", "closeTriggerMessage"]
, "openTriggerMessage", "closeTriggerMessage"]
-> do { isString p; requireProperty "doorVariable" } -> do { isString p; requireProperty "doorVariable" }
| name `elem` [ "autoOpen", "autoClose"]
-> do { isBool p; requireProperty "doorVariable" }
| name `elem` [ "bellButtonText", "bellPopup" ] | name `elem` [ "bellButtonText", "bellPopup" ]
-> do { isString p; requireProperty "bellVariable" } -> do { isString p; requireProperty "bellVariable" }
| name `elem` [ "enterValue", "leaveValue" ] | name `elem` [ "enterValue", "leaveValue" ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment