Class UI

java.lang.Object
mindustry.core.UI
All Implemented Interfaces:
arc.ApplicationListener, arc.assets.Loadable

public class UI extends Object implements arc.ApplicationListener, arc.assets.Loadable
  • Field Details

  • Constructor Details

    • UI

      public UI()
  • Method Details

    • loadColors

      public static void loadColors()
    • loadAsync

      public void loadAsync()
      Specified by:
      loadAsync in interface arc.assets.Loadable
    • loadSync

      public void loadSync()
      Specified by:
      loadSync in interface arc.assets.Loadable
    • getDependencies

      public arc.struct.Seq<arc.assets.AssetDescriptor> getDependencies()
      Specified by:
      getDependencies in interface arc.assets.Loadable
    • update

      public void update()
      Specified by:
      update in interface arc.ApplicationListener
    • init

      public void init()
      Specified by:
      init in interface arc.ApplicationListener
    • resize

      public void resize(int width, int height)
      Specified by:
      resize in interface arc.ApplicationListener
    • getIcon

      public arc.scene.style.TextureRegionDrawable getIcon(String name)
    • getIcon

      public arc.scene.style.TextureRegionDrawable getIcon(String name, String def)
    • loadAnd

      public void loadAnd(Runnable call)
    • loadAnd

      public void loadAnd(String text, Runnable call)
    • showTextInput

      public void showTextInput(String titleText, String text, int textLength, String def, boolean numbers, arc.func.Cons<String> confirmed, Runnable closed)
    • showTextInput

      public void showTextInput(String titleText, String text, int textLength, String def, boolean numbers, boolean allowEmpty, arc.func.Cons<String> confirmed, Runnable closed)
    • showTextInput

      public void showTextInput(String title, String text, String def, arc.func.Cons<String> confirmed)
    • showTextInput

      public void showTextInput(String title, String text, int textLength, String def, arc.func.Cons<String> confirmed)
    • showTextInput

      public void showTextInput(String title, String text, int textLength, String def, boolean numeric, arc.func.Cons<String> confirmed)
    • showInfoFade

      public void showInfoFade(String info)
    • showInfoFade

      public void showInfoFade(String info, float duration)
    • addDescTooltip

      public void addDescTooltip(arc.scene.Element elem, String description)
    • showInfoToast

      public void showInfoToast(String info, float duration)
      Shows a fading label at the top of the screen.
    • showInfoPopup

      public void showInfoPopup(String info, float duration, int align, int top, int left, int bottom, int right)
      Shows a label at some position on the screen. Does not fade.
    • showLabel

      public void showLabel(String info, float duration, float worldx, float worldy)
      Shows a label in the world. This label is behind everything. Does not fade.
    • showInfo

      public void showInfo(String info)
    • showInfoOnHidden

      public void showInfoOnHidden(String info, Runnable listener)
    • showStartupInfo

      public void showStartupInfo(String info)
    • showErrorMessage

      public void showErrorMessage(String text)
    • showException

      public void showException(Throwable t)
    • showException

      public void showException(String text, Throwable exc)
    • showText

      public void showText(String titleText, String text)
    • showText

      public void showText(String titleText, String text, int align)
    • showInfoText

      public void showInfoText(String titleText, String text)
    • showSmall

      public void showSmall(String titleText, String text)
    • showConfirm

      public void showConfirm(String text, Runnable confirmed)
    • showConfirm

      public void showConfirm(String title, String text, Runnable confirmed)
    • showConfirm

      public void showConfirm(String title, String text, arc.func.Boolp hide, Runnable confirmed)
    • showCustomConfirm

      public void showCustomConfirm(String title, String text, String yes, String no, Runnable confirmed, Runnable denied)
    • hasAnnouncement

      public boolean hasAnnouncement()
    • announce

      public void announce(String text)
      Display text in the middle of the screen, then fade out.
    • announce

      public void announce(String text, float duration)
      Display text in the middle of the screen, then fade out.
    • showOkText

      public void showOkText(String title, String text, Runnable confirmed)
    • newMenuDialog

      public arc.scene.ui.Dialog newMenuDialog(String title, String message, String[][] options, arc.func.Cons2<Integer,arc.scene.ui.Dialog> buttonListener)
    • showMenu

      public void showMenu(String title, String message, String[][] options, arc.func.Intc callback)
      Shows a menu that fires a callback when an option is selected. If nothing is selected, -1 is returned.
    • showFollowUpMenu

      public void showFollowUpMenu(int menuId, String title, String message, String[][] options, arc.func.Intc callback)
      Shows a menu that hides when another followUp-menu is shown or when nothing is selected.
      See Also:
    • hideFollowUpMenu

      public void hideFollowUpMenu(int menuId)
    • formatIcons

      public static String formatIcons(String s)
      Finds all :name: in a string and replaces them with the icon, if such exists. Based on TextFormatter::simpleFormat
    • formatTime

      public static String formatTime(float ticks)
      Formats time with hours:minutes:seconds.
    • formatAmount

      public static String formatAmount(long number)
    • roundAmount

      public static int roundAmount(int number)