Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
walint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
hub
walint
Commits
c89872d3
Commit
c89872d3
authored
3 years ago
by
stuebinm
Browse files
Options
Downloads
Patches
Plain Diff
suggest setting map meta properties if not given
parent
417087b1
No related branches found
No related tags found
No related merge requests found
Pipeline
#9725
passed
3 years ago
Stage: build
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/Paths.hs
+1
-1
1 addition, 1 deletion
lib/Paths.hs
lib/Properties.hs
+9
-0
9 additions, 0 deletions
lib/Properties.hs
lib/Util.hs
+8
-4
8 additions, 4 deletions
lib/Util.hs
with
18 additions
and
5 deletions
lib/Paths.hs
+
1
−
1
View file @
c89872d3
This diff is collapsed.
Click to expand it.
lib/Properties.hs
+
9
−
0
View file @
c89872d3
...
...
@@ -27,6 +27,7 @@ import Badges (Badge (Badge),
parseToken
)
import
Data.Data
(
Proxy
(
Proxy
))
import
Data.Functor
((
<&>
))
import
Data.List
((
\\
))
import
Data.Maybe
(
fromMaybe
,
isJust
)
import
Data.Set
(
Set
)
import
qualified
Data.Set
as
S
...
...
@@ -83,6 +84,14 @@ checkMap = do
whenLayerCollisions
layers
(
\
(
Property
name
_
)
->
name
==
"exitUrl"
||
name
==
"startLayer"
)
$
\
cols
->
warn
$
"collisions between entry and / or exit layers: "
<>
prettyprint
cols
let
missingMetaInfo
=
[
"mapName"
,
"mapDescription"
,
"mapLink"
,
"mapImage"
]
\\
fmap
getName
(
getProperties
tiledmap
)
unless
(
null
missingMetaInfo
)
$
suggest
$
"consider adding meta information to your map using the "
<>
prettyprint
missingMetaInfo
<>
" properties."
where
-- recursively find all layers (to deal with nested group layers)
collectLayers
::
Tiledmap
->
V
.
Vector
Layer
...
...
This diff is collapsed.
Click to expand it.
lib/Util.hs
+
8
−
4
View file @
c89872d3
...
...
@@ -39,13 +39,14 @@ instance PrettyPrint Aeson.Value where
v
->
(
T
.
pack
.
show
)
v
instance
PrettyPrint
t
=>
PrettyPrint
(
Set
t
)
where
prettyprint
=
T
.
intercalate
", "
.
fmap
prettyprint
.
S
.
toList
prettyprint
=
prettyprint
.
S
.
toList
instance
PrettyPrint
PropertyValue
where
prettyprint
=
\
case
StrProp
str
->
str
BoolProp
bool
->
if
bool
then
"true"
else
"false"
IntProp
int
->
showText
int
FloatProp
float
->
showText
float
-- | here since Unit is sometimes used as dummy type
instance
PrettyPrint
()
where
...
...
@@ -57,6 +58,9 @@ instance PrettyPrint Layer where
instance
PrettyPrint
Tileset
where
prettyprint
=
(
<>
)
"tileset "
.
tilesetName
instance
PrettyPrint
a
=>
PrettyPrint
[
a
]
where
prettyprint
=
T
.
intercalate
", "
.
fmap
prettyprint
printPretty
::
PrettyPrint
a
=>
a
->
IO
()
printPretty
=
putStr
.
T
.
unpack
.
prettyprint
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment