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);
}
}
});
}
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;
}
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;
}
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
}
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()));
}
Aggregations