Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Inventory interaction no longer opens inventory

Joined
Dec 10, 2014
Messages
3,255
Before, if you tried to interact with an item in your inventory and it wasn't open, it would open the backpack, but recently this doesn't seem to happen.

Is this intended or did something change?
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
6,770
Is it just the inventory or does this also happen for equiped items and such?
Did you end up fixing the inventory opening that i told you about a while back? It wouldn't hover the ribbon to get to the inventory component, but if you hover it yourself it opens the inventory fine
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
Did you end up fixing the inventory opening that i told you about a while back? It wouldn't hover the ribbon to get to the inventory component, but if you hover it yourself it opens the inventory fine
No, it's likely the same issue.
 
Bump guys? @SlashnHax
 
Joined
Aug 10, 2015
Messages
142
@Cloud Please find this and fix this as it is the only bug in Alpha Fighter.
THE ONLY BUG.

Trying to alch something with the equipment tab open for 9 hours is not good.
 
Joined
Dec 10, 2014
Messages
3,255
No, it's likely the same issue.
 
Bump guys? @SlashnHax
My bad, yeah, it's the same issue for equipped items (tested with Ring of Duelling).

I tried hovering over the ribbon, like @Aidden said, and then it seemed to be able to open the equipment tab by itself.
@Cloud Please find this and fix this as it is the only bug in Alpha Fighter.
THE ONLY BUG.

Trying to alch something with the equipment tab open for 9 hours is not good.
I've added explicit inventory opening for next update due to this bug xD
 
Joined
Aug 10, 2015
Messages
142
My bad, yeah, it's the same issue for equipped items (tested with Ring of Duelling).

I tried hovering over the ribbon, like @Aidden said, and then it seemed to be able to open the equipment tab by itself.

I've added explicit inventory opening for next update due to this bug xD
You the man
 
Joined
Nov 26, 2014
Messages
616
For anyone who want.

Code:
/**
* Interacts with a SpriteItem. Only works if item is in inventory or
* equipped.
*
* @param item   The item to interact with
* @param action The action to interact
* @return Returns true if interaction was successful
*/
public static boolean item(SpriteItem item, String action) {
    if (item != null && item.isValid()) {
        Openable tab;
        SpriteItem.Origin origin = item.getOrigin();
        if (origin.equals(SpriteItem.Origin.INVENTORY)) {
            tab = InterfaceWindows.getInventory();
        } else if (origin.equals(SpriteItem.Origin.EQUIPMENT)) {
            tab = InterfaceWindows.getEquipment();
        } else {
            return false;
        }
        if (tab.isOpen()) {
            return item.interact(action);
        } else {
            if (tab.open()) {
                final Openable t = tab;
                Execution.delayUntil(t::isOpen, Random.nextInt(1500, 3000));
            }
        }
    }
    return false;
}
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
Under what conditions is the ribbon visible? Can someone loan me an account that has that?
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
6,770
Under what conditions is the ribbon visible? Can someone loan me an account that has that?
The ribbons always visible afaik. But it doesn't know to hover the icon on the ribbon that then gives you access to the inventory button
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
The ribbons always visible afaik. But it doesn't know to hover the icon on the ribbon that then gives you access to the inventory button
I borrowed an account and it wasn't there, hence why I was asking.
 
Joined
Dec 10, 2014
Messages
3,255
For anyone who want.

Code:
/**
* Interacts with a SpriteItem. Only works if item is in inventory or
* equipped.
*
* @param item   The item to interact with
* @param action The action to interact
* @return Returns true if interaction was successful
*/
public static boolean item(SpriteItem item, String action) {
    if (item != null && item.isValid()) {
        Openable tab;
        SpriteItem.Origin origin = item.getOrigin();
        if (origin.equals(SpriteItem.Origin.INVENTORY)) {
            tab = InterfaceWindows.getInventory();
        } else if (origin.equals(SpriteItem.Origin.EQUIPMENT)) {
            tab = InterfaceWindows.getEquipment();
        } else {
            return false;
        }
        if (tab.isOpen()) {
            return item.interact(action);
        } else {
            if (tab.open()) {
                final Openable t = tab;
                Execution.delayUntil(t::isOpen, Random.nextInt(1500, 3000));
            }
        }
    }
    return false;
}
That name though, wouldn't interact have been a better choice? xD
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
6,770
Strange, normally you'd name the class a noun, not a verb... Like Interaction or something :p Just nitpicking, but I thought conventions was one of your pet peeves too?
I'm assuming he's done this because then he can have different interact methods for different types of object in one class, rather than creating an Item class, and Npc class etc with separate interact methods (hence the method being called item). It's a bit backwards, but saves making multiple classes just to have one method in them.
 
Top