format_help.lua¶
Functions used in the ingame help windows for formatting the text and pictures.
- image_line(image, count[, text = nil])¶
Aligns the image to a row on the right side with text on the left.
- Parameters:
image – the picture to be aligned to a row.
count – length of the picture row.
text – if given the text aligned on the left side, formatted via richtext.lua functions.
- Returns:
the text on the left and a picture row on the right.
- plot_size_line(size, size_only)¶
Creates a line describing space required on the map. Consists of a header colored text, followed by normal text and an image.
- Parameters:
size – size key. Expected values are “mine”, “port”, “small, “medium”, “big”, “none”.
size_only – size_only key. Optional bool value if size is a space requirement as well.
- Returns:
header followed by normal text and image if a space is required, or empty string.
- dependencies(items[, text = nil])¶
Creates a dependencies line of any length.
- Parameters:
items – ware, worker and/or building descriptions in the correct order from left to right as table (set in {}).
text – comment of the image.
- Returns:
a row of pictures connected by arrows.
- help_ware_amount_line(ware_description, amount)¶
Displays an amount of wares with name and images
- Parameters:
ware_description – The
wl.map.WareDescription
for the ware type to be displayedamount – The amount to show as a number
- Returns:
image_line for the ware type and amount
- help_worker_experience(worker_description, becomes_description)¶
Displays needed experience levels for workers
- Parameters:
worker_description – The
wl.map.WorkerDescription
for the lower-level workerbecomes_description – The
wl.map.WorkerDescription
for the higher-level worker
- Returns:
text describing the needed experience
- help_tool_string(tribe, toolname, no_of_workers)¶
Displays tools with an intro text and images
- Parameters:
tribe – The
wl.map.TribeDescription
for the tribe that uses the toolstoolnames – e.g. {“shovel”, “basket”}.
no_of_workers – the number of workers using the tools; for plural formatting.
- Returns:
image_line for the tools
- help_consumed_wares_workers(tribe, building, program_name)¶
Returns information for which wares and workers in which amounts are consumed by a production program.
- Parameters:
tribe – The
wl.map.TribeDescription
for the tribe that consumes the warebuilding – The
wl.map.BuildingDescription
for the building that runs the programprogram_name – The name of the production program that the info is collected for
- Returns:
A “Ware(s) consumed:” section with image_lines