forked from noxious/server
Almost finalised refactoring
This commit is contained in:
@ -27,7 +27,7 @@ export default class InitCommand extends BaseCommand {
|
||||
public async execute(): Promise<void> {
|
||||
// Assets
|
||||
await this.importTiles()
|
||||
await this.importObjects()
|
||||
await this.importMapObjects()
|
||||
await this.createCharacterType()
|
||||
await this.createCharacterHair()
|
||||
// await this.createCharacterEquipment()
|
||||
@ -51,19 +51,19 @@ export default class InitCommand extends BaseCommand {
|
||||
}
|
||||
}
|
||||
|
||||
private async importObjects(): Promise<void> {
|
||||
for (const object of fs.readdirSync(Storage.getPublicPath('objects'))) {
|
||||
private async importMapObjects(): Promise<void> {
|
||||
for (const mapObject of fs.readdirSync(Storage.getPublicPath('map_objects'))) {
|
||||
const newMapObject = new MapObject()
|
||||
newMapObject
|
||||
.setId(object.split('.')[0] as UUID)
|
||||
.setName('New object')
|
||||
.setId(mapObject.split('.')[0] as UUID)
|
||||
.setName('New map object')
|
||||
.setFrameWidth(
|
||||
(await sharp(Storage.getPublicPath('objects', object))
|
||||
(await sharp(Storage.getPublicPath('map_objects', mapObject))
|
||||
.metadata()
|
||||
.then((metadata) => metadata.height)) ?? 0
|
||||
)
|
||||
.setFrameHeight(
|
||||
(await sharp(Storage.getPublicPath('objects', object))
|
||||
(await sharp(Storage.getPublicPath('map_objects', mapObject))
|
||||
.metadata()
|
||||
.then((metadata) => metadata.width)) ?? 0
|
||||
)
|
||||
|
Reference in New Issue
Block a user