mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
feat(basic-matches): add runes
This commit is contained in:
parent
5b9a29ab4b
commit
c353bb227b
2 changed files with 9 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { secToTime, timeDifference } from '@/helpers/functions.js'
|
||||
import { createCDragonAssetUrl, secToTime, timeDifference } from '@/helpers/functions.js'
|
||||
import { maps, gameModes } from '@/data/data.js'
|
||||
import summonerSpells from '@/data/summonerSpells.json'
|
||||
import store from '@/store'
|
||||
|
||||
const leaguesNumbers = { 'I': 1, 'II': 2, 'III': 3, 'IV': 4 }
|
||||
|
||||
|
|
@ -10,6 +11,12 @@ const leaguesNumbers = { 'I': 1, 'II': 2, 'III': 3, 'IV': 4 }
|
|||
*/
|
||||
export function createMatchData(matches) {
|
||||
for (const match of matches) {
|
||||
// Runes
|
||||
const primaryRune = match.perks.selected.length ? store.state.cdragon.runes.perks[match.perks.selected[0]] : null
|
||||
const secondaryRune = store.state.cdragon.runes.perkstyles[match.perks.secondaryStyle]
|
||||
match.primaryRune = primaryRune ? createCDragonAssetUrl(primaryRune.icon) : null
|
||||
match.secondaryRune = secondaryRune ? createCDragonAssetUrl(secondaryRune.icon) : null
|
||||
|
||||
const date = new Date(match.date)
|
||||
const dateOptions = { day: '2-digit', month: '2-digit', year: 'numeric' }
|
||||
const timeOptions = { hour12: false, hour: '2-digit', minute: '2-digit' }
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class MatchParser {
|
|||
time_spent_living: player.longestTimeSpentLiving,
|
||||
perks_primary_style: primaryStyle!.style,
|
||||
perks_secondary_style: secondaryStyle!.style,
|
||||
perks_selected: perksSelected,
|
||||
perks_selected: perksSelected.concat(Object.values(player.perks.statPerks)),
|
||||
})
|
||||
}
|
||||
await Database.table('match_players').multiInsert(matchPlayers)
|
||||
|
|
|
|||
Loading…
Reference in a new issue