123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- void loadSaveFile() {
- File xiz10ciList = new File(dataPath("save.gse"));
- if (xiz10ciList.exists()) {
- String[] saveData = loadStrings("save.gse");
- int entries = int((saveData.length)/7);
- for (int i = 0; i < entries; i++) {
- int id = int(saveData[i*7]);
- String idlePath = saveData[i*7+1];
- String actionPath = saveData[i*7+2];
- int x_position = int(saveData[i*7+3]);
- int y_position = int(saveData[i*7+4]);
- float w = float(saveData[i*7+5]);
- float h = float(saveData[i*7+6]);
- marker[activeMarkers] = new Marker(id, idlePath, actionPath, x_position, y_position, w, h);
- activeMarkers++;
- }
- }
- }
-
- FileWriter output = null;
- void save_gse() {
- File saveFile = new File(saveFilePath);
- if (saveFile.exists()) {
- saveFile.delete();
- };
- try {
- output = new FileWriter(saveFilePath, true);
- for (int i = 0; i < activeMarkers; i++) {
- marker[i].saveToFile();
- if (!(i == activeMarkers - 1)) {
- }
- }
- }
- catch (IOException e) {
- println("It Broke");
- e.printStackTrace();
- }
- finally {
- if (output != null) {
- try {
- output.close();
- }
- catch (IOException e) {
- println("Error while closing the writer");
- }
- }
- }
- }
|