Skip to content

Commit

Permalink
Merge pull request #942 from Heroes-Profile/develop
Browse files Browse the repository at this point in the history
Heroes Profile v1.0.8
  • Loading branch information
Zemill authored Mar 18, 2024
2 parents 6ed809a + f8fffd4 commit a98c696
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public function getHeroMatchupsTalentsData(Request $request)
->filterByHero($hero)
->filterByAllyEnemy($allyEnemy)
->filterByLeagueTier($leagueTier)
->filterByGameMap($gameMap)
->groupBy('win_loss', 'level', 'talent')
->orderBy('level')
->orderBy('win_loss')
Expand Down
7 changes: 6 additions & 1 deletion app/Http/Controllers/Player/PlayerMMRController.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ public function getData(Request $request)
$rankTierName = str_replace(' ', '', strtolower(preg_replace('/\d/', '', $rankTier)));

$leagueBreakdownArray = $leagueBreakdown->toArray();
$fullBreakdownForTierArray = $this->globalDataService->getSubTiers($rankTiers[$rankTierName], $rankTierName);

if (isset($rankTierName) && isset($rankTiers[$rankTierName])) {
$fullBreakdownForTierArray = $this->globalDataService->getSubTiers($rankTiers[$rankTierName], $rankTierName);
} else {
$fullBreakdownForTierArray = [];
}

$smallestMmr = 0;

