Trouble with a Broken Sword-ish interface.

Started by Eggie, Sun 02/11/2003 20:45:34

Previous topic - Next topic

Eggie

I'm using a ProcessClick() command in my on_mouse_click function. And, of course it doesn't work on the GUI's....

So...Could i please request some help from people more inteligent than myself?

Ishmael

Sorry, I haven't played Broken Sword, so I can't straight off tell what you need to do... If you explain a bit better *what* should happen wen you do *what*? I would gladly help if I knew better what you're after... :)
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.

SSH

Do you mean right-clicks on the inventory, or something like that? I have been thinking about doing a BS style GUI myself. The dialogs are too much work at the moment, but the rest aint too bad.

Are are you looking for the interface_click function or RunInventoryInteration, or what?

12

Eggie

Ah...I should explain myself in a more coherent fashion.
Spibbly jibbly plop.

I have the script set up sp that if you right click it runs the 'look' interaction and if you left-click it runs the 'use' interaction.

The trouble is it doesn't register GUI button clicks.

Ishmael

function on_mouse_click (int button) {
if (button == LEFTINV) // left click on inv item
if (button == RIGHTINV) // right click on inv item
}

and check the 'handle inventory clicks in script' in the General Settings.

;)
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.

SSH

Have you got the Game Option "Handle Inventory clicks in script" option set? Are you using LEFTINV, RIGHTINV instead of LEFT/RIGHT for button matching?
12

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.

SSH

12

Eggie

Okay...it seems that ,yet again, I have mislead you.
Look like i'll have to re-explain myself...again.

I can't use it on GUI buttons. By this I mean things such as 'Inventory' and 'Save Game'. I'm pretty sure the inventory objects will will work fine.

Here's a section of the code:

function on_mouse_click(int button) {
 // called when a mouse button is clicked. button is either LEFT or RIGHT
 if (IsGamePaused() == 1) {
   // Game is paused, so do nothing (ie. don't allow mouse click)
 }
 else if (button==LEFT) { //left-click, use
   ProcessClick(mouse.x,mouse.y,MODE_WALK);
   ProcessClick(mouse.x, mouse.y, MODE_USE);
   //This is my code. But it doesn't work on GUI
  //   buttons.
 }
 else {   // right-click, look
   ProcessClick(mouse.x, mouse.y, MODE_LOOK);
 }
}

function interface_click(int interface, int button) {
 if (interface == ICONBAR) {
   if (button == 0) {  // show inventory
     show_inventory_window();
  //and these are the GUI buttons that don't work
   }
   else if (button == 1)    // save game
     SaveGameDialog();
   else if (button == 2)   // load game
     RestoreGameDialog();
   else if (button == 3)   // quit
     QuitGame(1);
 }  // end if interface ICONBAR

Eggie

On second thought, it's probably because I forgot to set the Left-click actions for the GUI buttons...

:-[

Dave Gilbert

Ahh, you beat me to it.  Yes, I once had that same problem myself.  I spent AGES going over my damn code only to discover that little checkbox that I didn't click...

SMF spam blocked by CleanTalk