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:
@@ -548,7 +548,17 @@ public class ResourceManager
|
|||||||
// look for the resource in any of the bundles
|
// look for the resource in any of the bundles
|
||||||
int size = bundles.length;
|
int size = bundles.length;
|
||||||
for (int ii = 0; ii < size; ii++) {
|
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) {
|
if (instr != null) {
|
||||||
// Log.info("Found resource [rset=" + rset +
|
// Log.info("Found resource [rset=" + rset +
|
||||||
// ", bundle=" + bundles[ii].getSource().getPath() +
|
// ", bundle=" + bundles[ii].getSource().getPath() +
|
||||||
@@ -586,7 +596,18 @@ public class ResourceManager
|
|||||||
// look for the resource in any of the bundles
|
// look for the resource in any of the bundles
|
||||||
int size = bundles.length;
|
int size = bundles.length;
|
||||||
for (int ii = 0; ii < size; ii++) {
|
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) {
|
if (file != null) {
|
||||||
// Log.info("Found image resource [rset=" + rset +
|
// Log.info("Found image resource [rset=" + rset +
|
||||||
// ", bundle=" + bundles[ii].getSource() +
|
// ", bundle=" + bundles[ii].getSource() +
|
||||||
|
|||||||
Reference in New Issue
Block a user