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();
}
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();
}
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();
}
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;
}
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();
}
Aggregations