Debian Codegraph @

autotests/html/test.pbl.html

raw
1 <!DOCTYPE html>
2 <html><head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4 <title>test.pbl</title>
5 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (Wesnoth Markup Language) - Theme (Breeze Light)"/>
6 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
7 <span style="color:#898887;"># Wesnoth Markup Language</span>
8
9 <span style="color:#006e28;">#textdomain wesnoth-libs</span>
10
11 <span style="color:#006e28;">#define __GUI_WINDOW_HEIGHT</span>
12 (
13 if(<span style="color:#0057ae;">window_height </span>= 0, 9999, window_height)
14 )<span style="color:#006e28;">#enddef</span>
15
16 <span style="color:#006e28;">#define __GUI_WINDOW_FUNCTIONS</span>
17 def reevaluate_best_size(w, s)
18 (
19 [
20 0,
21 <span style="color:#898887;">#</span>
22 debug_print('window ', w),
23 debug_print('screen ', s)
24 <span style="color:#898887;">#</span>
25 ][0]
26 );
27 <span style="color:#006e28;">#enddef</span>
28
29 <span style="color:#898887;"># Don't highlight array indices as tags</span>
30 stored_unit[1].moves
31 other[0][1][2]
32 other[foo][bar]
33
34 foo[<span style="color:#644a9b;">{MACRO}</span>]
35 foo[<span style="color:#b08000;">$index</span>]
36 foo[ 12 ]
37
38 <span style="color:#898887;"># Nested tags</span>
39 <span style="font-weight:bold;">[allow_undo][/allow_undo][not][true]</span>text<span style="font-weight:bold;">[/true][/not]</span>
40 <span style="font-weight:bold;">[foo][bar]</span>text<span style="font-weight:bold;">[/bar][/foo]</span>
41
42 <span style="font-weight:bold;">[about]</span>
43 <span style="color:#0057ae;">title</span>= <span style="color:#bf0303;">_ &quot;Campaign Designer&quot;</span>
44 <span style="color:#0057ae;">text</span>=<span style="color:#bf0303;">&quot;Your Name&quot;</span>
45 <span style="font-weight:bold;">[/about]</span>
46
47 <span style="font-weight:bold;">[window]</span>
48 <span style="color:#0057ae;">id </span>= <span style="color:#bf0303;">&quot;tooltip&quot;</span>
49
50 <span style="font-weight:bold;">[resolution]</span>
51 <span style="color:#0057ae;">definition </span>= <span style="color:#bf0303;">&quot;tooltip&quot;</span>
52 <span style="color:#0057ae;">automatic_placement </span>= false
53 <span style="color:#0057ae;">functions </span>= <span style="color:#bf0303;">&quot;</span><span style="color:#644a9b;">{__GUI_WINDOW_FUNCTIONS}</span><span style="color:#bf0303;">&quot;</span>
54
55 <span style="font-weight:bold;">[grid]</span>
56
57 <span style="font-weight:bold;">[row]</span>
58
59 <span style="font-weight:bold;">[column]</span>
60
61 <span style="font-weight:bold;">[label]</span>
62 <span style="color:#0057ae;">id </span>= <span style="color:#bf0303;">&quot;label&quot;</span>
63 <span style="color:#0057ae;">definition </span>= <span style="color:#bf0303;">&quot;default_small&quot;</span>
64
65 <span style="color:#0057ae;">use_markup </span>= true
66 <span style="color:#0057ae;">wrap </span>= true
67 <span style="font-weight:bold;">[/label]</span>
68
69 <span style="font-weight:bold;">[/column]</span>
70
71 <span style="font-weight:bold;">[/row]</span>
72
73 <span style="font-weight:bold;">[/grid]</span>
74
75 <span style="font-weight:bold;">[/resolution]</span>
76
77 <span style="font-weight:bold;">[/window]</span>
78
79 <span style="font-weight:bold;">[event]</span>
80 <span style="color:#0057ae;">name </span>= preload
81 <span style="color:#0057ae;">first_time_only </span>= no
82 <span style="font-weight:bold;">[lua]</span>
83 <span style="color:#0057ae;">code </span>=<span style="color:#bf0303;"> &lt;&lt;</span>
84 <span style="font-weight:bold;">function</span> narrator<span style="color:#ca60ca;">(</span><span style="color:#0057ae;">t</span><span style="color:#ca60ca;">)</span>
85 <span style="color:#898887;">-- Behave like the [message] tag.</span>
86 <span style="color:#0057ae;">wesnoth</span><span style="color:#ca60ca;">.</span>fire<span style="color:#ca60ca;">(</span><span style="color:#bf0303;">&quot;message&quot;</span><span style="color:#ca60ca;">,</span>
87 <span style="color:#ca60ca;">{</span> <span style="color:#0057ae;">speaker</span> <span style="color:#ca60ca;">=</span> <span style="color:#bf0303;">&quot;narrator&quot;</span><span style="color:#ca60ca;">,</span> <span style="color:#0057ae;">message</span> <span style="color:#ca60ca;">=</span> <span style="color:#0057ae;">t</span><span style="color:#ca60ca;">.</span><span style="color:#0057ae;">sentence</span> <span style="color:#ca60ca;">})</span>
88 <span style="font-weight:bold;">end</span>
89 <span style="color:#bf0303;">&gt;&gt;</span>
90 <span style="font-weight:bold;">[/lua]</span>
91 <span style="font-weight:bold;">[/event]</span>
92
93 <span style="font-weight:bold;">[event]</span>
94 <span style="color:#0057ae;">name </span>= turn 1
95 <span style="font-weight:bold;">[lua]</span>
96 <span style="color:#0057ae;">code </span>=<span style="color:#bf0303;"> &lt;&lt;</span> narrator<span style="color:#ca60ca;">(...)</span> <span style="color:#bf0303;">&gt;&gt;</span>
97 <span style="font-weight:bold;">[args]</span>
98 <span style="color:#0057ae;">sentence </span>= <span style="color:#bf0303;">_ &quot;Hello world!&quot;</span>
99 <span style="font-weight:bold;">[/args]</span>
100 <span style="font-weight:bold;">[/lua]</span>
101 <span style="font-weight:bold;">[lua]</span>
102 <span style="color:#0057ae;">code </span>=<span style="color:#bf0303;"> &lt;&lt;</span> narrator<span style="color:#ca60ca;">(...)</span> <span style="color:#bf0303;">&gt;&gt;</span>
103 <span style="font-weight:bold;">[args]</span>
104 <span style="color:#0057ae;">sentence </span>= <span style="color:#bf0303;">_ &quot;How are you today?&quot;</span>
105 <span style="font-weight:bold;">[/args]</span>
106 <span style="font-weight:bold;">[/lua]</span>
107 <span style="font-weight:bold;">[/event]</span>
108 </pre></body></html>