Search in sources :

Example 11 with OBJ_TYPE

use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.

the class ListChooser method chooseObj.

public static String chooseObj(List list, SELECTION_MODE MODE) {
    OBJ_TYPE T = ((Entity) list.get(0)).getOBJ_TYPE_ENUM();
    sortingDisabled = true;
    return new ListChooser(MODE, ListMaster.toNameList(list), T).getString();
}
Also used : Entity(main.entity.Entity) OBJ_TYPE(main.content.OBJ_TYPE)

Example 12 with OBJ_TYPE

use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.

the class VendorListsPanel method initListMap.

public Map<String, HC_PagedListPanel> initListMap(String tabName) {
    List<String> group = getListGroup(tabName);
    ArrayList<String> specialLists = new ArrayList<>();
    Map<String, HC_PagedListPanel> map = new XLinkedMap<>();
    for (String listName : group) {
        if (checkSpecial(listName)) {
            specialLists.add(listName);
            continue;
        }
        if (!responsive) {
            if (!checkList(listName, false)) {
                continue;
            }
        }
        if (!showAll) {
            if (!checkList(listName, true)) {
                continue;
            }
        }
        List<String> types = DataManager.getTypesSubGroupNames(TYPE, listName);
        if (Launcher.ILYA_MODE) {
            if (TYPE == DC_TYPE.SPELLS || TYPE == DC_TYPE.SKILLS) {
                FilterMaster.filterByProp(types, G_PROPS.WORKSPACE_GROUP.getName(), "" + MetaEnums.WORKSPACE_GROUP.DESIGN, TYPE, true);
                FilterMaster.filterByProp(types, G_PROPS.WORKSPACE_GROUP.getName(), "" + MetaEnums.WORKSPACE_GROUP.IMPLEMENT, TYPE, true);
                FilterMaster.filterByProp(types, PROPS.ITEM_SHOP_CATEGORY.getName(), "" + ItemEnums.ITEM_SHOP_CATEGORY.SPECIAL, TYPE, true);
            // so you see, it wouldn't be hard to filter the items for
            // each shop in macro
            }
        }
        if (types == null) {
            // shot in the leg!
            continue;
        }
        if (types.isEmpty()) {
            continue;
        }
        List<ObjType> data;
        // if (checkSpecial(listName))
        // data = getSpecialData();
        // else {
        OBJ_TYPE T = TYPE;
        if (T instanceof C_OBJ_TYPE) {
            if (tabName.equalsIgnoreCase(DC_TYPE.JEWELRY.getName())) {
                T = DC_TYPE.JEWELRY;
            }
            if (tabName.equalsIgnoreCase(ItemEnums.ITEM_TYPE.ALCHEMY.toString())) {
                T = DC_TYPE.ITEMS;
            }
            // if (TYPE != OBJ_TYPES.SPELLS)
            if (tabName.equalsIgnoreCase(ItemEnums.ARMOR_TYPE.LIGHT.toString()) || tabName.equalsIgnoreCase(ItemEnums.ARMOR_TYPE.HEAVY.toString())) {
                T = DC_TYPE.ARMOR;
            }
        }
        // TODO is there a
        data = DataManager.toTypeList(types, T);
        if (getFilter() != null) {
            data = getFilter().filter(data);
        }
        if (getSpecialFilter() != null) {
            data = getSpecialFilter().filter(data);
        }
        if (getSorter() != null) {
            try {
                Collections.sort(data, getSorter());
            } catch (Exception e) {
                main.system.ExceptionMaster.printStackTrace(e);
            // main.system.ExceptionMaster.printStackTrace(e);
            }
        }
        putList(listName, data, map);
    }
    for (String listName : specialLists) {
        List<ObjType> data = getSpecialData();
        if (getSorter() != null) {
            Collections.sort(data, getSorter());
        }
        putList(listName, data, map);
    }
    return map;
}
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) XLinkedMap(main.data.XLinkedMap) HC_PagedListPanel(eidolons.client.cc.gui.pages.HC_PagedListPanel)

Example 13 with OBJ_TYPE

use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.

the class Saver method getObjNodeXml.

