Search in sources :

Example 31 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class ResourceMaster method updateImagePath.

private static void updateImagePath(ObjType type) {
    for (PROPERTY prop : props) {
        if (!type.checkProperty(prop))
            continue;
        String path = getNewImagePath(prop, type);
        type.setProperty(prop, path);
    }
}
Also used : PROPERTY(main.content.values.properties.PROPERTY)

Example 32 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class ContentManager method getPROP.

public static PROPERTY getPROP(String valueName) {
    PROPERTY property = propCache.get(valueName);
    if (property != null) {
        if (property != G_PROPS.EMPTY_VALUE) {
            return property;
        }
    }
    property = getPROP(valueName, true);
    if (property == null) {
        property = getPROP(valueName, false);
    }
    if (property == null) {
        LogMaster.log(LogMaster.CORE_DEBUG, "PROPERTY NOT FOUND: " + valueName + "!");
    }
    if (property == null) {
        property = G_PROPS.EMPTY_VALUE;
    }
    propCache.put(valueName, property);
    if (property == G_PROPS.EMPTY_VALUE) {
        return null;
    }
    return property;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY)

Example 33 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class MC_ControlPanel method doFilter.

public static void doFilter(boolean alt, boolean shift) {
    // if (alt) {
    // AHK_Master.getPanel().resetFilter();
    // }
    PROPERTY filterProp = null;
    if (alt) {
        filterProp = AT_PROPS.MUSIC_TYPE;
    } else {
        int choice = DialogMaster.optionChoice(filter_vals, "Value to Filter by?");
        if (choice >= 0) {
            filterProp = filter_vals[choice];
        }
    }
    String filterVal = null;
    if (filterProp != null) {
        filterVal = CreationHelper.getInput(filterProp);
    }
    // strict filter
    if (!shift) {
        MusicListPanel panel = MusicCore.getFilterView(filterVal, filterProp);
        // additionalViews.put(panel.getName(), panel); TODO
        AHK_Master.getPanel().getViewsPanel().addView(panel);
        AHK_Master.getPanel().getViewsPanel().viewClicked(panel.getView().getName());
        return;
    }
    AHK_Master.getPanel().setFilterProp(filterProp);
    AHK_Master.getPanel().setFilterValue(filterVal);
    // AHK_Master.getPanel().setFilterOut(shift);
    // if (c)
    // AHK_Master.getPanel().setHighlight_disable_remove(
    // DialogMaster.ask("What to do with filtered lists?", true,
    // "Highlight",
    // "Disable", "Remove"));
    // else
    AHK_Master.getPanel().setHighlight_disable_remove(null);
    AHK_Master.getPanel().setViewAndRefresh(null);
    AHK_Master.getPanel().refresh();
}
Also used : PROPERTY(main.content.values.properties.PROPERTY)

Example 34 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class MC_ControlPanel method filterViaDialog.

public static List<ObjType> filterViaDialog(List<ObjType> types, boolean ctrl, boolean shift) {
    String filterValue;
    PROPERTY filterProp;
    boolean filterIn = !shift;
    boolean template = ctrl || DialogMaster.confirm("Template or Custom filter?");
    if (template) {
        // MusicMouseListener.s
        boolean group_tag = DialogMaster.confirm("Group or Tag Template?");
        Object[] values;
        if (group_tag) {
            filterProp = AT_PROPS.MUSIC_TYPE;
            values = MusicCore.std_groups[DialogMaster.optionChoice("Choose Template", (Object[]) MusicCore.std_groups)];
        } else {
            filterProp = AT_PROPS.MUSIC_TAGS;
            values = MusicCore.std_tags[DialogMaster.optionChoice("Choose Template", (Object[]) MusicCore.std_tags)];
        }
        filterValue = StringMaster.constructContainer(ListMaster.toStringList(values));
    } else {
        if (!shift) {
            filterIn = DialogMaster.confirm("Filter In or Filter Out?");
        }
        filterProp = filter_vals[DialogMaster.optionChoice(filter_vals, "Filter by...?")];
        filterValue = CreationHelper.getInput(filterProp, null, null, INPUT_REQ.MULTI_ENUM);
    }
    return (List<ObjType>) FilterMaster.filter(types, filterProp.getName(), filterValue, AT_OBJ_TYPE.MUSIC_LIST, true, !filterIn, null);
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) MusicList(main.music.entity.MusicList) List(java.util.List)

