arx-level-generator
Version:
A tool for creating Arx Fatalis maps
31 lines • 1.28 kB
JavaScript
import path from 'node:path';
import { ScriptCommand } from '../ScriptCommand.js';
export class TweakSkin extends ScriptCommand {
oldTexture;
newTexture;
constructor(oldTexture, newTexture) {
super();
this.oldTexture = oldTexture;
this.newTexture = newTexture;
}
toString() {
const oldFilename = typeof this.oldTexture === 'string' ? this.oldTexture : path.parse(this.oldTexture.filename).name;
const newFilename = typeof this.newTexture === 'string' ? this.newTexture : path.parse(this.newTexture.filename).name;
return `tweak skin "${oldFilename}" "${newFilename}"`;
}
async exportTextures(settings) {
const files = {};
const oldTexture = this.oldTexture;
if (typeof oldTexture !== 'string' && !oldTexture.isNative) {
const [source, target] = await oldTexture.exportSourceAndTarget(settings, false);
files[target] = source;
}
const newTexture = this.newTexture;
if (typeof newTexture !== 'string' && !newTexture.isNative) {
const [source, target] = await newTexture.exportSourceAndTarget(settings, false);
files[target] = source;
}
return files;
}
}
//# sourceMappingURL=TweakSkin.js.map