TerrainFoliagePropertiesDialog

Package: Libraries.Interface.Controls.Scenes.Dialogs · Inherits from: Libraries.Interface.Events.TextChangeListener, Libraries.Interface.Controls.Control, Libraries.Interface.Forms.FormPrimitiveContainer, Libraries.Interface.Item, Libraries.Interface.Controls.Scenes.Dialogs.PropertiesDialog, Libraries.Interface.Item2D, Libraries.Language.Object, Libraries.Interface.Events.SelectionListener, Libraries.Interface.Controls.Dialog

The TerrainFoliagePropertiesDialog is a selected terrain's Foliage section: the foliage assets it can be covered with, such as trees, rocks and grass. "Add asset..." adds a model file, drawn as itself, or a picture, drawn as a card; a terrain with no foliage list is given one in the project's Scenes/Foliage folder. Which asset the Foliage tool paints is chosen in the Brush section. Each asset is a part that folds, as the Water section's lakes do: a header with the asset's name, and a line under it saying whether it is a model or a card and how many copies it has. Assets are listed in alphabetical order; their order in the list file means nothing to how the foliage is drawn, so it can't be changed here. Opening an asset shows its name, its settings in groups that fold (Placement, Lean and turn, Color and wind, Levels of detail, Shadows) and Remove. One asset is open at a time. Settings are taken when the focus leaves a field. Settings with a bounded range, such as the slopes, lean, turn, tint, hue and wind, are a slider with a number field; they are taken on each key press, at the end of a drag, or when the focus leaves the number field. It shows in the scene editor's Properties panel, after the Materials section.

Variables

  • integer MOVE_UP
  • integer CHOOSE_LEVEL: the level, from 1.
  • integer CASTS_SHADOWS
  • integer REMOVE
  • integer PAINT
  • integer SETTINGS
  • integer RANDOM_TURN
  • integer MOVE_DOWN
  • integer ADD: alphabetically), and are kept so their numbers stay the same.
  • integer ALIGN_TO_NORMAL: the level, from 1.
  • integer CLOSE_SETTINGS

Actions

ButtonActivated(integer kind, integer asset)

This action is called by the section's buttons and checkboxes.

Parameters

  • kind integer: One of the button kinds, such as ADD
  • asset integer: The asset, from 0, for an asset's buttons

FieldLeft(Libraries.Interface.Controls.TextField field)

This action is called when the focus leaves one of the settings' fields: its value is taken. A number out of range is ignored.

Parameters

FocusField()

Moves the focus to the first asset's name, or to "Add asset..." when there are none.

FoldChanged(integer partKey, boolean open)

This action is called when an asset's or a group's header is opened or closed. Opening an asset closes any other, so one is open at a time.

Parameters

  • partKey integer: The part's number
  • open boolean: True if it was opened

Refresh()

Shows the terrain's foliage again, after it changed.

SelectionChanged(Libraries.Interface.Events.SelectionEvent event)

This action shows the dialog when a terrain is selected, and hides it otherwise.

Parameters

SetFields(Libraries.Interface.Controls.Scenes.Items.EditorItem item)

This action sets the fields from a selected terrain's highlight.

Parameters

SetTerrain(Libraries.Interface.Controls.Scenes.Items.EditorTerrain terrain)

This action shows a terrain's foliage assets: a part for each, and the open asset's body under it.

Parameters

SliderChanged(integer place, Libraries.Interface.Events.SliderChangedEvent event)

This action is called when one of the settings' sliders changes, by a key, the mouse, a screen reader, or a number typed in its field. While a drag goes on its field already shows the number, and nothing else is done, since each change rebuilds every cell of the foliage; the setting is taken once the change is final.

Parameters

Inherited Actions

263 actions from Libraries.Interface.Controls.Control
20 actions from Libraries.Interface.Controls.Dialog
34 actions from Libraries.Interface.Controls.Scenes.Dialogs.PropertiesDialog
1 action from Libraries.Interface.Events.TextChangeListener
8 actions from Libraries.Interface.Forms.FormPrimitiveContainer
57 actions from Libraries.Interface.Item
200 actions from Libraries.Interface.Item2D
3 actions from Libraries.Language.Object