Thread: Graal Controls.
View Single Post
  #6  
Old 08-07-2008, 10:24 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
With this, add a script function:
PHP Code:
bindfunction(idtextmulti);
Adds a function to the list of bind-able keys with the given id.
  
id (string) - The new button will have this unique ID.  If the ID already existsthe old button will be replaced with the new.
  
text (string) - The button's name will be displayed to the user as this.
  multi (bool) - If true, the function can be applied to more then one button.

Example: bindfunction(duck, "Crouch", 0);
This would add a button to the listen of buttons that would be labeled as "Crouch". 
Might want an unbindfunction(id), too.

As well as a function call:
PHP Code:
function onBoundDown(idtextcodekey) {}
Is triggered when a key that is bound with a function created by bindfunction() is pressed.
  
id (string) - The unique ID of the function.
  
text (string) - The text of the button (same text you put for bindfunction()).
  
code (int) - Keycode of the key pressed. (Just like onkeydown)
  
key (string) - The letter of the key pressed. (Just like onkeydown
Would be nice also if you made a similar call for onBoundUp() as well.

With these two added, everyone can use the same key configuration window. The bindfunction() functions will mostly be called when you log onto the server, and then will be unbound when you log off.

New functions would have to show up as unassigned buttons in another windows or part of the gui. Then just drag the unassigned buttons to a key on the keyboard.
__________________
Do it with a DON!
Reply With Quote