logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class ModalButtonToUiOptionConverter

    One-time migration helper that turns legacy modal SerializedComponentData buttons into the rich UiOption model now used by modals. A former submit button becomes a UiOption with SUBMIT and STRING, preserving Id/Guid/Label and the translate flags.

    Inheritance
    object
    ModalButtonToUiOptionConverter
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Modal.InterfaceAdapters.EntityMappers
    Assembly: Serenity.UnityModal.InterfaceAdapter.dll
    Syntax
    public static class ModalButtonToUiOptionConverter
    Remarks

    UiOption carries a single OnSubmitSignal (matching menu options), whereas a legacy button could carry several. The dominant real case is a single OnCloseModalSignal; when a button has more than one signal only the first is kept and a warning is logged so the rest can be re-added in the new options editor. UiOption is intentionally NOT forked to hold a signal list — that would break parity with menu options.

    Methods

    Convert(SerializedComponentData, string)

    Converts a single legacy button definition into an equivalent SUBMIT UiOption.

    Declaration
    public static UiOption Convert(SerializedComponentData button, string viewId)
    Parameters
    Type Name Description
    SerializedComponentData button

    The legacy button to convert.

    string viewId

    The owning modal id, stored on the produced option and its value.

    Returns
    Type Description
    UiOption

    A SUBMIT/STRING UiOption mirroring button.

    Convert(IReadOnlyList<SerializedComponentData>, string)

    Converts a list of legacy button definitions into an array of equivalent SUBMIT options.

    Declaration
    public static UiOption[] Convert(IReadOnlyList<SerializedComponentData> buttons, string viewId)
    Parameters
    Type Name Description
    IReadOnlyList<SerializedComponentData> buttons

    The legacy buttons to convert; null or empty yields an empty array.

    string viewId

    The owning modal id, stored on the produced options and their values.

    Returns
    Type Description
    UiOption[]

    An array of UiOption mirroring the buttons, in their original order.

    In this article
    © 2026 Serenity. All Rights Reserved