diff --git a/src/java/com/threerings/cast/ActionSequence.java b/src/java/com/threerings/cast/ActionSequence.java index fa8b0874b..08393df4e 100644 --- a/src/java/com/threerings/cast/ActionSequence.java +++ b/src/java/com/threerings/cast/ActionSequence.java @@ -1,5 +1,5 @@ // -// $Id: ActionSequence.java,v 1.4 2002/06/26 23:53:06 mdb Exp $ +// $Id: ActionSequence.java,v 1.5 2002/07/24 22:24:05 mdb Exp $ package com.threerings.cast; @@ -15,6 +15,16 @@ import java.io.Serializable; */ public class ActionSequence implements Serializable { + /** + * Defines the name of the default action sequence. When component + * tilesets are loaded to build a set of composited images for a + * particular action sequence, a check is first made for a component + * tileset specific to the action sequence and then for the + * component's default tileset if the action specific tileset did not + * exist. + */ + public static final String DEFAULT_SEQUENCE = "default"; + /** The action sequence name. */ public String name; diff --git a/src/java/com/threerings/cast/bundle/BundledComponentRepository.java b/src/java/com/threerings/cast/bundle/BundledComponentRepository.java index 3cda544b2..2ccb04101 100644 --- a/src/java/com/threerings/cast/bundle/BundledComponentRepository.java +++ b/src/java/com/threerings/cast/bundle/BundledComponentRepository.java @@ -1,5 +1,5 @@ // -// $Id: BundledComponentRepository.java,v 1.15 2002/06/26 23:53:06 mdb Exp $ +// $Id: BundledComponentRepository.java,v 1.16 2002/07/24 22:24:05 mdb Exp $ package com.threerings.cast.bundle; @@ -263,11 +263,6 @@ public class BundledComponentRepository public ActionFrames getFrames ( CharacterComponent component, String action) { - // load up the tileset for this action - String path = component.componentClass.name + "/" + - component.name + "/" + action + - BundleUtil.TILESET_EXTENSION; - // obtain the action sequence definition for this action ActionSequence actseq = (ActionSequence)_actions.get(action); if (actseq == null) { @@ -277,8 +272,21 @@ public class BundledComponentRepository return null; } + // first try loading up a tileset customized for this action + String root = component.componentClass.name + "/" + + component.name + "/"; + String path = root + action + BundleUtil.TILESET_EXTENSION; + try { - TileSet aset = (TileSet)BundleUtil.loadObject(_bundle, path); + TileSet aset = null; + aset = (TileSet)BundleUtil.loadObject(_bundle, path); + if (aset == null) { + Log.info("Falling back to default [path=" + path + "]."); + // try loading the default tileset + path = root + ActionSequence.DEFAULT_SEQUENCE + + BundleUtil.TILESET_EXTENSION; + aset = (TileSet)BundleUtil.loadObject(_bundle, path); + } aset.setImageProvider(this); return new TileSetFrameImage(aset, actseq);