Search in sources :

Example 1 with OUTLINE_IMAGE

use of main.content.enums.rules.VisionEnums.OUTLINE_IMAGE in project Eidolons by IDemiurge.

the class HintMaster method getHintsString.

public String getHintsString(BattleFieldObject unit) {
    OUTLINE_IMAGE img = master.getOutlineMaster().getImageDark(unit);
    Map<OUTLINE_IMAGE, String> map = cache.get(unit);
    if (map == null) {
        map = new HashMap<>();
        cache.put(unit, map);
    }
    String hintString = map.get(img);
    if (hintString != null)
        return hintString;
    hintString = "";
    List<OUTLINE_HINT> hints = getHints(unit, img);
    for (OUTLINE_HINT hint : hints) {
        hintString += StringMaster.getWellFormattedString(hint.toString()) + " ";
    }
    map.put(img, hintString);
    return hintString;
}
Also used : OUTLINE_HINT(main.content.enums.rules.VisionEnums.OUTLINE_HINT) OUTLINE_IMAGE(main.content.enums.rules.VisionEnums.OUTLINE_IMAGE)

Example 2 with OUTLINE_IMAGE

use of main.content.enums.rules.VisionEnums.OUTLINE_IMAGE in project Eidolons by IDemiurge.

the class VisibilityMaster method getDisplayImagePathForUnit.

public String getDisplayImagePathForUnit(DC_Obj obj) {
    // construct and cache an Outline obj per unit?
    OUTLINE_TYPE type = obj.getOutlineType();
    if (type == null) {
        return null;
    }
    if (type == VisionEnums.OUTLINE_TYPE.BLOCKED_OUTLINE) {
        return getImagePath(VisionEnums.OUTLINE_TYPE.DEEPER_DARKNESS, obj);
    }
    if ((type == VisionEnums.OUTLINE_TYPE.DEEPER_DARKNESS || type == VisionEnums.OUTLINE_TYPE.BLINDING_LIGHT)) {
        return getImagePath(type, obj);
    }
    if (obj instanceof DC_Cell) {
        return null;
    }
    String outlinePath = "ui\\outlines\\" + type.toString();
    OUTLINE_IMAGE outlineImage;
    if (type == VisionEnums.OUTLINE_TYPE.VAGUE_OUTLINE) {
        outlineImage = master.getOutlineMaster().getImageVague((Unit) obj);
    } else {
        outlineImage = master.getOutlineMaster().getImageDark((Unit) obj);
    }
    if (outlineImage != OUTLINE_IMAGE.UNKNOWN) {
        outlinePath += "_" + outlineImage.toString();
    }
    if (obj.isTargetHighlighted()) {
        outlinePath += TARGET;
    } else {
        if (obj.isInfoSelected()) {
            outlinePath += INFO;
        }
    }
    String image = (outlinePath + ".jpg");
    if (ImageManager.isImage(image)) {
        return image;
    }
    image = (outlinePath.replace("_" + outlineImage.toString(), "") + ".jpg");
    if (ImageManager.isImage(image)) {
        return image;
    }
    image = (outlinePath.replace(INFO, "").replace(TARGET, "") + ".jpg");
    if (ImageManager.isImage(image)) {
        return image;
    }
    return null;
// DIFFERENTIATE BETWEEN RANGE, CONCEALMENT, ILL AND STEALTH
}
Also used : OUTLINE_TYPE(main.content.enums.rules.VisionEnums.OUTLINE_TYPE) DC_Cell(eidolons.entity.obj.DC_Cell) OUTLINE_IMAGE(main.content.enums.rules.VisionEnums.OUTLINE_IMAGE) Unit(eidolons.entity.obj.unit.Unit)

Aggregations

OUTLINE_IMAGE (main.content.enums.rules.VisionEnums.OUTLINE_IMAGE)2 DC_Cell (eidolons.entity.obj.DC_Cell)1 Unit (eidolons.entity.obj.unit.Unit)1 OUTLINE_HINT (main.content.enums.rules.VisionEnums.OUTLINE_HINT)1 OUTLINE_TYPE (main.content.enums.rules.VisionEnums.OUTLINE_TYPE)1