improved emoticon selector

This commit is contained in:
Jakob Fries 2007-08-15 10:18:01 +00:00
parent 6771066174
commit a49f78b66b
5 changed files with 28 additions and 16 deletions

View file

@ -938,7 +938,7 @@ static void client_run(const char *direct_connect_server)
} }
// screenshot button // screenshot button
if(inp_key_down(input::f10)) if(inp_key_down(config.key_screenshot))
gfx_screenshot(); gfx_screenshot();
// panic button // panic button

View file

@ -21,7 +21,7 @@ MACRO_CONFIG_INT(gfx_texture_compression, 0, 0, 1)
MACRO_CONFIG_INT(gfx_high_detail, 1, 0, 1) MACRO_CONFIG_INT(gfx_high_detail, 1, 0, 1)
MACRO_CONFIG_INT(gfx_texture_quality, 1, 0, 1) MACRO_CONFIG_INT(gfx_texture_quality, 1, 0, 1)
MACRO_CONFIG_INT(key_screenshot, 'Q', 32, 512)
MACRO_CONFIG_STR(masterserver, 128, "master.teewars.com") MACRO_CONFIG_STR(masterserver, 128, "master.teewars.com")

View file

@ -1586,6 +1586,8 @@ void render_game()
// center at char but can be moved when mouse is far away // center at char but can be moved when mouse is far away
float offx = 0, offy = 0; float offx = 0, offy = 0;
if (config.dynamic_camera)
{
int deadzone = 300; int deadzone = 300;
if(mouse_pos.x > deadzone) offx = mouse_pos.x-deadzone; if(mouse_pos.x > deadzone) offx = mouse_pos.x-deadzone;
if(mouse_pos.x <-deadzone) offx = mouse_pos.x+deadzone; if(mouse_pos.x <-deadzone) offx = mouse_pos.x+deadzone;
@ -1593,6 +1595,7 @@ void render_game()
if(mouse_pos.y <-deadzone) offy = mouse_pos.y+deadzone; if(mouse_pos.y <-deadzone) offy = mouse_pos.y+deadzone;
offx = offx*2/3; offx = offx*2/3;
offy = offy*2/3; offy = offy*2/3;
}
screen_x = local_player_pos.x+offx; screen_x = local_player_pos.x+offx;
screen_y = local_player_pos.y+offy; screen_y = local_player_pos.y+offy;
@ -1855,7 +1858,7 @@ void render_game()
return; return;
} }
if (inp_key_pressed('E')) if (inp_key_pressed(config.key_emoticon))
{ {
if (!emoticon_selector_active) if (!emoticon_selector_active)
{ {

View file

@ -775,6 +775,10 @@ static int settings_general_render()
ui_do_label(column1_x, row1_y, "Name:", 36); ui_do_label(column1_x, row1_y, "Name:", 36);
ui_do_edit_box(config_copy.player_name, column2_x, row1_y, 300, 36, config_copy.player_name, sizeof(config_copy.player_name)); ui_do_edit_box(config_copy.player_name, column2_x, row1_y, 300, 36, config_copy.player_name, sizeof(config_copy.player_name));
// Dynamic camera
ui_do_label(column1_x, row2_y, "Dynamic Camera:", 36);
config_set_dynamic_camera(&config_copy, ui_do_check_box(&config_copy.dynamic_camera, column2_x, row2_y, 22, 22, config_copy.dynamic_camera));
return 0; return 0;
} }
@ -802,6 +806,8 @@ static int settings_controls_render()
{ "Grenade:", &config_copy.key_weapon2, config_set_key_weapon2 }, { "Grenade:", &config_copy.key_weapon2, config_set_key_weapon2 },
{ "Shotgun:", &config_copy.key_weapon3, config_set_key_weapon3 }, { "Shotgun:", &config_copy.key_weapon3, config_set_key_weapon3 },
{ "Hammer:", &config_copy.key_weapon4, config_set_key_weapon4 }, { "Hammer:", &config_copy.key_weapon4, config_set_key_weapon4 },
{ "Emoticon:", &config_copy.key_emoticon, config_set_key_emoticon },
{ "Screenshot:", &config_copy.key_screenshot, config_set_key_screenshot },
}; };
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)

View file

@ -1,13 +1,16 @@
MACRO_CONFIG_INT(key_move_left, 65, 32, 512) MACRO_CONFIG_INT(key_move_left, 'A', 32, 512)
MACRO_CONFIG_INT(key_move_right, 68, 32, 512) MACRO_CONFIG_INT(key_move_right, 'D', 32, 512)
MACRO_CONFIG_INT(key_jump, 32, 32, 512) MACRO_CONFIG_INT(key_jump, 32, 32, 512)
MACRO_CONFIG_INT(key_fire, 384, 32, 512) MACRO_CONFIG_INT(key_fire, 384, 32, 512)
MACRO_CONFIG_INT(key_hook, 385, 32, 512) MACRO_CONFIG_INT(key_hook, 385, 32, 512)
MACRO_CONFIG_INT(key_weapon1, 49, 32, 512) MACRO_CONFIG_INT(key_weapon1, '1', 32, 512)
MACRO_CONFIG_INT(key_weapon2, 50, 32, 512) MACRO_CONFIG_INT(key_weapon2, '2', 32, 512)
MACRO_CONFIG_INT(key_weapon3, 51, 32, 512) MACRO_CONFIG_INT(key_weapon3, '3', 32, 512)
MACRO_CONFIG_INT(key_weapon4, 52, 32, 512) MACRO_CONFIG_INT(key_weapon4, '4', 32, 512)
MACRO_CONFIG_INT(key_emoticon, 'E', 32, 512)
MACRO_CONFIG_INT(scroll_weapon, 1, 0, 1) MACRO_CONFIG_INT(scroll_weapon, 1, 0, 1)
MACRO_CONFIG_INT(scorelimit, 20, 0, 1000) MACRO_CONFIG_INT(scorelimit, 20, 0, 1000)
MACRO_CONFIG_INT(timelimit, 0, 0, 1000) MACRO_CONFIG_INT(timelimit, 0, 0, 1000)
MACRO_CONFIG_INT(dynamic_camera, 1, 0, 1)