wow, when I screw up... :)

fix the broken bindings menus
This commit is contained in:
Bill Currie 2005-05-07 08:28:44 +00:00
parent 0cbfc6f801
commit 69bf8f3941

View file

@ -50,6 +50,7 @@ typedef struct binding_s binding_t;
@interface Binding : Object @interface Binding : Object
{ {
@public
string text; string text;
string command; string command;
string keys; string keys;
@ -63,8 +64,8 @@ typedef struct binding_s binding_t;
self = [self init]; self = [self init];
if (self) { if (self) {
text = binding.text; text = binding.text;
text = binding.command; command = binding.command;
text = binding.keys; keys = binding.keys;
} }
return self; return self;
} }
@ -171,12 +172,12 @@ void (Array list)
get_hash_keys = get_hash_keys =
{ {
local integer i,hlen; local integer i,hlen;
local binding_t [] binding; local Binding binding;
local string desc1 = "", desc2 = ""; local string desc1 = "", desc2 = "";
hlen = [list count]; hlen = [list count];
for(i = 0; i < hlen; i++) { for(i = 0; i < hlen; i++) {
binding = (binding_t [])[list getItemAt: i]; binding = [list getItemAt: i];
desc1 = get_keyname (binding.command, 1); // first key bound to desc1 = get_keyname (binding.command, 1); // first key bound to
desc2 = get_keyname (binding.command, 2); // second key bound to desc2 = get_keyname (binding.command, 2); // second key bound to
@ -228,7 +229,7 @@ load_keybindings =
It takes the binding as argument. It takes the binding as argument.
This function is called by the real callbacks. This function is called by the real callbacks.
*/ */
integer (binding_t [] binding, integer key) integer (Binding binding, integer key)
CB_MAIN_control_binding = CB_MAIN_control_binding =
{ {
local integer retval = 0, bindcnt = 0; local integer retval = 0, bindcnt = 0;
@ -269,7 +270,7 @@ CB_MAIN_control_binding =
integer (string text, integer key) integer (string text, integer key)
CB_basic_control_binding = CB_basic_control_binding =
{ {
local binding_t [] binding = (binding_t [])[movement_bindings getItemAt: stoi (text)]; local Binding binding = [movement_bindings getItemAt: stoi (text)];
local integer ret = CB_MAIN_control_binding (binding, key); local integer ret = CB_MAIN_control_binding (binding, key);
// fetch all keynames (possible to optimize.. but not very neccessary) // fetch all keynames (possible to optimize.. but not very neccessary)
@ -306,7 +307,7 @@ DRAW_basic_control_binding =
hl = [movement_bindings count]; hl = [movement_bindings count];
for(i = 0; i < hl; i++) { for(i = 0; i < hl; i++) {
local binding_t [] binding = (binding_t [])[movement_bindings getItemAt: i]; local Binding binding = [movement_bindings getItemAt: i];
draw_val_item (x + 20, y + 40 + ( i * 10), bind_desc_pad, draw_val_item (x + 20, y + 40 + ( i * 10), bind_desc_pad,
binding.text, binding.keys); binding.text, binding.keys);
} }
@ -346,7 +347,7 @@ MENU_basic_control_binding =
integer (string text, integer key) integer (string text, integer key)
CB_misc_control_binding = CB_misc_control_binding =
{ {
local binding_t [] binding = (binding_t [])[misc_bindings getItemAt: stoi (text)]; local Binding binding = [misc_bindings getItemAt: stoi (text)];
local integer ret = CB_MAIN_control_binding (binding, key); local integer ret = CB_MAIN_control_binding (binding, key);
// fetch all keynames (possible to optimize.. but not very neccessary) // fetch all keynames (possible to optimize.. but not very neccessary)
@ -383,7 +384,7 @@ DRAW_misc_control_binding =
hl = [misc_bindings count]; hl = [misc_bindings count];
for(i=0;i < hl; i++) { for(i=0;i < hl; i++) {
local binding_t [] binding = (binding_t [])[misc_bindings getItemAt: i]; local Binding binding = [misc_bindings getItemAt: i];
draw_val_item (x + 20, y + 40+(i*10), bind_desc_pad, draw_val_item (x + 20, y + 40+(i*10), bind_desc_pad,
binding.text, binding.keys); binding.text, binding.keys);
} }
@ -422,7 +423,7 @@ MENU_misc_control_binding =
integer (string text, integer key) integer (string text, integer key)
CB_weapon_control_binding = CB_weapon_control_binding =
{ {
local binding_t [] binding = (binding_t [])[weapon_bindings getItemAt: stoi (text)]; local Binding binding = [weapon_bindings getItemAt: stoi (text)];
local integer ret = CB_MAIN_control_binding (binding, key); local integer ret = CB_MAIN_control_binding (binding, key);
// fetch all keynames (possible to optimize.. but not very neccessary) // fetch all keynames (possible to optimize.. but not very neccessary)
@ -459,7 +460,7 @@ DRAW_weapon_control_binding =
hl = [weapon_bindings count]; hl = [weapon_bindings count];
for(i = 0; i < hl; i++) { for(i = 0; i < hl; i++) {
local binding_t [] binding = (binding_t [])[weapon_bindings getItemAt: i]; local Binding binding = [weapon_bindings getItemAt: i];
draw_val_item (x + 20, y + 40 + (i * 10), bind_desc_pad, draw_val_item (x + 20, y + 40 + (i * 10), bind_desc_pad,
binding.text, binding.keys); binding.text, binding.keys);
} }