The Lord of the Rings Minecraft Mod Wiki
Advertisement
The Lord of the Rings Minecraft Mod Wiki

 0 

Renew this page to show changes

Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:Bar_simple/doc to edit this documentation. (How does this work?)

Description

This template creates a bar of similar icons.

It is a very simple version of the bar templates and called by the more comfortable {{Bar main}} template. It uses several bar templates to handle the actual display.

It handles

It handles not

  • Missing parameters -> Has to be done by calling template.
  • Displaying plain text if non-numeric -> Has to be done by calling template.
  • Calculate price ranges -> Has to be done by calling template.
  • Avoid the whole display wrapping around lines -> Has to be done by calling template.
  • Putting tags around the simple bar(s) -> Has to be done by calling template.
  • Displaying a range of values -> Has to be done by calling template.
  • Displaying the low level bar of icons itself -> Uses the {{Bar raw}} template for that.

Syntax

Type {{Bar simple|<type>|<number>|<options>}} somewhere.

  • <type> is the basic filename e.g. armour. The user must first provide a couple of images in advance: 0armour.png, 1armour.png, ..., 10armour.png to be able to display the respective icon bar. The images (at least that for 10) must have a small clear left margin, so when joined together, they look equally distributed. Defaut is hearts.There is a special display for coins.
  • <number> is the number of icons to be displayed. The number must be a numeric expression and will be rounded to the nearest integer. Default is 0. Causes error, when non-numeric!
  • <options> the options are so far:
    • ext=<extension> extension of the filename .jpg, .gif, ... default is .png
    • size=<size> height of the bar in px. Default is original size.
      You can also use a symbolic name here, like infobox, which selects a predefined size as defined in the {{Bar height}} template.
    • tooltip=<text> to define the text, which is shown, when hovering over the bar, default is the <number> parameter.
    • link=<text> to define the link, where the bar links to. Defaults are defined in the {{Bar link}} template.

Samples

type this to get this
{{Bar simple}}
No parameters -> default.
 0 
{{Bar simple||4}}
No type -> defaut type.
 4 
{{Bar simple|armour}}
No number -> default number.
 0 
{{Bar simple|hearts|some text}}
Non numeric -> error.
Expression error: Unexpected < operator.
{{Bar simple|food|6.9}}
Rounding numbers to next integer.
 6.9 
{{Bar simple|hearts|83.3}}
Large numbers -> compacted display.
41.5 x  83.3 
{{Bar simple|coins|243.7}}
Coins -> special display.
 243.7  243.7  243.7 
{{Bar simple||5|ext=.jpg}}
Extension specified -> not .png.
 5 
{{Bar simple|armour|8.3|size=9}}
Different size.
 8.3 
{{Bar simple||5|size=infobox}}
Predefined size.
 5 
{{Bar simple||10|tooltip=???}}
Tooltip defined.
 ??? 
{{Bar simple||10|link=Corn}}
Link defined.
 10