diff --git a/terrain/Terrain+Editing.cs b/terrain/Terrain+Editing.cs index 7b42e7a..1090caf 100644 --- a/terrain/Terrain+Editing.cs +++ b/terrain/Terrain+Editing.cs @@ -84,6 +84,25 @@ public partial class Terrain NotifyPropertyListChanged(); } + if ((ev is InputEventMouseButton { ButtonIndex: var wheel2, Pressed: var pressed2, CtrlPressed: true }) + && (wheel2 is MouseButton.WheelUp or MouseButton.WheelDown) && (_selection != null)) + { + GetViewport().SetInputAsHandled(); + if (!pressed2) return; + + var amount = (wheel2 == MouseButton.WheelUp) ? 1 : -1; + var selection = TileRegion.From(_selection.Value); + + foreach (var pos in selection.GetAllTiles()) { + var tile = GetTile(pos); + tile.TexturePrimary = PosMod(tile.TexturePrimary + amount, 4); + SetTile(pos, tile); + } + + UpdateMeshAndShape(); + NotifyPropertyListChanged(); + } + if (ev is InputEventMouseMotion) _unhandledMotion = true; }