Class Configuration

java.lang.Object
megamek.common.Configuration

public final class Configuration extends Object
Stores and provides access to the configuration of the MegaMek library.
  • Method Summary

    Modifier and Type
    Method
    Description
    static File
    Return the configured army tables directory, if set, otherwise return the default path, relative to the configured data directory.
    static File
    Return the configured board backgrounds directory, if set, otherwise return the default path, relative to the configured images directory.
    static File
    Return the configured boards directory, if set, otherwise return the default path, relative to the configured data directory.
    static File
    Return the camo directory, which is relative to the images directory.
    static File
    Return the configured configuration file directory.
    static File
    Return the configured data directory.
    static File
    Return the configured documentation directory.
    static File
    Get the fluff images directory, which is relative to the images directory.
    static File
    Return the configured fonts data directory, if set, otherwise return the default path, relative to the configured data directory.
    static File
    Return the configured force generator data directory, if set, otherwise return the default path, relative to the configured data directory.
    static File
     
    static File
     
    static File
    Return the hexes directory, which is relative to the images directory.
    static File
    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.
    static File
    Return the configured images directory, if set, otherwise return the default path, relative to the configured data directory.
    static File
    Return the minimap themes directory, which is relative to the hexes directory.
    static File
    Return the misc images directory, which is relative to the images directory.
    static File
    Return the nuke hit hexes directory, which is relative to the hexes directory.
    static File
    Return the orbital bombardment hexes directory, which is relative to the hexes directory.
    static File
    Return the portrait images directory, which is relative to the images directory.
    static File
    Return the configured scenarios directory, if set, otherwise return the default path, relative to the configured data directory.
    static void
    setArmyTablesDir(File army_tables_dir_path)
    Set the army tables directory to an arbitrary location (not relative to the data directory).
    static void
    setboardBackgroundsDir(File board_background_dir_path)
    Set the board backgrounds directory to an arbitrary location (not relative to the images directory).
    static void
    setBoardsDir(File boards_dir_path)
    Set the boards directory to an arbitrary location (not relative to the data directory).
    static void
    setConfigDir(File config_dir_path)
    Set the configuration directory.
    static void
    setDataDir(File data_dir_path)
    Set the data directory.
    static void
    setDocsDir(File docs_dir_path)
    Set the documentation directory.
    static void
    setFontsDir(File fontsDir)
    Set the force generator directory to an arbitrary location (not relative to the data directory).
    static void
    setForceGeneratorDir(File force_generator_dir_path)
    Set the force generator directory to an arbitrary location (not relative to the data directory).
    static void
    setImageFileAtlasMapFile(File imgFileAtlasMapFilePath)
    Set the image file to atlas loc file to an arbitrary location (not relative to the data directory).
    static void
    setImagesDir(File images_dir_path)
    Set the images directory to an arbitrary location (not relative to the data directory).
    static void
    setScenariosDir(File scenarios_dir_path)
    Set the scenarios directory to an arbitrary location (not relative to the data directory).
    static void
    setSkinDir(File skin_dir_path)
    Set the skins directory.
    static void
    setSoundsDir(File sounds_dir_path)
    Set the sounds directory to an arbitrary location (not relative to the data directory).
    static void
    setUnitsDir(File units_dir_path)
    Set the units directory to an arbitrary location (not relative to the data directory).
    static File
    Return the configured skin specification files directory.
    static File
    Return the configured sounds directory, if set, otherwise return the default path, relative to the configured data directory.
    static File
    Return the story arcs directory, which is relative to the directory.
    static File
    Get the unit images directory, which is relative to the images directory.
    static File
    Return the configured units directory, if set, otherwise return the default path, relative to the configured data directory.
    static File
     
    static File
    Return the configured userdata directory.
    static File
    Get the widgets directory, which is relative to the images directory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • userdataDir

      public static File userdataDir()
      Return the configured userdata directory.
      Returns:
      File containing the path to the userdata directory.
    • configDir

      public static File configDir()
      Return the configured configuration file directory.
      Returns:
      File containing the path to the config directory.
    • setConfigDir

      public static void setConfigDir(File config_dir_path)
      Set the configuration directory.
      Parameters:
      config_dir_path - The path to the config directory.
    • dataDir

      public static File dataDir()
      Return the configured data directory.
      Returns:
      File containing the path to the data directory.
    • setDataDir

      public static void setDataDir(File data_dir_path)
      Set the data directory.
      Parameters:
      data_dir_path - The path to the data directory.
    • docsDir

      public static File docsDir()
      Return the configured documentation directory.
      Returns:
      File containing the path to the documentation directory.
    • setDocsDir

      public static void setDocsDir(File docs_dir_path)
      Set the documentation directory.
      Parameters:
      docs_dir_path - The path to the documentation directory.
    • skinsDir

      public static File skinsDir()
      Return the configured skin specification files directory.
      Returns:
      File containing the path to the skins directory.
    • setSkinDir

      public static void setSkinDir(File skin_dir_path)
      Set the skins directory.
      Parameters:
      skin_dir_path - The path to the skins directory.
    • armyTablesDir

      public static File armyTablesDir()
      Return the configured army tables directory, if set, otherwise return the default path, relative to the configured data directory.
      Returns:
      File containing the path to the army tables directory.
    • setArmyTablesDir

      public static void setArmyTablesDir(File army_tables_dir_path)
      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

      public static File boardsDir()
      Return the configured boards directory, if set, otherwise return the default path, relative to the configured data directory.
      Returns:
      File containing the path to the boards directory.
    • setBoardsDir

      public static void setBoardsDir(File boards_dir_path)
      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

      public static File camoDir()
      Return the camo directory, which is relative to the images directory.
      Returns:
      File containing the path to the camo directory.
    • hexesDir

      public static File hexesDir()
      Return the hexes directory, which is relative to the images directory.
      Returns:
      File containing the path to the camo directory.
    • minimapThemesDir

      public static File minimapThemesDir()
      Return the minimap themes directory, which is relative to the hexes directory.
      Returns:
      File containing the path to the minimap themes directory.
    • orbitalBombardmentHexesDir

      public static File orbitalBombardmentHexesDir()
      Return the orbital bombardment hexes directory, which is relative to the hexes directory.
      Returns:
      File containing the path to the orbital bombardment hexes directory.
    • nukeHexesDir

      public static File nukeHexesDir()
      Return the nuke hit hexes directory, which is relative to the hexes directory.
      Returns:
      File containing the path to the orbital bombardment hexes directory.
    • fluffImagesDir

      public static File fluffImagesDir()
      Get the fluff images directory, which is relative to the images directory.
      Returns:
      File containing the path to the fluff images directory.
    • universeImagesDir

      public static File universeImagesDir()
      Returns:
      File containing the path to the universe images directory (having e.g. era, faction images).
    • imagesDir

      public static File imagesDir()
      Return the configured images directory, if set, otherwise return the default path, relative to the configured data directory.
      Returns:
      File containing the path to the images directory.
    • setImagesDir

      public static void setImagesDir(File images_dir_path)
      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

      public static File 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:
      File containing the path to the image file to atlas loc file.
    • setImageFileAtlasMapFile

      public static void setImageFileAtlasMapFile(File imgFileAtlasMapFilePath)
      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

      public static File boardBackgroundsDir()
      Return the configured board backgrounds directory, if set, otherwise return the default path, relative to the configured images directory.
      Returns:
      File containing the path to the images directory.
    • setboardBackgroundsDir

      public static void setboardBackgroundsDir(File board_background_dir_path)
      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

      public static File unitsDir()
      Return the configured units directory, if set, otherwise return the default path, relative to the configured data directory.
      Returns:
      File containing the path to the units directory.
    • gameSummaryImagesBVDir

      public static File gameSummaryImagesBVDir()
    • gameSummaryImagesMMDir

      public static File gameSummaryImagesMMDir()
    • setUnitsDir

      public static void setUnitsDir(File units_dir_path)
      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

      public static File miscImagesDir()
      Return the misc images directory, which is relative to the images directory.
      Returns:
      File containing the path to the misc directory.
    • portraitImagesDir

      public static File portraitImagesDir()
      Return the portrait images directory, which is relative to the images directory.
      Returns:
      File containing the path to the portrait directory.
    • storyarcsDir

      public static File storyarcsDir()
      Return the story arcs directory, which is relative to the directory.
      Returns:
      File containing the path to the portrait directory.
    • scenariosDir

      public static File scenariosDir()
      Return the configured scenarios directory, if set, otherwise return the default path, relative to the configured data directory.
      Returns:
      File containing the path to the scenarios directory.
    • setScenariosDir

      public static void setScenariosDir(File scenarios_dir_path)
      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

      public static File soundsDir()
      Return the configured sounds directory, if set, otherwise return the default path, relative to the configured data directory.
      Returns:
      File containing the path to the sounds directory.
    • setSoundsDir

      public static void setSoundsDir(File sounds_dir_path)
      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

      public static File forceGeneratorDir()
      Return the configured force generator data directory, if set, otherwise return the default path, relative to the configured data directory.
      Returns:
      File containing the path to the force generator directory.
    • setForceGeneratorDir

      public static void setForceGeneratorDir(File force_generator_dir_path)
      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

      public static File fontsDir()
      Return the configured fonts data directory, if set, otherwise return the default path, relative to the configured data directory.
      Returns:
      File containing the path to the force generator directory.
    • setFontsDir

      public static void setFontsDir(File fontsDir)
      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

      public static File unitImagesDir()
      Get the unit images directory, which is relative to the images directory.
      Returns:
      File containing the path to the unit images directory.
    • widgetsDir

      public static File widgetsDir()
      Get the widgets directory, which is relative to the images directory.
      Returns:
      File containing the path to the widgets directory.