Skip to content

Commit

Permalink
Merge pull request #38 from KyeOnDiscord/main
Browse files Browse the repository at this point in the history
shoes
  • Loading branch information
tnfAngel authored Nov 23, 2024
2 parents 9373763 + 4f95e75 commit 57848ee
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/defaultPartyMemberMeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Default:ArbitraryCustomDataStore_j": "{\"ArbitraryCustomDataStore\":[]}",
"Default:AthenaBannerInfo_j": "{\"AthenaBannerInfo\":{\"bannerIconId\":\"standardbanner15\",\"bannerColorId\":\"defaultcolor15\",\"seasonLevel\":1}}",
"Default:AthenaCosmeticLoadoutVariants_j": "{\"AthenaCosmeticLoadoutVariants\":{\"vL\":{},\"fT\":false}}",
"Default:AthenaCosmeticLoadout_j": "{\"AthenaCosmeticLoadout\":{\"characterPrimaryAssetId\":\"\",\"characterEKey\":\"\",\"backpackDef\":\"None\",\"backpackEKey\":\"\",\"pickaxeDef\":\"/Game/Athena/Items/Cosmetics/Pickaxes/DefaultPickaxe.DefaultPickaxe\",\"pickaxeEKey\":\"\",\"contrailDef\":\"/Game/Athena/Items/Cosmetics/Contrails/DefaultContrail.DefaultContrail\",\"contrailEKey\":\"\",\"scratchpad\":[],\"cosmeticStats\":[{\"statName\":\"HabaneroProgression\",\"statValue\":0},{\"statName\":\"TotalVictoryCrowns\",\"statValue\":0},{\"statName\":\"TotalRoyalRoyales\",\"statValue\":0},{\"statName\":\"HasCrown\",\"statValue\":0}]}}",
"Default:AthenaCosmeticLoadout_j": "{\"AthenaCosmeticLoadout\":{\"characterPrimaryAssetId\":\"\",\"characterEKey\":\"\",\"backpackDef\":\"None\",\"backpackEKey\":\"\",\"pickaxeDef\":\"/Game/Athena/Items/Cosmetics/Pickaxes/DefaultPickaxe.DefaultPickaxe\",\"pickaxeEKey\":\"\",\"contrailDef\":\"/Game/Athena/Items/Cosmetics/Contrails/DefaultContrail.DefaultContrail\",\"contrailEKey\":\"\",\"shoesDef\":\"None\",\"shoesEKey\":\"\",\"scratchpad\":[],\"cosmeticStats\":[{\"statName\":\"HabaneroProgression\",\"statValue\":0},{\"statName\":\"TotalVictoryCrowns\",\"statValue\":0},{\"statName\":\"TotalRoyalRoyales\",\"statValue\":0},{\"statName\":\"HasCrown\",\"statValue\":0}]}}",
"Default:BattlePassInfo_j": "{\"BattlePassInfo\":{\"bHasPurchasedPass\":false,\"passLevel\":1,\"selfBoostXp\":0,\"friendBoostXp\":0}}",
"Default:bIsPartyUsingPartySignal_b": "false",
"Default:CampaignHero_j": "{\"CampaignHero\":{\"heroItemInstanceId\":\"\",\"heroType\":\"\"}}",
Expand Down
21 changes: 21 additions & 0 deletions src/structures/party/ClientPartyMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,27 @@ class ClientPartyMember extends PartyMember {
await this.sendPatch(patches);
}

/**
* Updates the client party member's shoes
* @param id The shoes's ID
* @throws {EpicgamesAPIError}
*/
public async setShoes(id: 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}`,
},
});

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

/**
* Updates the client party member's emote
* @param id The emote's ID
Expand Down
7 changes: 7 additions & 0 deletions src/structures/party/PartyMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ class PartyMember extends User {
return this.meta.backpack;
}

/**
* The member's currently equipped shoes
*/
public get shoes() {
return this.meta.shoes;
}

/**
* Whether the member is ready
*/
Expand Down
7 changes: 7 additions & 0 deletions src/structures/party/PartyMemberMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ class PartyMemberMeta extends Meta<PartyMemberSchema> {
return (this.get('Default:AthenaCosmeticLoadout_j')?.AthenaCosmeticLoadout?.backpackDef as string)?.match(/(?<=\w*\.)\w*/)?.shift();
}

/**
* The currently equipped shoes
*/
public get shoes(): string | undefined {
return (this.get('Default:AthenaCosmeticLoadout_j')?.AthenaCosmeticLoadout?.shoesDef as string)?.match(/(?<=\w*\.)\w*/)?.shift();
}

/**
* Whether the member is ready
*/
Expand Down

0 comments on commit 57848ee

Please sign in to comment.