Search in sources :

Example 1 with MainBuilder

use of main.gui.builders.MainBuilder in project Eidolons by IDemiurge.

the class ArcaneVault method main.

public static void main(String[] args) {
    CoreEngine.setArcaneVault(true);
    if (args.length > 0) {
        setMacroMode(true);
        if (args.length > 1) {
            worldEditAutoInit = true;
        }
        selectiveLaunch = false;
        types = microForMacro;
    }
    GuiManager.init();
    if (selectiveLaunch) {
        int init = DialogMaster.optionChoice("Launch Options", LAUNCH_OPTIONS);
        if (init == -1) {
            return;
        }
        HT_View.setWorkspaceLaunch(workspaceLaunch);
        WorkspaceManager.ADD_WORKSPACE_TAB_ON_INIT = workspaceLaunch;
        selectiveInit = !"Full".equals(LAUNCH_OPTIONS[init]);
        if (selectiveInit) {
            types = presetTypes;
            switch(LAUNCH_OPTIONS[init]) {
                case "Battlecraft":
                    List<DC_TYPE> enumList = new EnumMaster<DC_TYPE>().getEnumList(DC_TYPE.class);
                    for (DC_TYPE sub : DC_TYPE.values()) {
                        if (sub.isNonBattlecraft()) {
                            enumList.remove(sub);
                        }
                    }
                    types = StringMaster.constructStringContainer(enumList);
                    break;
                case "Last":
                    types = FileManager.readFile(getLastTypesFilePath());
                    break;
                case "Arcane Tower":
                    arcaneTower = true;
                    // XML_Reader.setCustomTypesPath(customTypesPath);
                    break;
                case "Workspace":
                    break;
                case "Selective Custom":
                    types = ListChooser.chooseEnum(DC_TYPE.class, SELECTION_MODE.MULTIPLE);
                    try {
                        FileManager.write(types, getLastTypesFilePath());
                    } catch (Exception e) {
                        main.system.ExceptionMaster.printStackTrace(e);
                    }
                    break;
                case "Selective":
                    init = DialogMaster.optionChoice("Selective Templates", WORKSPACE_TEMPLATE.values());
                    if (init == -1) {
                        return;
                    }
                    template = WORKSPACE_TEMPLATE.values()[init];
                    types = template.getTypes();
                    break;
            }
            CoreEngine.setSelectivelyReadTypes(types);
        } else {
            AV_Tree.setFullNodeStructureOn(true);
        }
    }
    ItemGenerator.setGenerationOn(!ENABLE_ITEM_GENERATION);
    LogMaster.PERFORMANCE_DEBUG_ON = showTime;
    LogMaster.log(3, "Welcome to Arcane Vault! \nBrace yourself to face the darkest mysteries of Edalar...");
    initialize();
    if (macroMode) {
        ContentGenerator.generatePlaces();
    }
    if (artGen) {
        // ResourceMaster.createArtFolders(types);
        ResourceMaster.createUpdatedArtDirectory();
    // ModelManager.saveAll();
    // return;
    }
    if (imgPathUpdate) {
        ResourceMaster.updateImagePaths();
    }
    mainBuilder = new MainBuilder();
    mainBuilder.setKeyListener(new AV_KeyListener(getGame()));
    if (!isCustomLaunch()) {
        if (XML_Reader.getTypeMaps().keySet().contains(MACRO_OBJ_TYPES.FACTIONS.getName())) {
            UnitGroupMaster.modifyFactions();
        }
    }
    // ModelManager.generateFactions();
    showAndCreateGUI();
    if (worldEditAutoInit) {
    // WorldEditor.editDefaultCampaign();
    }
    ModelManager.startSaving();
    if (selectiveInit) {
        afterInit(template);
    }
// CoreEngine.setWritingLogFilesOn(true);
}
Also used : AV_KeyListener(main.utilities.hotkeys.AV_KeyListener) DC_TYPE(main.content.DC_TYPE) MainBuilder(main.gui.builders.MainBuilder)

Aggregations

DC_TYPE (main.content.DC_TYPE)1 MainBuilder (main.gui.builders.MainBuilder)1 AV_KeyListener (main.utilities.hotkeys.AV_KeyListener)1