Forum rules - please read before posting.

Grid inventory

Hi,

I'm building an inventory with a grid but I find myself facing two issues that I'm not sure how to handle without editing the original code.

1) How do I offset a full line instead of just one item? I've tried overriding the Shift method on MenuInventoryBox to use it's own version of MenuElement.Shift but then MenuInventoryBox has another method named Display that doesn't play along which isn't easy to override due to private members.

2) How do I implement mouse wheel scrolling in the inventory in a proper way?

Best regards,

Robin

Comments

  • 1) All you'd need to to is increase/decrease the offset value by gridWidth instead of 1.  Shouldn't need to go into Display or anything else.  That said, it's a useful suggestion and I'll look into adding it officially.

    2) This is more complicated, but again: could be useful.  Can't make promises, but I'll see about adding it in 1.38.
  • 1) I did manage to change the offset by the number of items in a single row but it isn't enough when the number of items in the inventory is not dividable with the number of items in a row. I think the first if statement in the Display method is to blame but I have not tried changing it.

    2) Would be great if it makes it. But a hint on how it could be achieved would also be welcome.

  • It'll likely be code inserted into PlayerMenus, which goes through each active element in turn.  If a scroll wheel (or whatever) axis is detected while the mouse hovers over the box, then you know to shift it.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.