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 TypeMethodDescriptionvoid
addDescTooltip
(arc.scene.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
Finds all :name: in a string and replaces them with the icon, if such exists.static String
formatTime
(float ticks) Formats time with hours:minutes:seconds.arc.struct.Seq<arc.assets.AssetDescriptor>
arc.scene.style.TextureRegionDrawable
arc.scene.style.TextureRegionDrawable
boolean
void
hideFollowUpMenu
(int menuId) void
init()
void
void
void
static void
void
loadSync()
arc.scene.ui.Dialog
newMenuDialog
(String title, String message, String[][] options, arc.func.Cons2<Integer, arc.scene.ui.Dialog> buttonListener) void
resize
(int width, int height) static int
roundAmount
(int number) void
showConfirm
(String text, Runnable confirmed) void
showConfirm
(String title, String text, arc.func.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, arc.func.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 titleText, String text, int textLength, String def, boolean numbers, boolean allowEmpty, arc.func.Cons<String> confirmed, Runnable closed) void
showTextInput
(String title, String text, int textLength, String def, boolean numeric, arc.func.Cons<String> confirmed) void
showTextInput
(String titleText, String text, int textLength, String def, boolean numbers, arc.func.Cons<String> confirmed, Runnable closed) void
showTextInput
(String title, String text, int textLength, String def, arc.func.Cons<String> confirmed) void
showTextInput
(String title, String text, String def, arc.func.Cons<String> confirmed) void
update()
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
Methods 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:
loadAsync
in interfacearc.assets.Loadable
-
loadSync
public void loadSync()- Specified by:
loadSync
in interfacearc.assets.Loadable
-
getDependencies
public arc.struct.Seq<arc.assets.AssetDescriptor> getDependencies()- Specified by:
getDependencies
in interfacearc.assets.Loadable
-
update
public void update()- Specified by:
update
in interfacearc.ApplicationListener
-
init
public void init()- Specified by:
init
in interfacearc.ApplicationListener
-
resize
public void resize(int width, int height) - Specified by:
resize
in 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)
-