use of eidolons.game.module.adventure.gui.map.obj.RouteComp in project Eidolons by IDemiurge.
the class MapComp method getRouteComp.
private RouteComp getRouteComp(Route p) {
RouteComp comp = routeComps.get(p);
if (comp == null) {
comp = new RouteComp(p);
routeComps.put(p, comp);
}
return comp;
}
use of eidolons.game.module.adventure.gui.map.obj.RouteComp in project Eidolons by IDemiurge.
the class MapComp method resetDisplayedRoutes.
private void resetDisplayedRoutes() {
routes.clear();
for (Route r : getRegion().getRoutes()) {
r.setCoordinatesValid(false);
}
for (Route r : getRegion().getRoutes()) {
// TODO not all routes should be *displayed*, really...
r.resetCoordinates();
if (r.isVisible()) {
if (r.isAvailable() || isAllRoutesDisplayedOn()) {
RouteComp routeComp = getRouteComp(r);
routes.put(adjustRouteCoordinate(routeComp), routeComp);
}
}
}
}
use of eidolons.game.module.adventure.gui.map.obj.RouteComp in project Eidolons by IDemiurge.
the class MapComp method refresh.
public void refresh() {
// re-evaluate available Routes
getComp().removeAll();
G_Panel backgroundComp = getBackgroundComp();
// ++ border of sorts?
getComp().add(backgroundComp);
if (listener != null) {
backgroundComp.addMouseListener(listener);
}
index = 0;
if (playerPartyComp == null) {
playerPartyComp = new PartyComp(getParty());
}
Coordinates ppp = getPlayerPartyPoint();
getComp().add(playerPartyComp.getComp(), "pos " + ppp.x + " " + ppp.y);
comp.setComponentZOrder(playerPartyComp.getComp(), index);
index++;
resetVisiblePlaces();
resetDisplayedRoutes();
for (Coordinates p : routes.keySet()) {
// ++ refresh
RouteComp routeComp = routes.get(p);
add(routeComp, "pos " + p.x + " " + p.y);
routeComp.refresh();
}
for (Coordinates p : places.keySet()) {
// ++ symbol if not available?
PlaceComp placeComp = places.get(p);
// Selectable?
getComp().add(placeComp.getComp(), "pos " + p.x + " " + p.y);
comp.setComponentZOrder(placeComp.getComp(), index);
index++;
placeComp.refresh();
}
comp.setComponentZOrder(backgroundComp, index);
addSpecialIcons();
// Route route = getParty().getCurrentRoute();
// if (route != null) {
// getComp().add(
// route.getComp().getComp(),
// "pos " + route.getMapPoint().x + " "
// + route.getMapPoint().y);
// }
// only display the active route if traveling!
getComp().revalidate();
}
use of eidolons.game.module.adventure.gui.map.obj.RouteComp in project Eidolons by IDemiurge.
the class MapComp method initComp.
private void initComp(Obj o) {
if (o instanceof Route) {
Route route = (Route) o;
RouteComp component = new RouteComp(route);
routeComps.put(route, component);
}
if (o instanceof Place) {
Place place = (Place) o;
PlaceComp component = new PlaceComp(place);
placeComps.put(place, component);
}
}
Aggregations