public sealed class FoliageModeThe viewport mode foliage is painted in.
Remarks
The fourth mode, and the first that requires nothing — [docs/plan/31 § Two modes, not three, and not one]. Sculpt and paint need a terrain and act on its texels; foliage paints onto any surface — a terrain, a blockout mesh, an imported cliff, a roof — and its filter set is the feature rather than an accident. One mode that did both would have to answer "what is the target surface" twice with different answers.
⚠ The digits are slots here too, and for the same reason they are in TerrainMode. Six tools rather than eight, and a digit past the sixth does nothing — a slot command means "the third tool", which is what the design sentence means, and the named commands keep the words the palette is searched with.
⚠ An empty palette shows the palette, not an empty strip. Entering a mode that does nothing and says nothing is the state every one of these toolsets puts a new user in, and Refusal is what the panel says instead.
Fields and properties (25)
public const string ModeIdWhat the mode is called, everywhere an id is wanted.
public const string FoliageContextThe command context the mode claims while it is active.
public const string PanelIdWhat the panel the mode opens is registered as.
public string IdWhat everything refers to it by: select, blockout.
public StringId TitleWhat the mode bar's button says.
public PathBuilder? Iconpublic IconArt? ArtColoured art for the mode's button, drawn with the title underneath.
public string? ContextWhich command context the mode claims while it is active, or .
public string? Panelpublic IReadOnlyList<ToolbarEntry> ToolbarWhat the mode puts on the mode bar beside the mode buttons.
public static IReadOnlyList<FoliageTool> ToolsThe six tools, in the order the strip lists them.
public const int SlotCountHow many digits the mode claims.
public FoliageEdit EditingThe editing state the mode drives.
public EditorDocument? DocumentThe document a committed stroke goes onto, or null while the mode drives none.
public float ReachHow far a pointer ray looks for a surface, in metres.
public float GroundHeightWhere the ground is, for a ray that has to meet something.
public bool HasPaletteWhether there is a palette to paint from.
public FoliageTool ToolWhich tool a drag runs.
public const string GrowBrushCommandMakes the brush bigger.
public const string ShrinkBrushCommandAnd smaller.
public const string AddTypeCommandAdds a type to the palette.
public const string RemoveTypeCommandRemoves the chosen ones, and every instance of them.
public const string DeselectCommandDeselects every instance.
public const string DeleteSelectionCommandDeletes the selected instances.
public static IReadOnlyList<string> CommandsEvery verb the mode registers besides the tools.
Events (2)
public Action<IEditorCommand>? CommittedRaised when a stroke has been committed, with the entry that undoes it.
public Action<FoliageTool>? ToolChangedRaised when Tool changes.
Methods (13)
public bool SelectSlot(int slot)Selects the th tool, 0-based.
public static string ToolCommand(FoliageTool tool)What the command that selects a tool is called.
public static string SlotCommand(int slot)What the command bound to a digit is called.
public void Register(EditorShell shell)Puts the mode's commands, bindings and panels into the shell.
public void Unregister(EditorShell shell)Takes them back out.
public void Activated()The mode has become the active one.
public void Deactivated()public bool Pointer(PointerEvent args)First refusal on a pointer event in the viewport.
public bool Key(KeyEvent args)First refusal on a key event in the viewport.
public bool Pointer(SceneViewport pane, PointerEvent args)public bool Key(SceneViewport pane, KeyEvent args)Offers a key event to it.
public IEditorCommand? Commit()Ends the stroke and puts it on the document's stack.
public IEditorCommand? DeleteSelection()Deletes what is selected, as one entry.
Used by (5)
- EditorModeTestsVixen.Editor.App.Tests
- FoliageModeTestsVixen.Editor.Terrain.Tests
- TerrainModuleVixen.Editor.Terrain
- TerrainPanelTestsVixen.Editor.App.Tests
- TerrainSessionTestsVixen.Editor.App.Tests