Search in sources :

Example 61 with ObjType

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

the class XML_Transformer method renameType.

public static void renameType(ObjType type, String newName, PROPERTY... props) {
    // backUp();
    // after files are read
    boolean dynamic = false;
    if (props == null) {
        dynamic = true;
    }
    // props = getValuesForType(obj_type);
    for (PROPERTY prop : props) {
        if (dynamic) {
        }
        for (OBJ_TYPE key : ContentManager.getOBJ_TYPEsForValue(prop)) {
            for (ObjType objType : DataManager.getTypes(key)) {
                String value = objType.getProperty(prop);
                value = value.replaceAll(type.getName(), newName);
                objType.setProperty(prop, value);
            }
            XML_Writer.writeXML_ForTypeGroup(key);
        }
    }
    type.setName(newName);
    XML_Writer.writeXML_ForType(type, type.getOBJ_TYPE_ENUM());
// XML_File file = getFile(type.getOBJ_TYPE_ENUM());
// String newContents = file
// .getContents()
// .replaceAll(XML_Converter.openXML(type.getName()), XML_Converter
// .openXML(newName));
// newContents =
// file.getContents().replaceAll(XML_Converter.closeXML(type
// .getName()), XML_Converter.closeXML(newName));
// String nameOpen = XML_Converter.openXML(type.getName());
// String nameClose = XML_Converter.closeXML(type.getName());
// newContents = file.getContents().replaceFirst(nameOpen +
// type.getName()
// + nameClose, nameOpen + newName + nameClose);
// file.setContents(newContents);
// XML_Writer.write(file);
}
Also used : ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY)

Example 62 with ObjType

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

the class MusicList method toBase.

@Override
public void toBase() {
    super.toBase();
    tracks = new ArrayList<>();
    String property = getProperty(AT_PROPS.TRACKS);
    for (ObjType t : DataManager.toTypeList(property, AT_OBJ_TYPE.TRACK)) {
        // duplicate preCheck
        tracks.add(MusicCore.getTrack(t));
    }
}
Also used : ObjType(main.entity.type.ObjType)

Example 63 with ObjType

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

the class MC_ControlPanel method massEdit.

public static void massEdit(boolean emptyOnly) {
    List<ObjType> types = DataManager.getTypes(AT_OBJ_TYPE.MUSIC_LIST);
    VALUE prop = getMassFilterValue();
    if (prop != null) {
        String filterValue = inputMassValue(prop);
        for (ObjType sub : new ArrayList<>(types)) // if (emptyOnly) {
        {
            if (!sub.checkContainerProp((PROPERTY) prop, filterValue, true)) {
                types.remove(sub);
            }
        }
    // } else if (!generic.checkValue(prop, filterValue))
    // types.remove(generic);
    }
    prop = getMassEditValue();
    if (prop == null) {
        return;
    }
    if (emptyOnly) {
        for (ObjType sub : new ArrayList<>(types)) {
            if (sub.checkValue(prop)) {
                types.remove(sub);
            }
        }
    }
    massEdit(types, prop);
}
Also used : ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY) VALUE(main.content.VALUE)

Example 64 with ObjType

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

the class MC_ControlPanel method massEdit.

public static void massEdit(List<ObjType> types, VALUE prop) {
    // GenericListChooser.s
    types = ListChooser.chooseTypes_(types);
    if (types.isEmpty()) {
        return;
    }
    String value = inputMassValue(prop);
    if (StringMaster.isEmpty(value)) {
        return;
    }
    MOD_PROP_TYPE p = new EnumMaster<MOD_PROP_TYPE>().selectEnum(MOD_PROP_TYPE.class);
    // }
    for (ObjType sub : (types)) {
        sub.modifyProperty(p, (PROPERTY) prop, value);
    }
}
Also used : ObjType(main.entity.type.ObjType) MOD_PROP_TYPE(main.ability.effects.Effect.MOD_PROP_TYPE)

Example 65 with ObjType

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

the class MC_ControlPanel method doDialog.

public static void doDialog(boolean alt, boolean shift, boolean ctrl, MusicList list, boolean last) {
    if (!last) {
        dialogChooseOrRandom = alt || DialogMaster.confirm("Choose or random?");
    }
    if (!last) {
        dialogListTypes = new ArrayList<>(DataManager.getTypes(AT_OBJ_TYPE.MUSIC_LIST));
        dialogListTypes = filterViaDialog(dialogListTypes, ctrl, shift);
        cachedDialogListTypes = new ArrayList<>(dialogListTypes);
    }
    String result;
    if (dialogChooseOrRandom) {
        result = ListChooser.chooseType(dialogListTypes).getProperty(AT_PROPS.PATH);
    } else {
        ObjType item = new RandomWizard<ObjType>().getRandomListItem(dialogListTypes);
        dialogListTypes.remove(item);
        if (dialogListTypes.isEmpty()) {
            dialogListTypes = new ArrayList<>(cachedDialogListTypes);
        }
        result = item.getProperty(AT_PROPS.PATH);
    }
    // String listPath = DataManager.getType(result, AT_OBJ_TYPE.MUSIC_LIST
    // )
    // .getProperty(AT_PROPS.PATH);
    PLAY_MODE playMode = MusicMouseListener.getPlayMode();
    if (ctrl) {
        playMode = new EnumMaster<PLAY_MODE>().retrieveEnumConst(PLAY_MODE.class, ListChooser.chooseEnum(PLAY_MODE.class));
    }
    MusicMouseListener.playM3uList(result, playMode);
}
Also used : PLAY_MODE(main.music.gui.MusicMouseListener.PLAY_MODE) ObjType(main.entity.type.ObjType)

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