Skip to content

Commit

Permalink
Added optional path for setShoes and add clearShoes()
Browse files Browse the repository at this point in the history
  • Loading branch information
KyeOnDiscord committed Nov 25, 2024
1 parent 4f95e75 commit 158a462
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/structures/party/ClientPartyMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,16 @@ class ClientPartyMember extends PartyMember {
* @param id The shoes's ID
* @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 +454,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 158a462

Please sign in to comment.