1
2
3
4
5
6
7
8
9
10
11
12
13
14\startuniqueMPgraphic{navplus}{size,color,type,mode}
15 color c ; numeric s, t ; path p ;
16 t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ;
17 if \MPvar{mode} = 1 : c := .5[c,white] fi ;
18 if t = 1 :
19 p := ((0,0)--(12,0)--(1,13)--(1,1)--(0,1)--(0,0)cycle)
20 xyscaled (3,4) ;
21 elseif t = 2 :
22 p := ((0,0)--(1,0)--(1,1)--(0,1)--(12,25)--(1,1)--(0,1)cycle)
23 xyscaled (4,3) ;
24 else :
25 p := fullsquare xyscaled (3,3) ;
26 fi ;
27 draw p withpen pencircle scaled (12) withcolor .75white ;
28 fill p withcolor c ;
29 draw p withpen pencircle scaled (13) withcolor .5c ;
30 currentpicture := currentpicture scaled s ;
31 currentpicture := currentpicture shifted center currentpicture ;
32\stopuniqueMPgraphic
33
34\setupMPvariables
35 [navplus]
36 [size=1ex,
37 color=black,
38 type=1,
39 mode=0]
40
41\definepalet
42 [navplus]
43 [attach=darkred,
44 comment=darkblue]
45
46\definesymbol
47 [commentnormal]
48 [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}]
49\definesymbol
50 [commentdown]
51 [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}]
52
53\definesymbol
54 [attachnormal]
55 [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach}]
56\definesymbol
57 [attachdown]
58 [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}]
59
60\unprotect
61
62\setupcomment [\c!symbol={commentnormal,commentdown}]
63\setupattachments[\c!symbol={attachnormal,attachdown}]
64
65\protect \endinput
66 |