From 158a462dd750b301839d646d65e758494a3e26e6 Mon Sep 17 00:00:00 2001 From: Kye Date: Mon, 25 Nov 2024 18:15:01 +1100 Subject: [PATCH 1/2] Added optional path for setShoes and add clearShoes() --- src/structures/party/ClientPartyMember.ts | 26 +++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/structures/party/ClientPartyMember.ts b/src/structures/party/ClientPartyMember.ts index f7b6fa3b..a9d68812 100644 --- a/src/structures/party/ClientPartyMember.ts +++ b/src/structures/party/ClientPartyMember.ts @@ -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}`, }, }); @@ -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 From 63672760d2ac97188f6ab62f59ed679c55da92c9 Mon Sep 17 00:00:00 2001 From: Kye Date: Mon, 25 Nov 2024 18:28:12 +1100 Subject: [PATCH 2/2] .setShoes doc --- src/structures/party/ClientPartyMember.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/structures/party/ClientPartyMember.ts b/src/structures/party/ClientPartyMember.ts index a9d68812..1bd010fb 100644 --- a/src/structures/party/ClientPartyMember.ts +++ b/src/structures/party/ClientPartyMember.ts @@ -359,6 +359,7 @@ 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, path?: string) {