DescriptionWML

From The Battle for Wesnoth Wiki
Revision as of 14:54, 9 July 2005 by WikiSysop (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A description is a part of the value of a menu attribute. It is used to represent a single option in the menu which consists of an image(called the icon) followed by text.

A description has the format

== ";"+ == if another description precedes it

== "*"+ == if it should be the default selection

"&"+"image//"+"="+//texts main description; different texts separated by +

for example:

difficulty_descriptions="&" + "elvish-fighter.png" + "=" + _"Fighter" + _"(easiest)" +
	";*" + "&" + "elvish-hero.png" + "=" + _"Hero" + ";" +
	"&" + "elvish-champion.png" + _"Champion" + _"(hardest)"

The utility macros(see UtilWML)

{MENU_IMG_TXT icon text}

{MENU_IMG_TXT2 icon text text-2}

can be used to create descriptions more easily. The above example would become:

difficulty_descriptions={MENU_IMG_TXT2 "elvish-fighter.png" _"Fighter" _"(easiest)"} +
	";*" + {MENU_IMG_TXT "elvish-hero.png" _"Hero"} + ";" +
	{MENU_IMG_TXT2 "elvish-champion.png" _"Champion" _"(hardest)"}

See Also