From d13e62438f5adea75f4003f8900ab2231b4a9b49 Mon Sep 17 00:00:00 2001 From: Paul Broadhead Date: Sun, 26 Mar 2023 21:59:56 +0100 Subject: [PATCH] Forum Topic 61841: Yellow Food Bar option for player banner. Added option for food level bar ALT+y and numbers CTRL-y as part of the player banner. The colour is yellow when full and moves to dark orange for empty. Also fixed: 1) Issue where background width would increase due to smallest numbers. 2) Issue where no clickable region remained when the banner is fully off. --- actors.c | 169 +++++++++++++++++++++++++++++++++++----------- elconfig.c | 2 +- gamewin.c | 22 ++++-- init.c | 4 ++ interface.c | 2 + interface.h | 2 + keys.c | 4 +- keys.h | 2 + named_colours.cpp | 2 + translate.c | 4 +- translate.h | 2 +- 11 files changed, 165 insertions(+), 50 deletions(-) diff --git a/actors.c b/actors.c index a51d3a4e8..e8a9c95e5 100755 --- a/actors.c +++ b/actors.c @@ -13,6 +13,7 @@ #include "errors.h" #include "events.h" #include "gl_init.h" +#include "hud_statsbar_window.h" #include "interface.h" #include "load_gl_extensions.h" #include "map.h" @@ -320,41 +321,62 @@ static void set_health_color(actor * actor_id, float percent, float multiplier, glColor4f(r*multiplier,g*multiplier,0.0f, a); } -static void set_mana_color(float percent, float multiplier, float a) +static void set_banner_colour_general(GLfloat zero_colours[3], GLfloat full_colours[3], float percent, float multiplier, float alpha) { - static int have_colours = 0; - static GLfloat full_mana[3], zero_mana[3]; GLfloat use_colours[3]; size_t i; - // get the mana colour range - if (!have_colours) - { - elglGetColour3v("banner.mana.full", full_mana); - elglGetColour3v("banner.mana.zero", zero_mana); - have_colours = 1; - } - - // not dynamic so just to full mana colour + // not dynamic so just to full colour if (!dynamic_banner_colour.yourself) { - glColor4f(multiplier * full_mana[0], multiplier * full_mana[1], full_mana[2], a); + glColor4f(multiplier * full_colours[0], multiplier * full_colours[1], full_colours[2], alpha); return; } - // dynamic so find step between full and zero mana for each colour + // dynamic so find step between full and zero for each colour for (i = 0; i < 3; i++) { - use_colours[i] = full_mana[i] + (zero_mana[i] - full_mana[i]) * (1.0f - percent); + use_colours[i] = full_colours[i] + (zero_colours[i] - full_colours[i]) * (1.0f - percent); if (use_colours[i] < 0.0f) use_colours[i] = 0.0f; else if (use_colours[i] > 1.0f) use_colours[i] = 1.0f; } - glColor4f(multiplier * use_colours[0], multiplier * use_colours[1], use_colours[2], a); + glColor4f(multiplier * use_colours[0], multiplier * use_colours[1], use_colours[2], alpha); +} + +static void set_mana_color(float percent, float multiplier, float a) +{ + static int have_colours = 0; + static GLfloat full_mana[3], zero_mana[3]; + + // get the mana colour range + if (!have_colours) + { + elglGetColour3v("banner.mana.full", full_mana); + elglGetColour3v("banner.mana.zero", zero_mana); + have_colours = 1; + } + + set_banner_colour_general(zero_mana, full_mana, percent, multiplier, a); } +static void set_food_color(float percent, float multiplier, float a) +{ + static int have_colours = 0; + static GLfloat full_food[3], zero_food[3]; + + // get the food colour range + if (!have_colours) + { + elglGetColour3v("banner.food.full", full_food); + elglGetColour3v("banner.food.zero", zero_food); + have_colours = 1; + } + + set_banner_colour_general(zero_food, full_food, percent, multiplier, a); +} static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) { @@ -378,7 +400,9 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) //we use health bar variables if possible, all the extras we need for ether bar are: double ether_str_x_len = 0; double etherbar_x_len_converted=0; - GLdouble name_bot_y, health_bot_y, ether_bot_y; + double food_str_x_len = 0; + double foodbar_x_len_converted=0; + GLdouble name_bot_y, health_bot_y, ether_bot_y, food_bot_y; //some general values valid for whole banner double bar_x_len = 0; @@ -392,6 +416,8 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) int display_health_bar = view_health_bar; int display_ether_bar = view_ether_bar; int display_ether = view_ether; + int display_food_bar = view_food_bar; + int display_food = view_food; int display_banner_alpha = use_alpha_banner; //some general info about "what's going on" - allows not to repeat complex conditions later @@ -399,13 +425,16 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) int displaying_other_player = 0; int display_health_line = 0; int display_ether_line = 0; + int display_food_line = 0; if (displaying_me && first_person) return; - //if not drawing me, can't display ether and ether bar + //if not drawing me, can't display ether/food or ether/food bar if (!displaying_me) { display_ether_bar = 0; display_ether = 0; + display_food_bar = 0; + display_food = 0; } //if instance mode enabled, overwrite default view banner view options according to it @@ -495,7 +524,7 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) { float font_scale2 = font_scale*powf(1.0f+((float)abs(actor_id->damage)/2.0f)/1000.0f, 4.0); int extra_y = (view_mode_instance && displaying_me) ?view_mode_instance_damage_height * bar_y_len : 0; - int lines = (!(view_mode_instance && displaying_me) && (display_hp || display_health_bar) && (display_ether || display_ether_bar)) ? 3 : 2; + int lines = (!(view_mode_instance && displaying_me) && (display_hp || display_health_bar) && (display_ether || display_ether_bar) && (display_food || display_food_bar)) ? 3 : 2; draw_ortho_ingame_string(hx - 0.5f * (float)get_string_width_zoom(str, NAME_FONT, font_scale2*0.17), a_bounce + hy + extra_y + get_text_height(lines, NAME_FONT, name_zoom), 0, str, 1, NAME_FONT, font_scale2*.14, font_scale2*.14); @@ -523,6 +552,7 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) //figure out which lines should we display display_health_line = (actor_id->kind_of_actor != NPC && (display_hp || display_health_bar) && actor_id->cur_health > 0 && actor_id->max_health > 0); display_ether_line = ((display_ether || display_ether_bar) && displaying_me && your_info.ethereal_points.base > 0 ); + display_food_line = ((display_food || display_food_bar) && displaying_me); if (view_mode_instance && displaying_me) { //make your bar a bit more above everything else so you can see it good enough //and got no problems with attacking mobs @@ -531,15 +561,16 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) // calculate the bottom y coord for the displayed info lines, keep centred around a the same point whether 3, 2 or 1 line being displays hy += bar_y_len; - name_bot_y = (display_names) ?hy + (display_health_line * bar_y_len / 2) + (display_ether_line * bar_y_len / 2) :0.0; - health_bot_y = (display_health_line) ?hy - (display_names * bar_y_len / 2) + (display_ether_line * bar_y_len / 2) :0.0; - ether_bot_y = (display_ether_line) ?hy -(display_names * bar_y_len / 2) - (display_health_line * bar_y_len / 2) : 0.0; - // printf("hy=%.1lf name=%.1lf health=%.1lf ether=%.1lf\n", hy, name_bot_y, health_bot_y, ether_bot_y); + name_bot_y = (display_names) ?hy + (display_health_line * bar_y_len / 2) + (display_ether_line * bar_y_len / 2) + (display_food_line * bar_y_len / 2) :0.0; + health_bot_y = (display_health_line) ?hy - (display_names * bar_y_len / 2) + (display_ether_line * bar_y_len / 2) + (display_food_line * bar_y_len / 2) :0.0; + ether_bot_y = (display_ether_line) ?hy -(display_names * bar_y_len / 2) - (display_health_line * bar_y_len / 2) + (display_food_line * bar_y_len / 2) : 0.0; + food_bot_y = (display_food_line) ?hy -(display_names * bar_y_len / 2) - (display_health_line * bar_y_len / 2) - (display_ether_line * bar_y_len / 2) : 0.0; + // printf("hy=%.1lf name=%.1lf health=%.1lf ether=%.1lf\n", hy, name_bot_y, health_bot_y, ether_bot_y, food_bot_y); // main block that draws the name, health and ether text if (!((first_person)&&(actor_id->actor_id==yourself))) { - if(actor_id->actor_name[0] && (display_names || display_health_line || display_ether_line)) + if(actor_id->actor_name[0] && (display_names || display_health_line || display_ether_line || display_food_line)) { if (display_names) { @@ -565,9 +596,10 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) draw_buffs(actor_id, hx, hy, hz); } - if( (!actor_id->dead) && (actor_id->kind_of_actor != NPC) && (display_health_line || display_ether_line)){ + if( (!actor_id->dead) && (actor_id->kind_of_actor != NPC) && (display_health_line || display_ether_line || display_food_line)){ unsigned char hp[200]; unsigned char mana[200]; + unsigned char food[200]; double health_str_x_len = 0.0; // make the heath bar the same length as the the health text so they are balanced @@ -579,18 +611,22 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) sprintf((char*)mana,"%d/%d", your_info.ethereal_points.cur, your_info.ethereal_points.base); ether_str_x_len=(float)get_string_width_zoom(mana, NAME_FONT, stat_font_size); } - //set bar length to longer one (mana or health) - not really clean solution - if (ether_str_x_len > health_str_x_len) { - bar_x_len = ether_str_x_len; - } else { - bar_x_len = health_str_x_len; + if (display_food || display_food_bar) { + sprintf((char*)food,"%d/%d", your_info.food_level, max_food_level); + food_str_x_len=(float)get_string_width_zoom(food, NAME_FONT, stat_font_size); } + //set bar length to longer one (mana, food or health) - not really clean solution + bar_x_len = health_str_x_len; + if (ether_str_x_len > bar_x_len) + bar_x_len = ether_str_x_len; + if (food_str_x_len > bar_x_len) + bar_x_len = food_str_x_len; - if (display_hp || display_ether) { + if (display_hp || display_ether || display_food) { float hp_off=(bar_x_len - health_str_x_len)/2.0; float eth_off=(bar_x_len - ether_str_x_len)/2.0; - float disp; - disp=(bar_x_len/2.0); + float food_off=(bar_x_len - food_str_x_len)/2.0; + float disp=(bar_x_len/2.0); if(display_health_bar){ hp_off+=5.0+disp; @@ -598,11 +634,18 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) if(display_ether_bar){ eth_off+=5.0+disp; } - if (display_hp && (disp+hp_off > banner_width)) { - banner_width = disp + hp_off; + if(display_food_bar){ + food_off+=5.0+disp; + } + + if (display_hp && ((health_str_x_len/2 + hp_off) > banner_width)) { + banner_width = health_str_x_len/2 + hp_off; + } + if (display_ether && ((ether_str_x_len/2 + eth_off) > banner_width)) { + banner_width = ether_str_x_len/2 + eth_off; } - if (display_ether && (disp+eth_off > banner_width)) { - banner_width = disp + eth_off; + if (display_food && ((food_str_x_len/2 + food_off) > banner_width)) { + banner_width = food_str_x_len/2 + food_off; } if (display_hp) { @@ -617,6 +660,12 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) draw_ortho_ingame_string(hx - disp + eth_off, ether_bot_y, hz, mana, 1, NAME_FONT, stat_font_size, stat_font_size); } + + if (display_food) { + set_food_color((float)your_info.food_level / (float)max_food_level, 1.0f, 1.0f); + draw_ortho_ingame_string(hx - disp + food_off, food_bot_y, + hz, food, 1, NAME_FONT, stat_font_size, stat_font_size); + } } } } @@ -744,9 +793,49 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) hx+=off; } + if (display_food_bar && display_food_line) { + float percentage = (float)your_info.food_level / (float)max_food_level; + float off; + float top_y = food_bot_y + bar_y_len / 3.0; + float bot_y = food_bot_y + 2 * bar_y_len / 3.0; + if(percentage>1.0f) // limit bar length + percentage = 1.0f; + if (display_food){ + off = bar_x_len + 5.0f; + } else { + off = bar_x_len / 2.0f; + } + if (bar_x_len / 2.0f > banner_width) { + banner_width = bar_x_len / 2.0f; + } + hx-=off; + + set_food_color(percentage, 0.5f, 1.0f); + foodbar_x_len_converted = percentage * bar_x_len; + glBegin(GL_QUADS); + glVertex3d(hx, top_y, hz); + glVertex3d(hx + foodbar_x_len_converted, top_y, hz); + + set_food_color(percentage, 1.0f, 1.0f); + + glVertex3d(hx + foodbar_x_len_converted, bot_y, hz); + glVertex3d(hx, bot_y, hz); + glEnd(); + set_health_color(actor_id, percentage, 1.0f, 1.0f); + glDepthFunc(GL_LEQUAL); + glColor3f (0.0f, 0.0f, 0.0f); + glBegin(GL_LINE_LOOP); + glVertex3f (hx - 1.0, top_y - 1.0 , hz); + glVertex3f (hx + bar_x_len + 1.0, top_y - 1.0, hz); + glVertex3f (hx + bar_x_len + 1.0, bot_y + 1.0, hz); + glVertex3f (hx - 1.0, bot_y + 1.0, hz); + glEnd(); + hx+=off; + } + // draw the alpha background (if ness) - y_bottom = ((ether_bot_y > 0) ?ether_bot_y :((health_bot_y > 0) ?health_bot_y : name_bot_y)) - 0.2 * bar_y_len; - y_top = ((name_bot_y > 0) ?name_bot_y :((health_bot_y > 0) ?health_bot_y : ether_bot_y)) + 1.2 * bar_y_len; + y_bottom = ((food_bot_y > 0) ?food_bot_y :((ether_bot_y > 0) ?ether_bot_y :((health_bot_y > 0) ?health_bot_y : name_bot_y))) - 0.2 * bar_y_len; + y_top = ((name_bot_y > 0) ?name_bot_y :((health_bot_y > 0) ?health_bot_y : ((ether_bot_y > 0) ? ether_bot_y : food_bot_y))) + 1.2 * bar_y_len; if (display_banner_alpha && banner_width > 0) { //if banner width > 0 there MUST be something displayed in the banner banner_width += name_zoom * 3; @@ -781,6 +870,8 @@ static void draw_actor_banner(actor *actor_id, const actor *me, float offset_z) /* use the same calculation as for the alpha background but have a fallback if no banner shown */ int xoff = (banner_width > 0) ?banner_width: 60; int yoff = (banner_width > 0) ?y_top - y_bottom: bar_y_len; + if (y_bottom < 0) + y_bottom = hy; if ((mouse_x > hx-xoff) && (mouse_x < hx+xoff) && ((window_height - mouse_y) > y_bottom) && ((window_height - mouse_y) < (y_bottom + yoff))) cm_mouse_over_banner = 1; diff --git a/elconfig.c b/elconfig.c index 868691c50..76c2cc954 100755 --- a/elconfig.c +++ b/elconfig.c @@ -2995,7 +2995,7 @@ static void init_ELC_vars(void) add_var(OPT_BOOL,"show_poison_count", "poison_count", &show_poison_count, change_var, 0, "Show Food Poison Count", "Displays on the poison drop icon, the number of times you have been food poisoned since last being free of poison.",HUD); - add_var(OPT_BOOL,"your_dynamic_banner_colour", "ydbc", &dynamic_banner_colour.yourself, change_var, 1, "Dynamic Health and Mana Banner Colours", "Dynamically change the colour of your health and mana banner. For example, the health banner changes from green to red as you loose health.",HUD); + add_var(OPT_BOOL,"your_dynamic_banner_colour", "ydbc", &dynamic_banner_colour.yourself, change_var, 1, "Dynamic Health, Mana and Food Banner Colours", "Dynamically change the colour of your health, mana and food banner. For example, the health banner changes from green to red as you loose health.",HUD); add_var(OPT_BOOL,"player_dynamic_banner_colour", "pdbc", &dynamic_banner_colour.other_players, change_var, 1, "Dynamic Other Players Health Banner Colour", "Dynamically change the colour of the health banner for other players. It changes from green to red as they loose health.",HUD); add_var(OPT_BOOL,"creature_dynamic_banner_colour", "cdbc", &dynamic_banner_colour.creatures, change_var, 1, "Dynamic Creatures Health Banner Colour", "Dynamically change the colour of the health banner for creatures. It changes from green to red as they loose health.",HUD); diff --git a/gamewin.c b/gamewin.c index 126848642..9475802c2 100644 --- a/gamewin.c +++ b/gamewin.c @@ -841,12 +841,14 @@ static int click_game_handler(window_info *win, int mx, int my, Uint32 flags) cm_bool_line(cm_id, 2, &view_hp, NULL); cm_bool_line(cm_id, 3, &view_ether_bar, NULL); cm_bool_line(cm_id, 4, &view_ether, NULL); - cm_bool_line(cm_id, 5, &view_mode_instance, "use_view_mode_instance"); - cm_bool_line(cm_id, 6, &view_chat_text_as_overtext, NULL); - cm_bool_line(cm_id, 7, &use_alpha_banner, "use_alpha_banner"); - cm_bool_line(cm_id, 8, &sit_lock, "sit_lock"); - cm_bool_line(cm_id, 9, &ranging_lock, NULL); - cm_bool_line(cm_id, 11, &cm_banner_disabled, "cm_banner_disabled"); + cm_bool_line(cm_id, 5, &view_food_bar, NULL); + cm_bool_line(cm_id, 6, &view_food, NULL); + cm_bool_line(cm_id, 7, &view_mode_instance, "use_view_mode_instance"); + cm_bool_line(cm_id, 8, &view_chat_text_as_overtext, NULL); + cm_bool_line(cm_id, 9, &use_alpha_banner, "use_alpha_banner"); + cm_bool_line(cm_id, 10, &sit_lock, "sit_lock"); + cm_bool_line(cm_id, 11, &ranging_lock, NULL); + cm_bool_line(cm_id, 13, &cm_banner_disabled, "cm_banner_disabled"); } cm_show_direct(cm_id, -1, -1); reset_cursor_time = SDL_GetTicks(); @@ -2128,6 +2130,14 @@ int keypress_root_common (SDL_Keycode key_code, Uint32 key_unicode, Uint16 key_m { view_ether_bar = !view_ether_bar; } + else if (KEY_DEF_CMP(K_VIEWFOOD, key_code, key_mod)) + { + view_food = !view_food; + } + else if (KEY_DEF_CMP(K_FOODBAR, key_code, key_mod)) + { + view_food_bar = !view_food_bar; + } else if (KEY_DEF_CMP(K_VIEWTEXTASOVERTEXT, key_code, key_mod)) { view_chat_text_as_overtext = !view_chat_text_as_overtext; diff --git a/init.c b/init.c index d28ef2503..ef56b1708 100644 --- a/init.c +++ b/init.c @@ -229,9 +229,11 @@ static void load_cstate(void) view_health_bar = json_cstate_get_bool("overhead", "view_health_bar", 0); view_ether_bar = json_cstate_get_bool("overhead", "view_ether_bar", 0); + view_food_bar = json_cstate_get_bool("overhead", "view_food_bar", 0); view_names = json_cstate_get_bool("overhead", "view_names", 0); view_hp = json_cstate_get_bool("overhead", "view_hp", 0); view_ether = json_cstate_get_bool("overhead", "view_ether", 0); + view_food = json_cstate_get_bool("overhead", "view_food", 0); { size_t i; @@ -549,9 +551,11 @@ static void save_cstate(void) json_cstate_set_bool("overhead", "view_health_bar", view_health_bar); json_cstate_set_bool("overhead", "view_ether_bar", view_ether_bar); + json_cstate_set_bool("overhead", "view_food_bar", view_food_bar); json_cstate_set_bool("overhead", "view_names", view_names); json_cstate_set_bool("overhead", "view_hp", view_hp); json_cstate_set_bool("overhead", "view_ether", view_ether); + json_cstate_set_bool("overhead", "view_food", view_food); { size_t i; diff --git a/interface.c b/interface.c index 53d9abed5..b049c7869 100755 --- a/interface.c +++ b/interface.c @@ -64,9 +64,11 @@ dynamic_banner_colour_def dynamic_banner_colour = int have_a_map=0; int view_health_bar=1; int view_ether_bar=0; +int view_food_bar=0; int view_names=1; int view_hp=0; int view_ether=0; +int view_food=0; int view_chat_text_as_overtext=0; int view_mode_instance=0; float view_mode_instance_banner_height=5.0f; diff --git a/interface.h b/interface.h index 050c8936b..e3198014d 100644 --- a/interface.h +++ b/interface.h @@ -45,9 +45,11 @@ extern dynamic_banner_colour_def dynamic_banner_colour; /*!<* health (and mana b extern int view_health_bar; /*!< indicates whether we should display the health bar or not */ extern int view_ether_bar; /*!< indicates whether we should display the ethereal bar or not */ +extern int view_food_bar; /*!< indicates whether we should display the food bar or not */ extern int view_names; /*!< indicates whether the names of actors should be displayed or not */ extern int view_hp; /*!< indicates whether the current/max material points of an actor should be displayed or not */ extern int view_ether; /*!< indicates whether the current/max ethereal points of an actor should be displayed or not */ +extern int view_food; /*!< indicates whether the current/max food level of an actor should be displayed or not */ extern int view_chat_text_as_overtext; /*!< if this is true, then any text an actor is saying will be additionally displayed in a bubble over its head */ extern int view_mode_instance; /*!< indicates if we have instance mode turned on, it shows monsters and our hp only, no other players, overwrites all other actor banner display options */ extern float view_mode_instance_banner_height; /*!< factor, we use to setup how high is banner above your toon when using view_mode_instance */ diff --git a/keys.c b/keys.c index bd6b0d30d..7b9156787 100644 --- a/keys.c +++ b/keys.c @@ -31,6 +31,8 @@ el_key_def K_VIEWNAMES = {SDLK_n, KMOD_LALT, "#K_VIEWNAMES"}; el_key_def K_VIEWHP = {SDLK_b, KMOD_LALT, "#K_VIEWHP"}; el_key_def K_VIEWETHER = {SDLK_k, KMOD_LALT, "#K_VIEWETHER"}; el_key_def K_ETHERBARS = {SDLK_j, KMOD_LALT, "#K_ETHERBARS"}; +el_key_def K_VIEWFOOD = {SDLK_y, KMOD_LCTRL, "#K_VIEWFOOD"}; +el_key_def K_FOODBAR = {SDLK_y, KMOD_LALT, "#K_FOODBAR"}; el_key_def K_STATS = {SDLK_a, KMOD_LCTRL, "#K_STATS"}; el_key_def K_QUESTLOG = {SDLK_g, KMOD_LCTRL, "#K_QUESTLOG"}; el_key_def K_SESSION = {SDLK_z, KMOD_LCTRL, "#K_SESSION"}; @@ -146,7 +148,7 @@ static el_key_def *key_def_store[] = &K_SPELL7, &K_SPELL8, &K_SPELL9, &K_STATS, &K_SUMMONINGMENU, &K_TABCOMPLETE, &K_TARGET_CLOSE, &K_TURNLEFT, &K_TURNRIGHT, &K_USE, &K_VIEWETHER, &K_VIEWHP, &K_VIEWNAMES, &K_VIEWTEXTASOVERTEXT, &K_WALK, &K_WINDOWS_ON_TOP, &K_WINSCALEDEF, &K_WINSCALEDOWN, - &K_WINSCALEINIT, &K_WINSCALEUP, &K_ZOOMIN, &K_ZOOMOUT, + &K_WINSCALEINIT, &K_WINSCALEUP, &K_ZOOMIN, &K_ZOOMOUT, &K_FOODBAR, &K_VIEWFOOD, #ifdef ECDEBUGWIN &K_ECDEBUGWIN #endif diff --git a/keys.h b/keys.h index 474fbb528..56e87a0db 100644 --- a/keys.h +++ b/keys.h @@ -53,6 +53,8 @@ extern el_key_def K_VIEWNAMES; /*!< key used to toggle display of names extern el_key_def K_VIEWHP; /*!< key used to toggle display of hitpoints (material points) */ extern el_key_def K_VIEWETHER; /*!< key used to toggle display of ether pointer */ extern el_key_def K_ETHERBARS; /*!< key used to toggle display of ether bar */ +extern el_key_def K_VIEWFOOD; /*!< key used to toggle display of overhead food level */ +extern el_key_def K_FOODBAR; /*!< key used to toggle display of overhead food level bar */ extern el_key_def K_STATS; /*!< key to toggle display of \ref stats_window */ extern el_key_def K_QUESTLOG; /*!< key to toggle display of \ref questlog_win */ extern el_key_def K_SESSION; /*!< key to toggle display of session tab in stats_window */ diff --git a/named_colours.cpp b/named_colours.cpp index 8d28bd3d6..6d46b4f95 100644 --- a/named_colours.cpp +++ b/named_colours.cpp @@ -189,6 +189,8 @@ namespace ELGL_Colour add("popup.optiontextmouseover", Colour_Tuple(1.0f, 1.0f, 1.0f, 1.0f)); add("banner.mana.full", Colour_Tuple(0.4f, 0.4f, 1.0f, 0.0f)); add("banner.mana.zero", Colour_Tuple(0.7f, 0.7f, 1.0f, 0.0f)); + add("banner.food.full", Colour_Tuple(1.0f, 1.0f, 0.0f, 0.0f)); + add("banner.food.zero", Colour_Tuple(1.0f, 0.5f, 0.0f, 0.0f)); } } // end namespace diff --git a/translate.c b/translate.c index 15a600f5e..cccf2dffc 100644 --- a/translate.c +++ b/translate.c @@ -398,7 +398,7 @@ char cm_textedit_menu_str[100], cm_quickbar_menu_str[150], cm_hud_menu_str[270], - cm_banner_menu_str[240], + cm_banner_menu_str[300], cm_title_menu_str[150], cm_title_help_str[50], cm_items_menu_str[190], @@ -1803,7 +1803,7 @@ void init_help() add_xml_identifier(misc, "cm_textedit_menu", cm_textedit_menu_str, "Cut\nCopy\nPaste\n--\nDate\nTime\nCoords", sizeof(cm_textedit_menu_str)); add_xml_identifier(misc, "cm_quickbar_menu", cm_quickbar_menu_str, "Enable Quickbar Menu\n--\nRelocatable Window\nMoveable Window\nRotate Window\n--\nReset Position", sizeof(cm_quickbar_menu_str)); add_xml_identifier(misc, "cm_hud_menu", cm_hud_menu_str, "Show Stats\nShow Stats Bars\nShow Knowledge Bar\nShow Timer\nShow Digital Clock\nShow Analogue Clock\nShow Seconds\nShow FPS\nShow Indicators\nEnable Quickbar Menu\n--\nShow Minimap\nShow Ranging Stats\n--\nEnable Sound Effects\nEnable Music\n--\nCopy Location", sizeof(cm_hud_menu_str)); - add_xml_identifier(misc, "cm_banner_menu", cm_banner_menu_str, "Show Names\nShow Health Bars\nShow Health Numbers\nShow Ether Bar\nShow Ether Numbers\nEnable Instance Mode\nShow Speech Bubbles\nEnable Banner Background\nSit Lock\nRanging Lock\n--\nDisable This Menu\n", sizeof(cm_banner_menu_str)); + add_xml_identifier(misc, "cm_banner_menu", cm_banner_menu_str, "Show Names\nShow Health Bars\nShow Health Numbers\nShow Ether Bar\nShow Ether Numbers\nShow Food Bar\nShow Food Numbers\nEnable Instance Mode\nShow Speech Bubbles\nEnable Banner Background\nSit Lock\nRanging Lock\n--\nDisable This Menu\n", sizeof(cm_banner_menu_str)); add_xml_identifier(misc, "cm_title_menu", cm_title_menu_str, "Hide Windows\nOpaque Background\nWindows On Top\nDisable Scaling Controls\n--\nDefault Window Position\n", sizeof(cm_title_menu_str)); add_xml_identifier(misc, "cm_title_help", cm_title_help_str, "Right-click for window menu", sizeof(cm_title_help_str)); add_xml_identifier(misc, "cm_items_menu", cm_items_menu_str, "--\nUse Small Window\nManual Window Size\nItem Window On Drop\nAllow Equipment Swap\nAlt/Ctrl-click With Any Cursor\nButtons On Left\nEquipment Grid On Left\n--\nOpen Storage (View Only)", sizeof(cm_items_menu_str)); diff --git a/translate.h b/translate.h index 20f2515dd..58880c688 100644 --- a/translate.h +++ b/translate.h @@ -548,7 +548,7 @@ extern char cm_textedit_menu_str[100], cm_quickbar_menu_str[150], cm_hud_menu_str[270], - cm_banner_menu_str[240], + cm_banner_menu_str[300], cm_title_menu_str[150], cm_title_help_str[50], cm_items_menu_str[190],