Draw belts, underground belts and splitters with their direction

Belts are drawn like the in-game map: a strip in the colour of their tier
(taken from the icon of the transport belt of the same tier), with an arrow
per lane in the direction items go. Splitters are drawn at their rotated
2x1 footprint with a bar across the back.

The mod now sends whether an underground belt is an entrance or an exit.
Entrances are capped on the side where items go underground, exits on the
side where they come out, and the hover tooltip says which it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lazzexus 2026-11-03 10:21:11 +01:00
parent b9adb9ea83
commit 4bf90a6c1d
7 changed files with 159 additions and 2 deletions

View file

@ -34,6 +34,8 @@ sealed interface FactorioEntityData {
val direction: UByte? = null,
/** @see FactorioEntityUpdateElement.Standard.recipe */
val recipe: String? = null,
/** @see FactorioEntityUpdateElement.Standard.beltToGroundType */
val beltToGroundType: String? = null,
) : FactorioEntityData
@ -281,6 +283,8 @@ sealed interface FactorioEntityUpdateElement {
val direction: UByte? = null,
/** The name of the recipe that a crafting machine is set to (or last used, for furnaces) */
val recipe: String? = null,
/** Whether an underground belt is an entrance (`input`) or an exit (`output`) */
val beltToGroundType: String? = null,
) : FactorioEntityUpdateElement
}

View file

@ -18,4 +18,6 @@ data class MapBuilding(
val direction: UByte? = null,
/** The name of the recipe of a crafting machine */
val recipe: String? = null,
/** Whether an underground belt is an entrance (`input`) or an exit (`output`) */
val beltToGroundType: String? = null,
)

View file

@ -177,6 +177,7 @@ data class MapChunkEntityUpdate(
lastUser = entity.lastUser,
direction = entity.direction,
recipe = entity.recipe,
beltToGroundType = entity.beltToGroundType,
)
}
}