File: tree_help.lua

package info (click to toggle)
widelands 2%3A1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 684,084 kB
  • sloc: cpp: 196,737; ansic: 19,395; python: 8,515; sh: 1,734; xml: 700; makefile: 46; lisp: 25
file content (30 lines) | stat: -rw-r--r-- 929 bytes parent folder | download | duplicates (2)
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
-- RST
-- tree_help.lua
-- -------------
--
-- This script returns a formatted entry for the tree help in the editor.
-- Pass the internal tree name to the coroutine to select the tree type.

include "scripting/richtext.lua"
include "scripting/help.lua"

return {
   func = function(tree_name)
      push_textdomain("widelands_editor")
      local tree = wl.Editor():get_immovable_description(tree_name)
      local result = li_object(tree.name, "")

      -- TRANSLATORS: A header in the editor help. Terrains preferred by a type of tree.
      result = result ..
               vspace(styles.get_size("help_terrain_tree_header_space_before")) ..
               h2(_("Preferred terrains")) ..
               vspace(styles.get_size("help_terrain_tree_header_space_after")) ..
               terrain_affinity_help(tree)

      pop_textdomain()
      return {
         title = tree.species,
         text = result
      }
   end
}