Search in sources :

Example 6 with InventoryDataSource

use of eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryDataSource in project Eidolons by IDemiurge.

the class InventoryWithAction method close.

public void close(Boolean result) {
    if (result == null)
        result = false;
    InventoryDataSource source = (InventoryDataSource) getUserObject();
    WaitMaster.receiveInput(InventoryTransactionManager.OPERATION, result);
    CharacterCreator.getHeroManager().removeHero(source.getUnit());
    if (!ExplorationMaster.isExplorationOn()) {
        source.getCancelHandler().cancel();
    } else {
    }
    setVisible(false);
}
Also used : InventoryDataSource(eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryDataSource)

Example 7 with InventoryDataSource

use of eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryDataSource in project Eidolons by IDemiurge.

the class InventoryWithAction method initButtonListeners.

private void initButtonListeners() {
    final InventoryDataSource source = (InventoryDataSource) getUserObject();
    ButtonStyled button = (ButtonStyled) doneButton.getActor();
    button.clearListeners();
    button.addListener(source.getDoneHandler());
// button.setDisabled(source.isDoneDisabled());
// button = (ButtonStyled) cancelButton.getActor();
// button.addListener(source.getCancelHandler());
// button.setDisabled(source.isCancelDisabled());
// button = (ButtonStyled) undoButton.getActor();
// button.addListener(source.getUndoHandler());
// button.setDisabled(source.isUndoDisabled());
}
Also used : InventoryDataSource(eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryDataSource) ButtonStyled(eidolons.libgdx.gui.generic.btn.ButtonStyled)

Example 8 with InventoryDataSource

use of eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryDataSource in project Eidolons by IDemiurge.

the class ContainerMaster method actionActivated.

@Override
protected boolean actionActivated(CONTAINER_ACTION sub, Unit unit, DungeonObj obj) {
    /*
        pickUpAction
         */
    unit.getGame().getInventoryManager().setHero(unit);
    unit.getGame().getInventoryManager().setOperationsPool(5);
    CharacterCreator.getHeroManager().addHero(unit);
    Pair<InventoryDataSource, ContainerDataSource> param = new ImmutablePair<>(new InventoryDataSource(unit), new ContainerDataSource(obj, unit));
    GuiEventManager.trigger(GuiEventType.SHOW_LOOT_PANEL, param);
    // return true;
    return (boolean) WaitMaster.waitForInput(InventoryTransactionManager.OPERATION);
}
Also used : InventoryDataSource(eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryDataSource) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) ContainerDataSource(eidolons.libgdx.gui.panels.dc.inventory.container.ContainerDataSource)

Aggregations

InventoryDataSource (eidolons.libgdx.gui.panels.dc.inventory.datasource.InventoryDataSource)8 ImmutablePair (org.apache.commons.lang3.tuple.ImmutablePair)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 Actor (com.badlogic.gdx.scenes.scene2d.Actor)1 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 InputListener (com.badlogic.gdx.scenes.scene2d.InputListener)1 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)1 TextButton (com.badlogic.gdx.scenes.scene2d.ui.TextButton)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 TextureRegionDrawable (com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable)1 OPERATIONS (eidolons.client.cc.gui.lists.dc.DC_InventoryManager.OPERATIONS)1 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)1 Unit (eidolons.entity.obj.unit.Unit)1 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)1 ButtonStyled (eidolons.libgdx.gui.generic.btn.ButtonStyled)1 TablePanel (eidolons.libgdx.gui.panels.TablePanel)1 InventorySlotsPanel (eidolons.libgdx.gui.panels.dc.inventory.InventorySlotsPanel)1 ContainerDataSource (eidolons.libgdx.gui.panels.dc.inventory.container.ContainerDataSource)1 Pair (org.apache.commons.lang3.tuple.Pair)1