Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: RandomTiger on October 17, 2002, 08:09:45 am

Title: Adding key protocol
Post by: RandomTiger on October 17, 2002, 08:09:45 am
I have added a new functionality to the O KEY.
But Im wondering about how to code it properly so the key reassigns and everything.

Is there anything I should be aware of?
Title: Adding key protocol
Post by: Righteous1 on October 17, 2002, 09:31:22 am
As near as I can tell:

Add a #define to controlsconfig.h with a unique value:

#define MULTI_SELF_DESTRUCT                  106

Increment the MAX controls define (Index used above +1):

#define CCFG_MAX 107

Add you default key and text to the end of the following table in ControlsConfigCommon.cpp:

config_item Control_config[CCFG_MAX + 1] = {
//          ALT?  |     Shift?   | KB Key, j/s button, Menu,     Function description

I think thats it.  I think Bobboau is adding 4 new key mappings as well so those will have to be merged.
Title: Adding key protocol
Post by: mikhael on October 17, 2002, 10:18:15 am
Just out of curiosity, is there any reason NOT to write in dummys for unbound keys in advance? That way people could look at the CVS version, see what keys were already being used and use something else. Is there going to be a performance loss from hitting an 'unbound' key that calls:

Code: [Select]

bool noFunc(void)
{
     return true;
}
Title: Adding key protocol
Post by: RandomTiger on October 17, 2002, 01:57:05 pm
It doesnt really work that way mikhael
Title: Adding key protocol
Post by: mikhael on October 17, 2002, 03:42:12 pm
[edit]
Evidently deleting your own dumb questions is bad. so I'll just ***** about it instead.
[/edit]