Package net.machinemuse.general.gui.clickable

Examples of net.machinemuse.general.gui.clickable.ClickableItem


    }

    @Override
    public void onMouseUp(double x, double y, int button) {
        if (selectedSlider != null && itemTarget.getSelectedItem() != null && moduleTarget.getSelectedModule() != null) {
            ClickableItem item = itemTarget.getSelectedItem();
            IPowerModule module = moduleTarget.getSelectedModule().getModule();
            MusePacket tweakRequest = new MusePacketTweakRequest(player, item.inventorySlot, module.getDataName(), selectedSlider.name(),
                    selectedSlider.value());
            PacketSender.sendToServer(tweakRequest.getPacket131());
        }
View Full Code Here


            }
            if (slots.size() > 0) {
                Iterator<MusePoint2D> pointiterator = itemPoints.iterator();

                for (int slot : slots) {
                    ClickableItem clickie = new ClickableItem(
                            player.inventory.getStackInSlot(slot),
                            pointiterator.next(), slot);
                    itemButtons.add(clickie);
                }
            }
View Full Code Here

        }
    }

    public void loadModules() {
        this.lastPosition = null;
        ClickableItem selectedItem = target.getSelectedItem();
        if (selectedItem != null) {
            moduleButtons = new ArrayList<ClickableModule>();
            categories = new HashMap<String, ModuleSelectionSubFrame>();

            List<IPowerModule> workingModules = ModuleManager.getValidModulesForItem(null, selectedItem.getItem());

            // Prune the list of disallowed modules, if not installed on this
            // item.
            for (Iterator<IPowerModule> it = workingModules.iterator(); it.hasNext(); ) {
                IPowerModule module = it.next();
                if (module.isAllowed() == false &&
                        ModuleManager.itemHasModule(selectedItem.getItem(), module.getDataName()) == false) {
                    it.remove();
                }
            }

            if (workingModules.size() > 0) {
                this.selectedModule = -1;
                for (IPowerModule module : workingModules) {
                    ModuleSelectionSubFrame frame = getOrCreateCategory(module.getCategory());
                    ClickableModule moduleClickable = frame.addModule(module);
                    // Indicate installed modules
                    if (!module.isAllowed()) {
                        // If a disallowed module made it to the list, indicate
                        // it as disallowed
                        moduleClickable.setAllowed(false);
                    } else if (ModuleManager.itemHasModule(selectedItem.getItem(), module.getDataName())) {
                        moduleClickable.setInstalled(true);
                    }
                    if (moduleClickable.getModule().equals(this.prevSelection)) {
                        this.selectedModule = moduleButtons.size();
                    }
View Full Code Here

        this.player = player;
    }

    @Override
    public void update(double mousex, double mousey) {
        ClickableItem selected = target.getSelectedItem();
        if (selected != null) {
            IModularItem item = MuseItemUtils.getAsModular(selected.getItem().getItem());
            info = item.getLongInfo(player, selected.getItem());
        } else {
            info = null;
        }
    }
View Full Code Here

        }
    }

    @Override
    public void onMouseDown(double x, double y, int button) {
        ClickableItem selItem = targetItem.getSelectedItem();
        ClickableModule selModule = targetModule.getSelectedModule();
        if (selItem != null && selModule != null) {
            ItemStack stack = selItem.getItem();
            IPowerModule module = selModule.getModule();

            if (!ModuleManager.itemHasModule(stack, module.getDataName())) {
                if (installButton.hitBox(x, y)) {
                    doInstall();
View Full Code Here

TOP

Related Classes of net.machinemuse.general.gui.clickable.ClickableItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.