mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-05 16:43:52 +00:00
fix(editor): river/road path selection uses last brush pos, edge ramp note
- Set Start/End buttons for river/road no longer require brush to be actively on terrain at click time — uses last known brush position which persists when cursor moves to the UI panel - Shows cursor coordinates above the buttons for visual confirmation - Edge ramp confirmed to only affect terrain heights, not water levels (water has its own height independent of terrain)
This commit is contained in:
parent
f6d30fcf9b
commit
63f4711eb3
2 changed files with 9 additions and 4 deletions
|
|
@ -622,14 +622,18 @@ void EditorUI::renderBrushPanel(EditorApp& app) {
|
|||
ImGui::SliderFloat("Width##path", &pathWidth, 2.0f, 50.0f);
|
||||
if (pathMode == 0) ImGui::SliderFloat("Depth##path", &pathDepth, 1.0f, 30.0f);
|
||||
auto& brush4 = app.getTerrainEditor().brush();
|
||||
if (ImGui::Button("Set Start##path", ImVec2(120, 0)) && brush4.isActive()) {
|
||||
pathStart = brush4.getPosition();
|
||||
auto brushPos = brush4.getPosition();
|
||||
ImGui::Text("Cursor: %.0f, %.0f, %.0f %s",
|
||||
brushPos.x, brushPos.y, brushPos.z,
|
||||
brush4.isActive() ? "" : "(off terrain)");
|
||||
if (ImGui::Button("Set Start##path", ImVec2(120, 0))) {
|
||||
pathStart = brushPos;
|
||||
pathStartSet = true;
|
||||
app.showToast("Path start set");
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Set End + Apply##path", ImVec2(140, 0)) && brush4.isActive() && pathStartSet) {
|
||||
pathEnd = brush4.getPosition();
|
||||
if (ImGui::Button("Set End + Apply##path", ImVec2(140, 0)) && pathStartSet) {
|
||||
pathEnd = brushPos;
|
||||
if (pathMode == 0) {
|
||||
app.getTerrainEditor().carveRiver(pathStart, pathEnd, pathWidth, pathDepth);
|
||||
app.getTexturePainter().paintAlongPath(pathStart, pathEnd, pathWidth * 1.5f,
|
||||
|
|
|
|||
|
|
@ -1086,6 +1086,7 @@ void TerrainEditor::addDetailNoise(float amplitude, float frequency, uint32_t se
|
|||
void TerrainEditor::rampEdges(float targetHeight, float rampWidth) {
|
||||
if (!terrain_) return;
|
||||
float relTarget = targetHeight - terrain_->chunks[0].position[2];
|
||||
// Note: only affects terrain heights, not water levels
|
||||
|
||||
for (int ci = 0; ci < 256; ci++) {
|
||||
auto& chunk = terrain_->chunks[ci];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue