Exemplo n.º 1
0
    public void ShowTextEntry(UiCreateNamePacket crNamePkt)
    {
        _dialog.SetPos(crNamePkt.DialogX, crNamePkt.DialogY);

        UpdateInput(crNamePkt.InitialValue ?? "");
        _titleLabel.Text   = crNamePkt.DialogTitle ?? "";
        _okButton.Text     = crNamePkt.OkButtonLabel ?? "";
        _cancelButton.Text = crNamePkt.CancelButtonLabel ?? "";
        _callback          = crNamePkt.Callback;

        if (crNamePkt.DialogX != 0 || crNamePkt.DialogY != 0)
        {
            _dialog.X = crNamePkt.DialogX;
            _dialog.Y = crNamePkt.DialogY;
        }
        else
        {
            _dialog.CenterOnScreen();
        }

        _dialog.Visible = true;
        _dialog.BringToFront();
    }