Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Stop Item from interacting with Inventory Buttons  (Read 2938 times)

0 Members and 1 Guest are viewing this topic.

Darky

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 109
    • View Profile
    • Spreadcamp
Stop Item from interacting with Inventory Buttons
« 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
« Last Edit: June 17, 2010, 04:32:34 PM by Darky »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Stop Item from interacting with Inventory Buttons
« Reply #1 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.  
   
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Darky

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 109
    • View Profile
    • Spreadcamp
Re: Stop Item from interacting with Inventory Buttons
« Reply #2 on: June 17, 2010, 04:52:41 PM »

You saved my day, Mnemonic. Works like a charm!
I can't thank you enough :)
Logged
 

Page created in 0.02 seconds with 24 queries.