Search in sources :

Example 1 with OUTLINE_TYPE

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

the class GridPanel method updateOutlines.

public void updateOutlines() {
    viewMap.keySet().forEach(obj -> {
        if (!obj.isOverlaying())
            if (!obj.isMine())
                if (!obj.isWall()) {
                    OUTLINE_TYPE outline = obj.getOutlineType();
                    GridUnitView uv = (GridUnitView) viewMap.get(obj);
                    TextureRegion texture = null;
                    if (outline != null) {
                        String path = Eidolons.game.getVisionMaster().getVisibilityMaster().getImagePath(outline, obj);
                        if (obj instanceof Unit) {
                            main.system.auxiliary.log.LogMaster.log(1, obj + " has OUTLINE: " + path);
                        }
                        texture = TextureCache.getOrCreateR(path);
                        uv.setOutline(texture);
                    } else {
                        if (obj instanceof Unit) {
                            if (!obj.isOutsideCombat()) {
                                main.system.auxiliary.log.LogMaster.log(1, obj + " has NO OUTLINE: ");
                            }
                        }
                        uv.setOutline(null);
                    }
                }
    });
}
Also used : OUTLINE_TYPE(main.content.enums.rules.VisionEnums.OUTLINE_TYPE) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) Unit(eidolons.entity.obj.unit.Unit)

Example 2 with OUTLINE_TYPE

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

the class UnitViewFactory method create.

public static GridUnitView create(BattleFieldObject bfObj) {
    UnitViewOptions options = new UnitViewOptions(bfObj);
    GridUnitView view = new GridUnitView(options);
    if (VisionMaster.isLastSeenOn()) {
        LastSeenView lsv = new LastSeenView(options, view);
        view.setLastSeenView(lsv);
        new LastSeenTooltipFactory().add(lsv, bfObj);
    }
    view.setOutlinePathSupplier(() -> {
        OUTLINE_TYPE type = null;
        // if (bfObj instanceof Unit) {
        // if (!VisionManager.checkVisible(bfObj)) {
        // type = OUTLINE_TYPE.DARK_OUTLINE;
        // }
        // }
        // if (type == null)
        type = bfObj.getOutlineTypeForPlayer();
        if (type == null)
            return null;
        String path = Eidolons.game.getVisionMaster().getVisibilityMaster().getImagePath(type, bfObj);
        return (path);
    });
    view.createHpBar((new ResourceSourceImpl(bfObj)));
    if (bfObj instanceof Unit) {
        view.getInitiativeQueueUnitView().getHpBar().setTeamColor(options.getTeamColor());
    }
    view.getHpBar().setTeamColor(options.getTeamColor());
    final UnitViewTooltip tooltip = new UnitViewTooltip(view);
    tooltip.setUserObject(UnitViewTooltipFactory.create(bfObj));
    view.setToolTip(tooltip);
    ClickListener listener = createListener(bfObj);
    view.addListener(listener);
    view.getInitiativeQueueUnitView().addListener(listener);
    return view;
}
Also used : OUTLINE_TYPE(main.content.enums.rules.VisionEnums.OUTLINE_TYPE) ResourceSourceImpl(eidolons.libgdx.gui.panels.dc.unitinfo.datasource.ResourceSourceImpl) LastSeenTooltipFactory(eidolons.libgdx.gui.tooltips.LastSeenTooltipFactory) Unit(eidolons.entity.obj.unit.Unit) UnitViewTooltip(eidolons.libgdx.gui.tooltips.UnitViewTooltip) BattleClickListener(eidolons.libgdx.bf.mouse.BattleClickListener) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Example 3 with OUTLINE_TYPE

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

the class DefaultActionHandler method doDebugStuff.

private static boolean doDebugStuff(Unit source, BattleFieldObject target) {
    target.getGame().getVisionMaster().getVisionController().log(source, target);
    target.getGame().getVisionMaster().getVisionController().logFor(target);
    OUTLINE_TYPE outlineType = source.getGame().getVisionMaster().getOutlineMaster().getOutlineType(target, source);
    VISIBILITY_LEVEL vl = source.getGame().getVisionMaster().getVisibilityLevel(source, target);
    target.getPlayerVisionStatus(true);
    target.getGamma();
    source.getGame().getVisionMaster().getIlluminationMaster().getIllumination(target);
    target.getGame().getVisionMaster().getGammaMaster().clearCache();
    target.getGame().getVisionMaster().getIlluminationMaster().clearCache();
    int g = target.getGame().getVisionMaster().getGammaMaster().getGamma(source, target);
    outlineType = source.getGame().getVisionMaster().getOutlineMaster().getOutlineType(target, source);
    vl = source.getGame().getVisionMaster().getVisibilityLevel(source, target);
    ClearShotCondition.clearCache();
    Ref ref = new Ref(source);
    ref.setMatch(target.getId());
    source.getGame().getVisionMaster().getSightMaster().getClearShotCondition().preCheck(ref);
    return false;
}
Also used : OUTLINE_TYPE(main.content.enums.rules.VisionEnums.OUTLINE_TYPE) VISIBILITY_LEVEL(main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL) Ref(main.entity.Ref)

Example 4 with OUTLINE_TYPE

use of main.content.enums.rules.VisionEnums.OUTLINE_TYPE 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)

Example 5 with OUTLINE_TYPE

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

the class VisibilityMaster method resetOutlineAndVisibilityLevel.

public void resetOutlineAndVisibilityLevel(DC_Obj unit) {
    Unit source = master.getActiveUnit();
    OUTLINE_TYPE outline = master.getOutlineMaster().getOutlineType(unit, source);
    if (source.isMine())
        if (source.isMainHero()) {
            if (unit == source) {
                unit.setOutlineType(null);
            } else {
                unit.setOutlineType(outline);
            }
            unit.setVisibilityLevel(getVisibility(unit.getOutlineType()));
            return;
        }
    unit.setVisibilityLevel(getVisibility(unit.getOutlineType()));
}
Also used : OUTLINE_TYPE(main.content.enums.rules.VisionEnums.OUTLINE_TYPE) Unit(eidolons.entity.obj.unit.Unit)

Aggregations

OUTLINE_TYPE (main.content.enums.rules.VisionEnums.OUTLINE_TYPE)6 Unit (eidolons.entity.obj.unit.Unit)4 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)1 DC_Cell (eidolons.entity.obj.DC_Cell)1 BattleClickListener (eidolons.libgdx.bf.mouse.BattleClickListener)1 ResourceSourceImpl (eidolons.libgdx.gui.panels.dc.unitinfo.datasource.ResourceSourceImpl)1 LastSeenTooltipFactory (eidolons.libgdx.gui.tooltips.LastSeenTooltipFactory)1 UnitViewTooltip (eidolons.libgdx.gui.tooltips.UnitViewTooltip)1 OUTLINE_IMAGE (main.content.enums.rules.VisionEnums.OUTLINE_IMAGE)1 VISIBILITY_LEVEL (main.content.enums.rules.VisionEnums.VISIBILITY_LEVEL)1 Ref (main.entity.Ref)1