Remove unused terrain commands and functions

This commit is contained in:
2026-04-18 19:48:35 +02:00
parent 517b714844
commit 5ce8d43382

View File

@@ -19,7 +19,6 @@ import { createDeleteBoxBrushCommand } from "../commands/delete-box-brush-comman
import { createDeleteEntityCommand } from "../commands/delete-entity-command";
import { createDeleteProjectAssetCommand } from "../commands/delete-project-asset-command";
import { createDeleteSelectionCommand } from "../commands/delete-selection-command";
import { createDeleteTerrainCommand } from "../commands/delete-terrain-command";
import { createDuplicateSelectionCommand } from "../commands/duplicate-selection-command";
import { createImportAudioAssetCommand } from "../commands/import-audio-asset-command";
import { createImportBackgroundImageAssetCommand } from "../commands/import-background-image-asset-command";
@@ -58,7 +57,6 @@ import { createSetWorldSettingsCommand } from "../commands/set-world-settings-co
import { createUpsertEntityCommand } from "../commands/upsert-entity-command";
import { createUpsertModelInstanceCommand } from "../commands/upsert-model-instance-command";
import { createUpsertPathCommand } from "../commands/upsert-path-command";
import { createUpsertTerrainCommand } from "../commands/upsert-terrain-command";
import { createUpsertInteractionLinkCommand } from "../commands/upsert-interaction-link-command";
import {
applySameKindSelectionClick,
@@ -71,13 +69,11 @@ import {
getSingleSelectedModelInstanceId,
getSingleSelectedPathOwnerId,
getSingleSelectedPathPoint,
getSingleSelectedTerrainId,
isBrushFaceSelected,
isBrushSelected,
isPathPointSelected,
isPathSelected,
isSelectionActiveId,
isTerrainSelected,
resolveSelectionActiveId,
type EditorSelection
} from "../core/selection";
@@ -202,13 +198,6 @@ import {
type ScenePath,
type ScenePathPoint
} from "../document/paths";
import {
createTerrain,
getTerrainBounds,
getTerrainKindLabel,
getTerrains,
type Terrain
} from "../document/terrains";
import {
areProjectTimeSettingsEqual,
cloneProjectTimeSettings,
@@ -1091,6 +1080,19 @@ function getSelectedPath(
return paths.find((path) => path.id === selectedPathId) ?? null;
}
function getSelectedTerrain(
selection: EditorSelection,
terrains: Terrain[]
): Terrain | null {
const selectedTerrainId = getSingleSelectedTerrainId(selection);
if (selectedTerrainId === null) {
return null;
}
return terrains.find((terrain) => terrain.id === selectedTerrainId) ?? null;
}
function getSelectedPathPointState(
selection: EditorSelection,
path: ScenePath | null
@@ -1240,6 +1242,17 @@ function getPathLabelById(pathId: string, paths: ScenePath[]): string {
: getScenePathLabel(paths[pathIndex], pathIndex);
}
function getTerrainLabel(terrain: Terrain, index: number): string {
return terrain.name ?? `Terrain ${index + 1}`;
}
function getTerrainLabelById(terrainId: string, terrains: Terrain[]): string {
const terrainIndex = terrains.findIndex((terrain) => terrain.id === terrainId);
return terrainIndex === -1
? getTerrainKindLabel()
: getTerrainLabel(terrains[terrainIndex], terrainIndex);
}
function formatAuthoredObjectStateSummary(state: {
visible: boolean;
enabled: boolean;