Class UiTexts

java.lang.Object
dev.xichil.mvui.UiTexts

public final class UiTexts extends Object
Ready-made texts: the ones the widgets themselves need, and common button labels mods can reuse.

The first group uses vanilla's own translation keys, which exist in every supported version, so they appear in the player's language without the mod shipping anything:

.footer(Button.builder("done").label(UiTexts.DONE).onPress(host::back).build())
The xis_mvui.* keys are translated by the library's own lang files. Each constant's English fallback is in its declaration.
  • Field Details

    • DONE

      public static final Text DONE
      "Done" (gui.done): the usual footer button that saves or confirms and goes back.
    • YES

      public static final Text YES
      "Yes" (gui.yes): a ConfirmDialog's default yes label.
    • NO

      public static final Text NO
      "No" (gui.no): a ConfirmDialog's default no label.
    • CANCEL

      public static final Text CANCEL
      "Cancel" (gui.cancel).
    • ON

      public static final Text ON
      "ON" (options.on): a Toggle's value while on.
    • OFF

      public static final Text OFF
      "OFF" (options.off): a Toggle's value while off.
    • WORKING

      public static final Text WORKING
      "Working…": what a screen shows while a UiHost.runAsync(Callable, BiConsumer) task runs.
    • ADD

      public static final Text ADD
      "Add": a StringListEditor's default Add label.
    • REMOVE

      public static final Text REMOVE
      "Remove": a StringListEditor's default Remove label.
    • ALREADY_IN_LIST

      public static final Text ALREADY_IN_LIST
      "Already in the list": a StringListEditor's error for a duplicate item.
    • OPEN_MENU

      public static final Text OPEN_MENU
      "Menu...": the default ScreenFactory.buttonLabel().
    • MOD_MENUS

      public static final Text MOD_MENUS
      "Mod menus...": the Options screen's button when several mods registered a menu; it opens MOD_MENUS_TITLE.
    • MOD_MENUS_TITLE

      public static final Text MOD_MENUS_TITLE
      "Mod menus": title of the list of every registered mod's menu.
    • SECTION_EXPANDED

      public static final Text SECTION_EXPANDED
      "▼ %s": a collapsible Section's header while expanded; the argument is the title.
    • SECTION_COLLAPSED

      public static final Text SECTION_COLLAPSED
      "▶ %s": a collapsible Section's header while collapsed; the argument is the title.
    • NOT_A_NUMBER

      public static final Text NOT_A_NUMBER
      "Not a number": a NumberField's error for text that doesn't parse.
    • NOT_A_WHOLE_NUMBER

      public static final Text NOT_A_WHOLE_NUMBER
      "Not a whole number": an int field's error for a decimal.
    • AT_LEAST

      public static final Text AT_LEAST
      "Must be at least %s": a NumberField's error below its minimum; the argument is the minimum.
    • AT_MOST

      public static final Text AT_MOST
      "Must be at most %s": a NumberField's error above its maximum; the argument is the maximum.
    • COLOR_RED

      public static final Text COLOR_RED
      "Red": a ColorPicker editor's slider.
    • COLOR_GREEN

      public static final Text COLOR_GREEN
      "Green": a ColorPicker editor's slider.
    • COLOR_BLUE

      public static final Text COLOR_BLUE
      "Blue": a ColorPicker editor's slider.
    • COLOR_ALPHA

      public static final Text COLOR_ALPHA
      "Alpha": a ColorPicker editor's slider, with alpha only.
    • COLOR_HEX

      public static final Text COLOR_HEX
      "Hex": the label of a ColorPicker editor's hex field.
    • NOT_A_COLOR

      public static final Text NOT_A_COLOR
      "Not a color: use #RRGGBB": a ColorPicker editor's hex field error.
    • NOT_A_COLOR_ALPHA

      public static final Text NOT_A_COLOR_ALPHA
      "Not a color: use #AARRGGBB": a ColorPicker editor's hex field error, with alpha.