Search in sources :

Example 1 with GameModeFileLoader

use of pcgen.persistence.GameModeFileLoader in project pcgen by PCGen.

the class DataTest method loadGameModes.

private static void loadGameModes() {
    String configFolder = "testsuite";
    String pccLoc = TestHelper.findDataFolder();
    System.out.println("Got data folder of " + pccLoc);
    try {
        TestHelper.createDummySettingsFile(TEST_CONFIG_FILE, configFolder, pccLoc);
    } catch (IOException e) {
        Logging.errorPrint("DataTest.loadGameModes failed", e);
    }
    PropertyContextFactory configFactory = new PropertyContextFactory(SystemUtils.USER_DIR);
    configFactory.registerAndLoadPropertyContext(ConfigurationSettings.getInstance(TEST_CONFIG_FILE));
    Main.loadProperties(false);
    PCGenTask loadPluginTask = Main.createLoadPluginTask();
    loadPluginTask.execute();
    GameModeFileLoader gameModeFileLoader = new GameModeFileLoader();
    gameModeFileLoader.execute();
    CampaignFileLoader campaignFileLoader = new CampaignFileLoader();
    campaignFileLoader.execute();
}
Also used : CampaignFileLoader(pcgen.persistence.CampaignFileLoader) PCGenTask(pcgen.system.PCGenTask) PropertyContextFactory(pcgen.system.PropertyContextFactory) IOException(java.io.IOException) GameModeFileLoader(pcgen.persistence.GameModeFileLoader)

Example 2 with GameModeFileLoader

use of pcgen.persistence.GameModeFileLoader in project pcgen by PCGen.

the class TestHelper method loadGameModes.

public static void loadGameModes(String testConfigFile) {
    String configFolder = "testsuite";
    String pccLoc = TestHelper.findDataFolder();
    System.out.println("Got data folder of " + pccLoc);
    try {
        TestHelper.createDummySettingsFile(testConfigFile, configFolder, pccLoc);
    } catch (IOException e) {
        Logging.errorPrint("DataTest.loadGameModes failed", e);
    }
    PropertyContextFactory configFactory = new PropertyContextFactory(SystemUtils.USER_DIR);
    configFactory.registerAndLoadPropertyContext(ConfigurationSettings.getInstance(testConfigFile));
    Main.loadProperties(false);
    PCGenTask loadPluginTask = Main.createLoadPluginTask();
    loadPluginTask.execute();
    GameModeFileLoader gameModeFileLoader = new GameModeFileLoader();
    gameModeFileLoader.execute();
    CampaignFileLoader campaignFileLoader = new CampaignFileLoader();
    campaignFileLoader.execute();
}
Also used : CampaignFileLoader(pcgen.persistence.CampaignFileLoader) PCGenTask(pcgen.system.PCGenTask) PropertyContextFactory(pcgen.system.PropertyContextFactory) IOException(java.io.IOException) GameModeFileLoader(pcgen.persistence.GameModeFileLoader)

Example 3 with GameModeFileLoader

use of pcgen.persistence.GameModeFileLoader in project pcgen by PCGen.

the class Main method startupWithGUI.

private static void startupWithGUI() {
    // configure the UI before any type of user prompting may take place
    configureUI();
    validateEnvironment(true);
    loadProperties(true);
    initPrintPreviewFonts();
    boolean showSplash = Boolean.parseBoolean(ConfigurationSettings.initSystemProperty("showSplash", "true"));
    //TODO: allow commandline override of splash property
    SplashScreen splash = null;
    if (showSplash) {
        splash = new SplashScreen();
        splash.setVisible(true);
    }
    PCGenTaskExecutor executor = new PCGenTaskExecutor();
    executor.addPCGenTask(createLoadPluginTask());
    executor.addPCGenTask(new GameModeFileLoader());
    executor.addPCGenTask(new CampaignFileLoader());
    if (splash != null) {
        executor.addPCGenTaskListener(splash);
    }
    executor.execute();
    if (splash != null) {
        //$NON-NLS-1$
        splash.setMessage(LanguageBundle.getString("in_taskInitUi"));
    }
    FacadeFactory.initialize();
    PCGenUIManager.initializeGUI();
    if (splash != null) {
        splash.dispose();
    }
    PCGenUIManager.startGUI();
}
Also used : CampaignFileLoader(pcgen.persistence.CampaignFileLoader) SplashScreen(pcgen.gui2.SplashScreen) GameModeFileLoader(pcgen.persistence.GameModeFileLoader)

