From 21a0bf7d6517af973b51ce0513d07874635acc9f Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Tue, 7 May 2024 09:06:23 -0500 Subject: [PATCH] WIP(shops): update avatar modal style --- .../client/src/components/creatorIntro.vue | 240 +++--------------- .../client/src/components/shops/buyModal.vue | 4 +- .../client/src/mixins/avatarEditUtilities.js | 10 +- website/common/locales/en/customizations.json | 2 +- 4 files changed, 48 insertions(+), 208 deletions(-) diff --git a/website/client/src/components/creatorIntro.vue b/website/client/src/components/creatorIntro.vue index 5e1de562cc..afec0a7d11 100644 --- a/website/client/src/components/creatorIntro.vue +++ b/website/client/src/components/creatorIntro.vue @@ -153,28 +153,29 @@ id="backgrounds" class="section customize-section pt-4" > -
+
{{ $t('incentiveBackgrounds') }}
{{ $t('incentiveBackgroundsUnlockedWithCheckins') }}
-
+
@@ -202,12 +203,13 @@ v-for="bg in allBackgrounds.eventBackgrounds.items" :id="bg.key" :key="bg.key" - class="col-4 text-center customize-option background-button" + class="background-item" + :class="{selected: bg.key === user.preferences.background}" @click="unlock('background.' + bg.key)" >
- -
-
- 1 -
- - -
{{ $t('monthlyBackgrounds') }}
-
+
- +
diff --git a/website/client/src/components/shops/buyModal.vue b/website/client/src/components/shops/buyModal.vue index 4659ee184b..3d260dae8d 100644 --- a/website/client/src/components/shops/buyModal.vue +++ b/website/client/src/components/shops/buyModal.vue @@ -822,8 +822,10 @@ export default { } if (this.item.purchaseType === 'customization') { - await this.unlock(this.item.path); + const buySuccess = await this.unlock(this.item.path); + if (!buySuccess) return; this.sync(); + this.purchased(this.item.text); } else { const shouldConfirmPurchase = this.item.currency === 'gems' || this.item.currency === 'hourglasses'; if ( diff --git a/website/client/src/mixins/avatarEditUtilities.js b/website/client/src/mixins/avatarEditUtilities.js index a61eded2cc..374fa7c657 100644 --- a/website/client/src/mixins/avatarEditUtilities.js +++ b/website/client/src/mixins/avatarEditUtilities.js @@ -140,13 +140,9 @@ export const avatarEditorUtilities = { // eslint-disable-line import/prefer-defa if (loginIncentives.indexOf(path) === -1) { if (fullSet) { - if (window.confirm(this.$t('purchaseFor', { cost: cost * 4 })) !== true) return; // eslint-disable-line no-alert - // @TODO: implement gem modal - // if (this.user.balance < cost) return $rootScope.openModal('buyGems'); + if (window.confirm(this.$t('purchaseFor', { cost: cost * 4 })) !== true) return false; // eslint-disable-line no-alert } else if (!get(this.user, `purchased.${path}`)) { - if (window.confirm(this.$t('purchaseFor', { cost: cost * 4 })) !== true) return; // eslint-disable-line no-alert - // @TODO: implement gem modal - // if (this.user.balance < cost) return $rootScope.openModal('buyGems'); + if (window.confirm(this.$t('purchaseFor', { cost: cost * 4 })) !== true) return false; // eslint-disable-line no-alert } } @@ -158,8 +154,10 @@ export const avatarEditorUtilities = { // eslint-disable-line import/prefer-defa }, }); this.backgroundUpdate = new Date(); + return true; } catch (e) { window.alert(e.message); // eslint-disable-line no-alert + return false; } }, async buy (item) { diff --git a/website/common/locales/en/customizations.json b/website/common/locales/en/customizations.json index 79069158b4..d694d84a2e 100644 --- a/website/common/locales/en/customizations.json +++ b/website/common/locales/en/customizations.json @@ -18,7 +18,7 @@ "candycane": "Candy Cane", "candycorn": "Candy Corn", "clownfish": "Clownfish", - "convict": "Convict", + "convict": "Referee", "cross": "Cross", "curlyLong": "Curly Long", "curlyShort": "Curly Short",