feat(character): hide helmet and cloak according to character flags
This commit is contained in:
parent
6d625929f1
commit
88e1d143d1
2 changed files with 9 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ interface ICharacterData {
|
||||||
hairStyle: number;
|
hairStyle: number;
|
||||||
hairColor: number;
|
hairColor: number;
|
||||||
facialStyle: number;
|
facialStyle: number;
|
||||||
|
playerFlags: number;
|
||||||
online: number;
|
online: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -143,6 +144,7 @@ export class CharacterController {
|
||||||
race: charData.race,
|
race: charData.race,
|
||||||
gender: charData.gender,
|
gender: charData.gender,
|
||||||
class: charData.class,
|
class: charData.class,
|
||||||
|
flags: charData.playerFlags,
|
||||||
characterModelItems: await this.getModelViewerItems(equipmentData, charData.class),
|
characterModelItems: await this.getModelViewerItems(equipmentData, charData.class),
|
||||||
customizationOptions: customization,
|
customizationOptions: customization,
|
||||||
equipment,
|
equipment,
|
||||||
|
|
@ -198,7 +200,7 @@ export class CharacterController {
|
||||||
|
|
||||||
private async getCharacterData(realm: string, charName: string): Promise<ICharacterData> {
|
private async getCharacterData(realm: string, charName: string): Promise<ICharacterData> {
|
||||||
const [rows, fields] = await this.armory.getCharactersDb(realm).query(`
|
const [rows, fields] = await this.armory.getCharactersDb(realm).query(`
|
||||||
SELECT guid, name, race, class, gender, level, skin, face, hairStyle, hairColor, facialStyle, online
|
SELECT guid, name, race, class, gender, level, skin, face, hairStyle, hairColor, facialStyle, playerFlags, online
|
||||||
FROM characters
|
FROM characters
|
||||||
WHERE LOWER(name) = LOWER(?)
|
WHERE LOWER(name) = LOWER(?)
|
||||||
`, [charName]);
|
`, [charName]);
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,11 @@
|
||||||
};
|
};
|
||||||
const genders = ["male", "female"];
|
const genders = ["male", "female"];
|
||||||
|
|
||||||
|
const hideHelm = (charData.flags & 0x0400) === 0x0400;
|
||||||
|
$("#cb-hide-helmet").prop("checked", hideHelm);
|
||||||
|
const hideCloak = (charData.flags & 0x0800) === 0x0800;
|
||||||
|
$("#cb-hide-cloak").prop("checked", hideCloak);
|
||||||
|
|
||||||
const characterModel = {
|
const characterModel = {
|
||||||
type: ZamModelViewer.WOW,
|
type: ZamModelViewer.WOW,
|
||||||
contentPath: "/data/",
|
contentPath: "/data/",
|
||||||
|
|
@ -80,7 +85,7 @@
|
||||||
sheathOff: -1,
|
sheathOff: -1,
|
||||||
},
|
},
|
||||||
cls: charData.class,
|
cls: charData.class,
|
||||||
items: charData.characterModelItems,
|
items: charData.characterModelItems.filter(item => !((item[0] === 1 && hideHelm) || (item[0] === 16 && hideCloak))),
|
||||||
models: {
|
models: {
|
||||||
type: ZamModelViewer.Wow.Types.CHARACTER,
|
type: ZamModelViewer.Wow.Types.CHARACTER,
|
||||||
id: `${races[charData.race]}${genders[charData.gender]}`,
|
id: `${races[charData.race]}${genders[charData.gender]}`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue