Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/giorgi-o/SkinPeek
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgi-o committed Feb 1, 2024
2 parents 60479d7 + 640a876 commit b544c55
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 17 additions & 4 deletions discord/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,13 @@ export const skinCollectionSingleEmbed = async (interaction, id, user, {loadout,
const skinsUuid = [];
const createField = async (weaponUuid, inline=true) => {
const weapon = await getWeapon(weaponUuid);
const skin = await getSkinFromSkinUuid(loadout.Guns.find(gun => gun.ID === weaponUuid).SkinID);
const skinUuid = loadout.Guns.find(gun => gun.ID === weaponUuid)?.SkinID
if(!skinUuid) return {
name: 'No information available',
value: 'Login to the game for display',
inline: inline
}
const skin = await getSkinFromSkinUuid(skinUuid);
skinsUuid.push(skin);
totalValue += skin.price;

Expand Down Expand Up @@ -665,6 +671,8 @@ export const skinCollectionSingleEmbed = async (interaction, id, user, {loadout,
await createField(WeaponTypeUuid.Guardian),
await createField(WeaponTypeUuid.Marshal),

await createField(WeaponTypeUuid.Outlaw),

await createField(WeaponTypeUuid.Stinger),
await createField(WeaponTypeUuid.Ares),
await createField(WeaponTypeUuid.Odin),
Expand Down Expand Up @@ -720,8 +728,13 @@ export const skinCollectionPageEmbed = async (interaction, id, user, {loadout, f

const createEmbed = async (weaponUuid) => {
const weapon = await getWeapon(weaponUuid);
const skin = await getSkinFromSkinUuid(loadout.Guns.find(gun => gun.ID === weaponUuid).SkinID);

const skinUuid = loadout.Guns.find(gun => gun.ID === weaponUuid)?.SkinID
if(!skinUuid) return {
title: 'No information available',
description: 'Login to the game for display',
color: VAL_COLOR_1,
}
const skin = await getSkinFromSkinUuid(skinUuid);
totalValue += skin.price;

const starEmoji = favorites.FavoritedContent[skin.skinUuid] ? " ⭐" : "";
Expand All @@ -736,7 +749,7 @@ export const skinCollectionPageEmbed = async (interaction, id, user, {loadout, f
}

const pages = [
[WeaponTypeUuid.Vandal, WeaponTypeUuid.Phantom, WeaponTypeUuid.Operator, WeaponTypeUuid.Knife],
[WeaponTypeUuid.Vandal, WeaponTypeUuid.Phantom, WeaponTypeUuid.Operator, WeaponTypeUuid.Outlaw, WeaponTypeUuid.Knife],
[WeaponTypeUuid.Classic, WeaponTypeUuid.Sheriff, WeaponTypeUuid.Spectre, WeaponTypeUuid.Marshal],
[WeaponTypeUuid.Frenzy, WeaponTypeUuid.Ghost, WeaponTypeUuid.Bulldog, WeaponTypeUuid.Guardian],
[WeaponTypeUuid.Shorty, WeaponTypeUuid.Bucky, WeaponTypeUuid.Judge],
Expand Down
2 changes: 2 additions & 0 deletions misc/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ export const WeaponType = {
Vandal: "Vandal",

Marshal: "Marshal",
Outlaw: "Outlaw",
Operator: "Operator",
Ares: "Ares",
Odin: "Odin",
Expand All @@ -413,6 +414,7 @@ export const WeaponTypeUuid = {
[WeaponType.Operator]: "a03b24d3-4319-996d-0f8c-94bbfba1dfc7",
[WeaponType.Guardian]: "4ade7faa-4cf1-8376-95ef-39884480959b",
[WeaponType.Marshal]: "c4883e50-4494-202c-3ec3-6b8a9284f00b",
[WeaponType.Outlaw]: "5f0aaf7a-4289-3998-d5ff-eb9a5cf7ef5c",
[WeaponType.Spectre]: "462080d1-4035-2937-7c09-27aa2a5c27a7",
[WeaponType.Stinger]: "f7e1b454-4ad4-1063-ec0a-159e56b58941",
[WeaponType.Knife]: "2f59173c-4bed-b6c3-2191-dea9b58be9c7",
Expand Down

0 comments on commit b544c55

Please sign in to comment.