Search in sources :

Example 11 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class TestDungeonInitializer method chooseDungeonLevel.

public String chooseDungeonLevel() {
    String path = PathFinder.getDungeonLevelFolder();
    String subFolder = ListChooser.chooseEnum(DUNGEON_SUBFOLDER.class, SELECTION_MODE.SINGLE);
    // DialogMaster.inputText("generic folder (empty for root", "");
    if (!StringMaster.isEmpty(subFolder)) {
        path += subFolder.replace(";", "") + "\\";
    }
    File folder = FileManager.getFile(path);
    List<String> files = FileManager.getFileNames(FileManager.findFiles(folder, ".xml", false, false));
    ListChooser listChooser = new ListChooser(SELECTION_MODE.SINGLE, files, false);
    listChooser.setMaxColumnNumber(4);
    listChooser.setMaxRowCount(40);
    String level = listChooser.choose();
    if (level == null) {
        return null;
    }
    if (subFolder == null) {
        return level;
    }
    return subFolder.replace(";", "") + "\\" + level;
}
Also used : ListChooser(main.swing.generic.components.editors.lists.ListChooser) File(java.io.File)

Example 12 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class HT_View method selectAltLink.

private String selectAltLink(String name, String prevData) {
    LINK_VARIANT variant;
    variant = new EnumMaster<LINK_VARIANT>().retrieveEnumConst(LINK_VARIANT.class, new ListChooser(SELECTION_MODE.SINGLE, LINK_VARIANT.class).choose());
    if (variant == null) {
        if (prevData != null) {
        } else {
            return null;
        }
    }
    String offsetX = "" + DialogMaster.inputInt("offset x", 0);
    String offsetY = "" + DialogMaster.inputInt("offset y", 0);
    String offsets = offsetX + "," + offsetY;
    String suffix = (variant + "");
    suffix += "=" + offsets;
    String value = name + StringMaster.wrapInParenthesis(suffix);
    return value;
}
Also used : EnumMaster(main.system.auxiliary.EnumMaster) LINK_VARIANT(eidolons.client.cc.gui.neo.tree.logic.TreeMap.LINK_VARIANT) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 13 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class HT_View method selectAltBase.

private String selectAltBase(ObjType type) {
    List<ObjType> types = new ArrayList<>(tree.getTypes());
    for (ObjType t : tree.getTypes()) {
        if (t.getIntParam(PARAMS.CIRCLE) >= type.getIntParam(PARAMS.CIRCLE)) {
            types.remove(t);
        }
    }
    types.remove(type);
    String name = new ListChooser(SELECTION_MODE.SINGLE, DataManager.toStringList(types), isSkill() ? DC_TYPE.SKILLS : DC_TYPE.CLASSES).choose();
    return name;
}
Also used : ObjType(main.entity.type.ObjType) ArrayList(java.util.ArrayList) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 14 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class TreeControlPanel method handleControl.

public void handleControl(TREE_CONTROLS c, boolean alt) {
    ObjType selectedType = view.getTree().getSelectedType();
    switch(c) {
        case TEST:
            AutoTestMaster.testType(selectedType);
            break;
        case WS_CYCLE:
            workspaceCycle(alt);
            break;
        case WS_TOGGLE:
            if (alt) {
                if (view instanceof SkillTreeView) {
                    SkillTreeView skillTreeView = (SkillTreeView) view;
                    String enums = new ListChooser(SELECTION_MODE.MULTIPLE, MASTERY.class).choose();
                    if (StringMaster.isEmpty(enums)) {
                        return;
                    }
                    List<MASTERY> list = new EnumMaster<MASTERY>().getEnumList(MASTERY.class, enums);
                    skillTreeView.setWorkspace(list.toArray(new MASTERY[list.size()]));
                    view.setWorkspaceMode(true);
                    view.refresh();
                    return;
                }
            }
            view.setWorkspaceMode(!view.isWorkspaceMode());
            view.refresh();
            break;
        case LINK:
            view.adjustLink(null, HC_Master.getSelectedTreeNode());
            break;
        // break;
        case OFFSET_X:
            view.adjustOffset(alt, true, HC_Master.getSelectedTreeNode());
            break;
        case OFFSET_Y:
            view.adjustOffset(alt, false, HC_Master.getSelectedTreeNode());
            break;
        case REBUILD:
            view.rebuildAndSetTree();
            break;
        case ALT_BASE:
            if (alt) {
                view.editAltBaseLink(selectedType);
                break;
            }
            view.addAltBase(selectedType);
            break;
        case SET:
            setProp(alt, selectedType);
            view.rebuildAndSetTree();
            break;
        default:
            break;
    }
}
Also used : MASTERY(main.content.enums.entity.SkillEnums.MASTERY) ObjType(main.entity.type.ObjType) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 15 with ListChooser

use of main.swing.generic.components.editors.lists.ListChooser in project Eidolons by IDemiurge.

the class TreeControlPanel method setProperty.

// private static void setProp(boolean alt, ObjType selectedType) {
// 
// }
private static boolean setProperty(boolean alt, ObjType selectedType) {
    String name;
    String containerString = "Lore;Description;Flavor;Image;Actives;Passives;Attribute Bonuses;Parameter Bonuses;";
    // TODO v-flow buttons one-click!
    List<String> listData = StringMaster.openContainer(containerString);
    name = new ListChooser(SELECTION_MODE.SINGLE, listData, true).choose();
    if (name == null) {
        return false;
    }
    // name = new ButtonChoicePanel(SELECTION_MODE.SINGLE,
    // listData).choose();
    PROPERTY prop = ContentManager.getPROP(name);
    String value = null;
    if (alt) {
        value = new TextEditor().launch(selectedType.getProperty(prop));
    } else if (DC_ContentManager.getEditorMap() != null) {
        if (DC_ContentManager.getEditorMap().get(name) != null) {
            value = DC_ContentManager.getEditorMap().get(name).launch(value, name);
        }
    } else if (prop == G_PROPS.IMAGE) {
        value = new ImageChooser().launch(selectedType.getImagePath(), "");
    // tableMouse.getEditor(prop)
    } else {
        value = new TextEditor().launch(selectedType.getProperty(prop));
    }
    if (value != null) {
        selectedType.setProperty(prop, value);
    }
    return true;
// TableMouseListener
// if ()
}
Also used : TextEditor(main.swing.generic.components.editors.TextEditor) ImageChooser(main.swing.generic.components.editors.ImageChooser) PROPERTY(main.content.values.properties.PROPERTY) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Aggregations

ListChooser (main.swing.generic.components.editors.lists.ListChooser)17 ObjType (main.entity.type.ObjType)6 ArrayList (java.util.ArrayList)5 EnumMaster (main.system.auxiliary.EnumMaster)3 LINK_VARIANT (eidolons.client.cc.gui.neo.tree.logic.TreeMap.LINK_VARIANT)2 File (java.io.File)2 DC_TYPE (main.content.DC_TYPE)2 PROPERTY (main.content.values.properties.PROPERTY)2 Ref (main.entity.Ref)2 ImageChooser (main.swing.generic.components.editors.ImageChooser)2 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)1 HC_Tab (eidolons.client.cc.gui.neo.tabs.HC_Tab)1 DC_SpellObj (eidolons.entity.active.DC_SpellObj)1 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)1 DC_Cell (eidolons.entity.obj.DC_Cell)1 Unit (eidolons.entity.obj.unit.Unit)1 ArenaBattleMaster (eidolons.game.battlecraft.logic.battle.arena.ArenaBattleMaster)1 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)1 Preset (eidolons.test.Preset)1