Example 4 with GameModeFileLoader

use of pcgen.persistence.GameModeFileLoader in project pcgen by PCGen.

the class Main method startupWithoutGUI.

private static boolean startupWithoutGUI() {
    loadProperties(false);
    validateEnvironment(false);
    PCGenTaskExecutor executor = new PCGenTaskExecutor();
    executor.addPCGenTask(createLoadPluginTask());
    executor.addPCGenTask(new GameModeFileLoader());
    executor.addPCGenTask(new CampaignFileLoader());
    executor.execute();
    UIDelegate uiDelegate = new ConsoleUIDelegate();
    BatchExporter exporter = new BatchExporter(exportSheet, uiDelegate);
    boolean result = true;
    if (partyFile != null) {
        result = exporter.exportParty(partyFile, outputFile);
    }
    if (characterFile != null) {
        result = exporter.exportCharacter(characterFile, outputFile);
    }
    return result;
}
Also used : CampaignFileLoader(pcgen.persistence.CampaignFileLoader) GameModeFileLoader(pcgen.persistence.GameModeFileLoader) UIDelegate(pcgen.facade.core.UIDelegate)

Example 5 with GameModeFileLoader

use of pcgen.persistence.GameModeFileLoader in project pcgen by PCGen.

the class DataLoadTest method loadGameModes.

private static void loadGameModes() {
    String configFolder = "testsuite";
    String pccLoc = TestHelper.findDataFolder();
    System.out.println("Got data folder of " + pccLoc);
    try {
        TestHelper.createDummySettingsFile(TEST_CONFIG_FILE, configFolder, pccLoc);
    } catch (IOException e) {
        Logging.errorPrint("DataTest.loadGameModes failed", e);
    }
    PropertyContextFactory configFactory = new PropertyContextFactory(SystemUtils.USER_DIR);
    configFactory.registerAndLoadPropertyContext(ConfigurationSettings.getInstance(TEST_CONFIG_FILE));
    Main.loadProperties(false);
    PCGenTask loadPluginTask = Main.createLoadPluginTask();
    loadPluginTask.execute();
    GameModeFileLoader gameModeFileLoader = new GameModeFileLoader();
    gameModeFileLoader.execute();
    CampaignFileLoader campaignFileLoader = new CampaignFileLoader();
    campaignFileLoader.execute();
}
Also used : CampaignFileLoader(pcgen.persistence.CampaignFileLoader) PCGenTask(pcgen.system.PCGenTask) PropertyContextFactory(pcgen.system.PropertyContextFactory) IOException(java.io.IOException) GameModeFileLoader(pcgen.persistence.GameModeFileLoader)

Aggregations

CampaignFileLoader (pcgen.persistence.CampaignFileLoader)6 GameModeFileLoader (pcgen.persistence.GameModeFileLoader)6 IOException (java.io.IOException)3 PCGenTask (pcgen.system.PCGenTask)3 PropertyContextFactory (pcgen.system.PropertyContextFactory)3 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 ArrayList (java.util.ArrayList)1 UIDelegate (pcgen.facade.core.UIDelegate)1 SplashScreen (pcgen.gui2.SplashScreen)1 CampaignPanel (pcgen.gui2.converter.panel.CampaignPanel)1 ConvertSubPanel (pcgen.gui2.converter.panel.ConvertSubPanel)1 GameModePanel (pcgen.gui2.converter.panel.GameModePanel)1 RunConvertPanel (pcgen.gui2.converter.panel.RunConvertPanel)1 SourceSelectionPanel (pcgen.gui2.converter.panel.SourceSelectionPanel)1 StartupPanel (pcgen.gui2.converter.panel.StartupPanel)1 SummaryPanel (pcgen.gui2.converter.panel.SummaryPanel)1 WriteDirectoryPanel (pcgen.gui2.converter.panel.WriteDirectoryPanel)1