Package mindustry.core
Class UI
java.lang.Object
mindustry.core.UI
- All Implemented Interfaces:
arc.ApplicationListener,arc.assets.Loadable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDescTooltip(arc.scene.Element elem, String description) voidDisplay text in the middle of the screen, then fade out.voidDisplay text in the middle of the screen, then fade out.static StringformatAmount(long number) static StringFinds all :name: in a string and replaces them with the icon, if such exists.static StringformatTime(float ticks) Formats time with hours:minutes:seconds.arc.struct.Seq<arc.assets.AssetDescriptor>arc.scene.style.TextureRegionDrawablearc.scene.style.TextureRegionDrawablebooleanvoidhideFollowUpMenu(int menuId) voidinit()voidvoidvoidstatic voidvoidloadSync()arc.scene.ui.DialognewMenuDialog(String title, String message, String[][] options, arc.func.Cons2<Integer, arc.scene.ui.Dialog> buttonListener) voidresize(int width, int height) static introundAmount(int number) voidshowConfirm(String text, Runnable confirmed) voidshowConfirm(String title, String text, arc.func.Boolp hide, Runnable confirmed) voidshowConfirm(String title, String text, Runnable confirmed) voidshowCustomConfirm(String title, String text, String yes, String no, Runnable confirmed, Runnable denied) voidshowErrorMessage(String text) voidshowException(String text, Throwable exc) voidvoidshowFollowUpMenu(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.voidvoidshowInfoFade(String info) voidshowInfoFade(String info, float duration) voidshowInfoOnHidden(String info, Runnable listener) voidshowInfoPopup(String info, float duration, int align, int top, int left, int bottom, int right) Shows a label at some position on the screen.voidshowInfoText(String titleText, String text) voidshowInfoToast(String info, float duration) Shows a fading label at the top of the screen.voidShows a label in the world.voidShows a menu that fires a callback when an option is selected.voidshowOkText(String title, String text, Runnable confirmed) voidvoidshowStartupInfo(String info) voidvoidvoidshowTextInput(String titleText, String text, int textLength, String def, boolean numbers, boolean allowEmpty, arc.func.Cons<String> confirmed, Runnable closed) voidshowTextInput(String title, String text, int textLength, String def, boolean numeric, arc.func.Cons<String> confirmed) voidshowTextInput(String titleText, String text, int textLength, String def, boolean numbers, arc.func.Cons<String> confirmed, Runnable closed) voidshowTextInput(String title, String text, int textLength, String def, arc.func.Cons<String> confirmed) voidshowTextInput(String title, String text, String def, arc.func.Cons<String> confirmed) voidupdate()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface arc.ApplicationListener
dispose, exit, fileDropped, pause, resumeMethods inherited from interface arc.assets.Loadable
getName
-
Field Details
-
billions
-
millions
-
thousands
-
packer
public static arc.graphics.g2d.PixmapPacker packer -
hudfrag
-
chatfrag
-
consolefrag
-
minimapfrag
-
listfrag
-
loadfrag
-
hints
-
hudGroup
public arc.scene.ui.layout.WidgetGroup hudGroup -
about
-
restart
-
custom
-
maps
-
load
-
discord
-
join
-
host
-
paused
-
settings
-
controls
-
editor
-
language
-
bans
-
admins
-
traces
-
database
-
-
planet
-
research
-
schematics
-
mods
-
picker
-
effects
-
logic
-
fullText
-
campaignComplete
-
followUpMenus
public arc.struct.IntMap<arc.scene.ui.Dialog> followUpMenus -
drillCursor
public arc.Graphics.Cursor drillCursor -
unloadCursor
public arc.Graphics.Cursor unloadCursor -
targetCursor
public arc.Graphics.Cursor targetCursor -
repairCursor
public arc.Graphics.Cursor repairCursor
-
-
Constructor Details
-
UI
public UI()
-
-
Method Details
-
loadColors
public static void loadColors() -
loadAsync
public void loadAsync()- Specified by:
loadAsyncin interfacearc.assets.Loadable
-
loadSync
public void loadSync()- Specified by:
loadSyncin interfacearc.assets.Loadable
-
getDependencies
public arc.struct.Seq<arc.assets.AssetDescriptor> getDependencies()- Specified by:
getDependenciesin interfacearc.assets.Loadable
-
update
public void update()- Specified by:
updatein interfacearc.ApplicationListener
-
init
public void init()- Specified by:
initin interfacearc.ApplicationListener
-
resize
public void resize(int width, int height) - Specified by:
resizein interfacearc.ApplicationListener
-
getIcon
-
getIcon
-
loadAnd
-
loadAnd
-
showTextInput
-
showTextInput
-
showTextInput
-
showTextInput
-
showTextInput
-
showInfoFade
-
showInfoFade
-
addDescTooltip
-
showInfoToast
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
Shows a label in the world. This label is behind everything. Does not fade. -
showInfo
-
showInfoOnHidden
-
showStartupInfo
-
showErrorMessage
-
showException
-
showException
-
showText
-
showText
-
showInfoText
-
showSmall
-
showConfirm
-
showConfirm
-
showConfirm
-
showCustomConfirm
-
hasAnnouncement
public boolean hasAnnouncement() -
announce
Display text in the middle of the screen, then fade out. -
announce
Display text in the middle of the screen, then fade out. -
showOkText
-
newMenuDialog
-
showMenu
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. -
hideFollowUpMenu
public void hideFollowUpMenu(int menuId) -
formatIcons
Finds all :name: in a string and replaces them with the icon, if such exists. Based on TextFormatter::simpleFormat -
formatTime
Formats time with hours:minutes:seconds. -
formatAmount
-
roundAmount
public static int roundAmount(int number)
-