Skip to content

Commit 7a360ec

Browse files
committed
chore: always use items as reward types
1 parent 80fb652 commit 7a360ec

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# UnderScript Changelog
22

3+
## Version 0.55.6 (2023-10-19)
4+
1. Breaking quest stuff, CMD_God will need to update :sad:
5+
36
## Version 0.55.5 (2023-10-17)
47
1. More quest stuff (Thank CMD_God)
58

src/base/api/constants.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as api from '../../utils/4.api.js';
2+
import Item from '../../structures/constants/item.js';
3+
4+
const constants = api.mod.constants;
5+
Object.keys(Item).forEach((key) => {
6+
constants[key] = Item[key];
7+
});

src/structures/quests/Reward.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,34 +56,42 @@ function rewardType(el) {
5656
if (temp) {
5757
const { textContent: text } = temp.attributes.onmouseover;
5858
return {
59-
type: 'card',
59+
type: Item.CARD,
6060
value: text.substring(text.indexOf(',') + 1, text.indexOf(')')).trim(),
6161
};
6262
}
6363

6464
temp = el.querySelector('[data-skin-type]');
6565
if (temp) {
6666
return {
67-
type: 'card skin',
67+
type: Item.SKIN,
6868
value: new Skin(temp.dataset),
6969
};
7070
}
7171

7272
temp = el.querySelector('.avatar');
7373
if (temp) {
7474
return {
75-
type: 'avatar',
75+
type: Item.AVATAR,
7676
value: {
7777
image: temp.src,
7878
rarity: temp.classList[1],
7979
},
8080
};
8181
}
8282

83+
temp = el.querySelector('[src*="/emotes/"]');
84+
if (temp) {
85+
return {
86+
type: Item.EMOTE,
87+
value: temp.src,
88+
};
89+
}
90+
8391
temp = el.querySelector('[src*="/profiles/"]');
8492
if (temp) {
8593
return {
86-
type: 'profile',
94+
type: Item.PROFILE,
8795
value: temp.src,
8896
};
8997
}

0 commit comments

Comments
 (0)