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 formatting.lua functions.

Returns

the text on the left and a picture row on the right.

plot_size_line(size)

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”.

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 LuaWareDescription for the ware type to be displayed

  • amount – 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 LuaWorkerDescription for the lower-level worker

  • becomes_description – The LuaWorkerDescription 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 LuaTribeDescription for the tribe that uses the tools

  • toolnames – 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(building, program_name)

Returns information for which wares and workers in which amounts are consumed by a production program.

Parameters
  • tribe – The LuaTribeDescription for the tribe that consumes the ware

  • building – The LuaBuildingDescription for the building that runs the program

  • program_name – The name of the production program that the info is collected for

Returns

A “Ware(s) consumed:” section with image_lines