diff options
| author | Jakob Fries <jakob.fries@gmail.com> | 2008-01-18 15:55:03 +0000 |
|---|---|---|
| committer | Jakob Fries <jakob.fries@gmail.com> | 2008-01-18 15:55:03 +0000 |
| commit | 7b73f1505212f7235db0987fb4e52549fdd73fb5 (patch) | |
| tree | 4a7552c382e707cb463ab5bf7f5808e5d2124d9b /src/game/client/gc_hooks.cpp | |
| parent | 57c47659930c5e01ae5d3e8cef51c06d28d20508 (diff) | |
| download | zcatch-7b73f1505212f7235db0987fb4e52549fdd73fb5.tar.gz zcatch-7b73f1505212f7235db0987fb4e52549fdd73fb5.zip | |
Console is now accessable in-game and has more commands: connect, disconnect, quit.
Diffstat (limited to 'src/game/client/gc_hooks.cpp')
| -rw-r--r-- | src/game/client/gc_hooks.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/game/client/gc_hooks.cpp b/src/game/client/gc_hooks.cpp index d70e84a5..34196eaa 100644 --- a/src/game/client/gc_hooks.cpp +++ b/src/game/client/gc_hooks.cpp @@ -25,6 +25,10 @@ extern void menu_init(); extern bool menu_active; extern bool menu_game_active; +extern "C" void modc_preinit() +{ + client_console_init(); +} extern "C" void modc_init() { @@ -37,8 +41,6 @@ extern "C" void modc_init() gfx_text_set_default_font(&default_font); menu_init(); - - client_console_init(); // setup sound channels snd_set_channel(CHN_GUI, 1.0f, 0.0f); @@ -299,6 +301,8 @@ extern "C" void modc_render() if(client_state() == CLIENTSTATE_ONLINE) { render_game(); + if (console_active()) + console_render(); // handle team switching // TODO: FUGLY!!! @@ -314,10 +318,8 @@ extern "C" void modc_render() { menu_render(); if (console_active()) - { console_render(); - return; - } + return; } // @@ -346,10 +348,22 @@ extern "C" int modc_snap_input(int *data) else { input_data.state = STATE_PLAYING; - input_data.left = inp_key_state(config.key_move_left); - input_data.right = inp_key_state(config.key_move_right); - input_data.hook = inp_key_state(config.key_hook); - input_data.jump = inp_key_state(config.key_jump); + + // TODO: this doesn't feel too pretty... look into it? + if (console_active()) + { + input_data.left = 0; + input_data.right = 0; + input_data.hook = 0; + input_data.jump = 0; + } + else + { + input_data.left = inp_key_state(config.key_move_left); + input_data.right = inp_key_state(config.key_move_right); + input_data.hook = inp_key_state(config.key_hook); + input_data.jump = inp_key_state(config.key_jump); + } } // stress testing |