Skip to content
Snippets Groups Projects
Commit b1dcbc9e authored by stuebinm's avatar stuebinm
Browse files

add adjustment: add prefix for openWebsite

parent 6c674fa7
No related branches found
No related tags found
No related merge requests found
......@@ -3,5 +3,6 @@
"ScriptInject":null,
"AllowScripts":true,
"MaxWarnLevel":"Suggestion",
"DontCopyAssets":true
"DontCopyAssets":true,
"LinkPrefix":"https://exit.rc3.world?link="
}
......@@ -40,6 +40,7 @@ data LintConfig f = LintConfig
-- ^ Don't copy map assets (mostly useful for development)
, configAllowScripts :: HKD f Bool
-- ^ Allow defining custom scripts in maps
, configLinkPrefix :: HKD f Text
} deriving (Generic)
type LintConfig' = LintConfig Identity
......
......@@ -153,7 +153,10 @@ checkLayerProperty p@(Property name _value) = case name of
uselessEmptyLayer
suggestProperty $ Property "openWebsiteTrigger" (StrProp "onaction")
unwrapLink p $ \link -> if "https://" `isPrefixOf` link
then dependsOn $ Link link
then do
dependsOn $ Link link
prefix <- lintConfig configLinkPrefix
setProperty "openWebsite" (prefix <> link)
else unwrapPath link (dependsOn . Local)
"openWebsiteTrigger" -> do
isString p
......@@ -173,7 +176,7 @@ checkLayerProperty p@(Property name _value) = case name of
"allowApi" -> isForbidden
"exitUrl" -> do
forbidEmptyLayer
unwrapLink p $ \link -> if "https://" `isPrefixOf` link
unwrapLink p $ \link -> if "/" `isPrefixOf` link
then dependsOn $ MapLink link
else unwrapPath link (dependsOn . LocalMap)
"startLayer" -> do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment