Skip to content

Commit

Permalink
hide future event achievement selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras committed Jan 20, 2025
1 parent 7790651 commit 0a9ba96
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@
$imgClass = $isUnlockedOnHardcore ? 'goldimagebig' : 'badgeimg';
$imgClass .= ' w-[54px] h-[54px] sm:w-16 sm:h-16';
$renderedAchievementAvatar = achievementAvatar(
$achievement,
label: false,
icon: $achBadgeName,
iconSize: 64,
iconClass: $imgClass,
tooltip: false
);
$unlockDate = '';
if (isset($achievement['DateEarned'])) {
$unlockDate = Carbon::parse($achievement['DateEarned'])->format('F j Y, g:ia');
Expand All @@ -53,8 +44,23 @@
if ($activeUntil > Carbon::now()) {
$isActive = true;
}
} elseif ($achievement['SourceAchievementId']) {
// future event has been picked. don't show it until it's active
$achBadgeName = '00000';
$achievement['Title'] = '?????';
$achievement['Description'] = '?????';
$achievement['SourceGameId'] = null;
}
}
$renderedAchievementAvatar = achievementAvatar(
$achievement,
label: false,
icon: $achBadgeName,
iconSize: 64,
iconClass: $imgClass,
tooltip: false
);
?>

<li class="flex gap-x-3 odd:bg-[rgba(50,50,50,0.4)] light:odd:bg-neutral-200 px-2 py-3 md:py-1 w-full {{ $isUnlocked ? 'unlocked-row' : '' }} {{ $achievement['type'] === 'missable' ? 'missable-row' : '' }} {{ $isActive ? 'active-row' : '' }}">
Expand Down
14 changes: 12 additions & 2 deletions resources/views/pages-legacy/achievementInfo.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use App\Platform\Enums\AchievementType;
use App\Platform\Services\TriggerDecoderService;
use App\Support\Shortcode\Shortcode;
use Carbon\Carbon;
use Illuminate\Support\Facades\Blade;
authenticateFromCookie($user, $permissions, $userDetails);
Expand Down Expand Up @@ -132,9 +133,18 @@
$eventAchievement = EventAchievement::where('achievement_id', '=', $achievementID)
->with('sourceAchievement')->first();
// update the ID of the dataOut so the link goes to the source achievement
if ($eventAchievement?->sourceAchievement) {
$dataOut['ID'] = $eventAchievement->sourceAchievement->ID;
if ($eventAchievement->active_from > Carbon::now()) {
// future event has been picked. don't show it until it's active
$eventAchievement = null;
$badgeName = $dataOut['BadgeName'] = '00000';
$achievementTitleRaw = $achievementTitle = $dataOut['Title'] = '?????';
$achievementDescriptionRaw = $dataOut['Description'] = '?????';
$dataOut['SourceGameId'] = null;
} else {
// update the ID of the dataOut so the link goes to the source achievement
$dataOut['ID'] = $eventAchievement->sourceAchievement->ID;
}
}
}
Expand Down

0 comments on commit 0a9ba96

Please sign in to comment.