Merge branch 'sabrecat/customizations' into subs-private

This commit is contained in:
Sabe Jones
2024-04-03 08:36:25 -05:00
16 changed files with 224 additions and 60 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "habitica", "name": "habitica",
"version": "5.22.2", "version": "5.22.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "habitica", "name": "habitica",
"version": "5.22.2", "version": "5.22.3",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@babel/core": "^7.22.10", "@babel/core": "^7.22.10",

View File

@@ -1,7 +1,7 @@
{ {
"name": "habitica", "name": "habitica",
"description": "A habit tracker app which treats your goals like a Role Playing Game.", "description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "5.22.2", "version": "5.22.3",
"main": "./website/server/index.js", "main": "./website/server/index.js",
"dependencies": { "dependencies": {
"@babel/core": "^7.22.10", "@babel/core": "^7.22.10",

View File

@@ -541,10 +541,6 @@
margin: auto -1rem -1rem; margin: auto -1rem -1rem;
} }
// .pt-015 {
// padding-top: 0.15rem;
// }
.gems-left { .gems-left {
height: 32px; height: 32px;
background-color: $green-100; background-color: $green-100;
@@ -596,8 +592,10 @@ import moment from 'moment';
import planGemLimits from '@/../../common/script/libs/planGemLimits'; import planGemLimits from '@/../../common/script/libs/planGemLimits';
import { drops as dropEggs } from '@/../../common/script/content/eggs'; import { drops as dropEggs } from '@/../../common/script/content/eggs';
import { drops as dropPotions } from '@/../../common/script/content/hatching-potions'; import { drops as dropPotions } from '@/../../common/script/content/hatching-potions';
import spellsMixin from '@/mixins/spells'; import { avatarEditorUtilities } from '@/mixins/avatarEditUtilities';
import numberInvalid from '@/mixins/numberInvalid'; import numberInvalid from '@/mixins/numberInvalid';
import spellsMixin from '@/mixins/spells';
import sync from '@/mixins/sync';
import svgClose from '@/assets/svg/close.svg'; import svgClose from '@/assets/svg/close.svg';
import svgGold from '@/assets/svg/gold.svg'; import svgGold from '@/assets/svg/gold.svg';
@@ -644,7 +642,15 @@ export default {
CountdownBanner, CountdownBanner,
numberIncrement, numberIncrement,
}, },
mixins: [buyMixin, currencyMixin, notifications, numberInvalid, spellsMixin], mixins: [
avatarEditorUtilities,
buyMixin,
currencyMixin,
notifications,
numberInvalid,
spellsMixin,
sync,
],
props: { props: {
// eslint-disable-next-line vue/require-default-prop // eslint-disable-next-line vue/require-default-prop
item: { item: {
@@ -754,7 +760,7 @@ export default {
this.selectedAmountToBuy = 1; this.selectedAmountToBuy = 1;
}, },
buyItem () { async buyItem () {
// @TODO: I think we should buying to the items. // @TODO: I think we should buying to the items.
// Turn the items into classes, and use polymorphism // Turn the items into classes, and use polymorphism
if (this.item.buy) { if (this.item.buy) {
@@ -827,7 +833,10 @@ export default {
return; return;
} }
if (this.genericPurchase) { if (this.item.purchaseType === 'customization') {
await this.unlock(this.item.path);
this.sync();
} else if (this.genericPurchase) {
this.makeGenericPurchase(this.item, 'buyModal', this.selectedAmountToBuy); this.makeGenericPurchase(this.item, 'buyModal', this.selectedAmountToBuy);
this.purchased(this.item.text); this.purchased(this.item.text);
} }

View File

@@ -51,6 +51,7 @@
<item-rows <item-rows
:items="customizationsItems({category, searchBy: searchTextThrottled})" :items="customizationsItems({category, searchBy: searchTextThrottled})"
:type="category.identifier" :type="category.identifier"
:fold-button="category.identifier === 'background'"
:item-width="94" :item-width="94"
:item-margin="24" :item-margin="24"
:max-items-per-row="8" :max-items-per-row="8"
@@ -87,14 +88,6 @@
height: 216px; height: 216px;
} }
.item-rows {
max-width: 920px;
.items > div:nth-of-type(8n) {
margin-right: 0px;
}
}
.npc { .npc {
background-repeat: no-repeat; background-repeat: no-repeat;
} }

View File

@@ -35,6 +35,7 @@
:hide-pinned="hidePinned" :hide-pinned="hidePinned"
:hide-locked="hideLocked" :hide-locked="hideLocked"
:search-by="searchTextThrottled" :search-by="searchTextThrottled"
class="mb-4"
/> />
<layout-section :title="$t('items')"> <layout-section :title="$t('items')">
<div slot="filters"> <div slot="filters">
@@ -121,6 +122,10 @@
height: 112px; height: 112px;
} }
.items {
max-width: 944px;
}
.market { .market {
.avatar { .avatar {
cursor: default; cursor: default;

View File

@@ -18,7 +18,7 @@
</p> </p>
</div> </div>
<show-more-button <show-more-button
v-if="items.length > itemsPerRow" v-if="foldButton && items.length > itemsPerRow"
:show-all="showAll" :show-all="showAll"
@click="toggleItemsToShow()" @click="toggleItemsToShow()"
/> />
@@ -29,7 +29,11 @@
@import '~@/assets/scss/colors.scss'; @import '~@/assets/scss/colors.scss';
.item-rows { .item-rows {
margin-right: -1.5rem; max-width: 944px;
}
.btn-show-more {
max-width: 920px;
} }
</style> </style>
@@ -64,6 +68,10 @@ export default {
maxItemsPerRow: { maxItemsPerRow: {
type: Number, type: Number,
}, },
foldButton: {
type: Boolean,
default: true,
},
}, },
data () { data () {
return { return {
@@ -82,7 +90,7 @@ export default {
}, },
}, },
created () { created () {
this.showAll = this.$_openedItemRows_isToggled(this.type); this.showAll = this.$_openedItemRows_isToggled(this.type) || !this.foldButton;
}, },
methods: { methods: {
toggleItemsToShow () { toggleItemsToShow () {

View File

@@ -1,5 +1,5 @@
<template> <template>
<div> <div class="layout-section">
<div class="clearfix"> <div class="clearfix">
<h2 class="float-left mb-3 filters-title"> <h2 class="float-left mb-3 filters-title">
{{ title }} {{ title }}
@@ -22,6 +22,9 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.clearfix {
max-width: 920px;
}
@media only screen and (max-width: 768px) { @media only screen and (max-width: 768px) {
.filters, .filters-title { .filters, .filters-title {
float: none; float: none;

View File

@@ -0,0 +1,127 @@
{
"0ff591": "Turquoise",
"2b43f6": "Blue",
"6bd049": "Green",
"800ed0": "Purple",
"98461a": "Skin Tone 6",
"915533": "Skin Tone 1",
"aurora": "Aurora",
"bear": "Bear",
"black": "Black",
"blond": "Blond",
"blue": "Blue",
"braid": "Braid",
"brown": "Brown",
"c06534": "Skin Tone 5",
"c3e1dc": "Cyan",
"cactus": "Cactus",
"candycane": "Candy Cane",
"candycorn": "Candy Corn",
"clownfish": "Clownfish",
"convict": "Convict",
"cross": "Cross",
"curlyLong": "Curly Long",
"curlyShort": "Curly Short",
"d7a9f7": "Lavender",
"dapper": "Dapper",
"ddc994": "Skin Tone 2",
"deepocean": "Deep Ocean",
"doubleBraid": "Double Braid",
"doubleBun": "Double Bun",
"doubleHighPonytail": "Double High Ponytail",
"doublePonytail": "Double Ponytail",
"ea8349": "Skin Tone 4",
"eb052b": "Red",
"f5a76e": "Skin Tone 3",
"f5d70f": "Yellow",
"f69922": "Orange",
"fauxhawk": "Fauxhawk",
"festive": "Festive",
"fire": "Fire",
"fox": "Fox",
"frost": "Frost",
"ghost": "Ghost",
"ghostwhite": "Ghost White",
"goatee": "Goatee",
"green": "Green",
"halloween": "Halloween",
"highPonytailLeft": "High Ponytail Left",
"highPonytailRight": "High Ponytail Right",
"holly": "Holly",
"hollygreen": "Holly Green",
"horizon": "Horizon",
"largeMustache": "Large Mustache",
"leftBun": "Left Bun",
"lion": "Lion",
"longBeard": "Long Beard",
"merblue": "Merblue",
"mergold": "Mergold",
"mergreen": "Mergreen",
"merruby": "Merruby",
"messy": "Messy",
"midnight": "Midnight",
"mohawk": "Mohawk",
"monster": "Monster",
"ocean": "Ocean",
"ogre": "Ogre",
"panda": "Panda",
"pastelBlue": "Pastel Blue",
"pastelGreen": "Pastel Green",
"pastelOrange": "Pastel Orange",
"pastelPink": "Pastel Pink",
"pastelPurple": "Pastel Purple",
"pastelRainbowChevron": "Pastel Rainbow Chevron",
"pastelRainbowDiagonal": "Pastel Rainbow Diagonal",
"pastelYellow": "Pastel Yellow",
"pblue": "Special Pastel Blue",
"pblue2": "Pastel Blue",
"peppermint": "Peppermint",
"pgreen": "Special Pastel Green",
"pgreen2": "Pastel Green",
"pig": "Pig",
"polar": "Polar",
"ponytail": "Ponytail",
"porange": "Special Pastel Orange",
"porange2": "Pastel Orange",
"ppink": "Special Pastel Pink",
"ppink2": "Pastel Pink",
"ppurple": "Special Pastel Purple",
"ppurple2": "Pastel Purple",
"pumpkin": "Pumpkin",
"pumpkin2": "Jack O' Lantern",
"purple": "Purple",
"pyellow": "Special Pastel Yellow",
"pyellow2": "Pastel Yellow",
"rainbow": "Rainbow",
"red": "Red",
"redblue": "Red and Blue",
"reptile": "Reptile",
"rightBun": "Right Bun",
"shadow": "Shadow",
"shadow2": "Shade",
"shark": "Shark",
"shortBeard": "Short Beard",
"skeleton": "Skeleton",
"skeleton2": "Bones",
"smallMustache": "Small Mustache",
"snowy": "Snowy",
"straightLong": "Straight Long",
"straightShort": "Straight Short",
"sugar": "Sugar",
"thunder": "Thunder",
"tiger": "Tiger",
"transparent": "Transparent",
"tropical": "Tropical",
"tropicalwater": "Tropical Water",
"TRUred": "Crimson",
"updo": "Updo",
"wavyLong": "Wavy Long",
"wavyShort": "Wavy Short",
"white": "White",
"winternight": "Winter Night",
"winterstar": "Winter Star",
"wolf": "Wolf",
"yellow": "Yellow",
"zombie": "Zombie",
"zombie2": "Undead"
}

View File

@@ -666,7 +666,7 @@ const releaseDates = {
backgrounds012024: '2024-01-04T08:00-05:00', backgrounds012024: '2024-01-04T08:00-05:00',
backgrounds022024: '2024-02-06T08:00-05:00', backgrounds022024: '2024-02-06T08:00-05:00',
backgrounds032024: '2024-03-05T08:00-05:00', backgrounds032024: '2024-03-05T08:00-05:00',
backgrounds042024: '2024-04-04T00:00-04:00', backgrounds042024: '2023-04-04T00:00-04:00',
}; };
const flat = {}; const flat = {};

View File

@@ -1,26 +1,27 @@
import prefill from '../prefill'; import prefill from '../prefill';
import sets from '../sets'; import sets from '../sets';
import t from '../../translation';
export default prefill({ export default prefill({
0: {}, 0: {},
1: {}, 1: { text: t('ponytail')},
2: { price: 2, set: sets.baseHair1 }, 2: { text: t('doublePonytail'), price: 2, set: sets.baseHair1 },
3: {}, 3: { text: t('braid') },
4: { price: 2, set: sets.baseHair1 }, 4: { text: t('doubleBraid'), price: 2, set: sets.baseHair1 },
5: { price: 2, set: sets.baseHair1 }, 5: { text: t('wavyLong'), price: 2, set: sets.baseHair1 },
6: { price: 2, set: sets.baseHair1 }, 6: { text: t('wavyShort'), price: 2, set: sets.baseHair1 },
7: { price: 2, set: sets.baseHair1 }, 7: { text: t('straightLong'), price: 2, set: sets.baseHair1 },
8: { price: 2, set: sets.baseHair1 }, 8: { text: t('straightShort'), price: 2, set: sets.baseHair1 },
9: { price: 2, set: sets.baseHair2 }, 9: { text: t('highPonytailLeft'), price: 2, set: sets.baseHair2 },
10: { price: 2, set: sets.baseHair2 }, 10: { text: t('leftBun'), price: 2, set: sets.baseHair2 },
11: { price: 2, set: sets.baseHair2 }, 11: { text: t('highPonytailRight'), price: 2, set: sets.baseHair2 },
12: { price: 2, set: sets.baseHair2 }, 12: { text: t('rightBun'), price: 2, set: sets.baseHair2 },
13: { price: 2, set: sets.baseHair2 }, 13: { text: t('doubleHighPonytail'), price: 2, set: sets.baseHair2 },
14: { price: 2, set: sets.baseHair2 }, 14: { text: t('doubleBun'), price: 2, set: sets.baseHair2 },
15: { price: 2, set: sets.baseHair3 }, 15: { text: t('updo'), price: 2, set: sets.baseHair3 },
16: { price: 2, set: sets.baseHair3 }, 16: { text: t('curlyLong'), price: 2, set: sets.baseHair3 },
17: { price: 2, set: sets.baseHair3 }, 17: { text: t('curlyShort'), price: 2, set: sets.baseHair3 },
18: { price: 2, set: sets.baseHair3 }, 18: { text: t('messy'), price: 2, set: sets.baseHair3 },
19: { price: 2, set: sets.baseHair3 }, 19: { text: t('mohawk'), price: 2, set: sets.baseHair3 },
20: { price: 2, set: sets.baseHair3 }, 20: { text: t('fauxhawk'), price: 2, set: sets.baseHair3 },
}); });

View File

@@ -1,9 +1,10 @@
import sets from '../sets';
import prefill from '../prefill'; import prefill from '../prefill';
import sets from '../sets';
import t from '../../translation';
export default prefill({ export default prefill({
0: {}, 0: {},
1: { price: 2, set: sets.facialHair }, 1: { text: t('goatee'), price: 2, set: sets.facialHair },
2: { price: 2, set: sets.facialHair }, 2: { text: t('shortBeard'), price: 2, set: sets.facialHair },
3: { price: 2, set: sets.facialHair }, 3: { text: t('longBeard'), price: 2, set: sets.facialHair },
}); });

View File

@@ -1,8 +1,9 @@
import sets from '../sets';
import prefill from '../prefill'; import prefill from '../prefill';
import sets from '../sets';
import t from '../../translation';
export default prefill({ export default prefill({
0: {}, 0: {},
1: { price: 2, set: sets.facialHair }, 1: { text: t('smallMustache'), price: 2, set: sets.facialHair },
2: { price: 2, set: sets.facialHair }, 2: { text: t('largeMustache'), price: 2, set: sets.facialHair },
}); });

View File

@@ -1,4 +1,5 @@
import forOwn from 'lodash/forOwn'; import forOwn from 'lodash/forOwn';
import t from '../translation';
export default function prefillAppearances (obj) { export default function prefillAppearances (obj) {
forOwn(obj, (value, key) => { forOwn(obj, (value, key) => {
@@ -6,6 +7,9 @@ export default function prefillAppearances (obj) {
if (!value.price) { if (!value.price) {
value.price = 0; value.price = 0;
} }
if (!value.text) {
value.text = t(key);
}
}); });
return obj; return obj;
} }

View File

@@ -90,7 +90,7 @@ export const EVENTS = {
}, },
aprilFools2024: { aprilFools2024: {
start: '2024-04-01T00:00-04:00', start: '2024-04-01T00:00-04:00',
end: '2024-04-02T20:00-04:00', end: '2024-04-02T08:00-04:00',
aprilFools: 'Fungi', aprilFools: 'Fungi',
}, },
spring2024: { spring2024: {

View File

@@ -1806,7 +1806,7 @@ const releaseDates = {
schoolUniform: '2024-01-04T08:00-05:00', schoolUniform: '2024-01-04T08:00-05:00',
whiteLoungeWear: '2024-02-06T08:00-05:00', whiteLoungeWear: '2024-02-06T08:00-05:00',
hatterSet: '2024-03-05T08:00-05:00', hatterSet: '2024-03-05T08:00-05:00',
optimistSet: '2024-04-04T00:00-05:00', optimistSet: '2024-03-05T00:00-05:00',
}; };
forEach({ forEach({

View File

@@ -385,7 +385,9 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
class: `hair hair_bangs_${user.preferences.hair.bangs}_${item.key}`, class: `hair hair_bangs_${user.preferences.hair.bangs}_${item.key}`,
currency: 'gems', currency: 'gems',
option: item.key, option: item.key,
path: `hair.color.${item.key}`,
purchaseType: 'customization', purchaseType: 'customization',
text: item.text(language),
type: 'color', type: 'color',
value: item.price, value: item.price,
}; };
@@ -397,7 +399,9 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
class: `hair hair_base_${item.key}_${user.preferences.hair.color}`, class: `hair hair_base_${item.key}_${user.preferences.hair.color}`,
currency: 'gems', currency: 'gems',
option: item.key, option: item.key,
path: `hair.base.${item.key}`,
purchaseType: 'customization', purchaseType: 'customization',
text: item.text(language),
type: 'base', type: 'base',
value: item.price, value: item.price,
}; };
@@ -409,7 +413,9 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
class: `facial-hair hair_mustache_${item.key}_${user.preferences.hair.color}`, class: `facial-hair hair_mustache_${item.key}_${user.preferences.hair.color}`,
currency: 'gems', currency: 'gems',
option: item.key, option: item.key,
path: `hair.mustache.${item.key}`,
purchaseType: 'customization', purchaseType: 'customization',
text: item.text(language),
type: 'mustache', type: 'mustache',
value: item.price, value: item.price,
}; };
@@ -421,7 +427,9 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
class: `facial-hair hair_beard_${item.key}_${user.preferences.hair.color}`, class: `facial-hair hair_beard_${item.key}_${user.preferences.hair.color}`,
currency: 'gems', currency: 'gems',
option: item.key, option: item.key,
path: `hair.beard.${item.key}`,
purchaseType: 'customization', purchaseType: 'customization',
text: item.text(language),
type: 'beard', type: 'beard',
value: item.price, value: item.price,
}; };
@@ -432,7 +440,9 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
key: item.key, key: item.key,
class: `skin skin_${item.key}`, class: `skin skin_${item.key}`,
currency: 'gems', currency: 'gems',
path: `skin.${item.key}`,
purchaseType: 'customization', purchaseType: 'customization',
text: item.text(language),
type: 'skin', type: 'skin',
value: item.price, value: item.price,
}; };
@@ -443,7 +453,9 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang
key: item.key, key: item.key,
class: `shirt ${user.preferences.size}_shirt_${item.key}`, class: `shirt ${user.preferences.size}_shirt_${item.key}`,
currency: 'gems', currency: 'gems',
path: `shirt.${item.key}`,
purchaseType: 'customization', purchaseType: 'customization',
text: item.text(language),
type: 'shirt', type: 'shirt',
value: item.price, value: item.price,
}; };