Search in sources :

Example 1 with PartyComp

use of eidolons.game.module.adventure.gui.map.obj.PartyComp 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();
}
Also used : RouteComp(eidolons.game.module.adventure.gui.map.obj.RouteComp) PartyComp(eidolons.game.module.adventure.gui.map.obj.PartyComp) G_Panel(main.swing.generic.components.G_Panel) Coordinates(main.game.bf.Coordinates) PlaceComp(eidolons.game.module.adventure.gui.map.obj.PlaceComp)

Aggregations

PartyComp (eidolons.game.module.adventure.gui.map.obj.PartyComp)1 PlaceComp (eidolons.game.module.adventure.gui.map.obj.PlaceComp)1 RouteComp (eidolons.game.module.adventure.gui.map.obj.RouteComp)1 Coordinates (main.game.bf.Coordinates)1 G_Panel (main.swing.generic.components.G_Panel)1