Also need to adjust the path to find localized resource files if we come through the getResource/getImageResource calls that pass us a resource set.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@85 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Mike Thomas
2006-12-02 01:41:28 +00:00
parent 227108e7fa
commit e74970ac1e
@@ -548,7 +548,17 @@ public class ResourceManager
// look for the resource in any of the bundles
int size = bundles.length;
for (int ii = 0; ii < size; ii++) {
InputStream instr = bundles[ii].getResource(path);
InputStream instr = null;
// Try a localized version first.
if (_localePrefix != null) {
instr = bundles[ii].getResource(
PathUtil.appendPath(_localePrefix, path));
}
// If we didn't find that, try a generic.
if (instr == null) {
instr = bundles[ii].getResource(path);
}
if (instr != null) {
// Log.info("Found resource [rset=" + rset +
// ", bundle=" + bundles[ii].getSource().getPath() +
@@ -586,7 +596,18 @@ public class ResourceManager
// look for the resource in any of the bundles
int size = bundles.length;
for (int ii = 0; ii < size; ii++) {
File file = bundles[ii].getResourceFile(path);
File file = null;
// Try a localized version first.
if (_localePrefix != null) {
file = bundles[ii].getResourceFile(
PathUtil.appendPath(_localePrefix, path));
}
// If we didn't find that, try generic.
if (file == null) {
file = bundles[ii].getResourceFile(path);
}
if (file != null) {
// Log.info("Found image resource [rset=" + rset +
// ", bundle=" + bundles[ii].getSource() +