18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 22:07:55 +01:00

feat(editor): no question of the terrain at the first L, it loads in the background and the photo doesn't wait for it

The first L in a new scenery with no tracks nor terrain asked in a window whether to load the terrain. Now nothing is asked:
where the scenery lies on the map the terrain model loads in the background around it, as the answer Load the terrain did, and
a line in the panel of the laying says "Terrain: loading..." with Without terrain, which stops it as that answer did; it goes
once the terrain is in. A scenery not placed on the map has Place it... there, to Terrain (F5). Whether a new scenery gets its
terrain by itself is a checkbox of the settings of the terrain loading, where the window had it. A download of the model that
failed is told there, and in the banner of the loading and the terrain panel, in plain words as the photo tells its own, not
as the code of WinHTTP (which stays in the log).

A tile of the photo no longer waits for the chunks of the terrain still to come under it: it lies flat at the height of the
ground found last (of the layer before any was) and goes onto the ground as it comes. The window and its strings are gone.
This commit is contained in:
maj00r
2026-11-24 00:07:02 +01:00
parent 8c257fb6ad
commit 344e5eff3c
12 changed files with 159 additions and 183 deletions
+12 -7
View File
@@ -645,10 +645,8 @@ void editor_mode::ground_sources(editor_orthophoto &Layer)
gather_ground_triangles(Min, Max, true, 50.0f, Out, true, Heightmap);
});
Layer.height_source([](double const X, double const Z, double &Height) { return EditorTerrain.height_at(X, Z, Height); });
// with the heightmap terrain, a new tile waits while a chunk under it is still to come; where none is nor will be, or the walk of
// the chunks doesn't reach, it lies on the other ground or on the NMT guess as before. A scenery without it as before
Layer.coming_source([](glm::dvec2 const &Min, glm::dvec2 const &Max) { return EditorTerrain.active() && EditorTerrain.ground_coming(Min, Max); });
// the imagery often comes before the terrain made from the model: it lies where the terrain will be
// a tile doesn't wait for the chunks of the heightmap terrain still to come under it: it lies flat meanwhile, and goes onto them as
// they come. The imagery often comes before the terrain made from the model: it lies where the terrain will be
Layer.guess_source([this](double const X, double const Z, double &Height) {
if (nmt_ground(X, Z, Height))
return true;
@@ -1797,7 +1795,6 @@ bool editor_mode::update()
render_open_scenery_popup();
render_shortcuts_window();
render_first_steps();
render_nmt_prompt();
render_nmt_banner();
render_nmt_buried();
render_empty_scenery_hint();
@@ -1932,6 +1929,15 @@ void editor_mode::render_terrain_loading()
ImGui::SameLine();
ImGui::TextDisabled("%s", STR_C("(within the download area, there is none)"));
}
// no question asked: the terrain of a new scenery comes as its first track is laid, unless this is off
bool offer{EditorSettings.terrain_offer()};
if (ImGui::Checkbox(STR_C("The terrain loaded by itself as the first track of a new scenery is laid"), &offer))
{
EditorSettings.terrain_offer(offer);
EditorSettings.save();
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", STR_C("In the background, where the scenery lies on the map; the panel of the laying tells it, with the button to go without it"));
}
namespace
@@ -6482,8 +6488,7 @@ void editor_mode::render_first_steps()
}
note_first_steps();
follow_tutorial();
// the question of the terrain of a new scenery isn't drawn over the window: the window waits for the answer
if (false == m_first_steps_open || m_nmt_state.prompt)
if (false == m_first_steps_open)
{
m_first_steps_shown = 0;
return;