Skip to content

Commit

Permalink
fix: setOutfit and outfit getter
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisNils committed Dec 4, 2023
1 parent e561345 commit 84280e6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/defaultPartyMemberMeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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\":{\"characterDef\":\"\",\"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\":\"\",\"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
4 changes: 2 additions & 2 deletions src/structures/party/ClientPartyMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class ClientPartyMember extends PartyMember {
* @param path The outfit's path in the game files
* @throws {EpicgamesAPIError}
*/
public async setOutfit(id: string, variants: CosmeticVariant[] = [], enlightment?: CosmeticEnlightment, path?: string) {
public async setOutfit(id: string, variants: CosmeticVariant[] = [], enlightment?: CosmeticEnlightment) {
let data = this.meta.get('Default:AthenaCosmeticLoadout_j');
let variantData = this.meta.get('Default:AthenaCosmeticLoadoutVariants_j');

Expand Down Expand Up @@ -223,7 +223,7 @@ class ClientPartyMember extends PartyMember {
...data,
AthenaCosmeticLoadout: {
...data.AthenaCosmeticLoadout,
characterDef: `${path?.replace(/\/$/, '') ?? '/BRCosmetics/Athena/Items/Cosmetics/Characters'}/${id}.${id}`,
characterPrimaryAssetId: `AthenaCharacter:${id}`,
scratchpad,
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/structures/party/ClientPartyMemberMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ClientPartyMemberMeta extends PartyMemberMeta {
'Default:AthenaCosmeticLoadout_j': JSON.stringify({
AthenaCosmeticLoadout: {
...JSON.parse(defaultPartyMemberMeta['Default:AthenaCosmeticLoadout_j']).AthenaCosmeticLoadout,
characterDef: `AthenaCharacterItemDefinition'/BRCosmetics/Athena/Items/Cosmetics/Characters/${defaultCharacter}.${defaultCharacter}'`,
characterPrimaryAssetId: `AthenaCharacter:${defaultCharacter}`,
},
}),
'Default:CampaignHero_j': JSON.stringify({
Expand Down
2 changes: 1 addition & 1 deletion src/structures/party/PartyMemberMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PartyMemberMeta extends Meta<PartyMemberSchema> {
* The currently equipped outfit CID
*/
public get outfit(): string | undefined {
return (this.get('Default:AthenaCosmeticLoadout_j')?.AthenaCosmeticLoadout?.characterDef as string)?.match(/(?<=\w*\.)\w*/)?.shift();
return (this.get('Default:AthenaCosmeticLoadout_j')?.AthenaCosmeticLoadout?.characterPrimaryAssetId as string)?.replace('AthenaCharacter:', '');
}

/**
Expand Down

0 comments on commit 84280e6

Please sign in to comment.