Search in sources :

Example 26 with VALUE

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

the class HeroTextComp method refresh.

@Override
public void refresh() {
    if (getMouseListeners().length == 0) {
        addMouseListener(this);
    }
    if (hero == null) {
        return;
    }
    List<String> lines = new ArrayList<>();
    for (VALUE V : VALUES) {
        String value = hero.getValue(V);
        if (V instanceof PARAMETER) {
            value = V.getName() + " " + value;
        }
        lines.add(value);
    }
    setTextLines(lines);
}
Also used : ArrayList(java.util.ArrayList) VALUE(main.content.VALUE) PARAMETER(main.content.values.parameters.PARAMETER)

Example 27 with VALUE

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

the class ValueInfoPage method init.

protected void init() {
    if (!isInitialized()) {
        return;
    }
    X = getDefaultX();
    Y = getDefaultY();
    i = 0;
    Z = getDefaultZ();
    if (isAddHeader()) {
        addHeader();
    }
    for (VALUE p : values) {
        EntityValueComponent comp = getComponent(p);
        addComponent(comp, p);
    }
    initialized = true;
}
Also used : VALUE(main.content.VALUE) EntityValueComponent(eidolons.swing.components.panels.page.info.element.EntityValueComponent)

Example 28 with VALUE

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

the class ValueHelper method getValue.

public VALUE getValue(String valueName) {
    VALUE value;
    value = checkFoundValues(valueName);
    if (value != null) {
        if (!checkRejectedValue(valueName, value)) {
            return value;
        }
    }
    ContentManager.setExcludedValueSet(rejectedValues.get(valueName));
    try {
        value = ContentManager.getValue(valueName);
        if (value == null) {
            value = ContentManager.getValue(valueName, true);
        }
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    } finally {
        ContentManager.setExcludedValueSet(null);
    }
    return value;
}
Also used : VALUE(main.content.VALUE)

Example 29 with VALUE

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

the class ValueHelper method setValue.

public void setValue(String valueName) {
    if (getEntity() == null) {
        return;
    }
    VALUE v = getValue(valueName);
    String amount;
    if (v != null) {
        amount = getEntity().getValue(v);
        foundValues.put(valueName, v);
    } else {
        valueName = CounterMaster.findCounter(valueName);
        amount = "" + getEntity().getCounter(valueName);
    }
    String name = valueName;
    if (v != null) {
        name = v.getName();
    }
    String message = "Set value: " + name + " for " + getEntity().getName();
    String input = JOptionPane.showInputDialog(parent, message, amount);
    Set<VALUE> set = rejectedValues.get(valueName);
    if (set == null) {
        set = new HashSet<>();
        rejectedValues.put(valueName, set);
    }
    if (input != null) {
        set.remove(v);
    } else {
        set.add(v);
    }
    if (!StringMaster.isEmpty(input)) {
        if (!input.equalsIgnoreCase(amount)) {
            if (v != null) {
                getEntity().setValue(v, input);
                if (getEntity() instanceof Obj) {
                    getEntity().getType().setValue(v, input);
                }
            // if (getEntity() instanceof DC_HeroObj ) //set items
            // initialized false!
            } else {
                getEntity().setCounter(valueName, StringMaster.getInteger(input));
            }
            game.getManager().reset();
            game.getManager().refreshAll();
        }
    }
    if (getEntity() instanceof ObjType) {
        if (CoreEngine.isArcaneVault()) {
            XML_Writer.writeXML_ForType((ObjType) getEntity());
        }
    }
}
Also used : ObjType(main.entity.type.ObjType) Obj(main.entity.obj.Obj) VALUE(main.content.VALUE)

Example 30 with VALUE

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

the class XlsMaster method createSheet.

private static void createSheet(HSSFWorkbook workbook, DC_TYPE TYPE, String[] groups, PARAMS[] params, String[] formulas) {
    HSSFSheet sheet = workbook.createSheet(TYPE.getName());
    int row = 0;
    HSSFRow rowhead = sheet.createRow((short) row);
    rowhead.createCell(0).setCellValue("Name");
    int column = 1;
    for (String formula : formulas) {
        rowhead.createCell(column).setCellValue(formula.split(formula_sep)[0]);
        column++;
    }
    for (PARAMS param : params) {
        rowhead.createCell(column).setCellValue((param).getShortName());
        column++;
    }
    row++;
    for (String group : groups) {
        rowhead = sheet.createRow((short) row);
        row++;
        rowhead.createCell(0).setCellValue(group);
        for (ObjType objType : DataManager.getTypesGroup(TYPE, group)) {
            rowhead = sheet.createRow((short) row);
            row++;
            column = 0;
            rowhead.createCell(column).setCellValue(objType.getName());
            column++;
            final ObjType simUnit = DataManager.getType(simUnitName, C_OBJ_TYPE.UNITS_CHARS);
            Ref ref = new Ref() {

                @Override
                public ObjType getType(String string) {
                    if (string.equalsIgnoreCase(TYPE_KEY))
                        return objType;
                    return simUnit;
                }
            };
            Map<VALUE, Integer> valueMap = null;
            int simUnitRow = 0;
            // Map<VALUE, Integer> entityMap;
            for (String raw_formula : formulas) {
                String formula = getFormula(raw_formula, row, column, valueMap, simUnitRow);
                rowhead.createCell(column).setCellFormula(formula);
                column++;
            }
            for (PARAMS param : params) {
                rowhead.createCell(column).setCellValue(objType.getParam(param));
                column++;
            }
        }
    }
}
Also used : Ref(main.entity.Ref) ObjType(main.entity.type.ObjType) HSSFRow(org.apache.poi.hssf.usermodel.HSSFRow) HSSFSheet(org.apache.poi.hssf.usermodel.HSSFSheet) PARAMS(eidolons.content.PARAMS) VALUE(main.content.VALUE)

Aggregations

VALUE (main.content.VALUE)33 ObjType (main.entity.type.ObjType)8 PARAMETER (main.content.values.parameters.PARAMETER)7 ArrayList (java.util.ArrayList)5 PROPERTY (main.content.values.properties.PROPERTY)5 PARAMS (eidolons.content.PARAMS)3 UNIT_INFO_PARAMS (eidolons.content.UNIT_INFO_PARAMS)2 MultiValueContainer (eidolons.libgdx.gui.panels.dc.unitinfo.MultiValueContainer)2 List (java.util.List)2 OBJ_TYPE (main.content.OBJ_TYPE)2 G_PROPS (main.content.values.properties.G_PROPS)2 Obj (main.entity.obj.Obj)2 Formula (main.system.math.Formula)2 ChoiceSequence (eidolons.client.cc.gui.neo.choice.ChoiceSequence)1 EntityChoiceView (eidolons.client.cc.gui.neo.choice.EntityChoiceView)1 SequenceManager (eidolons.client.dc.SequenceManager)1 DC_UnitAction (eidolons.entity.active.DC_UnitAction)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 Unit (eidolons.entity.obj.unit.Unit)1 FutureBuilder (eidolons.game.battlecraft.ai.tools.future.FutureBuilder)1