Skip to content

Commit

Permalink
Small changes to EditorOptions class
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaskelly committed Apr 21, 2020
1 parent 274851c commit 9b9ba23
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DelvEdit/src/com/interrupt/dungeoneer/editor/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public static void init() {
}

public static void dispose() {
EditorOptions.toLocalFiles(options);
Editor.options.dispose();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.Json;

/** Editor options container class. */
public class EditorOptions {
public Array<String> recentlyOpenedFiles;

Expand All @@ -30,4 +31,12 @@ public static void toLocalFiles(EditorOptions instance) {
FileHandle file = Gdx.files.local(path);
file.writeString(json.toJson(instance), false);
}

public void save() {
EditorOptions.toLocalFiles(this);
}

public void dispose() {
Editor.options.save();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public void actionPerformed(ActionEvent e) {
@Override
public void actionPerformed(ActionEvent e) {
Editor.options.recentlyOpenedFiles.clear();
Editor.options.save();
}
}));
}
Expand Down

0 comments on commit 9b9ba23

Please sign in to comment.