Class MenuResult

java.lang.Object
mindustry.ui.builder.MenuResult

public class MenuResult extends Object
  • Field Details

    • maxResultLen

      public static final int maxResultLen
      Maximum length of result string
      See Also:
    • maxValueLen

      public static final int maxValueLen
      Maximum length of a single value in chars.
      See Also:
    • maxTotalStringLen

      public static final int maxTotalStringLen
      Maximum total length of all string values in chars. This includes IDs of result values.
      See Also:
    • maxTotalValues

      public static final int maxTotalValues
      Maximum values count of any type that can be sent.
      See Also:
    • token

      public long token
      Token passed to MenuBuilder.
    • result

      @Nullable public String result
      Button that was actually clicked, or null if the dialog was closed (back button).
    • values

      public arc.struct.ObjectMap<String,Object> values
      Maps ID to element value (slider: value, text field: text, checkbox: checked)
  • Constructor Details

    • MenuResult

      public MenuResult()
      Implies cancelled results.
    • MenuResult

      public MenuResult(@Nullable String result)
  • Method Details

    • wasCancelled

      public boolean wasCancelled()
      Returns:
      if the dialog was closed with no choice being made.
    • is

      public boolean is(String text)
      Returns:
      whether the result ID matches the specified parameter.
    • getString

      public String getString(String id, String defaultValue)
    • getString

      @Nullable public String getString(String id)
    • getFloat

      public float getFloat(String id, float def)
    • getFloat

      public float getFloat(String id)
    • getBool

      public boolean getBool(String id, boolean def)
    • getBool

      public boolean getBool(String id)
    • toString

      public String toString()
      Overrides:
      toString in class Object