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