-
public class Console
The main class of the console mod. Most of its methods aren't publicly accessible, so this is mainly used to display messages to the player.
-
-
Field Summary
Fields Modifier and Type Field Description private static LazyFont
font
private static String
lastCommand
-
Method Summary
Modifier and Type Method Description static void
reloadSettings()
Forces the console to reload its settings from the settings file. static ConsoleSettings
getSettings()
static BaseCommand.CommandContext
getContext()
static float
getFontSize()
static float
getScrollbackWidth()
static Object
getCommandTarget(BaseCommand.CommandContext context)
static void
showMessage(Object message, Level logLevel)
Displays a message to the user. static void
showMessage(Object message)
Displays a message to the user. static void
showIndentedMessage(String preamble, Object message, int indentation)
Displays an indented message to the user. static void
showException(Object message, Throwable ex)
Displays the stack trace of a Throwable. static void
showDialogOnClose(InteractionDialogPlugin dialog, SectorEntityToken token)
static void
showDialogOnClose(SectorEntityToken token)
static void
parseInput(String rawInput, BaseCommand.CommandContext context)
static void
advance(ConsoleListener listener)
static LazyFont
getFont()
static String
getLastCommand()
-
-
Method Detail
-
reloadSettings
static void reloadSettings()
Forces the console to reload its settings from the settings file.
-
getSettings
static ConsoleSettings getSettings()
-
getContext
static BaseCommand.CommandContext getContext()
-
getFontSize
static float getFontSize()
-
getScrollbackWidth
static float getScrollbackWidth()
-
getCommandTarget
static Object getCommandTarget(BaseCommand.CommandContext context)
-
showMessage
static void showMessage(Object message, Level logLevel)
Displays a message to the user. The message will be formatted and shownto the player when they reach a section of the game where it can bedisplayed properly (combat/campaign map).
- Parameters:
message
- The message to show.logLevel
- If this is equal to/higher than the "consoleLogLevel"setting, this message will be logged in Starsector.log.
-
showMessage
static void showMessage(Object message)
Displays a message to the user. The message will be formatted and shownto the player when they reach a section of the game where it can bedisplayed properly (combat/campaign map).
- Parameters:
message
- The message to show.
-
showIndentedMessage
static void showIndentedMessage(String preamble, Object message, int indentation)
Displays an indented message to the user. The message will be formatted and shownto the player when they reach a section of the game where it can bedisplayed properly (combat/campaign map).
- Parameters:
preamble
- An optional argument; this part of the message will not be indented.message
- The indented message to show.indentation
- The number of spaces to indent{@code message}
with.
-
showException
static void showException(Object message, Throwable ex)
Displays the stack trace of a Throwable.
- Parameters:
message
- An optional message to show before the stack trace.ex
- The Throwable whose stack trace will be shown.
-
showDialogOnClose
static void showDialogOnClose(InteractionDialogPlugin dialog, SectorEntityToken token)
-
showDialogOnClose
static void showDialogOnClose(SectorEntityToken token)
-
parseInput
static void parseInput(String rawInput, BaseCommand.CommandContext context)
-
advance
static void advance(ConsoleListener listener)
-
getFont
static LazyFont getFont()
-
getLastCommand
static String getLastCommand()
-
-
-
-