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;
|
||||
hairColor: number;
|
||||
facialStyle: number;
|
||||
playerFlags: number;
|
||||
online: number;
|
||||
}
|
||||
|
||||
|
|
@ -143,6 +144,7 @@ export class CharacterController {
|
|||
race: charData.race,
|
||||
gender: charData.gender,
|
||||
class: charData.class,
|
||||
flags: charData.playerFlags,
|
||||
characterModelItems: await this.getModelViewerItems(equipmentData, charData.class),
|
||||
customizationOptions: customization,
|
||||
equipment,
|
||||
|
|
@ -198,7 +200,7 @@ export class CharacterController {
|
|||
|
||||
private async getCharacterData(realm: string, charName: string): Promise<ICharacterData> {
|
||||
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
|
||||
WHERE LOWER(name) = LOWER(?)
|
||||
`, [charName]);
|
||||
|
|
|
|||
|
|
@ -65,6 +65,11 @@
|
|||
};
|
||||
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 = {
|
||||
type: ZamModelViewer.WOW,
|
||||
contentPath: "/data/",
|
||||
|
|
@ -80,7 +85,7 @@
|
|||
sheathOff: -1,
|
||||
},
|
||||
cls: charData.class,
|
||||
items: charData.characterModelItems,
|
||||
items: charData.characterModelItems.filter(item => !((item[0] === 1 && hideHelm) || (item[0] === 16 && hideCloak))),
|
||||
models: {
|
||||
type: ZamModelViewer.Wow.Types.CHARACTER,
|
||||
id: `${races[charData.race]}${genders[charData.gender]}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue