Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Darky on June 17, 2010, 04:27:57 PM

Title: Stop Item from interacting with Inventory Buttons
Post by: Darky on June 17, 2010, 04:27:57 PM
Hello everyone, I have a problem with my inventory. I hope it's not a engine limitation I stumbled upon :)

When I take an item out of the inventory and try to leftclick buttons like next, prev, etc from the inventory it presses the button as it should but it also trys to make an interaction with the item. Because of that everytime I click for example "next" while having an item it would scroll but my main character would also say things like "I can't do that." - how can I fix that??

Thank you very much in advance
Darky
Title: Re: Stop Item from interacting with Inventory Buttons
Post by: Mnemonic on June 17, 2010, 04:36:16 PM
In game.script, in LeftClick handler, there's the code for using an inventory item:

Code: WME Script
  1.     // using an inventory item on another object
  2.     else if(Game.SelectedItem != null && Game.SelectedItem!=ActObj)
  3.     {
  4.  

You will need to expand the condition to something like:

Code: WME Script
  1.     else if(Game.SelectedItem != null && Game.SelectedItem != ActObj && ActObj.Type != "button")
  2.  
   
Title: Re: Stop Item from interacting with Inventory Buttons
Post by: Darky on June 17, 2010, 04:52:41 PM
You saved my day, Mnemonic. Works like a charm!
I can't thank you enough :)