Skip to content

Commit

Permalink
Merge pull request #40 from KyeOnDiscord/main
Browse files Browse the repository at this point in the history
update setshoes
  • Loading branch information
tnfAngel authored Nov 28, 2024
2 parents 57848ee + 6367276 commit adaf52b
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/structures/party/ClientPartyMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,16 +359,19 @@ class ClientPartyMember extends PartyMember {
/**
* Updates the client party member's shoes
* @param id The shoes's ID
* @param path The shoes' path in the game files
* @throws {EpicgamesAPIError}
*/
public async setShoes(id: string) {
public async setShoes(id: string, path?: string) {
let data = this.meta.get('Default:AthenaCosmeticLoadout_j');

data = this.meta.set('Default:AthenaCosmeticLoadout_j', {
...data,
AthenaCosmeticLoadout: {
...data.AthenaCosmeticLoadout,
shoesDef: `/CosmeticShoes/Assets/Items/Cosmetics/${id}.${id}`,
shoesDef: `${
path?.replace(/\/$/, '') ?? '/CosmeticShoes/Assets/Items/Cosmetics'
}/${id}.${id}`,
},
});

Expand Down Expand Up @@ -452,6 +455,26 @@ class ClientPartyMember extends PartyMember {
});
}

/**
* Clears the client party member's shoes
* @throws {EpicgamesAPIError}
*/
public async clearShoes() {
let data = this.meta.get('Default:AthenaCosmeticLoadout_j');

data = this.meta.set('Default:AthenaCosmeticLoadout_j', {
...data,
AthenaCosmeticLoadout: {
...data.AthenaCosmeticLoadout,
shoesDef: '',
},
});

await this.sendPatch({
'Default:AthenaCosmeticLoadout_j': data,
});
}

/**
* Updates the client party member's match state.
* NOTE: This is visually, the client will not actually join a match
Expand Down

0 comments on commit adaf52b

Please sign in to comment.