Skip to content

Issue #651 save asset node in TerrainEditorController #653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 18, 2025

Conversation

neph1
Copy link
Contributor

@neph1 neph1 commented Jun 16, 2025

Fixes #651

@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

@Copilot 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; });

@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
1 participant