A Sandbox.UI panel for the career finale screen. Shows the career goal state (road, qualified, or won), a bilingual description, and either a button to open the final cup or the victory season label.
@using Sandbox
@using Sandbox.UI
@using Socer
@using System
@inherits Panel
<root class="localized-text @(Career.CareerWon?"career-won":Career.FinalCup!=null?"qualified":"road")">
<img class="finale-trophy" src="/ui-icons/ui-bold-nav-cup.svg" />
<div class="finale-copy">
<label class="finale-kicker">@T("ЦЕЛЬ КАРЬЕРЫ", "CAREER GOAL")</label>
<label class="finale-title">@(Career.CareerWon?T("Кубок чемпионов ваш. Вы победили!","The Champions Cup is yours. You win!"):Career.FinalCup!=null?T("Вы в Кубке чемпионов","You qualified for the Champions Cup"):T("Путь к Кубку чемпионов","Road to the Champions Cup"))</label>
<label class="finale-description">@Description</label>
</div>
@if(Career.FinalCup!=null && !Career.CareerWon)
{
<button class="finale-open" onclick=@(()=>OnOpenCup?.Invoke())>@T("К финальному кубку →","View final cup →")</button>
}
else if(Career.CareerWon)
{
<label class="finale-season">@T($"ПОБЕДА · СЕЗОН {Career.CareerVictorySeason}",$"VICTORY · SEASON {Career.CareerVictorySeason}")</label>
}
</root>
@code {
[Parameter] public ClubCareer Career {get;set;}
[Parameter] public Action OnOpenCup {get;set;}
static string T(string ru,string en)=>GamePreferences.Russian?ru:en;
string Description=>Career.CareerWon
?T("Основная цель выполнена. Состав, коллекция и история остаются с вами; можно продолжить карьеру.","Your main goal is complete. Keep your squad, collection and history, and continue your career.")
:Career.FinalCup?.Eliminated==true
?T("В этот раз трофей не покорился. Займите 1-е или 2-е место в Премьер-лиге в новом сезоне, чтобы вернуться.","This attempt is over. Finish first or second in the Premier League next season to return.")
:Career.FinalCup!=null
?T("Премьер-лига завершена в топ-2. Три кубковые победы принесут главный трофей и завершат путь к чемпионству.","A top-two Premier League finish earned your place. Win three cup rounds to lift the final trophy and complete your journey.")
:T("Пройдите пять лиг. Итоговое 1-е или 2-е место в Премьер-лиге откроет финальный кубок. Победа в нём — победа в игре.","Climb through five leagues. Finish first or second in the Premier League to unlock the final cup. Win it to win the game.");
protected override int BuildHash()=>HashCode.Combine(Career.CareerWon,Career.CareerVictorySeason,Career.FinalCup!=null,Career.FinalCup?.Eliminated,Career.FinalCup?.Started,Career.Division,GamePreferences.Revision);
}