Vixen
02b45cc4
csharp
public sealed class FoliageMode

The viewport mode foliage is painted in.

Read the guide page for this →

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 ModeId

    What the mode is called, everywhere an id is wanted.

  • public const string FoliageContext

    The command context the mode claims while it is active.

  • public const string PanelId

    What the panel the mode opens is registered as.

  • public string Id

    What everything refers to it by: select, blockout.

  • public StringId Title

    What the mode bar's button says.

  • public PathBuilder? Icon
  • public IconArt? Art

    Coloured art for the mode's button, drawn with the title underneath.

  • public string? Context

    Which command context the mode claims while it is active, or .

  • public string? Panel
  • public IReadOnlyList<ToolbarEntry> Toolbar

    What the mode puts on the mode bar beside the mode buttons.

  • public static IReadOnlyList<FoliageTool> Tools

    The six tools, in the order the strip lists them.

  • public const int SlotCount

    How many digits the mode claims.

  • public FoliageEdit Editing

    The editing state the mode drives.

  • public EditorDocument? Document

    The document a committed stroke goes onto, or null while the mode drives none.

  • public float Reach

    How far a pointer ray looks for a surface, in metres.

  • public float GroundHeight

    Where the ground is, for a ray that has to meet something.

  • public bool HasPalette

    Whether there is a palette to paint from.

  • public FoliageTool Tool

    Which tool a drag runs.

  • public const string GrowBrushCommand

    Makes the brush bigger.

  • public const string ShrinkBrushCommand

    And smaller.

  • public const string AddTypeCommand

    Adds a type to the palette.

  • public const string RemoveTypeCommand

    Removes the chosen ones, and every instance of them.

  • public const string DeselectCommand

    Deselects every instance.

  • public const string DeleteSelectionCommand

    Deletes the selected instances.

  • public static IReadOnlyList<string> Commands

    Every verb the mode registers besides the tools.

Events (2)

  • public Action<IEditorCommand>? Committed

    Raised when a stroke has been committed, with the entry that undoes it.

  • public Action<FoliageTool>? ToolChanged

    Raised 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