Search in sources :

Example 1 with HC_PagedListPanel

use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.

the class SkillTabNew method resetComps.

public void resetComps() {
    if (isReinitDataRequired() || isDirty()) {
        initData();
    }
    int i = 0;
    for (HC_PagedListPanel pagedListPanel : listPages) {
        ArrayList<ObjType> data = getData(SKILL_DISPLAY_GROUPS.values()[i]);
        i++;
        pagedListPanel.setData(data);
        pagedListPanel.initPages();
        getItemManager().add(pagedListPanel);
        pagedListPanel.refresh();
        if (pagedListPanel.getParent() == null) {
            addComps();
        }
    }
}
Also used : ObjType(main.entity.type.ObjType) HC_PagedListPanel(eidolons.client.cc.gui.pages.HC_PagedListPanel)

Example 2 with HC_PagedListPanel

use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.

the class SkillTabNew method addComps.

protected void addComps() {
    iconColumns = new ArrayList<>();
    int i = 0;
    int w = getTemplate().getTemplate().getVisuals().getWidth();
    int h = getTemplate().getTemplate().getVisuals().getHeight();
    for (HC_PagedListPanel pagedListPanel : listPages) {
        String constraints = "id " + LIST_ID + i + ", " + "pos " + offsetX + " " + h * i + "+" + getMainPosY();
        add(pagedListPanel, constraints);
        MasteryIconColumn icons = new MasteryIconColumn(hero, SKILL_DISPLAY_GROUPS.values()[i]);
        constraints = "pos " + (offsetX + w + 3) + " " + (h * i) + "-2";
        add(icons, constraints);
        iconColumns.add(icons);
        i++;
        if (getItemManager() != null) {
            getItemManager().add(pagedListPanel);
        }
    }
}
Also used : HC_PagedListPanel(eidolons.client.cc.gui.pages.HC_PagedListPanel)

Example 3 with HC_PagedListPanel

use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.

the class ItemListManager method mouseClicked.

@Override
public void mouseClicked(MouseEvent e) {
    boolean alt = e.isAltDown();
    boolean right = SwingUtilities.isRightMouseButton(e);
    JList<ObjType> list = (JList<ObjType>) e.getSource();
    HeroListPanel hlp = (HeroListPanel) list.getParent();
    ObjType type = list.getSelectedValue();
    if (right && e.getClickCount() == 1) {
        if (isRemovable((HC_PagedListPanel) hlp.getParent()) || (!getHero().getGame().isSimulation() && PROP == PROPS.INVENTORY)) {
            removeType(type, hlp, isAltProp(hlp) ? prop2 : PROP);
            DC_SoundMaster.playStandardSound(getRemoveSound(type.getOBJ_TYPE_ENUM()));
            // coins clink! failed to parse xml
            return;
        }
    }
    // double right click won't work for ITEMS!
    if (right && e.getClickCount() > 1) {
        alt = true;
    }
    if (alt || e.getClickCount() > 1) {
        if (addType(type, hlp, alt)) {
            DC_SoundMaster.playStandardSound(getAddSound(type.getOBJ_TYPE_ENUM()));
        } else {
            failedAddType(type);
        }
    } else {
        typeSelected(type, hlp);
        DC_SoundMaster.playStandardSound(STD_SOUNDS.MODE);
    }
}
Also used : ObjType(main.entity.type.ObjType) HC_PagedListPanel(eidolons.client.cc.gui.pages.HC_PagedListPanel)

Example 4 with HC_PagedListPanel

use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.

the class ShopListsPanel method initListMap.

// to be used
public Map<String, HC_PagedListPanel> initListMap(String tabName) {
    if (!Launcher.getMainManager().isMacroMode()) {
        return super.initListMap(tabName);
    }
    if (getTown() == null) {
        return new HashMap<>();
    }
    Map<String, HC_PagedListPanel> map = new XLinkedMap<>();
    List<ObjType> items = new ArrayList<>();
    Shop shop = getShop(tabName);
    shop.setVendorPanel(this);
    for (ObjType t : shop.getItems()) {
        items.add(t);
    }
    for (String group : getListGroup(tabName)) {
        List<ObjType> data = new ArrayList<>();
        for (ObjType t : items) {
            if (checkType(t, group, shop)) {
                data.add(t);
            }
        }
        if (!data.isEmpty()) {
            putList(group, data, map);
        }
    }
    // sorting?
    return map;
}
Also used : Shop(eidolons.game.module.adventure.town.Shop) ObjType(main.entity.type.ObjType) XLinkedMap(main.data.XLinkedMap) HC_PagedListPanel(eidolons.client.cc.gui.pages.HC_PagedListPanel)

Example 5 with HC_PagedListPanel

use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.

the class VendorListsPanel method putList.

protected void putList(String listName, List<ObjType> data, Map<String, HC_PagedListPanel> map) {
    HC_PagedListPanel list = // vertical, rowsPerList, itemSize, data);
    new HC_PagedListPanel(HC_LISTS.VENDOR, hero, manager, data, listName);
    list.setTYPE(TYPE);
    list.setBorderChecker(getBorderChecker());
    map.put(listName, list);
    manager.add(list);
}
Also used : HC_PagedListPanel(eidolons.client.cc.gui.pages.HC_PagedListPanel)

Aggregations

HC_PagedListPanel (eidolons.client.cc.gui.pages.HC_PagedListPanel)7 ObjType (main.entity.type.ObjType)4 XLinkedMap (main.data.XLinkedMap)2 Shop (eidolons.game.module.adventure.town.Shop)1 C_OBJ_TYPE (main.content.C_OBJ_TYPE)1 OBJ_TYPE (main.content.OBJ_TYPE)1 G_Panel (main.swing.generic.components.G_Panel)1