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.
public static void reloadSettings()
Forces the console to reload its settings from the settings file.
IOException
- if the JSON file at CommonStrings#PATH_SETTINGS
does not exist or can't be opened.JSONException
- if the JSON is malformed or missing entries.public static ConsoleSettings getSettings()
public static org.lazywizard.lazylib.ui.LazyFont getFont()
public static org.lazywizard.console.BaseCommand.CommandContext getContext()
public static void showMessage(java.lang.Object message, org.apache.log4j.Level logLevel)
Displays a message to the user. The message will be formatted and shown to the player when they reach a section of the game where it can be displayed properly (combat/campaign map).
message
- The message to show.logLevel
- If this is equal to/higher than the "consoleLogLevel" setting, this message will be logged in Starsector.log.public static void showMessage(java.lang.Object message)
Displays a message to the user. The message will be formatted and shown to the player when they reach a section of the game where it can be displayed properly (combat/campaign map).
message
- The message to show.public static void showIndentedMessage(@Nullable java.lang.String preamble, java.lang.Object message, int indentation)
Displays an indented message to the user. The message will be formatted and shown to the player when they reach a section of the game where it can be displayed properly (combat/campaign map).
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 message
with.public static void showException(java.lang.Object message, java.lang.Throwable ex)
Displays the stack trace of a Throwable
.
public static void showDialogOnClose(com.fs.starfarer.api.campaign.InteractionDialogPlugin dialog, com.fs.starfarer.api.campaign.SectorEntityToken token)
public static void showDialogOnClose(com.fs.starfarer.api.campaign.SectorEntityToken token)