Package megamek.common
Class Configuration
java.lang.Object
megamek.common.Configuration
Stores and provides access to the configuration of the MegaMek library.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FileReturn the configured army tables directory, if set, otherwise return the default path, relative to the configured data directory.static FileDeprecated, for removal: This API element is subject to removal in a future version.static FileReturn the configured boards directory, if set, otherwise return the default path, relative to the configured data directory.static FilecamoDir()Return the camo directory, which is relative to the images' directory.static FileReturn the configured configuration file directory.static FiledataDir()Return the configured data directory.static FiledocsDir()Return the configured documentation directory.static FileGet the fluff images directory, which is relative to the images' directory.static FilefontsDir()Deprecated, for removal: This API element is subject to removal in a future version.static FileReturn the configured force generator data directory, if set, otherwise return the default path, relative to the configured data directory.static Filestatic Filestatic FileDeprecated, for removal: This API element is subject to removal in a future version.static FilehexesDir()Return the hexes directory, which is relative to the images' directory.static FileReturn the configured file that maps an image file to a location within an image atlas, if set, otherwise return the default path, relative to the configured data directory.static FileReturn the configured images directory, if set, otherwise return the default path, relative to the configured data directory.static FileReturn the minimap themes directory, which is relative to the hexes' directory.static FileReturn the misc images directory, which is relative to the images' directory.static FileReturn the nuke hit hexes directory, which is relative to the hexes' directory.static FileReturn the orbital bombardment hexes directory, which is relative to the hexes' directory.static FileReturn the portrait images directory, which is relative to the images' directory.static FileReturn the configured scenarios directory, if set, otherwise return the default path, relative to the configured data directory.static voidsetArmyTablesDir(File army_tables_dir_path) Set the army tables directory to an arbitrary location (not relative to the data directory).static voidsetBoardBackgroundsDir(File board_background_dir_path) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetBoardsDir(File boards_dir_path) Set the boards directory to an arbitrary location (not relative to the data directory).static voidsetConfigDir(File configDirPath) Set the configuration directory.static voidsetDataDir(File data_dir_path) Set the data directory.static voidsetDocsDir(File docs_dir_path) Set the documentation directory.static voidsetFontsDir(File fontsDir) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetForceGeneratorDir(File force_generator_dir_path) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetImageFileAtlasMapFile(File imgFileAtlasMapFilePath) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetImagesDir(File images_dir_path) Set the images directory to an arbitrary location (not relative to the data directory).static voidsetNamesDir(File namesDir) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetScenariosDir(File scenarios_dir_path) Set the scenarios directory to an arbitrary location (not relative to the data directory).static voidsetSkinDir(File skin_dir_path) Deprecated, for removal: This API element is subject to removal in a future version.static voidsetSoundsDir(File sounds_dir_path) Set the sounds directory to an arbitrary location (not relative to the data directory).static voidsetUnitsDir(File units_dir_path) Set the units directory to an arbitrary location (not relative to the data directory).static FileskinsDir()Return the configured skin specification files directory.static FileReturn the configured sounds directory, if set, otherwise return the default path, relative to the configured data directory.static FileReturn the story arcs directory, which is relative to the directory.static FileGet the unit images directory, which is relative to the images' directory.static FileunitsDir()Return the configured units directory, if set, otherwise return the default path, relative to the configured data directory.static Filestatic FileReturn the configured userdata directory.static FileGet the widgets directory, which is relative to the images' directory.
-
Method Details
-
userDataDir
Return the configured userdata directory.- Returns:
Filecontaining the path to the userdata directory.
-
configDir
Return the configured configuration file directory.- Returns:
Filecontaining the path to the config directory.
-
setConfigDir
Set the configuration directory.- Parameters:
configDirPath- The path to the config directory.
-
dataDir
Return the configured data directory.- Returns:
Filecontaining the path to the data directory.
-
setDataDir
Set the data directory.- Parameters:
data_dir_path- The path to the data directory.
-
docsDir
Return the configured documentation directory.- Returns:
Filecontaining the path to the documentation directory.
-
setDocsDir
Set the documentation directory.- Parameters:
docs_dir_path- The path to the documentation directory.
-
skinsDir
Return the configured skin specification files directory.- Returns:
Filecontaining the path to the skins' directory.
-
setSkinDir
Deprecated, for removal: This API element is subject to removal in a future version.Set the skins' directory.- Parameters:
skin_dir_path- The path to the skins' directory.
-
armyTablesDir
Return the configured army tables directory, if set, otherwise return the default path, relative to the configured data directory.- Returns:
Filecontaining the path to the army tables directory.
-
setArmyTablesDir
Set the army tables directory to an arbitrary location (not relative to the data directory).- Parameters:
army_tables_dir_path- The path to the army tables directory.
-
boardsDir
Return the configured boards directory, if set, otherwise return the default path, relative to the configured data directory.- Returns:
Filecontaining the path to the boards' directory.
-
setBoardsDir
Set the boards directory to an arbitrary location (not relative to the data directory).- Parameters:
boards_dir_path- dir path The path to the boards' directory.
-
camoDir
Return the camo directory, which is relative to the images' directory.- Returns:
Filecontaining the path to the camo directory.
-
hexesDir
Return the hexes directory, which is relative to the images' directory.- Returns:
Filecontaining the path to the camo directory.
-
minimapThemesDir
Return the minimap themes directory, which is relative to the hexes' directory.- Returns:
Filecontaining the path to the minimap themes directory.
-
orbitalBombardmentHexesDir
Return the orbital bombardment hexes directory, which is relative to the hexes' directory.- Returns:
Filecontaining the path to the orbital bombardment hexes directory.
-
nukeHexesDir
Return the nuke hit hexes directory, which is relative to the hexes' directory.- Returns:
Filecontaining the path to the orbital bombardment hexes directory.
-
fluffImagesDir
Get the fluff images directory, which is relative to the images' directory.- Returns:
Filecontaining the path to the fluff images directory.
-
universeImagesDir
- Returns:
Filecontaining the path to the universe images directory (having e.g. era, faction images).
-
imagesDir
Return the configured images directory, if set, otherwise return the default path, relative to the configured data directory.- Returns:
Filecontaining the path to the images' directory.
-
setImagesDir
Set the images directory to an arbitrary location (not relative to the data directory).- Parameters:
images_dir_path- The path to the images' directory.
-
imageFileAtlasMapFile
Return the configured file that maps an image file to a location within an image atlas, if set, otherwise return the default path, relative to the configured data directory.- Returns:
Filecontaining the path to the image file to atlas loc file.
-
setImageFileAtlasMapFile
@Deprecated(since="0.51.0", forRemoval=true) public static void setImageFileAtlasMapFile(File imgFileAtlasMapFilePath) Deprecated, for removal: This API element is subject to removal in a future version.Set the image file to atlas loc file to an arbitrary location (not relative to the data directory).- Parameters:
imgFileAtlasMapFilePath- The path to the images' directory.
-
boardBackgroundsDir
Deprecated, for removal: This API element is subject to removal in a future version.Return the configured board backgrounds directory, if set, otherwise return the default path, relative to the configured images' directory.- Returns:
Filecontaining the path to the images' directory.
-
setBoardBackgroundsDir
@Deprecated(since="0.51.0", forRemoval=true) public static void setBoardBackgroundsDir(File board_background_dir_path) Deprecated, for removal: This API element is subject to removal in a future version.Set the board backgrounds directory to an arbitrary location (not relative to the images directory).- Parameters:
board_background_dir_path- The path to the images' directory.
-
unitsDir
Return the configured units directory, if set, otherwise return the default path, relative to the configured data directory.- Returns:
Filecontaining the path to the units' directory.
-
gameSummaryImagesBVDir
-
gameSummaryImagesMMDir
-
setUnitsDir
Set the units directory to an arbitrary location (not relative to the data directory).- Parameters:
units_dir_path- The path to the units' directory.
-
miscImagesDir
Return the misc images directory, which is relative to the images' directory.- Returns:
Filecontaining the path to the misc directory.
-
portraitImagesDir
Return the portrait images directory, which is relative to the images' directory.- Returns:
Filecontaining the path to the portrait directory.
-
storyArcsDir
Return the story arcs directory, which is relative to the directory.- Returns:
Filecontaining the path to the portrait directory.
-
scenariosDir
Return the configured scenarios directory, if set, otherwise return the default path, relative to the configured data directory.- Returns:
Filecontaining the path to the scenarios' directory.
-
setScenariosDir
Set the scenarios directory to an arbitrary location (not relative to the data directory).- Parameters:
scenarios_dir_path- The path to the scenarios' directory.
-
soundsDir
Return the configured sounds directory, if set, otherwise return the default path, relative to the configured data directory.- Returns:
Filecontaining the path to the sounds' directory.
-
setSoundsDir
Set the sounds directory to an arbitrary location (not relative to the data directory).- Parameters:
sounds_dir_path- The path to the sounds' directory.
-
forceGeneratorDir
Return the configured force generator data directory, if set, otherwise return the default path, relative to the configured data directory.- Returns:
Filecontaining the path to the force generator directory.
-
setForceGeneratorDir
@Deprecated(since="0.51.0", forRemoval=true) public static void setForceGeneratorDir(File force_generator_dir_path) Deprecated, for removal: This API element is subject to removal in a future version.Set the force generator directory to an arbitrary location (not relative to the data directory).- Parameters:
force_generator_dir_path- The path to the force generator directory.
-
fontsDir
Deprecated, for removal: This API element is subject to removal in a future version.Return the configured fonts data directory, if set, otherwise return the default path, relative to the configured data directory.- Returns:
Filecontaining the path to the force generator directory.
-
setFontsDir
Deprecated, for removal: This API element is subject to removal in a future version.Set the force generator directory to an arbitrary location (not relative to the data directory).- Parameters:
fontsDir- The path to the force generator directory.
-
unitImagesDir
Get the unit images directory, which is relative to the images' directory.- Returns:
Filecontaining the path to the unit images' directory.
-
widgetsDir
Get the widgets directory, which is relative to the images' directory.- Returns:
Filecontaining the path to the widgets' directory.
-
getNamesDir
Deprecated, for removal: This API element is subject to removal in a future version. -
setNamesDir
Deprecated, for removal: This API element is subject to removal in a future version.
-