Code/UI/SubPanels/Choices.razor
@using Sandbox
@namespace VNBase.UI
@inherits SubPanel
@if ( !Player.IsValid() )
{
return;
}
<root class="centered @( HasChoices ? "" : "hidden" )">
@if ( HasChoices && Player.State.IsDialogueFinished )
{
<div class="choicePanel">
@foreach ( var choice in Player.State.Choices )
{
var environment = Player.ActiveScript?.GetEnvironment();
var isAvailable = environment is not null && choice.IsAvailable( environment );
string text = choice.Text;
<button class="choice @( isAvailable ? "" : "hidden" )" @onclick="@( () => ExecuteChoice( choice ) )">
@text
</button>
}
</div>
}
</root>