Ypos inventory problem

Started by blenderhead, Fri 03/12/2004 15:23:56

Previous topic - Next topic

blenderhead

hi, im trying to create a mouse ypos inventory instead of a the default popup modal but when i choose  mouse Ypos and set the Ypos then test my game the inventory is on screen and when i close it, it wont apear when i move the pointer the to the y pos.

???

Ashen

When you say you 'close' it, do you mean with a GUIOff() command? (Or equivilent, if you're using the Interaction Editor)

If so, that might be your problem right there - as far as I know, doing that will disable Ypos GUIs so they don't pop up again, rather than just turn them off temporarily. Try leaving that command out - surely it will close on it's own when you move the cursor off it, anyway.

Alternatively, or if that's not practical, change the 'off button' script to turn the GUI off, then right back on again (e.g GUIOff (INV); GUIOn (INV);). This should close the inventory - and move your cursor so it won't turn it back on - but leave the GUI able to be opened when you move the cursor back to the Ypos.

If you didn't mean you used the GUIOff () command or equivilent, just ignore me.
I know what you're thinking ... Don't think that.

blenderhead

I didnt mean Gui off i havent acualy used the script im not to skilled at it but i dont think it should be a problem in this case/

ill try using the gui off gui on comant you gave me but where on the script do i put it?

Ashen

If you haven't used it, don't bother, it's probably not the problem I thought it was.

What did you mean by "when i close it", then? How have you set up your Inventory GUI (especially if you haven't gotten into the script)?
I know what you're thinking ... Don't think that.

blenderhead

#4
by closing it i mean clicking on the OK button


i have another problem i have changed the iconbar to y pos it opens fine but i wont it to go away when i move my cursor away from it but it just stays there. (solved)

but the inventory is still a problem ???


Ashen

OK, I see - you're using the default GUI, you've just changed it to Ypos?
In that case - the OK button does run GUIOff() in script, without you having to do anything.
You need to:
Open up the script editor. Click 'Script' on the menu bar, and choose 'interface_click' from the drop-down list. This is the bit of the script that deals with clicks on the GUIs. Find the line that says something like:
Code: ags

if (interface == INVENTORY) {

(Might be slightly different, if you've renamed the GUI, for example)
Scroll down a bit more, until you find the bit that deals with the OK button:
Code: ags

if (button == 3) {
      // They pressed the OK button, close the GUI
      GUIOff (INVENTORY);
      SetDefaultCursor();
    }

and add the GUIOn command:
Code: ags

if (button == 3) {
      // They pressed the OK button, close the GUI
      GUIOff (INVENTORY);
      GUIOn (INVENTORY);
      SetDefaultCursor();
    }




I'm not quite sure what your second question means - ICONBAR is Ypos by default, so I don't see how you've changed it to that. What is the 'Popup Ypos' set to?
I know what you're thinking ... Don't think that.

blenderhead

ok i changed the script but it seem to have done the opposite my inventory is initualy visible and when i put my pointer to  mouse position it dissapears also when i click on any button or item in the inventory it dissapears untill i move the pointer away,
and the buttons dont do what they are supose to ?


its ok i solved the second question.

Ashen

Odd, it works for me.
It might be that having 2 Ypos GUIs is confusing the engine, which is why only one works right.

How do you mean, the buttons don't do what they're supposed to? Have they 'swapped' functions (e.g. the Look button closes it, and the OK button changes the mode), or are they just not doing anything?
I know what you're thinking ... Don't think that.

blenderhead

its ok im ive changed the inventory back to popup and its ok now thanks for your help     :)

Pumaman

The Mouse Ypos setting is really only intended for icon bars, because it will only remove the GUI if you move the mouse below the bottom of the GUI.

If you want the inventory window to pop up when you move the mouse to the top of the screen, you'd need to do that manually with scripting. Since you don't seem very familiar with scripting yet, I'd leave it for now.

SMF spam blocked by CleanTalk