mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Fixed different resolutions (#1362)
* Fixed different resolutions * Fixed replacing shapezio vanilla sprites
This commit is contained in:
parent
e9c26a71e2
commit
cb5df2473e
@ -127,8 +127,13 @@ export class ModInterface {
|
||||
for (const spriteName in sourceData) {
|
||||
const { frame, sourceSize, spriteSourceSize } = sourceData[spriteName];
|
||||
|
||||
const sprite = new AtlasSprite(spriteName);
|
||||
Loader.sprites.set(spriteName, sprite);
|
||||
let sprite = /** @type {AtlasSprite} */ (Loader.sprites.get(spriteName));
|
||||
|
||||
if (!sprite) {
|
||||
sprite = new AtlasSprite(spriteName);
|
||||
Loader.sprites.set(spriteName, sprite);
|
||||
}
|
||||
|
||||
sprite.frozen = true;
|
||||
|
||||
const link = new SpriteAtlasLink({
|
||||
@ -142,9 +147,14 @@ export class ModInterface {
|
||||
w: sourceSize.w,
|
||||
h: sourceSize.h,
|
||||
});
|
||||
sprite.linksByResolution["0.25"] = link;
|
||||
sprite.linksByResolution["0.5"] = link;
|
||||
sprite.linksByResolution["0.75"] = link;
|
||||
|
||||
if (atlasData.meta && atlasData.meta.scale) {
|
||||
sprite.linksByResolution[atlasData.meta.scale] = link;
|
||||
} else {
|
||||
sprite.linksByResolution["0.25"] = link;
|
||||
sprite.linksByResolution["0.5"] = link;
|
||||
sprite.linksByResolution["0.75"] = link;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user