| 269 | } |
| 270 | |
| 271 | public static void setGame(final String key) |
| 272 | { |
| 273 | final GameMode newMode = SystemCollections.getGameModeNamed(key); |
| 274 | |
| 275 | if (newMode != null) |
| 276 | { |
| 277 | game.setValue(newMode); |
| 278 | } |
| 279 | // new key for game mode specific options are pcgen.options.gameMode.X.optionName |
| 280 | // but offer downward compatible support to read in old version for unitSet from 5.8.0 |
| 281 | String unitSetName = getOptions().getProperty("pcgen.options.gameMode." + key + ".unitSetName", |
| 282 | getOptions().getProperty("pcgen.options.unitSetName." + key, game.get().getDefaultUnitSet())); |
| 283 | if (!game.get().selectUnitSet(unitSetName)) |
| 284 | { |
| 285 | if (!game.get().selectDefaultUnitSet()) |
| 286 | { |
| 287 | game.get().selectUnitSet(Constants.STANDARD_UNITSET_NAME); |
| 288 | } |
| 289 | } |
| 290 | game.get().setDefaultXPTableName(getPCGenOption( |
| 291 | "gameMode." + key + ".xpTableName", "")); //$NON-NLS-1$ //$NON-NLS-2$ |
| 292 | game.get().setDefaultCharacterType(getPCGenOption( |
| 293 | "gameMode." + key + ".characterType", "")); //$NON-NLS-1$ //$NON-NLS-2$ |
| 294 | |
| 295 | AbilityCategory featTemplate = game.get().getFeatTemplate(); |
| 296 | if (featTemplate != null) |
| 297 | { |
| 298 | AbilityCategory.FEAT.copyFields(featTemplate); |
| 299 | } |
| 300 | getChosenCampaignFiles(game.get()); |
| 301 | } |
| 302 | |
| 303 | public static ObjectProperty<GameMode> getGameAsProperty() |
| 304 | { |