X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud.qc;h=f8d8a3296e9713dcc99d34b83fc52928558aa557;hp=60e1a4648af4556c56672dc54352edd97651eb96;hb=e3e13a6eac82464c004af16230f1da2b92776636;hpb=c953fe161d41b8b2dc5d6e08390c67bc09c9bba7 diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 60e1a4648a..f8d8a3296e 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -787,7 +787,7 @@ string GetAmmoPicture(float i) } } -void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_selected) +void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_selected, float infinite_ammo) { float a; if(autocvar__hud_configure) @@ -799,7 +799,9 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s a = getstati(GetAmmoStat(itemcode)); // how much ammo do we have of type itemcode? vector color; - if(a < 10) + if(infinite_ammo) + color = '0 0.5 0.75'; + else if(a < 10) color = '0.7 0 0'; else color = '1 1 1'; @@ -830,12 +832,12 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s if(autocvar_hud_panel_ammo_text) { - if(a > 0) + if(a > 0 || infinite_ammo) drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL); else // "ghost" ammo count drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize_x + eY * mySize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL); } - if(a > 0) + if(a > 0 || infinite_ammo) drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL); else // "ghost" ammo icon drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * mySize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL); @@ -897,20 +899,23 @@ void HUD_Ammo(void) ammo_size_y = newSize; } - float i, stat_items, currently_selected; + float i, stat_items, currently_selected, infinite_ammo; + infinite_ammo = FALSE; if (autocvar_hud_panel_ammo_onlycurrent) { if(autocvar__hud_configure) { - DrawAmmoItem(pos, ammo_size, 2, true); //show rockets + DrawAmmoItem(pos, ammo_size, 2, true, FALSE); //show rockets return; } stat_items = getstati(STAT_ITEMS); + if (stat_items & IT_UNLIMITED_WEAPON_AMMO) + infinite_ammo = TRUE; for (i = 0; i < AMMO_COUNT; ++i) { currently_selected = stat_items & GetAmmoItemCode(i); if (currently_selected) { - DrawAmmoItem(pos, ammo_size, i, true); + DrawAmmoItem(pos, ammo_size, i, true, infinite_ammo); return; } } @@ -918,9 +923,11 @@ void HUD_Ammo(void) } stat_items = getstati(STAT_ITEMS); + if (stat_items & IT_UNLIMITED_WEAPON_AMMO) + infinite_ammo = TRUE; for (i = 0; i < AMMO_COUNT; ++i) { currently_selected = stat_items & GetAmmoItemCode(i); - DrawAmmoItem(pos + eX * column * (ammo_size_x + offset_x) + eY * row * (ammo_size_y + offset_y), ammo_size, i, currently_selected); + DrawAmmoItem(pos + eX * column * (ammo_size_x + offset_x) + eY * row * (ammo_size_y + offset_y), ammo_size, i, currently_selected, infinite_ammo); ++row; if(row >= rows) { @@ -4513,7 +4520,7 @@ void HUD_CenterPrint (void) // entries = bound(1, floor(CENTERPRINT_MAX_ENTRIES * 4 * panel_size_y/panel_size_x), CENTERPRINT_MAX_ENTRIES); // height = panel_size_y/entries; // fontsize = '1 1 0' * height; - height = vid_conheight/40 * autocvar_hud_panel_centerprint_fontscale; + height = vid_conheight/50 * autocvar_hud_panel_centerprint_fontscale; fontsize = '1 1 0' * height; entries = bound(1, floor(panel_size_y/height), CENTERPRINT_MAX_ENTRIES);