Skip to content

Commit

Permalink
Don't open a level that's already open
Browse files Browse the repository at this point in the history
  • Loading branch information
meh2481 committed Dec 22, 2023
1 parent 423e9c9 commit c0e7998
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/WooGLEFX/Engine/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,13 @@ public static void openLevel(String levelName, double version) {
if (levelName == null || levelName.equals("")) {
return;
}
// Don't open a level if it's already open
for (Tab tab : levelSelectPane.getTabs()) {
if (tab.getText().equals(levelName)) {
levelSelectPane.getSelectionModel().select(tab);
return;
}
}
failedResources.clear();

try {
Expand Down

0 comments on commit c0e7998

Please sign in to comment.