summaryrefslogtreecommitdiff
path: root/ui/editNetwork.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-12-22 13:53:27 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-12-22 13:53:27 +0000
commit749df22c85b83c86ec68ebc74829287e54498e26 (patch)
tree8e3635f80673c0b8d4505de3d363aa7742a2d430 /ui/editNetwork.cpp
parentExpose network base width and surface (diff)
downloadilt-749df22c85b83c86ec68ebc74829287e54498e26.tar.bz2
ilt-749df22c85b83c86ec68ebc74829287e54498e26.tar.xz
ilt-749df22c85b83c86ec68ebc74829287e54498e26.zip
Set terrain heights when creating new network linksterrain-for-networks
Diffstat (limited to 'ui/editNetwork.cpp')
-rw-r--r--ui/editNetwork.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui/editNetwork.cpp b/ui/editNetwork.cpp
index ac2d93d..50d049d 100644
--- a/ui/editNetwork.cpp
+++ b/ui/editNetwork.cpp
@@ -64,6 +64,17 @@ EditNetwork::Builder::render(const SceneShader & shader) const
}
void
+EditNetwork::Builder::setHeightsFor(Network * network, const Link::CCollection & links, GeoData::SetHeightsOpts opts)
+{
+ opts.surface = network->getBaseSurface();
+ const auto width = network->getBaseWidth();
+
+ for (const auto & link : links) {
+ gameState->geoData->setHeights(link->getBase(width), opts);
+ }
+}
+
+void
EditNetwork::render(const UIShader & shader, const UIComponent::Position & parentPos) const
{
if (builder) {