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?
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... :)
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?
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.
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.
;)
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?
Ha! ;D
Beaten by "Quick Draw TK" :(
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
On second thought, it's probably because I forgot to set the Left-click actions for the GUI buttons...
:-[
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...