Process Click for inventory

Started by Sam., Sat 26/03/2005 16:58:40

Previous topic - Next topic

Sam.

For my gui, i want inventory items to be used automatically when clicked, and only combined if a button is pressed. I want my inventory window to be opened up, then , when you click on an inventory item, it is used on the selected hotpot (selecting the hotspot is already done). I tried using the "runhotspotinteraction" but this doesn't allow for conditionals and such. Is there a way to simulate selecting an inventory ieam and running its interaction without moving it from your inventory and only clicking once?
Bye bye thankyou I love you.

Ishmael

You can do it with RunHotspotInteraction. Just in the on_mouse_click:

  if (button == LEFTINV) {
    RunHotspotInteraction(HOTSPOTNUM, 4);
  }


And replace HOTSPOTNUM with a variable which defines the hotspot it's used with. In the hotspot interactions, set up your interaction for the "Inventory used with hotspot" interaction as usual.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Sam.

no, that doesn't work, because you can't set it to specific inventory items.
Bye bye thankyou I love you.

Ishmael

I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Pumaman

You can use SetActiveInventory to change the active inv item before you call RunHotspotInteraction, then change it back afterwards if you like.

SMF spam blocked by CleanTalk