mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
Merge branch 'main' into animation
This commit is contained in:
commit
49e7f2c631
89 changed files with 1050 additions and 687 deletions
|
|
@ -69,6 +69,7 @@ Rotation profile (set of available block rotations and behaviour of placing bloc
|
|||
- "pipe" - wood logs, pipes, pillars
|
||||
- "pane" - panels, doors, signs
|
||||
- "stairs" - "pane" + flipped variants
|
||||
- "ladder" - like a "pipe", but on horizontal surfaces it is installed like "pane"
|
||||
|
||||
### *particles*
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ gui.confirm(
|
|||
## Documents and templates
|
||||
|
||||
```lua
|
||||
-- Loads a UI document with its script, returns the name of the document if successfully loaded.
|
||||
-- Loads a UI document with its script. Returns document environment table
|
||||
gui.load_document(
|
||||
-- Path to the xml file of the page. Example: `core:layouts/pages/main.xml`
|
||||
path: str,
|
||||
|
|
@ -147,7 +147,7 @@ gui.load_document(
|
|||
name: str
|
||||
-- Table of parameters passed to the on_open event
|
||||
args: table
|
||||
) -> str
|
||||
) -> table
|
||||
|
||||
-- Loads and processes layout template from file
|
||||
gui.template(
|
||||
|
|
|
|||
|
|
@ -57,6 +57,10 @@ hud.get_block_inventory() -> int
|
|||
-- Gives the ID of the second open inventory (block, virtual inventory...) or 0.
|
||||
hud.get_second_inventory() -> int
|
||||
|
||||
-- Get the inventory ID of exchange item (grabbed item in inventory) or 0.
|
||||
-- It has only one slot - 0
|
||||
hud.get_exchange_inventory() -> int
|
||||
|
||||
-- Gives the ID of the player that the UI is bound to.
|
||||
hud.get_player() -> int
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ Called on block broken by player
|
|||
function on_replaced(x, y, z, playerid)
|
||||
```
|
||||
|
||||
Called on block replaced with other by player
|
||||
Called before a player replaces a block
|
||||
|
||||
```lua
|
||||
function on_interact(x, y, z, playerid) -> bool
|
||||
|
|
|
|||
|
|
@ -212,10 +212,27 @@ local map = Heightmap(width, height)
|
|||
Operations apply to all height values.
|
||||
|
||||
```lua
|
||||
-- Convert to absolute values
|
||||
map:abs()
|
||||
```
|
||||
|
||||
Casts height values to absolute.
|
||||
-- Round down
|
||||
map:floor()
|
||||
|
||||
-- Round up
|
||||
map:ceil()
|
||||
|
||||
-- Round to the nearest integer
|
||||
map:round()
|
||||
|
||||
-- Sine of height values (in radians)
|
||||
map:sin()
|
||||
|
||||
-- Cosine of height values (in radians)
|
||||
map:cos()
|
||||
|
||||
-- Tangent of height values (in radians)
|
||||
map:tan()
|
||||
```
|
||||
|
||||
### Binary Operations
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ Examples:
|
|||
- `position-func` - position supplier for an element (two numbers), called on every parent container size update or on element adding on a container. May be called before *on_hud_open*
|
||||
- `size-func` - element size provider (two numbers), called when the size of the container in which the element is located changes, or when an element is added to the container. Can be called before on_hud_open is called.
|
||||
- `onclick` - lua function called when an element is clicked.
|
||||
- `onrightclick` - lua function called when the right mouse button is pressed on an element.
|
||||
- `onmiddleclick` - lua function called when the middle mouse button is pressed on an element.
|
||||
- `ondoubleclick` - lua function called when you double click on an element.
|
||||
- `onfocus` - lua function called when focusing on an element.
|
||||
- `ondefocus` - lua function called when the element loses focus.
|
||||
|
|
@ -192,6 +194,9 @@ Example of list description:
|
|||
- `width` - minimum content width. Default: 100.
|
||||
- `selected` - initially selected value. Default: "".
|
||||
- `onselect` - function to which the user-selected value is passed
|
||||
- `mode` - behaviour / display mode:
|
||||
- `select` - default mode.
|
||||
- `button` - button mode: the text is not replaced with the selected option; the element rendered as a regular button.
|
||||
|
||||
## *bindbox*
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue