Package mindustry.core
Class UI
java.lang.Object
mindustry.core.UI
- All Implemented Interfaces:
ApplicationListener
,Loadable
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescTooltip
(Element elem, String description) void
Display text in the middle of the screen, then fade out.void
Display text in the middle of the screen, then fade out.static String
formatAmount
(long number) static String
formatTime
(float ticks) Formats time with hours:minutes:seconds.boolean
void
hideFollowUpMenu
(int menuId) void
init()
Called when theApplication
is first created.void
void
void
static void
void
loadSync()
newMenuDialog
(String title, String message, String[][] options, Cons2<Integer, Dialog> buttonListener) void
resize
(int width, int height) Called when theApplication
is resized.static int
roundAmount
(int number) void
showConfirm
(String text, Runnable confirmed) void
showConfirm
(String title, String text, Boolp hide, Runnable confirmed) void
showConfirm
(String title, String text, Runnable confirmed) void
showCustomConfirm
(String title, String text, String yes, String no, Runnable confirmed, Runnable denied) void
showErrorMessage
(String text) void
showException
(String text, Throwable exc) void
void
showFollowUpMenu
(int menuId, String title, String message, String[][] options, Intc callback) Shows a menu that hides when another followUp-menu is shown or when nothing is selected.void
void
showInfoFade
(String info) void
showInfoFade
(String info, float duration) void
showInfoOnHidden
(String info, Runnable listener) 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.void
showInfoText
(String titleText, String text) void
showInfoToast
(String info, float duration) Shows a fading label at the top of the screen.void
Shows a label in the world.void
Shows a menu that fires a callback when an option is selected.void
showOkText
(String title, String text, Runnable confirmed) void
void
showStartupInfo
(String info) void
void
void
showTextInput
(String title, String text, int textLength, String def, boolean numeric, Cons<String> confirmed) void
showTextInput
(String titleText, String text, int textLength, String def, boolean numbers, Cons<String> confirmed, Runnable closed) void
void
void
update()
Called when theApplication
should update itself.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.ApplicationListener
dispose, exit, fileDropped, pause, resume
-
Field Details
-
billions
-
millions
-
thousands
-
packer
-
hudfrag
-
chatfrag
-
consolefrag
-
minimapfrag
-
listfrag
-
loadfrag
-
hints
-
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
-
drillCursor
-
unloadCursor
-
targetCursor
-
-
Constructor Details
-
UI
public UI()
-
-
Method Details
-
loadColors
public static void loadColors() -
loadAsync
public void loadAsync() -
loadSync
public void loadSync() -
getDependencies
- Specified by:
getDependencies
in interfaceLoadable
-
update
public void update()Description copied from interface:ApplicationListener
Called when theApplication
should update itself.- Specified by:
update
in interfaceApplicationListener
-
init
public void init()Description copied from interface:ApplicationListener
Called when theApplication
is first created. Only gets called if the application is created before the listener is added.- Specified by:
init
in interfaceApplicationListener
-
resize
public void resize(int width, int height) Description copied from interface:ApplicationListener
Called when theApplication
is resized. This can happen at any point during a non-paused state but will never happen before a call toApplicationListener.init()
.- Specified by:
resize
in interfaceApplicationListener
- Parameters:
width
- the new width in pixelsheight
- the new height in pixels
-
getIcon
-
getIcon
-
loadAnd
-
loadAnd
-
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, Intc callback) Shows a menu that hides when another followUp-menu is shown or when nothing is selected. -
hideFollowUpMenu
public void hideFollowUpMenu(int menuId) -
formatTime
Formats time with hours:minutes:seconds. -
formatAmount
-
roundAmount
public static int roundAmount(int number)
-