(pages): cleanup
This commit is contained in:
2
pages/dist/main.js
vendored
2
pages/dist/main.js
vendored
File diff suppressed because one or more lines are too long
1
pages/dist/v4/index.html
vendored
1
pages/dist/v4/index.html
vendored
File diff suppressed because one or more lines are too long
1
pages/dist/v4/main.js
vendored
1
pages/dist/v4/main.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
/* Config: Cust */
|
/* Config: Cust */
|
||||||
const CUST_REV_UV = 5;
|
|
||||||
const CUST_REV = 4;
|
const CUST_REV = 4;
|
||||||
|
const CUST_REV_ADV = 5;
|
||||||
|
|
||||||
enum CustPlatform {
|
enum CustPlatform {
|
||||||
Undefined = 0,
|
Undefined = 0,
|
||||||
@@ -430,7 +430,7 @@ class Cust {
|
|||||||
|
|
||||||
save() {
|
save() {
|
||||||
this.storage.updateFromTable();
|
this.storage.updateFromTable();
|
||||||
var lambda = (i => {
|
let lambda = (i => {
|
||||||
if (!i.offset) {
|
if (!i.offset) {
|
||||||
i.getInputElement()?.focus();
|
i.getInputElement()?.focus();
|
||||||
throw new Error(`Failed to get offset for ${i.name}`);
|
throw new Error(`Failed to get offset for ${i.name}`);
|
||||||
@@ -443,7 +443,7 @@ class Cust {
|
|||||||
mapper.set(i.offset, i.value!);
|
mapper.set(i.offset, i.value!);
|
||||||
});
|
});
|
||||||
CustTable.forEach(lambda);
|
CustTable.forEach(lambda);
|
||||||
if (this.rev == CUST_REV_UV) {
|
if (this.rev == CUST_REV_ADV) {
|
||||||
AdvTable.forEach(lambda);
|
AdvTable.forEach(lambda);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -528,13 +528,13 @@ class Cust {
|
|||||||
let offset = this.beginOffset + this.magicLen;
|
let offset = this.beginOffset + this.magicLen;
|
||||||
let revLen = 4;
|
let revLen = 4;
|
||||||
this.rev = this.mapper[revLen].get(offset);
|
this.rev = this.mapper[revLen].get(offset);
|
||||||
if (this.rev != CUST_REV && this.rev != CUST_REV_UV) {
|
if (this.rev != CUST_REV && this.rev != CUST_REV_ADV) {
|
||||||
throw new Error(`Unsupported custRev, expected: ${CUST_REV} or ${CUST_REV_UV}, got ${this.rev}`);
|
throw new Error(`Unsupported custRev, expected: ${CUST_REV} or ${CUST_REV_ADV}, got ${this.rev}`);
|
||||||
}
|
}
|
||||||
offset += revLen;
|
offset += revLen;
|
||||||
document.getElementById("cust_rev")!.innerHTML = `Cust v${CUST_REV} is loaded.`;
|
document.getElementById("cust_rev")!.innerHTML = `Cust v${this.rev} is loaded.`;
|
||||||
|
|
||||||
CustTable.forEach(i => {
|
let lambda = (i => {
|
||||||
i.offset = offset;
|
i.offset = offset;
|
||||||
let mapper = this.mapper[i.size];
|
let mapper = this.mapper[i.size];
|
||||||
if (!mapper) {
|
if (!mapper) {
|
||||||
@@ -545,18 +545,10 @@ class Cust {
|
|||||||
offset += i.size;
|
offset += i.size;
|
||||||
i.validate();
|
i.validate();
|
||||||
});
|
});
|
||||||
if (this.rev == CUST_REV_UV) {
|
|
||||||
AdvTable.forEach(i => {
|
CustTable.forEach(lambda);
|
||||||
i.offset = offset;
|
if (this.rev == CUST_REV_ADV) {
|
||||||
let mapper = this.mapper[i.size];
|
AdvTable.forEach(lambda);
|
||||||
if (!mapper) {
|
|
||||||
i.getInputElement()?.focus();
|
|
||||||
throw new Error(`Unknown size at ${i}`);
|
|
||||||
}
|
|
||||||
i.value = mapper.get(offset);
|
|
||||||
offset += i.size;
|
|
||||||
i.validate();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user