Expand Down
17 changes: 11 additions & 6 deletions app/Services/GlobalDataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,19 @@ public function calculateSubTier($rankTiers, $mmr)
if ($maxMmr == '') {
$maxMmr = $minMmr + $split;
}
if ($mmr >= $minMmr && $mmr < $maxMmr) {
for ($i = ($minMmr + $split); $i < $maxMmr; $i += $split) {

if ($mmr >= $i) {
$result = $tierNames[$key].' '.$counter;
$counter--;
}
if ($mmr >= $minMmr && $mmr < $maxMmr) {
if($mmr < ($minMmr + $split)){
$result = $tierNames[$key].' '.$counter;
}else{
for ($i = ($minMmr + $split); $i < $maxMmr; $i += $split) {
if ($mmr >= $i) {
$result = $tierNames[$key].' '.$counter;
$counter--;
}
}
}

} else {
if ($mmr >= $minMmr && $mmr >= $maxMmr) {
$result = 'Master';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,39 +71,8 @@
<single-select-filter :values="filters.mcl_seasons" :text="'Seasons'" @input-changed="handleInputChange" :defaultValue="defaultseason"></single-select-filter>
<custom-button :disabled="isLoading" @click="filter()" :text="'Filter'" :size="'medium'" color="teal" class="bg-teal rounded text-white ml-10 px-4 py-2 mt-auto mb-2 hover:bg-lteal" :ignoreclick="true"></custom-button>
</div>




<div v-if="recentMatchesData">
<ul class="pagination flex max-w-[1500px] mx-auto px-2 justify-between mb-2 text-sm">
<li class="page-item mr-auto" :class="{ disabled: !recentMatchesData.pagination.prev_page_url }">
<a class="page-link" @click.prevent="getRecentMatches(recentMatchesData.pagination.current_page - 1)" href="#">
Previous
</a>
</li>
<li class="page-item ml-auto" :class="{ disabled: !recentMatchesData.pagination.next_page_url }">
<a class="page-link" @click.prevent="getRecentMatches(recentMatchesData.pagination.current_page + 1)" href="#">
Next
</a>
</li>
</ul>
</div>



<esports-recent-matches v-if="recentMatchesData" :data="recentMatchesData.data" :esport="'hi_nc'"></esports-recent-matches>
<ul class="pagination flex max-w-[1500px] mx-auto px-2 justify-between mb-2 text-sm">
<li class="page-item mr-auto" :class="{ disabled: !recentMatchesData.pagination.prev_page_url }">
<a class="page-link" @click.prevent="getRecentMatches(recentMatchesData.pagination.current_page - 1)" href="#">
Previous
</a>
</li>
<li class="page-item ml-auto" :class="{ disabled: !recentMatchesData.pagination.next_page_url }">
<a class="page-link" @click.prevent="getRecentMatches(recentMatchesData.pagination.current_page + 1)" href="#">
Next
</a>
</li>
</ul>
</div>


Expand Down
6 changes: 3 additions & 3 deletions resources/js/components/GameSummaryBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

<div v-if="!esport && esport != true" class="flex w-full hover:backdrop-brightness-125 max-md:flex-col">
<div class="flex w-full md:ml-10 max-md:flex-col">
<stat-box :title="'Player MMR'" :value="data.player_mmr.toLocaleString('en-US')" :secondstat="data.player_change.toFixed(2)" :secondcaption="'Change'" secondtype="mmrchange" :color="data.winner === 1 ? 'blue' : 'red'"></stat-box>
<stat-box :title="'Hero MMR'" :value="data.hero_mmr.toLocaleString('en-US')" :secondstat="data.hero_change.toFixed(2)" :secondcaption="'Change'" secondtype="mmrchange" :color="data.winner === 1 ? 'blue' : 'red'"></stat-box>
<stat-box :title="'Role MMR'" :value="data.role_mmr.toLocaleString('en-US')" :secondstat="data.role_change.toFixed(2)" :secondcaption="'Change'" secondtype="mmrchange" :color="data.winner === 1 ? 'blue' : 'red'"></stat-box>
<stat-box :title="'Player MMR'" :value="data.player_mmr.toLocaleString('en-US')" :secondstat="data.player_change !== null ? data.player_change.toFixed(2) : null" :secondcaption="'Change'" secondtype="mmrchange" :color="data.winner === 1 ? 'blue' : 'red'"></stat-box>
<stat-box :title="'Hero MMR'" :value="data.hero_mmr.toLocaleString('en-US')" :secondstat="data.player_change !== null ? data.hero_change.toFixed(2): null" :secondcaption="'Change'" secondtype="mmrchange" :color="data.winner === 1 ? 'blue' : 'red'"></stat-box>
<stat-box :title="'Role MMR'" :value="data.role_mmr.toLocaleString('en-US')" :secondstat="data.player_change !== null ? data.role_change.toFixed(2) : null" :secondcaption="'Change'" secondtype="mmrchange" :color="data.winner === 1 ? 'blue' : 'red'"></stat-box>
</div>
<div class="flex gap-x-1 mx-2 items-center justify-start md:w-[450px] pl-2">
<div class="flex-1"><talent-image-wrapper :talent="data.level_one" :size="'medium'"></talent-image-wrapper></div>
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/Player/MmrData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ export default {
},
computed: {
reversedData() {
if (!Array.isArray(this.data)) {
console.error("this.data is not an array.");
return [];
}
return [...this.data].reverse();
},
sortedData() {
Expand Down
7 changes: 4 additions & 3 deletions resources/js/components/SearchedBattletagHolding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<div class="max-w-[1500px] mx-auto mt-10 w-full" v-if="battletagresponse">
<div class="flex flex-col items-center justify-center " v-if="battletagresponse.length > 1">
<h2 class="text-xl mb-4 ">Results</h2>
<div
<a
class="bg-blue hover:bg-lblue p-4 rounded mb-4 w-[500px] flex flex-col items-center cursor-pointer"
v-for="(item, index) in battletagresponse"
:key="index"
@click="redirectToProfile(item.battletag, item.blizz_id, item.region)"
@click="redirectToProfile(item.battletag, item.blizz_id, item.region, false)"
:href="`/Player/${item.battletagShort}/${item.blizz_id}/${item.region}`"
>
<div>{{ item.battletagShort }} ({{ item.regionName }})</div>
<div>{{ item.latest_game }}</div>
Expand All @@ -17,7 +18,7 @@
<div v-if="item.latestHero">
<hero-image-wrapper :hero="item.latestHero"></hero-image-wrapper>
</div>
</div>
</a>
</div>

<div v-else-if="battletagresponse.length == 1">
Expand Down

0 comments on commit a98c696

Please sign in to comment.