Inventory box

The inventory box is the graphical representation of your inventory window. It defines the placement of the items, some controls (such as the close and/or scrolling buttons) and mainly the design of the background of the inventory.

Inventory box is defined in a simple text file which as a structure similar to this:

INVENTORY_BOX
{
  ITEM_WIDTH = 65
  ITEM_HEIGHT = 65
  SPACING = 10
  SCROLL_BY = 1
  HIDE_SELECTED = TRUE

  AREA { 30, 12, 770, 77 }
  EXCLUSIVE = FALSE

  WINDOW
  {
    X = 0
    Y = 0
    WIDTH = 800
    HEIGHT = 90
    IMAGE = "interface\inventory.bmp"
  
    BUTTON
    {
      TEMPLATE = "ui_elements\template\but.button"
      NAME = "prev"
      TEXT = "<"
      X = 0
      Y = 0
      WIDTH = 30
      HEIGHT = 90
    }

    BUTTON
    {
      TEMPLATE = "ui_elements\template\but.button"
      NAME = "next"
      TEXT = ">"
      X = 770
      Y = 0
      WIDTH = 30
      HEIGHT = 90
    }
  }
}
 

As you see, the first part (purple) defines some inventory specific attributes, while the second part (gray) defines the design. The second part is a casual window, as described in the Windows and controls chapter. The inventory window can contain any GUI elements you want, please see the mentioned chapter for more details about GUI definitions.

Let's take a closer look at the first section. It contains the following attributes:

Based on this setting, WME will automatically populate the defined rectangle with items.

 

As for the second part, i.e. the window definitions, it's a normal window definition with a few exceptions. If you name some of the buttons "next", "prev" or "close", WME will use them automatically for inventory scrolling and/or closing.