Skip to content

Commit 987f33c

Browse files
committed
2 parents c9d48ea + 6700a92 commit 987f33c

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

adventure-composer/src/main/java/com/bladecoder/engineeditor/Editor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ public void dispose() {
175175
}
176176

177177
public void exit() {
178-
if (Ctx.project.getWorld().isModified()
179-
|| Ctx.project.getSelectedChapter().isModified()) {
178+
if (Ctx.project.getProjectDir() != null && (Ctx.project.getWorld().isModified()
179+
|| Ctx.project.getSelectedChapter().isModified())) {
180180
new Dialog("Save Project", skin) {
181181
protected void result(Object object) {
182182
if (((Boolean) object).booleanValue()) {

adventure-composer/src/main/java/com/bladecoder/engineeditor/Main.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public static void main(final String[] args) {
3434
// cfg.samples = 2;
3535
// cfg.useGL30 = true;
3636

37-
if (Main.class.getResource("/res/images/ic_app64.png") != null)
38-
cfg.addIcon("images/ic_app64.png", FileType.Internal);
37+
if (Main.class.getResource("/images/ic_app64.png") != null)
38+
cfg.addIcon("ic_app64.png", FileType.Internal);
3939

40-
if (Main.class.getResource("/res/images/ic_app32.png") != null)
40+
if (Main.class.getResource("/images/ic_app32.png") != null)
4141
cfg.addIcon("images/ic_app32.png", FileType.Internal);
4242

43-
if (Main.class.getResource("/res/images/ic_app16.png") != null)
43+
if (Main.class.getResource("/images/ic_app16.png") != null)
4444
cfg.addIcon("images/ic_app16.png", FileType.Internal);
4545

4646
parseArgs(args);

blade-engine/src/com/bladecoder/engine/loader/ChapterXMLLoader.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,13 @@ else if (localName.equals(XMLConstants.ACTOR_TAG)) {
168168
} else if (localName.equals(XMLConstants.SCENE_TAG)) {
169169
scene.setPlayer((SpriteActor) scene.getActor(player, false));
170170
scene.orderLayersByZIndex();
171+
scene = null;
171172
}
172173
}
173174

174175
private void parseScene(Attributes atts) throws SAXException {
175176

176177
this.scene = new Scene();
177-
scenes.add(scene);
178-
179-
if (initScene == null)
180-
initScene = this.scene.getId();
181178

182179
String idScn = atts.getValue(XMLConstants.ID_ATTR);
183180
String musicFilename = atts.getValue(XMLConstants.MUSIC_ATTR);
@@ -218,6 +215,11 @@ private void parseScene(Attributes atts) throws SAXException {
218215

219216
scene.setMusic(musicFilename, loopMusic, initialDelay, repeatDelay);
220217
}
218+
219+
scenes.add(scene);
220+
221+
if (initScene == null)
222+
initScene = this.scene.getId();
221223
}
222224

223225
private void parseActor(Attributes atts) throws SAXException {
@@ -652,8 +654,16 @@ public void setDocumentLocator(Locator l) {
652654

653655
@Override
654656
public void error(SAXParseException e) throws SAXException {
655-
EngineLogger.error(MessageFormat.format("{0} Line: {1} Column: {2}. {3}", actor.getId(), e.getLineNumber(),
657+
if(actor != null)
658+
EngineLogger.error(MessageFormat.format("{0}.{1} Line: {2} Column: {3}. {4}", scene.getId(), actor.getId(), e.getLineNumber(),
656659
e.getColumnNumber(), e.getMessage()));
660+
else if(scene != null)
661+
EngineLogger.error(MessageFormat.format("{0} Line: {1} Column: {2}. {3}", actor.getId(), e.getLineNumber(),
662+
e.getColumnNumber(), e.getMessage()));
663+
else
664+
EngineLogger.error(MessageFormat.format("Line: {1} Column: {2}. {3}", e.getLineNumber(),
665+
e.getColumnNumber(), e.getMessage()));
666+
657667
EngineLogger.error("CAUSA", (Exception) e.getCause());
658668
}
659669

blade-engine/src/com/bladecoder/engine/model/World.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ public void read(Json json, JsonValue jsonData) {
684684
String dialogId = json.readValue("currentDialog", String.class, jsonData);
685685

686686
if (dialogId != null) {
687-
SpriteActor actor = (SpriteActor) instance.getCurrentScene().getActor(actorId, false);
687+
BaseActor actor = instance.getCurrentScene().getActor(actorId, false);
688688
instance.currentDialog = actor.getDialog(dialogId);
689689
}
690690

0 commit comments

Comments
 (0)