Skip to content

Issue #651 save asset node in TerrainEditorController#653

Merged
neph1 merged 3 commits intojMonkeyEngine:masterfrom
neph1:Issue-651-terrain-save
Jun 18, 2025
Merged

Issue #651 save asset node in TerrainEditorController#653
neph1 merged 3 commits intojMonkeyEngine:masterfrom
neph1:Issue-651-terrain-save

Conversation

@neph1
Copy link
Copy Markdown
Contributor

@neph1 neph1 commented Jun 16, 2025

Fixes #651

Comment thread jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java Outdated
@neph1 neph1 force-pushed the Issue-651-terrain-save branch from f98e316 to b2f463a Compare June 16, 2025 19:10
@neph1 neph1 requested a review from Copilot June 16, 2025 19:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the TerrainEditorController to properly save the terrain asset after changes, modernizes thread enqueuing to use lambdas, and cleans up unused imports.

  • Always enqueue currentFileObject.saveAsset() after saving alpha layers.
  • Replace anonymous Callable classes with lambda expressions for conciseness.
  • Remove unused imports and update copyright year.
Comments suppressed due to low confidence (2)

jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java:146

  • The original conditional logic around setModified was removed, so this now always toggles the flag—even if it wasn't intended; restore the previous checks to avoid inadvertently clearing or setting the modified state.
currentFileObject.setModified(state);

jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java:108

  • [nitpick] There are many repeated enqueue calls with similar lambda patterns; consider extracting a helper method (e.g., runOnSceneThread(Runnable)) to reduce duplication and improve readability.
SceneApplication.getApplication().enqueue(() -> { doSaveAlphaImages(); return null; });

Comment thread jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorController.java Outdated
@neph1 neph1 merged commit 9ecf510 into jMonkeyEngine:master Jun 18, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terrain Editor save issue

2 participants