mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
[WIP] Play Sounds in the new Client (#9012)
* move audioThemes to content - add audio settings * copy audioFiles to website/static/audio - playSounds on $emit() * Play Sounds for Rewards, Purchasing Items / Quests * remove shop http-api calls * play reward sound when buying gem * fix lint / always show mysterybox
This commit is contained in:
@@ -291,7 +291,7 @@ export default {
|
||||
|
||||
let specialArray = itemsByType.special;
|
||||
|
||||
if (this.user.purchased.plan.mysteryItems.length) {
|
||||
if (this.user.purchased.plan.customerId) {
|
||||
specialArray.push({
|
||||
key: 'mysteryItem',
|
||||
class: `inventory_present inventory_present_${moment().format('MM')}`,
|
||||
@@ -390,11 +390,16 @@ export default {
|
||||
if (item.key === 'timeTravelers') {
|
||||
this.$router.push({name: 'time'});
|
||||
} else if (item.key === 'mysteryItem') {
|
||||
if (item.quantity === 0)
|
||||
return;
|
||||
|
||||
let result = await this.$store.dispatch('user:openMysteryItem');
|
||||
|
||||
let openedItem = result.data.data;
|
||||
let text = this.content.gear.flat[openedItem.key].text();
|
||||
this.drop(this.$t('messageDropMysteryItem', {dropText: text}), openedItem);
|
||||
item.quantity--;
|
||||
this.$forceUpdate();
|
||||
} else {
|
||||
this.selectedSpell = item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user