Search in sources :

Example 1 with ConditionMaster

use of main.system.entity.ConditionMaster in project Eidolons by IDemiurge.

the class FilterMaster method newFilter.

public static void newFilter() {
    Conditions conditions = new Conditions();
    OBJ_TYPE TYPE = ArcaneVault.getSelectedOBJ_TYPE();
    CONDITION_TEMPLATES[] templates = CONDITION_TEMPLATES.values();
    while (true) {
        // CHOOSE TYPE? OR USE SELECTED TAB!
        int i = DialogMaster.optionChoice(templates, "choose filter template");
        if (i == -1) {
            break;
        }
        CONDITION_TEMPLATES template = CONDITION_TEMPLATES.values()[i];
        String value = DialogMaster.inputText("Enter filter's value name");
        if (StringMaster.isEmpty(value)) {
            break;
        }
        VALUE val = ContentManager.findValue(value);
        value = DialogMaster.inputText("Enter filtering value");
        if (StringMaster.isEmpty(value)) {
            break;
        }
        conditions.add(new ConditionMaster().getConditionFromTemplate(template, StringMaster.getValueRef(KEYS.MATCH, val), value));
    }
    if (conditions.isEmpty()) {
        return;
    }
    if (TYPE == null) {
    }
    // Document node = XML_Converter.getDoc(XML_Converter.openXml("conditions")
    // + XML_Converter.closeXml("conditions"));
    // String conditionString = XML_Converter.getStringFromXML(node);
    TypeFilter filter = new TypeFilter(conditions, TYPE);
    // save!
    filters.add(filter);
    ArcaneVault.getMainBuilder().getTabBuilder().addFilter(filter);
}
Also used : OBJ_TYPE(main.content.OBJ_TYPE) VALUE(main.content.VALUE) CONDITION_TEMPLATES(main.system.entity.ConditionMaster.CONDITION_TEMPLATES) ConditionMaster(main.system.entity.ConditionMaster) Conditions(main.elements.conditions.Conditions)

Aggregations

OBJ_TYPE (main.content.OBJ_TYPE)1 VALUE (main.content.VALUE)1 Conditions (main.elements.conditions.Conditions)1 ConditionMaster (main.system.entity.ConditionMaster)1 CONDITION_TEMPLATES (main.system.entity.ConditionMaster.CONDITION_TEMPLATES)1