Add validation and update status message for foliage painting/erasing
This commit is contained in:
@@ -9307,6 +9307,16 @@ export function App({ store, draftStorage = null, initialStatusMessage }: AppPro
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(tool === "foliagePaint" || tool === "foliageErase") &&
|
||||||
|
activeFoliageLayer === null
|
||||||
|
) {
|
||||||
|
setStatusMessage(
|
||||||
|
"Create or select a foliage layer before arming foliage mask painting."
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (armedTerrainBrushTool === tool) {
|
if (armedTerrainBrushTool === tool) {
|
||||||
setArmedTerrainBrushTool(null);
|
setArmedTerrainBrushTool(null);
|
||||||
setStatusMessage(
|
setStatusMessage(
|
||||||
@@ -9321,6 +9331,8 @@ export function App({ store, draftStorage = null, initialStatusMessage }: AppPro
|
|||||||
? ` ${getTerrainLayerLabel(
|
? ` ${getTerrainLayerLabel(
|
||||||
clampTerrainPaintLayerIndex(activeTerrainPaintLayerIndex)
|
clampTerrainPaintLayerIndex(activeTerrainPaintLayerIndex)
|
||||||
).toLowerCase()}`
|
).toLowerCase()}`
|
||||||
|
: tool === "foliagePaint" || tool === "foliageErase"
|
||||||
|
? ` for ${activeFoliageLayer?.name ?? "the active foliage layer"}`
|
||||||
: "";
|
: "";
|
||||||
setStatusMessage(
|
setStatusMessage(
|
||||||
`Armed ${getTerrainBrushToolLabel(tool)} terrain brush${paintLayerLabel} for ${getTerrainLabelById(selectedTerrain.id, terrainList)}. Drag in the viewport to edit the selected terrain.`
|
`Armed ${getTerrainBrushToolLabel(tool)} terrain brush${paintLayerLabel} for ${getTerrainLabelById(selectedTerrain.id, terrainList)}. Drag in the viewport to edit the selected terrain.`
|
||||||
|
|||||||
Reference in New Issue
Block a user