mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-07-12 23:14:58 +00:00
add interior loading
This commit is contained in:
parent
8509faf6bc
commit
b86e5622af
1552 changed files with 1507302 additions and 44 deletions
|
|
@ -15,9 +15,25 @@ export function getActualResourcePath(resourcePath: string) {
|
|||
}
|
||||
const resourcePaths = getResourceList();
|
||||
const lowerCased = resourcePath.toLowerCase();
|
||||
return (
|
||||
resourcePaths.find((s) => s.toLowerCase() === lowerCased) ?? resourcePath
|
||||
const foundLowerCase = resourcePaths.find(
|
||||
(s) => s.toLowerCase() === lowerCased
|
||||
);
|
||||
if (foundLowerCase) {
|
||||
return foundLowerCase;
|
||||
}
|
||||
const isTexture = resourcePath.startsWith("textures/");
|
||||
if (isTexture) {
|
||||
const foundNested = resourcePaths.find(
|
||||
(s) =>
|
||||
s
|
||||
.replace(/^(textures\/)((lush|desert|badlands|lava|ice)\/)/, "$1")
|
||||
.toLowerCase() === lowerCased
|
||||
);
|
||||
if (foundNested) {
|
||||
return foundNested;
|
||||
}
|
||||
}
|
||||
return resourcePath;
|
||||
}
|
||||
|
||||
export function getResourceList() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue