idz: Add idz_settings.driving_style column

This commit is contained in:
BemaniWitch 2020-10-25 18:49:13 -04:00 committed by Tau
parent 9f6b0e59c8
commit 48a9bcbdbd
8 changed files with 41 additions and 1 deletions

View File

@ -104,7 +104,8 @@ create table "idz_settings" (
"pack" integer not null,
"aura" integer not null,
"paper_cup" integer not null, -- Not a boolean, oddly enough
"gauges" integer not null
"gauges" integer not null,
"driving_style" integer not null
);
create table "idz_story_state" (

View File

@ -0,0 +1,33 @@
create table "new_idz_settings" (
"id" integer primary key not null
references "idz_profile"("id")
on delete cascade,
"music" integer not null,
"pack" integer not null,
"aura" integer not null,
"paper_cup" integer not null, -- Not a boolean, oddly enough
"gauges" integer not null,
"driving_style" integer not null
);
insert into "new_idz_settings" (
"id",
"music",
"pack",
"aura",
"paper_cup",
"gauges",
"driving_style"
) select
x."id",
x."music",
x."pack",
x."aura",
x."paper_cup",
x."gauges",
0
from "idz_settings" as x;
drop table "idz_settings";
alter table "new_idz_settings" rename to "idz_settings";

View File

@ -95,6 +95,7 @@ export function saveProfile2(buf: Buffer): SaveProfileRequest {
aura: buf.readUInt8(0x002c),
paperCup: buf.readUInt8(0x00f6),
gauges: buf.readUInt8(0x00f7),
drivingStyle: 0, // Not supported until idz2
},
};
}

View File

@ -97,6 +97,7 @@ export function saveProfile3(buf: Buffer): SaveProfileRequest {
aura: buf.readUInt8(0x002c),
paperCup: buf.readUInt8(0x00f6),
gauges: buf.readUInt8(0x00f7),
drivingStyle: 0, // Not supported until idz2
},
};
}

View File

@ -16,6 +16,7 @@ export function saveSettings(buf: Buffer): SaveSettingsRequest {
paperCup: buf.readUInt8(0x0011),
gauges: buf.readUInt8(0x0012),
aura: buf.readUInt8(0x0013),
drivingStyle: 0, // Not supported until idz2
},
field_0010: buf.readUInt8(0x0010),
};

View File

@ -34,6 +34,7 @@ export async function createProfile(
aura: 0,
paperCup: 0,
gauges: 5,
drivingStyle: 0, // Not supported until idz2
};
const story: Story = {
x: 0,

View File

@ -4,4 +4,5 @@ export interface Settings {
aura: number;
paperCup: number;
gauges: number;
drivingStyle: number;
}

View File

@ -27,6 +27,7 @@ export class SqlSettingsRepository implements FacetRepository<Settings> {
aura: parseInt(row.aura!),
paperCup: parseInt(row.paper_cup!),
gauges: parseInt(row.gauges!),
drivingStyle: parseInt(row.driving_style!),
};
}