ClubContextHelp.razor

UI panel that shows a contextual help card for the club screen. Displays an icon, title, body and tip text from ClubHelp.Get, with a close/dismiss button, and switches text between Russian and English based on GamePreferences.

@using Sandbox
@using Sandbox.UI
@using Socer
@using System
@inherits Panel

<root class="club-context-help localized-text">
@if(Game?.ClubOpen==true && !Game.GameSettingsOpen && Game.TutorialStep<0 && Game.ActiveClubHelp!=ClubHelpTopic.None)
{
    var help=ClubHelp.Get(Game.ActiveClubHelp);
    <div class="club-context-help-card">
        <div class="club-context-help-head">
            <img class="club-context-help-icon" src="@($"/ui-icons/ui-bold-nav-{help.Icon}.svg")" />
            <label class="club-context-help-title">@(GamePreferences.Russian?help.RussianTitle:help.EnglishTitle)</label>
            <button class="club-context-help-close" onclick=@(()=>Game.DismissClubHelp())>×</button>
        </div>
        <div class="club-context-help-points">
            <div class="club-context-help-point"><div class="club-context-help-dot"></div><label>@(GamePreferences.Russian?help.RussianBody:help.EnglishBody)</label></div>
            <div class="club-context-help-point"><div class="club-context-help-dot"></div><label>@(GamePreferences.Russian?help.RussianTip:help.EnglishTip)</label></div>
        </div>
        <button class="club-context-help-dismiss" onclick=@(()=>Game.DismissClubHelp())>@(GamePreferences.Russian?"Понятно":"Got it")</button>
    </div>
}
</root>

@code {
    [Parameter] public MatchController Game {get;set;}
    protected override int BuildHash()=>HashCode.Combine(Game?.ClubOpen,Game?.ActiveClubHelp,Game?.GameSettingsOpen,Game?.TutorialStep,GamePreferences.Revision);
}