Search in sources :

Example 56 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class LE_MapMaster method replace.

public void replace(String prevFiller, String filler, List<Coordinates> coordinates) {
    LevelEditor.getCurrentLevel().removeObj(prevFiller, coordinates.toArray(new Coordinates[coordinates.size()]));
    ObjType type = DataManager.getType(filler);
    for (Coordinates c : coordinates) {
        // LevelEditor.getObjMaster().removeObj(c);
        LevelEditor.getObjMaster().addObj(type, c);
    }
}
Also used : ObjType(main.entity.type.ObjType) Coordinates(main.game.bf.Coordinates)

Example 57 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class LE_ObjMaster method replace.

public static void replace() {
    ObjType type = ArcaneVault.getSelectedType();
    List<Coordinates> coordinates = LE_MapMaster.pickCoordinates();
    if (!ListMaster.isNotEmpty(coordinates)) {
        return;
    }
    ObjType type2 = ArcaneVault.getSelectedType();
    if (type2 == type) {
        type2 = DataManager.getType(ListChooser.chooseType(type.getOBJ_TYPE_ENUM()), type.getOBJ_TYPE_ENUM());
    }
    replace(type, type2, coordinates);
}
Also used : ObjType(main.entity.type.ObjType) Coordinates(main.game.bf.Coordinates)

Example 58 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class LE_Palette method newPalette.

public void newPalette() {
    int optionChoice = DialogMaster.optionChoice("Choose object TYPE...", default_palette);
    OBJ_TYPE TYPE;
    List<ObjType> typeList;
    if (optionChoice == -1) {
        if (DialogMaster.confirm("Multi-type Palette?")) {
            optionChoice = DialogMaster.optionChoice("Choose object multi TYPE...", multi_types);
            if (optionChoice == -1) {
                return;
            }
            TYPE = multi_types[optionChoice];
            typeList = DataManager.getTypes(TYPE);
        } else {
            return;
        }
    } else {
        TYPE = default_palette[optionChoice];
        typeList = DataManager.getTypes(TYPE);
    }
    // int index = DialogMaster.optionChoice("Choose object TYPE...",
    // palettes.toArray());
    // PaletteWorkspace ws = palettes.getOrCreate(index);
    List<String> listData = DataManager.toStringList(typeList);
    List<String> secondListData = (TYPE instanceof C_OBJ_TYPE) ? new ArrayList<>() : DataManager.toStringList(typeList);
    // if (ws != null) {
    // secondListData = DataManager.convertToStringList(ws.getTypeList());
    // }
    String data = new ListChooser(listData, secondListData, false, TYPE).choose();
    if (data == null) {
        return;
    }
    List<ObjType> list = DataManager.toTypeList(data, TYPE);
    String name = DialogMaster.inputText();
    imagePath = new ImageChooser().launch(imagePath, "");
    PaletteWorkspace ws = new PaletteWorkspace(name, list, imagePath);
    addWorkspaceTab(ws);
    saveWorkspace(ws);
}
Also used : C_OBJ_TYPE(main.content.C_OBJ_TYPE) C_OBJ_TYPE(main.content.C_OBJ_TYPE) OBJ_TYPE(main.content.OBJ_TYPE) ObjType(main.entity.type.ObjType) ImageChooser(main.swing.generic.components.editors.ImageChooser) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 59 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class LE_Palette method chooseWorkspaces.

public List<PaletteWorkspace> chooseWorkspaces() {
    List<String> list = new ArrayList<>();
    List<PaletteWorkspace> chosenPalettes = new ArrayList<>();
    for (PaletteWorkspace ws : workspaces) {
        ObjType type = new ObjType(ws.getName());
        type.setOBJ_TYPE_ENUM(DC_TYPE.META);
        type.setImage(imagePath);
        list.add(type.getName());
    }
    List<String> chosen = StringMaster.openContainer(new ListChooser(list, new ArrayList<>(), false, DC_TYPE.META).choose());
    for (String name : chosen) {
        for (PaletteWorkspace p : palettes) {
            if (p.getName().equals(name)) {
                chosenPalettes.add(p);
            }
        }
    }
    return chosenPalettes;
}
Also used : ObjType(main.entity.type.ObjType) ArrayList(java.util.ArrayList) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Example 60 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class LE_Palette method createObjGroup.

public void createObjGroup() {
    Map<ObjType, Integer> map = new HashMap<>();
    int optionChoice = DialogMaster.optionChoice("Choose object TYPE...", default_palette);
    if (optionChoice == -1) {
        return;
    }
    OBJ_TYPE TYPE = default_palette[optionChoice];
    Integer chance = 0;
    boolean randomOff = false;
    while (true) {
        String type = ListChooser.chooseType(TYPE);
        if (type == null) {
            break;
        }
        if (!randomOff) {
            chance = DialogMaster.inputInt("Set chance for object to be there..." + " (set negative to add '1 object only' rule for this group; use 100+ if more than one object is to be created)", chance);
            if (chance == null) {
                Boolean choice = DialogMaster.askAndWait("", "Continue", "Random off", "Cancel");
                if (choice == null) {
                    return;
                }
                if (choice) {
                    chance = 0;
                } else {
                    randomOff = true;
                    chance = 100;
                }
            }
        }
        map.put(DataManager.getType(type, TYPE), chance);
    }
    boolean addToMainPalette = false;
    String data = null;
    for (ObjType type : map.keySet()) {
        chance = map.get(type);
        if (chance != 100) {
        }
        // weight map format? =,
        data += type.getName() + ";";
    }
    String path = null;
    String fileName = null;
    XML_Writer.write(data, path, fileName);
// write to workspace?
}
Also used : C_OBJ_TYPE(main.content.C_OBJ_TYPE) OBJ_TYPE(main.content.OBJ_TYPE) ObjType(main.entity.type.ObjType) HashMap(java.util.HashMap)

Aggregations

ObjType (main.entity.type.ObjType)354 ArrayList (java.util.ArrayList)42 Coordinates (main.game.bf.Coordinates)30 Ref (main.entity.Ref)25 Unit (eidolons.entity.obj.unit.Unit)24 OBJ_TYPE (main.content.OBJ_TYPE)18 PROPERTY (main.content.values.properties.PROPERTY)18 DC_TYPE (main.content.DC_TYPE)16 PARAMETER (main.content.values.parameters.PARAMETER)16 File (java.io.File)15 Entity (main.entity.Entity)12 XLinkedMap (main.data.XLinkedMap)11 EnumMaster (main.system.auxiliary.EnumMaster)11 DC_SpellObj (eidolons.entity.active.DC_SpellObj)9 MATERIAL (main.content.enums.entity.ItemEnums.MATERIAL)9 Obj (main.entity.obj.Obj)9 QUALITY_LEVEL (main.content.enums.entity.ItemEnums.QUALITY_LEVEL)8 MusicList (main.music.entity.MusicList)8 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)6 C_OBJ_TYPE (main.content.C_OBJ_TYPE)6