Example 35 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class MusicCore method getGroupedView.

public static MusicListPanel getGroupedView(int option, Class<?> constClass) {
    if (option == -1) {
        return null;
    }
    PROPERTY filterProp = ContentManager.getPROP(constClass.getSimpleName());
    // String[] array = (AHK_Master.qwerty + " " +
    // AHK_Master.qwerty.substring(1).toUpperCase() + " 123")
    // .split(" ");
    String viewName = "All " + StringMaster.getWellFormattedString(constClass.getSimpleName());
    Map<String, List<String>> map = new XLinkedMap<>();
    List<String> musicConsts = EnumMaster.getEnumConstantNames(constClass);
    if (option != 0) {
        musicConsts = getMusicConsts(constClass, option);
        viewName = getViewName(constClass, option);
    }
    Map<ObjType, String> multiPropMap = new HashMap<>();
    loop: for (String g : musicConsts) {
        // map.
        List<String> list = new ArrayList<>();
        // for (MusicList musList : listTypeMap.values()) {
        typeLoop: for (ObjType type : DataManager.getTypes(AT_OBJ_TYPE.MUSIC_LIST)) {
            if (type.checkProperty(filterProp, g)) {
                if (filterProp.isContainer()) {
                    containerLoop: for (String sub : StringMaster.open(type.getProperty(filterProp))) {
                        for (String c : musicConsts) {
                            if (StringMaster.compare(c, sub)) {
                                if (c.equalsIgnoreCase(g)) {
                                    break containerLoop;
                                } else {
                                    multiPropMap.put(type, c);
                                    continue typeLoop;
                                }
                            }
                        }
                    }
                }
                list.add(AHK_Master.getScriptLineForList(type));
            }
        }
        map.put(g, list);
    }
    for (ObjType sub : multiPropMap.keySet()) {
        for (String c : map.keySet()) {
            if (multiPropMap.get(sub).equals(c)) {
                map.get(c).add(AHK_Master.getScriptLineForList(sub));
            }
        }
    }
    for (String sub : map.keySet()) {
        map.put(sub, new ArrayList<>(new LinkedHashSet<>(map.get(sub))));
    }
    // TODO adapt to max list size also
    int wrap = 5 - map.size() / 2;
    MusicListPanel musicListPanel = new MusicListPanel("", null);
    G_Panel view = // AHK_Master.getPanel()
    musicListPanel.initView(map, false, wrap, musicConsts);
    musicListPanel.setView(view);
    view.setName(viewName);
    return musicListPanel;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) XLinkedMap(main.data.XLinkedMap) G_Panel(main.swing.generic.components.G_Panel) ObjType(main.entity.type.ObjType) MusicListPanel(main.music.gui.MusicListPanel) MusicList(main.music.entity.MusicList) List(java.util.List)

Aggregations

PROPERTY (main.content.values.properties.PROPERTY)57 PARAMETER (main.content.values.parameters.PARAMETER)23 ObjType (main.entity.type.ObjType)17 OBJ_TYPE (main.content.OBJ_TYPE)6 ArrayList (java.util.ArrayList)5 VALUE (main.content.VALUE)5 Ref (main.entity.Ref)5 DC_TYPE (main.content.DC_TYPE)4 Node (org.w3c.dom.Node)4 DC_SpellObj (eidolons.entity.active.DC_SpellObj)3 Unit (eidolons.entity.obj.unit.Unit)3 XLinkedMap (main.data.XLinkedMap)3 Obj (main.entity.obj.Obj)3 EnumMaster (main.system.auxiliary.EnumMaster)3 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)2 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)2 File (java.io.File)2 List (java.util.List)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 MOD_PROP_TYPE (main.ability.effects.Effect.MOD_PROP_TYPE)2