private static String getObjNodeXml(DC_GameState state) {
    StringBuilder builder = new StringBuilder(80000);
    builder.append(XML_Converter.openXml(OBJ_NODE));
    for (OBJ_TYPE TYPE : state.getObjMaps().keySet()) {
        if (state.getObjMaps().get(TYPE).isEmpty())
            continue;
        builder.append(XML_Converter.openXml(TYPE.getName()));
        for (Integer id : state.getObjMaps().get(TYPE).keySet()) {
            Obj obj = state.getObjMaps().get(TYPE).get(id);
            obj.setProperty(G_PROPS.ID, id + "");
            builder.append(XML_Converter.openXmlFormatted(obj.getName()));
            builder.append(XML_Converter.openXml(PROPS_NODE));
            for (PROPERTY property : obj.getPropMap().keySet()) {
                if (property.isDynamic() || !obj.getProperty(property).equals(obj.getType().getProperty(property))) {
                    // only write values that aren't at base
                    builder.append(XML_Formatter.getValueNode(obj, property));
                }
            }
            builder.append(XML_Converter.closeXml(PROPS_NODE));
            builder.append(XML_Converter.openXml(PARAMS_NODE));
            for (PARAMETER parameter : obj.getParamMap().keySet()) {
                if (parameter.isDynamic() || !obj.getParam(parameter).equals(obj.getType().getParam(parameter))) {
                    // only write values that aren't at base
                    builder.append(XML_Formatter.getValueNode(obj, parameter));
                }
            }
            builder.append(XML_Converter.closeXml(PARAMS_NODE));
            // REF !
            builder.append(XML_Converter.closeXmlFormatted(obj.getName()));
        }
        builder.append(XML_Converter.closeXml(TYPE.getName()));
    }
    builder.append(XML_Converter.closeXml(OBJ_NODE));
    return builder.toString();
}
Also used : OBJ_TYPE(main.content.OBJ_TYPE) Obj(main.entity.obj.Obj) PROPERTY(main.content.values.properties.PROPERTY) PARAMETER(main.content.values.parameters.PARAMETER)

Example 14 with OBJ_TYPE

use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.

the class StateCloner method cloneMaps.

private void cloneMaps(DC_GameState state, DC_GameState clone) {
    for (OBJ_TYPE TYPE : state.getObjMaps().keySet()) {
        Map<Integer, Obj> cloneMap = getObjMap();
        Map<Integer, Obj> map = state.getObjMaps().get(TYPE);
        if (map == null) {
            continue;
        }
        for (Obj e : map.values()) {
            Obj cloneObj = cloneObj(e);
            cloneMap.put(cloneObj.getId(), cloneObj);
        }
        clone.getObjMaps().put(TYPE, cloneMap);
    }
}
Also used : OBJ_TYPE(main.content.OBJ_TYPE) DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj) DC_BuffObj(eidolons.entity.obj.attach.DC_BuffObj) DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj) DC_SpellObj(eidolons.entity.active.DC_SpellObj) Obj(main.entity.obj.Obj) DC_ArmorObj(eidolons.entity.item.DC_ArmorObj) PassiveAbilityObj(main.ability.PassiveAbilityObj)

Example 15 with OBJ_TYPE

use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.

the class MacroManager method saveCustomTypes.

public static void saveCustomTypes() {
    // saveCopyTypes();
    for (OBJ_TYPE t : custom_OBJ_TYPES) {
        String content = XML_Converter.openXmlFormatted(t.getName());
        for (ObjType type : customTypes) {
            if (type.getOBJ_TYPE_ENUM() == t) {
                content += XML_Writer.getIncompleteTypeXML(type, type.getType());
            }
        }
        content += XML_Converter.closeXmlFormatted(t.getName());
        String path = getTypeDataPath();
        String fileName = t.getName() + ".xml";
        XML_Writer.write(content, path, fileName);
    }
}
Also used : OBJ_TYPE(main.content.OBJ_TYPE) ObjType(main.entity.type.ObjType)

Aggregations

OBJ_TYPE (main.content.OBJ_TYPE)31 ObjType (main.entity.type.ObjType)16 C_OBJ_TYPE (main.content.C_OBJ_TYPE)7 ArrayList (java.util.ArrayList)5 PROPERTY (main.content.values.properties.PROPERTY)5 Obj (main.entity.obj.Obj)5 Entity (main.entity.Entity)3 DC_SpellObj (eidolons.entity.active.DC_SpellObj)2 Unit (eidolons.entity.obj.unit.Unit)2 File (java.io.File)2 VALUE (main.content.VALUE)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 Actor (com.badlogic.gdx.scenes.scene2d.Actor)1 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 NinePatchDrawable (com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable)1 ChoiceSequence (eidolons.client.cc.gui.neo.choice.ChoiceSequence)1 EntityChoiceView (eidolons.client.cc.gui.neo.choice.EntityChoiceView)1 HC_PagedListPanel (eidolons.client.cc.gui.pages.HC_PagedListPanel)1 SequenceManager (eidolons.client.dc.SequenceManager)1