Skip to content

Commit

Permalink
Update some extra editor & draft bits for LoL
Browse files Browse the repository at this point in the history
  • Loading branch information
slmnio committed Dec 28, 2024
1 parent 9517bb1 commit 63144aa
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 11 deletions.
4 changes: 2 additions & 2 deletions website/src/components/broadcast/HeroDraft.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
<div v-for="num of maxPlayers" :key="num" class="player">
<transition name="fade" mode="out-in" :duration="250">
<div v-if="picks[ti]?.[num-1]?.name" :key="picks[ti]?.[num-1]?.id" class="pick flex-center">
<div class="pick-number">{{ getPickBanItem(pickBanOrder, "pick", ti+1, num - 1)?.countOfType }}</div>
<div class="pick-number">{{ getPickBanItem(pickBanOrder, "pick", ti+1, num - 1)?.countOfTeamType }}</div>
<div class="pick-image bg-center" :style="resizedImage(picks[ti][num-1], ['main_image', 'icon'], 'h-500')"></div>
<div class="pick-text" :style="themeBackground1(broadcast?.event)">{{ picks[ti]?.[num-1]?.name }}</div>
</div>
<div v-else class="pick pick-placeholder flex-center" :class="{'pick-next': picks[ti]?.[num-1]?.orderItem?.num === (currentPickBan + 1) }">
<div class="pick-number">{{ picks[ti]?.[num-1]?.orderItem?.countOfType }}</div>
<div class="pick-number">{{ picks[ti]?.[num-1]?.orderItem?.countOfTeamType }}</div>
</div>
</transition>
</div>
Expand Down
2 changes: 2 additions & 0 deletions website/src/components/broadcast/Standings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export default {
wins: 0,
losses: 0,
played: 0,
scheduled: 0,
map_wins: 0,
map_losses: 0,
Expand All @@ -187,6 +188,7 @@ export default {
if (!match.teams.some(t => t.id === team.id)) return;
// one of the teams is current loop team
const scores = [match.score_1, match.score_2];
team.standings.scheduled++;
if (!scores.some(score => score === match.first_to)) return; // not finished
const opponent = match.teams.find(t => t.id !== team.id);
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/website/dashboard/HeroesPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="heroes-picker d-flex flex-column gap-1">
<div v-for="i of count" :key="i" class="form-group d-flex align-items-center">
<div v-if="pickBanOrder?.length && currentAction" class="draft-number">
{{ getPickBanItem(pickBanOrder, currentAction?.type, currentAction?.team, i - 1)?.num }}
{{ getPickBanItem(pickBanOrder, currentAction?.type, currentAction?.team, i - 1)?.countOfType }}
</div>
<div class="hero-icon bg-center" :style="resizedImage(getHero(localValue[i - 1]), ['icon', 'main_image'], 's-100')">
</div>
Expand Down
31 changes: 25 additions & 6 deletions website/src/components/website/dashboard/MatchEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -805,13 +805,16 @@ export default {
this.matchData.forfeit_reason = data.forfeit_reason;
this.matchData.vod = data.vod;

this.maps.forEach((map, i) => {
console.log("map choices", i, this.availableMaps.length);
if (this.availableMaps.length === 1) {
this.mapChoices[i] = this.availableMaps[0].id;
if (this.availableMaps.length === 1) {
console.log("map choices", this.availableMaps.length);
if (this.maps.length) {
this.maps.forEach((map, i) => {
this.mapChoices[i] = this.availableMaps[0].id;
});
} else {
this.mapChoices[0] = this.availableMaps[0].id;
}
});

}
this.previousAutoData = {
draws: Object.assign([], this.draws),
existingMapIDs: Object.assign([], this.existingMapIDs),
Expand Down Expand Up @@ -1037,6 +1040,22 @@ export default {
handler() {

}
},
availableMaps: {
deep: true,
immediate: true,
handler(maps) {
if (maps.length === 1) {
console.log("map choices", maps.length);
if (this.maps.length) {
this.maps.forEach((map, i) => {
if (!this.mapChoices[i]) this.mapChoices[i] = maps[0].id;
});
} else {
if (!this.mapChoices[0]) this.mapChoices[0] = maps[0].id;
}
}
}
}
// loadedFully: {
// immediate: true,
Expand Down
5 changes: 3 additions & 2 deletions website/src/utils/content-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,13 +875,14 @@ export function processPickBanOrder(order, flip) {
counts[item.type][item.team] = 0;
}
counts[item.type][item.team]++;
item.countOfType = counts[item.type][item.team];
item.countOfTeamType = counts[item.type][item.team];
item.countOfType = Object.values(counts[item.type]).reduce((a, b) => a + b, 0);
}
return item;
});

}

export function getPickBanItem(order, type, team, index) {
return order.find(o => o.team === team && o.type === type && o.countOfType === (index + 1));
return order.find(o => o.team === team && o.type === type && o.countOfTeamType === (index + 1));
}
5 changes: 5 additions & 0 deletions website/src/utils/standings.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ export const StandingsShowKeys = (game) => {
title: "Matches played",
display: (team) => team.standings.played
},
"Scheduled": {
header: "Sched",
title: "Matches scheduled",
display: (team) => team.standings.scheduled
},

"MatchDiffPoints": {
header: "Match diff",
Expand Down

0 comments on commit 63144aa

Please sign in to comment.