diff --git a/migrations/Migration20250128154500.ts b/migrations/Migration20250128165214.ts similarity index 97% rename from migrations/Migration20250128154500.ts rename to migrations/Migration20250128165214.ts index ace0822..03ba14d 100644 --- a/migrations/Migration20250128154500.ts +++ b/migrations/Migration20250128165214.ts @@ -1,6 +1,6 @@ import { Migration } from '@mikro-orm/migrations'; -export class Migration20250128154500 extends Migration { +export class Migration20250128165214 extends Migration { override async up(): Promise { this.addSql(`create table \`map\` (\`id\` varchar(255) not null, \`name\` varchar(255) not null, \`width\` int not null default 10, \`height\` int not null default 10, \`tiles\` json null, \`pvp\` tinyint(1) not null default false, \`created_at\` datetime not null, \`updated_at\` datetime not null, primary key (\`id\`)) default character set utf8mb4 engine = InnoDB;`); @@ -32,7 +32,7 @@ export class Migration20250128154500 extends Migration { this.addSql(`create table \`character_hair\` (\`id\` varchar(255) not null, \`name\` varchar(255) not null, \`gender\` varchar(255) not null default 'MALE', \`is_selectable\` tinyint(1) not null default false, \`sprite_id\` varchar(255) null, \`created_at\` datetime not null, \`updated_at\` datetime not null, primary key (\`id\`)) default character set utf8mb4 engine = InnoDB;`); this.addSql(`alter table \`character_hair\` add index \`character_hair_sprite_id_index\`(\`sprite_id\`);`); - this.addSql(`create table \`sprite_action\` (\`id\` varchar(255) not null, \`sprite_id\` varchar(255) not null, \`action\` varchar(255) not null, \`sprites\` json null, \`origin_x\` int not null default 0, \`origin_y\` int not null default 0, \`frame_width\` int not null default 0, \`frame_height\` int not null default 0, \`frame_rate\` int not null default 0, primary key (\`id\`)) default character set utf8mb4 engine = InnoDB;`); + this.addSql(`create table \`sprite_action\` (\`id\` varchar(255) not null, \`sprite_id\` varchar(255) not null, \`action\` varchar(255) not null, \`sprites\` json null, \`origin_x\` numeric(5,2) not null default 0, \`origin_y\` numeric(5,2) not null default 0, \`frame_width\` int not null default 0, \`frame_height\` int not null default 0, \`frame_rate\` int not null default 0, primary key (\`id\`)) default character set utf8mb4 engine = InnoDB;`); this.addSql(`alter table \`sprite_action\` add index \`sprite_action_sprite_id_index\`(\`sprite_id\`);`); this.addSql(`create table \`tile\` (\`id\` varchar(255) not null, \`name\` varchar(255) not null, \`tags\` json null, \`created_at\` datetime not null, \`updated_at\` datetime not null, primary key (\`id\`)) default character set utf8mb4 engine = InnoDB;`); diff --git a/src/entities/base/spriteAction.ts b/src/entities/base/spriteAction.ts index a84d081..8681139 100644 --- a/src/entities/base/spriteAction.ts +++ b/src/entities/base/spriteAction.ts @@ -19,11 +19,11 @@ export class BaseSpriteAction extends BaseEntity { @Property({ type: 'json', nullable: true }) sprites?: string[] - @Property() - originX = 0 + @Property({ type: 'decimal', precision: 5, scale: 2 }) + originX = 0.00 - @Property() - originY = 0 + @Property({ type: 'decimal', precision: 5, scale: 2 }) + originY = 0.00 @Property() frameWidth = 0 diff --git a/src/events/gameMaster/assetManager/sprite/update.ts b/src/events/gameMaster/assetManager/sprite/update.ts index 36739dd..ede700e 100644 --- a/src/events/gameMaster/assetManager/sprite/update.ts +++ b/src/events/gameMaster/assetManager/sprite/update.ts @@ -135,7 +135,7 @@ export default class SpriteUpdateEvent extends BaseEvent { return await sharp(buffer) .extend({ - top: 0, + top: topPadding, bottom: bottomPadding, left: leftPadding, right: rightPadding,