use of eidolons.swing.components.obj.CellComp in project Eidolons by IDemiurge.
the class DC_BattleFieldGrid method resetComponents.
@Deprecated
private void resetComponents() {
int offsetX = getOffsetX();
int offsetY = getOffsetY();
LogMaster.log(0, "resetting grid comps with offsetX = " + offsetX + ";offsetY =" + offsetY);
for (int i = 0; i < getDisplayedCellsX(); i++) {
for (int j = 0; j < getDisplayedCellsY(); j++) {
int x = i + getOffsetX();
int y = j + getOffsetY();
Coordinates c = new Coordinates(x, y);
List<BattleFieldObject> objects = game.getObjectsOnCoordinate(getZ(), c, false, true, false);
List<Unit> overlayingObjects = new ArrayList<>(new DequeImpl(game.getObjectsOnCoordinate(getZ(), c, true, true, false)).getRemoveAll(objects));
// visibility preCheck!
CellComp comp = gridComp.getCells()[x][y];
List<BattleFieldObject> list = new ArrayList<>();
for (BattleFieldObject obj : objects) {
if (VisionManager.checkVisible(obj)) {
list.add(obj);
}
}
comp.setSizeFactor(gridComp.getZoom());
comp.setOverlayingObjects(overlayingObjects);
if (list.size() != 0) {
// comp.setObjects(list);
}
comp.refresh();
}
}
comp.refresh();
}
use of eidolons.swing.components.obj.CellComp in project Eidolons by IDemiurge.
the class AnimationManager method setOverlayingImage.
private void setOverlayingImage(Obj obj, Image img) {
CellComp objComponent = getComp(obj);
objComponent.setCenterOverlayingImage(img);
}
use of eidolons.swing.components.obj.CellComp in project Eidolons by IDemiurge.
the class LE_MouseMaster method mouseClicked.
public void mouseClicked(MouseEvent e) {
// info click!
DC_Obj obj;
coordinates = null;
boolean right = SwingUtilities.isRightMouseButton(e);
CellComp cellComp = getGrid().getCompByPoint(e.getPoint());
previousCoordinate = coordinates;
coordinates = cellComp.getCoordinates();
obj = cellComp.getTopObjOrCell();
obj.setCoordinates(coordinates);
lastClicked = obj;
if (!right) {
selectedObj = obj;
}
if (right) {
setMode(null);
}
if (checkEventConsumed(obj, right)) {
getGrid().getPanel().repaint();
return;
}
LevelEditor.getGrid().setDirty(true);
handleClick(e, right);
if (LevelEditor.getGrid().isDirty()) {
LevelEditor.getGrid().refresh();
}
}
use of eidolons.swing.components.obj.CellComp in project Eidolons by IDemiurge.
the class LE_Simulation method getCells.
@Override
public Set<Obj> getCells() {
if (cells != null) {
return cells;
}
cells = new HashSet<>();
for (int i = 0; i < LevelEditor.getGrid().getCellsX(); i++) {
for (int j = 0; j < LevelEditor.getGrid().getCellsY(); j++) {
CellComp c = LevelEditor.getGrid().getCells()[i][j];
cells.add(c.getTerrainObj());
}
}
return cells;
}
use of eidolons.swing.components.obj.CellComp in project Eidolons by IDemiurge.
the class AnimationManager method addTextOverlay.
private void addTextOverlay(String amount, Ref ref, int delay, Color c, Point p) {
CellComp comp = getComp(ref.getTargetObj());
SmartText text = new SmartText(amount, c);
text.setFont(FontMaster.getFont(FONT.AVQ, DEFAULT_OVERLAY_FONT_SIZE, Font.PLAIN));
comp.addAnimOverlayingString(p, text);
animate(delay, comp);
}
Aggregations