From e3cdab625a1c81757e41ae42105bde6208bbba95 Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Wed, 5 Feb 2025 16:31:03 -0500 Subject: [PATCH 1/5] fix: add neededCurrencyOnly prop --- website/client/src/components/shops/balanceInfo.vue | 3 +++ website/client/src/pages/settings/components/yourBalance.vue | 3 +++ website/client/src/pages/settings/settingRows/classSetting.vue | 1 + 3 files changed, 7 insertions(+) diff --git a/website/client/src/components/shops/balanceInfo.vue b/website/client/src/components/shops/balanceInfo.vue index d4730345384..83fc89abf92 100644 --- a/website/client/src/components/shops/balanceInfo.vue +++ b/website/client/src/components/shops/balanceInfo.vue @@ -54,6 +54,9 @@ export default { amountNeeded: { type: Number, }, + neededCurrencyOnly: { + type: String, + }, }, data () { return { diff --git a/website/client/src/pages/settings/components/yourBalance.vue b/website/client/src/pages/settings/components/yourBalance.vue index 2e439cfffd7..a2277a23838 100644 --- a/website/client/src/pages/settings/components/yourBalance.vue +++ b/website/client/src/pages/settings/components/yourBalance.vue @@ -28,6 +28,9 @@ export default { amountNeeded: { type: Number, }, + neededCurrencyOnly: { + type: String, + }, }, }; diff --git a/website/client/src/pages/settings/settingRows/classSetting.vue b/website/client/src/pages/settings/settingRows/classSetting.vue index f4c7e4f64c0..ccd345da882 100644 --- a/website/client/src/pages/settings/settingRows/classSetting.vue +++ b/website/client/src/pages/settings/settingRows/classSetting.vue @@ -66,6 +66,7 @@ From e69078fcce4c02e72447a237917ea700f89109ca Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Thu, 6 Feb 2025 15:34:27 -0500 Subject: [PATCH 2/5] fix: worked on logic for displaying only gems --- website/client/src/components/shops/balanceInfo.vue | 13 ++++++++++++- .../src/pages/settings/components/yourBalance.vue | 3 ++- .../src/pages/settings/settingRows/classSetting.vue | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/website/client/src/components/shops/balanceInfo.vue b/website/client/src/components/shops/balanceInfo.vue index 83fc89abf92..a0bd9aeacb8 100644 --- a/website/client/src/components/shops/balanceInfo.vue +++ b/website/client/src/components/shops/balanceInfo.vue @@ -3,6 +3,7 @@
@@ -29,7 +30,7 @@ export default { type: Number, }, neededCurrencyOnly: { - type: String, + type: Boolean, }, }, }; diff --git a/website/client/src/pages/settings/settingRows/classSetting.vue b/website/client/src/pages/settings/settingRows/classSetting.vue index ccd345da882..803a988768c 100644 --- a/website/client/src/pages/settings/settingRows/classSetting.vue +++ b/website/client/src/pages/settings/settingRows/classSetting.vue @@ -66,7 +66,7 @@
From a98572c8b5d60463f4a139a4a81ed2523c04326c Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Fri, 7 Feb 2025 14:19:25 -0500 Subject: [PATCH 3/5] fix: removed gold & hourglasses if neededCurrencyOnly is true --- .../src/components/shops/balanceInfo.vue | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/website/client/src/components/shops/balanceInfo.vue b/website/client/src/components/shops/balanceInfo.vue index a0bd9aeacb8..9cb0c6d1f59 100644 --- a/website/client/src/components/shops/balanceInfo.vue +++ b/website/client/src/components/shops/balanceInfo.vue @@ -71,43 +71,40 @@ export default { computed: { currencies () { const currencies = []; - currencies.push({ - type: 'hourglasses', - icon: this.icons.hourglasses, - value: this.userHourglasses, - }); + if (this.neededCurrencyOnly === true) { + currencies.push({ + type: 'gems', + icon: this.icons.gem, + value: this.userGems, + }); + } else { + currencies.push({ + type: 'hourglasses', + icon: this.icons.hourglasses, + value: this.userHourglasses, + }); - currencies.push({ - type: 'gems', - icon: this.icons.gem, - value: this.userGems, - }); + currencies.push({ + type: 'gems', + icon: this.icons.gem, + value: this.userGems, + }); - currencies.push({ - type: 'gold', - icon: this.icons.gold, - value: this.userGold, - }); + currencies.push({ + type: 'gold', + icon: this.icons.gold, + value: this.userGold, + }); - for (const currency of currencies) { - if ( - currency.type === this.currencyNeeded - && !this.enoughCurrency(this.currencyNeeded, this.amountNeeded) - ) { - currency.notEnough = true; + for (const currency of currencies) { + if ( + currency.type === this.currencyNeeded + && !this.enoughCurrency(this.currencyNeeded, this.amountNeeded) + ) { + currency.notEnough = true; + } } } - - for (const currency of currencies) { - if ( - currency.type === this.neededCurrencyOnly - ) { - return this.currencyNeeded; - } - } - console.log(currencies); - console.log(this.neededCurrencyOnly); - console.log(this.currencyNeeded); return currencies; }, }, From cc70a5c5f20f80f4e9325168a5b46d30caa3d8d2 Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Fri, 7 Feb 2025 14:28:45 -0500 Subject: [PATCH 4/5] fix: aligned gem count properly --- .../client/src/pages/settings/settingRows/classSetting.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/website/client/src/pages/settings/settingRows/classSetting.vue b/website/client/src/pages/settings/settingRows/classSetting.vue index 803a988768c..ec60ff0334f 100644 --- a/website/client/src/pages/settings/settingRows/classSetting.vue +++ b/website/client/src/pages/settings/settingRows/classSetting.vue @@ -67,6 +67,7 @@ :amount-needed="amountNeeded" currency-needed="gems" :neededCurrencyOnly="true" + class="currency-align" /> @@ -81,6 +82,11 @@ input { margin-right: 2rem; } +.currency-align { + display: flex; + align-items: center; +} + .form-group { margin-bottom: 1.5rem; } From e36dde7518fffb91a487e43201c440c0c2eaecec Mon Sep 17 00:00:00 2001 From: CuriousMagpie Date: Mon, 10 Feb 2025 15:43:17 -0500 Subject: [PATCH 5/5] fix: updates based on some comments (all comments answered) --- .../src/components/shops/balanceInfo.vue | 61 ++++++++++--------- .../pages/settings/components/yourBalance.vue | 2 +- .../settings/settingRows/classSetting.vue | 6 -- 3 files changed, 32 insertions(+), 37 deletions(-) diff --git a/website/client/src/components/shops/balanceInfo.vue b/website/client/src/components/shops/balanceInfo.vue index 9cb0c6d1f59..73c359d85cd 100644 --- a/website/client/src/components/shops/balanceInfo.vue +++ b/website/client/src/components/shops/balanceInfo.vue @@ -70,39 +70,40 @@ export default { }, computed: { currencies () { - const currencies = []; - if (this.neededCurrencyOnly === true) { - currencies.push({ - type: 'gems', - icon: this.icons.gem, - value: this.userGems, - }); - } else { - currencies.push({ - type: 'hourglasses', - icon: this.icons.hourglasses, - value: this.userHourglasses, - }); + const currencies = [{ + type: 'hourglasses', + icon: this.icons.hourglasses, + value: this.userHourglasses, + }, - currencies.push({ - type: 'gems', - icon: this.icons.gem, - value: this.userGems, - }); + { + type: 'gems', + icon: this.icons.gem, + value: this.userGems, + }, - currencies.push({ - type: 'gold', - icon: this.icons.gold, - value: this.userGold, - }); + { + type: 'gold', + icon: this.icons.gold, + value: this.userGold, + }]; - for (const currency of currencies) { - if ( - currency.type === this.currencyNeeded - && !this.enoughCurrency(this.currencyNeeded, this.amountNeeded) - ) { - currency.notEnough = true; - } + for (const currency of currencies) { + if (this.neededCurrencyOnly) { + const neededCurrency = [ + // need to figure out how to abstract this so any currency can be called, not just gems + { + type: 'gems', + icon: this.icons.gem, + value: this.userGems, + }, + ]; + return neededCurrency; + } + + if (currency.type === this.currencyNeeded + && !this.enoughCurrency(this.currencyNeeded, this.amountNeeded)) { + currency.notEnough = true; } } return currencies; diff --git a/website/client/src/pages/settings/components/yourBalance.vue b/website/client/src/pages/settings/components/yourBalance.vue index 6ce249fd25d..c3b0e4af6ca 100644 --- a/website/client/src/pages/settings/components/yourBalance.vue +++ b/website/client/src/pages/settings/components/yourBalance.vue @@ -11,7 +11,7 @@ class="balance-info" :currency-needed="currencyNeeded" :amount-needed="amountNeeded" - neededCurrencyOnly + neededCurrencyOnly="" /> diff --git a/website/client/src/pages/settings/settingRows/classSetting.vue b/website/client/src/pages/settings/settingRows/classSetting.vue index ec60ff0334f..803a988768c 100644 --- a/website/client/src/pages/settings/settingRows/classSetting.vue +++ b/website/client/src/pages/settings/settingRows/classSetting.vue @@ -67,7 +67,6 @@ :amount-needed="amountNeeded" currency-needed="gems" :neededCurrencyOnly="true" - class="currency-align" /> @@ -82,11 +81,6 @@ input { margin-right: 2rem; } -.currency-align { - display: flex; - align-items: center; -} - .form-group { margin-bottom: 1.5rem; }