예제 #1
0
    public void SetResponses(IEnumerable <ResponseLine> responses)
    {
        Clear();

        var responseIndex = 0;

        foreach (var responseLine in responses)
        {
            // this was previously loaded from dlg_ui.mes file, but we ignore that now
            var numberText     = $"{responseIndex + 1}.";
            var responseButton = new DialogResponseButton(
                new Rectangle(0, responseIndex * 25, 594, 23),
                numberText,
                responseLine.Text,
                responseLine.SkillUsed
                );
            var index = responseIndex;
            responseButton.SetClickHandler(() => OnResponseSelected?.Invoke(index));
            Add(responseButton);
            responseIndex++;
        }
    }
 public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
 {
     OnResponseSelected?.Invoke(this, (int)indexPath.Item);
 }