Better late game items (fix #6) :)
This commit is contained in:
@@ -11,12 +11,23 @@ for(let item of items.value) {
|
||||
|
||||
watch(() => props.builds, () => trimBuilds(props.builds))
|
||||
trimBuilds(props.builds)
|
||||
trimLateGameItems(props.builds)
|
||||
|
||||
function trimBuilds(builds : Builds) {
|
||||
builds.tree.children.splice(1, builds.tree.children.length - 1)
|
||||
if(builds.tree.children[0] != null && builds.tree.children[0] != undefined)
|
||||
builds.tree.children[0].children.splice(1, builds.tree.children[0].children.length - 1)
|
||||
}
|
||||
function trimLateGameItems(builds: Builds) {
|
||||
function trimLateGameItemsFromTree(tree: ItemTree) {
|
||||
const foundIndex = builds.lateGame.findIndex((x) => x.data === tree.data)
|
||||
if(foundIndex != -1) builds.lateGame.splice(foundIndex, 1)
|
||||
for(let children of tree.children) {
|
||||
trimLateGameItemsFromTree(children)
|
||||
}
|
||||
}
|
||||
trimLateGameItemsFromTree(builds.tree)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -90,7 +101,7 @@ function trimBuilds(builds : Builds) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="iv-items-container">
|
||||
<div class="iv-items-container" v-if="builds.lateGame.length > 4">
|
||||
<div style="margin-left: 5px; margin-right: 5px;" v-for="item in builds.lateGame.slice(4, 8)" >
|
||||
<NuxtImg v-if="item.data != null && item.data != undefined"
|
||||
class="item-img" width="64" height="64" :alt="item.data.toString()"
|
||||
|
||||
Reference in New Issue
Block a user