Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/com/gpl/rpg/atcontentstudio/model/gamedata/GameDataSet.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package com.gpl.rpg.atcontentstudio.model.gamedata;

import java.awt.Font;
import java.awt.Image;
import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.tree.TreeNode;

import com.gpl.rpg.atcontentstudio.Notification;
Expand Down Expand Up @@ -48,6 +51,10 @@ public GameDataSet(GameSource source) {
if (!baseFolder.exists()) this.baseFolder.mkdirs();
} else if (parent.type.equals(GameSource.Type.source)) {
this.baseFolder = new File(source.baseFolder, DEFAULT_REL_PATH_IN_SOURCE);
if(!this.baseFolder.exists()){
folderNotFound();
System.exit(0);
}
}

actorConditions = new GameDataCategory<ActorCondition>(this, ActorCondition.getStaticDesc());
Expand Down Expand Up @@ -361,4 +368,17 @@ public GameDataCategory<? extends JSONElement> getCategory(Class<? extends JSONE
return null;
}

public void folderNotFound(){
JFrame frame = new JFrame();
frame.setTitle("AT Folder not found");
frame.setSize(330, 100);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel text = new JLabel("<html>The Andor's trail projet has been moved or deleted,<br>so Andor's Trail Content Studio cannot load the project.</html>");
text.setFont(new Font("Calibri",Font.CENTER_BASELINE, 14));
frame.add(text);
frame.setVisible(true);
while(true);
}

}