Allow the resource manager to be run in "don't unpack yer bundles" mode.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3996 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -226,6 +226,11 @@ public class ResourceManager
|
||||
}
|
||||
}
|
||||
|
||||
// check to see if we're in developer mode in which case we won't
|
||||
// unpack our resources
|
||||
_unpack = !"true".equalsIgnoreCase(
|
||||
System.getProperty("no_unpack_resources"));
|
||||
|
||||
// make sure there's a trailing slash
|
||||
if (!resourceDir.endsWith(File.separator)) {
|
||||
resourceDir += File.separator;
|
||||
@@ -322,7 +327,7 @@ public class ResourceManager
|
||||
public boolean checkBundle (String path)
|
||||
{
|
||||
return new ResourceBundle(
|
||||
getResourceFile(path), true, true).isUnpacked();
|
||||
getResourceFile(path), true, _unpack).isUnpacked();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -336,7 +341,7 @@ public class ResourceManager
|
||||
public void resolveBundle (String path, final ResultListener listener)
|
||||
{
|
||||
final ResourceBundle bundle =
|
||||
new ResourceBundle(getResourceFile(path), true, true);
|
||||
new ResourceBundle(getResourceFile(path), true, _unpack);
|
||||
if (bundle.isUnpacked()) {
|
||||
if (bundle.sourceIsReady()) {
|
||||
listener.requestCompleted(bundle);
|
||||
@@ -563,7 +568,7 @@ public class ResourceManager
|
||||
while (tok.hasMoreTokens()) {
|
||||
String path = tok.nextToken().trim();
|
||||
ResourceBundle bundle =
|
||||
new ResourceBundle(getResourceFile(path), true, true);
|
||||
new ResourceBundle(getResourceFile(path), true, _unpack);
|
||||
set.add(bundle);
|
||||
if (bundle.isUnpacked() && bundle.sourceIsReady()) {
|
||||
continue;
|
||||
@@ -634,6 +639,9 @@ public class ResourceManager
|
||||
* them from the classpath. */
|
||||
protected String _rootPath;
|
||||
|
||||
/** Whether or not to unpack our resource bundles. */
|
||||
protected boolean _unpack;
|
||||
|
||||
/** Our default resource set. */
|
||||
protected ResourceBundle[] _default = new ResourceBundle[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user