-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hatched-pet-dialog in items / stable
- Loading branch information
Showing
6 changed files
with
186 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
website/client/components/inventory/stable/hatchedPetDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<template lang="pug"> | ||
|
||
b-modal#hatchedPet-modal( | ||
:visible="true", | ||
v-if="pet != null", | ||
:hide-header="true" | ||
) | ||
div.content | ||
div.dialog-header.title You hatched a new pet! | ||
|
||
|
||
div.inner-content | ||
div.pet-background | ||
div(:class="pet.class") | ||
|
||
h4.title {{ pet.name }} | ||
div.text(v-if="!hideText") | ||
| {{ $t('hatchedPetNotesPart1') }} | ||
| | ||
router-link(:to="{name: 'stable'}") {{ $t('stable') }} | ||
| | ||
| {{ $t('hatchedPetNotesPart2') }} | ||
|
||
|
||
button.btn.btn-primary(@click="close()") {{ $t('onward') }} | ||
|
||
div.clearfix(slot="modal-footer") | ||
</template> | ||
|
||
|
||
<style lang="scss"> | ||
@import '~client/assets/scss/colors.scss'; | ||
@import '~client/assets/scss/modal.scss'; | ||
#hatchedPet-modal { | ||
@include centeredModal(); | ||
.modal-dialog { | ||
width: 330px; | ||
} | ||
.content { | ||
text-align: center; | ||
} | ||
.inner-content { | ||
margin: 33px auto auto; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
.pet-background { | ||
width: 112px; | ||
height: 112px; | ||
border-radius: 4px; | ||
background-color: $gray-700; | ||
} | ||
.Pet { | ||
margin: auto; | ||
} | ||
.dialog-header { | ||
color: $purple-200; | ||
} | ||
} | ||
</style> | ||
|
||
|
||
<script> | ||
import bModal from 'bootstrap-vue/lib/components/modal'; | ||
export default { | ||
components: { | ||
bModal, | ||
}, | ||
methods: { | ||
close () { | ||
this.$emit('closed', this.item); | ||
this.$root.$emit('hide::modal', 'hatchedPet-modal'); | ||
}, | ||
hideDialog () { | ||
}, | ||
}, | ||
props: { | ||
pet: { | ||
type: Object, | ||
}, | ||
hideText: { | ||
type: Boolean, | ||
} | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export default function createAnimal (egg, potion, type, content, userItems) { | ||
let animalKey = `${egg.key}-${potion.key}`; | ||
|
||
return { | ||
key: animalKey, | ||
class: type === 'pet' ? `Pet Pet-${animalKey}` : `Mount_Icon_${animalKey}`, | ||
eggKey: egg.key, | ||
eggName: egg.text(), | ||
potionKey: potion.key, | ||
potionName: potion.text(), | ||
name: content[`${type}Info`][animalKey].text(), | ||
isOwned () { | ||
return userItems[`${type}s`][animalKey] > 0; | ||
}, | ||
mountOwned () { | ||
return userItems.mounts[this.key] > 0; | ||
}, | ||
isAllowedToFeed () { | ||
return type === 'pet' && this.isOwned() && !this.mountOwned(); | ||
}, | ||
isHatchable () { | ||
return userItems.eggs[egg.key] > 0 && userItems.hatchingPotions[potion.key] > 0; | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters