diff --git a/actors.c b/actors.c index e8a9c95e5..fe4aeb87a 100755 --- a/actors.c +++ b/actors.c @@ -378,6 +378,28 @@ static void set_food_color(float percent, float multiplier, float a) set_banner_colour_general(zero_food, full_food, percent, multiplier, a); } +static void check_for_banner_now_off(void) +{ + static int banner_was_on = -1; + int banner_is_on = view_names||view_hp||view_health_bar||view_ether_bar||view_ether||view_food_bar||view_food; + if (banner_was_on == -1) + banner_was_on = banner_is_on; + else + { + if ((banner_was_on != banner_is_on) && (banner_is_on == 0)) + { + char str[200]; + char key_str[20]; + str[0] = '\0'; + safe_strcat(str, banner_off_help_str, sizeof(str)); + safe_strcat(str, get_key_string(K_VIEWNAMES, key_str, sizeof(key_str)), sizeof(str)); + safe_strcat(str, "].", sizeof(str)); + LOG_TO_CONSOLE(c_red1, str); + } + banner_was_on = banner_is_on; + } +} + static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) { unsigned char str[60]; @@ -427,6 +449,8 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) int display_ether_line = 0; int display_food_line = 0; + check_for_banner_now_off(); + if (displaying_me && first_person) return; //if not drawing me, can't display ether/food or ether/food bar diff --git a/translate.c b/translate.c index cccf2dffc..0b53a7ef5 100644 --- a/translate.c +++ b/translate.c @@ -536,6 +536,7 @@ char name_too_long[75], commands_help_not_recognsed_str[40], commands_help_description_help_str[100], commands_help_search_help_str[100], + banner_off_help_str[100], cmd_ignores[20], cmd_ignore[20], cmd_unignore[20], @@ -1180,6 +1181,7 @@ void init_console() add_xml_identifier(misc, "commands_help_not_recognsed", commands_help_not_recognsed_str, "Unrecognised command", sizeof(commands_help_not_recognsed_str)); add_xml_identifier(misc, "commands_help_description_help", commands_help_description_help_str, "For help on a particular command, use ## .", sizeof(commands_help_description_help_str)); add_xml_identifier(misc, "commands_help_search_help", commands_help_search_help_str, "To search command name and description, use #? .", sizeof(commands_help_search_help_str)); + add_xml_identifier(misc, "banner_off_help", banner_off_help_str, "Player banner off. To restore enable an option, e.g. names [", sizeof(banner_off_help_str)); add_xml_identifier(loading_msg,"init_opengl",init_opengl_str,"Initializing OpenGL extensions",sizeof(init_opengl_str)); add_xml_identifier(loading_msg,"init_random",init_random_str,"Generating random seed",sizeof(init_random_str)); diff --git a/translate.h b/translate.h index 58880c688..38e4c8fc8 100644 --- a/translate.h +++ b/translate.h @@ -280,6 +280,7 @@ extern char commands_help_not_recognsed_str[40], commands_help_description_help_str[100], commands_help_search_help_str[100], + banner_off_help_str[100], cmd_ignores[20], cmd_ignore[20], cmd_unignore[20],