diff --git a/studio/src/renderer/src/bridge/types.ts b/studio/src/renderer/src/bridge/types.ts
index fd440af25..c1a8c6e3a 100644
--- a/studio/src/renderer/src/bridge/types.ts
+++ b/studio/src/renderer/src/bridge/types.ts
@@ -3,7 +3,8 @@
import type { BlockLook } from '../scene/blockLooks'
import type { CoverLook } from '../scene/coverLooks'
-export type LabelKind = 'BIOME' | 'REGION'
+/** WATER is a hydrology feature in the river view, such as a stream or a lake. */
+export type LabelKind = 'BIOME' | 'REGION' | 'WATER'
export interface MapLabel {
kind: LabelKind
@@ -236,6 +237,8 @@ export interface WorldInfo {
fluidHeight: number
tileSize: number
hasPlayers: boolean
+ /** Whether the dimension plans water; without it the river view has nothing to show. */
+ hydrology: boolean
views: ViewInfo[]
}
diff --git a/studio/src/renderer/src/components/IdeIcon.tsx b/studio/src/renderer/src/components/IdeIcon.tsx
index beaa821e8..3fe42edd7 100644
--- a/studio/src/renderer/src/components/IdeIcon.tsx
+++ b/studio/src/renderer/src/components/IdeIcon.tsx
@@ -41,6 +41,7 @@ export type IdeIconName =
| 'views/palettes'
| 'views/procedural'
| 'views/regions'
+ | 'views/rivers'
| 'views/saved-world'
| 'views/world-3d'
diff --git a/studio/src/renderer/src/icons/views/rivers.svg b/studio/src/renderer/src/icons/views/rivers.svg
new file mode 100644
index 000000000..a38c67edb
--- /dev/null
+++ b/studio/src/renderer/src/icons/views/rivers.svg
@@ -0,0 +1,4 @@
+
diff --git a/studio/src/renderer/src/icons/views/rivers_dark.svg b/studio/src/renderer/src/icons/views/rivers_dark.svg
new file mode 100644
index 000000000..5ca99ca0e
--- /dev/null
+++ b/studio/src/renderer/src/icons/views/rivers_dark.svg
@@ -0,0 +1,4 @@
+
diff --git a/studio/src/renderer/src/map/census.ts b/studio/src/renderer/src/map/census.ts
index 7a00c1a7b..f4e436142 100644
--- a/studio/src/renderer/src/map/census.ts
+++ b/studio/src/renderer/src/map/census.ts
@@ -44,7 +44,7 @@ export function countShares(tiles: PlacedTile[], area: WorldArea): Share[] {
for (let pixelZ = firstZ; pixelZ < endZ; pixelZ += stride) {
for (let pixelX = firstX; pixelX < endX; pixelX += stride) {
const subject = subjectAt(tile, gridIndex(tile, pixelX, pixelZ))
- if (subject === null) {
+ if (subject === null || isDryGround(subject.subject)) {
continue
}
const id = `${subject.subject.kind}:${subject.subject.key}`
@@ -75,6 +75,11 @@ export function heightBandShares(heights: readonly number[], seaLevel: number):
})
}
+/** The river view's label for ground without water, which the legend does not list. */
+function isDryGround(subject: Highlight): boolean {
+ return subject.kind === 'WATER' && subject.key === 'dry'
+}
+
function subjectAt(tile: MapTile, cell: number): { subject: Highlight; color: number } | null {
const index = tile.subjects[cell]
if (index === NO_LABEL) {
diff --git a/studio/src/renderer/src/map/tileStyle.ts b/studio/src/renderer/src/map/tileStyle.ts
index 229f4a60a..fd1503d2a 100644
--- a/studio/src/renderer/src/map/tileStyle.ts
+++ b/studio/src/renderer/src/map/tileStyle.ts
@@ -7,7 +7,7 @@ const WATER_OVER_GROUND = 0.65
/** What a highlight picks out: a biome or region by key, or a height band in the 3D world's legend. */
export interface Highlight {
- kind: 'BIOME' | 'REGION' | 'HEIGHT'
+ kind: 'BIOME' | 'REGION' | 'WATER' | 'HEIGHT'
key: string
name: string
}
diff --git a/studio/src/renderer/src/studio/MapStudio.tsx b/studio/src/renderer/src/studio/MapStudio.tsx
index ec7682bfd..21de9f47a 100644
--- a/studio/src/renderer/src/studio/MapStudio.tsx
+++ b/studio/src/renderer/src/studio/MapStudio.tsx
@@ -5,6 +5,7 @@ import type { MapHover, MapLabel, Marker, ModuleViewInfo, PickDisplay, ServerUsa
import type { Share } from '../map/census'
import type { MapController, MapStatus, MapToggles } from '../map/MapController'
import type { Highlight } from '../map/tileStyle'
+import { IdeIcon } from '@/components/IdeIcon'
import { HelpDialog } from './HelpDialog'
import { HoverCard } from './HoverCard'
import { Legend } from './Legend'
@@ -73,7 +74,7 @@ export function MapStudio({ client, world, theme, onDisconnect }: MapStudioProps
const sceneViews = useModuleViews(loadSceneViews, packRevision)
const patternViews = useModuleViews(loadPatternViews, packRevision)
const views = useMemo(
- () => [...withAppViews(world.views), ...patternViews.map(asViewInfo), ...sceneViews.map(asViewInfo), NOISE],
+ () => [...withAppViews(world.views), ...patternViews.map(asViewInfo), ...sceneViews.map(asViewInfo)],
[world.views, patternViews, sceneViews]
)
const sceneView = sceneViews.find((candidate) => candidate.id === viewId) ?? null
@@ -270,6 +271,17 @@ export function MapStudio({ client, world, theme, onDisconnect }: MapStudioProps
{pointer !== null && hover !== null && (
No rivers planned
+Enable hydrology in
+dimensions/{world.dimension}.json
+They appear here once the pack reloads.
+