First commit
This commit is contained in:
parent
6a961987d8
commit
d6578f09fb
53
README.md
53
README.md
@ -44,6 +44,59 @@ In addition DocLib supports image links for the ingame manual:
|
|||||||
See examples in `manual_EN.md`.
|
See examples in `manual_EN.md`.
|
||||||
|
|
||||||
|
|
||||||
|
### Construction Plans
|
||||||
|
|
||||||
|
This is a feature, mainly used by the mod techage to show construction plans of
|
||||||
|
multi-block machines. But it can be used for any other mod, too.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A construction plan is a map with up to 12 * 10 fields.
|
||||||
|
Each field can contain a node/item, text, or an image.
|
||||||
|
The arrangement is defined via a Lua table.
|
||||||
|
|
||||||
|
This is an example of a map with 12 * 10 fields from the demo code in `node.lua`:
|
||||||
|
|
||||||
|
|
||||||
|
```lua
|
||||||
|
|
||||||
|
local ITEM1 = {"item", "doclib_demo_img1.png"}
|
||||||
|
local ITEM2 = {"item", "doclib_demo_img2.png", "Tooltip 1"}
|
||||||
|
local ITEM3 = {"item", "doclib_demo_img3.png", "Tooltip 2"}
|
||||||
|
local ITEM4 = {"item", "doclib_demo_img4.png", "Tooltip 3"}
|
||||||
|
local ITEM5 = {"item", "doclib_book_inv.png", "doclib:manual"}
|
||||||
|
local ITEM6 = {"item", "doclib:manual", "doclib:manual"}
|
||||||
|
local IMG_1 = {"img", "doclib_book_inv.png", "2,2"}
|
||||||
|
local TEXT1 = {"text", "Top view"}
|
||||||
|
local TEXT2 = {"text", "Pointless Demo"}
|
||||||
|
local TEXT3 = {"text", "End"}
|
||||||
|
|
||||||
|
local plan1 = {
|
||||||
|
{TEXT2, false, false, false, false, false, false, false, false, false, false, ITEM4},
|
||||||
|
{false, false, false, TEXT1, false, false, false, false, IMG_1, false, false, false},
|
||||||
|
{false, false, false, false, false, false, false, false, false, false, false, false},
|
||||||
|
{false, false, false, false, ITEM1, false, false, false, false, false, false, false},
|
||||||
|
{false, false, false, ITEM4, ITEM5, ITEM2, false, false, false, false, false, false},
|
||||||
|
{false, false, false, false, ITEM3, false, false, false, false, false, false, false},
|
||||||
|
{false, false, false, false, ITEM6, false, false, false, false, false, false, false},
|
||||||
|
{false, false, false, false, false, false, false, false, false, false, false, false},
|
||||||
|
{false, false, false, false, false, false, false, false, false, false, false, false},
|
||||||
|
{TEXT3, false, false, false, false, false, false, false, false, false, false, ITEM4},
|
||||||
|
}
|
||||||
|
|
||||||
|
doclib.add_manual_plan("doclib", "EN", "demo1", plan1)
|
||||||
|
```
|
||||||
|
|
||||||
|
- Unused field elements are set to `false`
|
||||||
|
- For a text field a table like `{"text", "Pointless Demo"}` is used
|
||||||
|
- For an item field a table like `{"item", "doclib_demo_img2.png", "Tooltip 1"}` is used.
|
||||||
|
The third value is a tooltip. It can be a string, a node name, or `nil` for no tooltip.
|
||||||
|
- For an image field a table like `{"img", "doclib_book_inv.png", "2,2"}` is used.
|
||||||
|
The third value is the image size in fields (width x height).
|
||||||
|
|
||||||
|
With `doclib.add_manual_plan` the plan is stored under the name "demo1".
|
||||||
|
|
||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
Copyright (C) 2023 Joachim Stolberg
|
Copyright (C) 2023 Joachim Stolberg
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user