| 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 Dark)"/> |
| 6 | </head><body style="background-color:#232629;color:#cfcfc2"><pre> |
| 7 | <span style="color:#7a7c7d"># Wesnoth Markup Language</span> |
| 8 | |
| 9 | <span style="color:#27ae60">#textdomain wesnoth-libs</span> |
| 10 | |
| 11 | <span style="color:#27ae60">#define __GUI_WINDOW_HEIGHT</span> |
| 12 | ( |
| 13 | if(<span style="color:#2980b9">window_height </span>= 0, 9999, window_height) |
| 14 | )<span style="color:#27ae60">#enddef</span> |
| 15 | |
| 16 | <span style="color:#27ae60">#define __GUI_WINDOW_FUNCTIONS</span> |
| 17 | def reevaluate_best_size(w, s) |
| 18 | ( |
| 19 | [ |
| 20 | 0, |
| 21 | <span style="color:#7a7c7d">#</span> |
| 22 | debug_print('window ', w), |
| 23 | debug_print('screen ', s) |
| 24 | <span style="color:#7a7c7d">#</span> |
| 25 | ][0] |
| 26 | ); |
| 27 | <span style="color:#27ae60">#enddef</span> |
| 28 | |
| 29 | <span style="color:#7a7c7d"># 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:#8e44ad">{MACRO}</span>] |
| 35 | foo[<span style="color:#f67400">$index</span>] |
| 36 | foo[ 12 ] |
| 37 | |
| 38 | <span style="color:#7a7c7d"># 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:#2980b9">title</span>= <span style="color:#f44f4f">_ "Campaign Designer"</span> |
| 44 | <span style="color:#2980b9">text</span>=<span style="color:#f44f4f">"Your Name"</span> |
| 45 | <span style="font-weight:bold">[/about]</span> |
| 46 | |
| 47 | <span style="font-weight:bold">[window]</span> |
| 48 | <span style="color:#2980b9">id </span>= <span style="color:#f44f4f">"tooltip"</span> |
| 49 | |
| 50 | <span style="font-weight:bold">[resolution]</span> |
| 51 | <span style="color:#2980b9">definition </span>= <span style="color:#f44f4f">"tooltip"</span> |
| 52 | <span style="color:#2980b9">automatic_placement </span>= false |
| 53 | <span style="color:#2980b9">functions </span>= <span style="color:#f44f4f">"</span><span style="color:#8e44ad">{__GUI_WINDOW_FUNCTIONS}</span><span style="color:#f44f4f">"</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:#2980b9">id </span>= <span style="color:#f44f4f">"label"</span> |
| 63 | <span style="color:#2980b9">definition </span>= <span style="color:#f44f4f">"default_small"</span> |
| 64 | |
| 65 | <span style="color:#2980b9">use_markup </span>= true |
| 66 | <span style="color:#2980b9">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:#2980b9">name </span>= preload |
| 81 | <span style="color:#2980b9">first_time_only </span>= no |
| 82 | <span style="font-weight:bold">[lua]</span> |
| 83 | <span style="color:#2980b9">code </span>=<span style="color:#f44f4f"> <<</span> |
| 84 | <span style="font-weight:bold">function</span> narrator<span style="color:#3f8058">(</span><span style="color:#27aeae">t</span><span style="color:#3f8058">)</span> |
| 85 | <span style="color:#7a7c7d">-- Behave like the [message] tag.</span> |
| 86 | <span style="color:#27aeae">wesnoth</span><span style="color:#3f8058">.</span>fire<span style="color:#3f8058">(</span><span style="color:#f44f4f">"message"</span><span style="color:#3f8058">,</span> |
| 87 | <span style="color:#3f8058">{</span> <span style="color:#27aeae">speaker</span> <span style="color:#3f8058">=</span> <span style="color:#f44f4f">"narrator"</span><span style="color:#3f8058">,</span> <span style="color:#27aeae">message</span> <span style="color:#3f8058">=</span> <span style="color:#27aeae">t</span><span style="color:#3f8058">.</span><span style="color:#27aeae">sentence</span> <span style="color:#3f8058">})</span> |
| 88 | <span style="font-weight:bold">end</span> |
| 89 | <span style="color:#f44f4f">>></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:#2980b9">name </span>= turn 1 |
| 95 | <span style="font-weight:bold">[lua]</span> |
| 96 | <span style="color:#2980b9">code </span>=<span style="color:#f44f4f"> <<</span> narrator<span style="color:#3f8058">(...)</span> <span style="color:#f44f4f">>></span> |
| 97 | <span style="font-weight:bold">[args]</span> |
| 98 | <span style="color:#2980b9">sentence </span>= <span style="color:#f44f4f">_ "Hello world!"</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:#2980b9">code </span>=<span style="color:#f44f4f"> <<</span> narrator<span style="color:#3f8058">(...)</span> <span style="color:#f44f4f">>></span> |
| 103 | <span style="font-weight:bold">[args]</span> |
| 104 | <span style="color:#2980b9">sentence </span>= <span style="color:#f44f4f">_ "How are you today?"</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> |