Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: CMK2901 on January 27, 2007, 10:42:28 PM

Title: "next" & "prev" possible bug
Post by: CMK2901 on January 27, 2007, 10:42:28 PM
Sorry for posting so much, but I've really been slaving away at transferring my project to Wintermute and I may have come upon a small bug.

For the inventory object, I have two button objects to scroll through the inventory and these buttons use the IMAGE_PRESS property.  When the buttons are not named "prev" and "next", they work fine, but when I name the buttons appropriately, the button no longer switches to a pressed state when clicked.  This seems to only happen when the buttons are named "next" and "prev" (possible "close" as well, but I haven't tried). 


-Clark
Title: Re: "next" & "prev" possible bug
Post by: Mnemonic on January 28, 2007, 09:36:55 AM
I'm unable to replicate this, it seems to work ok for me. How does your inventory definition look like? Any errors in wme.log (missing images etc.)?
Title: Re: "next" & "prev" possible bug
Post by: CMK2901 on January 28, 2007, 07:10:11 PM
Sure; I have this in inventory.def:

Code: [Select]
INVENTORY_BOX
{
  ITEM_WIDTH = 65
  ITEM_HEIGHT = 65
  SPACING = 10
  SCROLL_BY = 1
  HIDE_SELECTED = FALSE

  AREA { 252, 0, 755, 90 }

  WINDOW
  {
    NAME = "Inventory"
    X = 0
    Y = 510
    WIDTH = 799
    HEIGHT = 90
    IMAGE = "interface\InventoryDialog\inv_background.png"
    MENU = FALSE
 
    BUTTON
    {
      NAME = "interactInv"
      IMAGE = "interface\InventoryDialog\interact_n.png"
      IMAGE_HOVER = "interface\InventoryDialog\interact_h.png"
      IMAGE_PRESS = "interface\InventoryDialog\interact_d.png"
      X = 0
      Y = 0
      PARENT_NOTIFY = TRUE
    }

    BUTTON
    {
      NAME = "lookInv"
      IMAGE = "interface\InventoryDialog\look_n.png"
      IMAGE_HOVER = "interface\InventoryDialog\look_h.png"
      IMAGE_PRESS = "interface\InventoryDialog\look_d.png"
      X = 84
      Y = 0
      PARENT_NOTIFY = TRUE
    }

    BUTTON
    {
      NAME = "pointerInv"
      IMAGE = "interface\InventoryDialog\pointer_n.png"
      IMAGE_HOVER = "interface\InventoryDialog\pointer_h.png"
      IMAGE_PRESS = "interface\InventoryDialog\pointer_d.png"
      X = 168
      Y = 0
      PARENT_NOTIFY = TRUE
    }

    BUTTON
    {
      NAME = "prev"
      IMAGE = "interface\InventoryDialog\arru_n.png"
      IMAGE_PRESS = "interface\InventoryDialog\arru_d.png"
      X = 755
      Y = 0
      PARENT_NOTIFY = TRUE
    }

    BUTTON
    {
      NAME = "next"
      IMAGE = "interface\InventoryDialog\arrd_n.png"
      IMAGE_PRESS = "interface\InventoryDialog\arrd_d.png"
      X = 755
      Y = 45
      PARENT_NOTIFY = TRUE
    }
  }
}

And if I rename the prev and next buttons to anything else, the button animation works, but as-is, it doesn't seem to respond.  Any ideas?? 

If there is a manual command for scrolling through the inventory besides using "next" and "prev", it would be easy enough to name them something else and then script the action in an "on" event statement.
Title: Re: "next" & "prev" possible bug
Post by: Mnemonic on January 28, 2007, 07:17:45 PM
Are those buttons actually enabled? WME automatically disables the "next" and "prev" buttons if there are not enough items to scroll. Since you don't have a separate image for the disabled state, they may appear to be enabled, while they are actually not.

And, yes, you can manually scroll the inventory by changing the Game.InventoryScrollOffset attribute.
Title: Re: "next" & "prev" possible bug
Post by: CMK2901 on January 29, 2007, 12:59:31 AM
Ah, yes.  That has to be it.

Thanks for the speedy replies!