Skip to content

Commit 6961d90

Browse files
Use champion icons for statstones
1 parent b2d09fb commit 6961d90

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pages/loots/index.vue

+11-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div class="d-flex flex-wrap justify-content-around gap-2">
2323
<div class="card bg-transparent bg-screen border-light border-opacity-25" style="max-width: 180px; width: 180px;"
2424
v-for="loot in p.pages[p.index.value]" :key="loot.id">
25-
<img :src="loot.getImage('latest')" loading="lazy" onerror="this.onerror = null; this.src='/clean-cuts/img/error.png';" />
25+
<img :src="getLootImage(loot)" loading="lazy" onerror="this.onerror = null; this.src='/clean-cuts/img/error.png';" />
2626

2727
<div class="card-body d-flex flex-column justify-content-end">
2828
<h5>{{ loot.name }}</h5>
@@ -43,6 +43,7 @@ import Pagination from "../../components/Pagination.vue";
4343
import useClient from '../../composables/useClient';
4444
import useIsNumeric from "../../composables/useIsNumeric";
4545
import usePagination from '../../composables/usePagination';
46+
import { Loot } from '../../core/models';
4647
4748
const { client } = useClient();
4849
@@ -69,4 +70,13 @@ const p = computed(() => {
6970
7071
return usePagination(filtered, 100);
7172
});
73+
74+
const summaries = await client.championSummaries.listAsync({locale: "default", version: "latest"});
75+
76+
const getLootImage = (loot: Loot) => {
77+
if (loot.type.includes('Statstone'))
78+
return summaries.find((x) => loot.name.toLowerCase().includes(x.name.toLowerCase()))?.getIcon({locale: "default", version: "latest"});
79+
80+
return loot.getImage('latest');
81+
}
7282
</script>

0 commit comments

Comments
 (0)