diff --git a/CHANGELOG.md b/CHANGELOG.md index 02a36bc16..f400c8e26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.6.2] + +### Spell Animation Previewer + +* Fixed bug that prevented all previews from showing properly + ## [1.6.1] ### Linux Auto Updates diff --git a/frontend/src/app/eq-assets/eq-assets.ts b/frontend/src/app/eq-assets/eq-assets.ts index 1588b565b..7cf1dc9d9 100644 --- a/frontend/src/app/eq-assets/eq-assets.ts +++ b/frontend/src/app/eq-assets/eq-assets.ts @@ -40,7 +40,15 @@ export default class EqAssets { return ids } + public static spellAnimationFileIds = [] + public static getSpellAnimationFileIds() { + + // return cached set + if (this.spellAnimationFileIds.length > 0) { + return this.spellAnimationFileIds + } + let ids = []; if (SpellAnimations[0].contents) { SpellAnimations[0].contents.forEach((row) => { @@ -55,6 +63,9 @@ export default class EqAssets { return a - b; }); + // cache for second retrieval + this.spellAnimationFileIds = ids + return ids } } diff --git a/frontend/src/views/viewers/SpellAnimationViewer.vue b/frontend/src/views/viewers/SpellAnimationViewer.vue index 961abc430..a641b45c1 100644 --- a/frontend/src/views/viewers/SpellAnimationViewer.vue +++ b/frontend/src/views/viewers/SpellAnimationViewer.vue @@ -16,6 +16,7 @@ class="form-control ml-2 mb-4" v-model="search" v-on:keyup="triggerSearch" + @enter="triggerSearch" placeholder="Search for spell names to find animations" > @@ -126,19 +127,24 @@ export default { this.$router.push({ path: ROUTE.SPELL_ANIMATION_VIEWER, query: { q: this.search } }).catch(err => err) }, 1000), spellAnimSearch: function () { + console.log("trigger") + this.loaded = false let foundAnim = {}; - let filteredAnimations = [] - - for (let spellAnimMapping of spellAnimMappings) { - const spellName = spellAnimMapping[0].toLowerCase().trim() - const spellAnimId = spellAnimMapping[2] - - if (spellName.includes(this.search.toLowerCase())) { - if (!foundAnim[spellAnimId] && animationPreviewExists[spellAnimId]) { - filteredAnimations.push(spellAnimId) - foundAnim[spellAnimId] = 1 + let filteredAnimations = EqAssets.getSpellAnimationFileIds() + + if (this.search !== "") { + filteredAnimations = [] + for (let spellAnimMapping of spellAnimMappings) { + const spellName = spellAnimMapping[0].toLowerCase().trim() + const spellAnimId = spellAnimMapping[2] + + if (spellName.includes(this.search.toLowerCase())) { + if (!foundAnim[spellAnimId] && animationPreviewExists[spellAnimId]) { + filteredAnimations.push(spellAnimId) + foundAnim[spellAnimId] = 1 + } } } } diff --git a/package.json b/package.json index 95f6512eb..e9d233eb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spire", - "version": "1.6.1", + "version": "1.6.2", "repository": { "type": "git", "url": "https://github.com/Akkadius/spire.git"