From: Jakob MG Date: Mon, 13 Jun 2011 14:13:54 +0000 (+0200) Subject: Hakk arround lack of vehicle panelhud. now all relevant info is dispalyed in vehicles too X-Git-Tag: xonotic-v0.5.0~199^2~11^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=90237e1169ef6044ff7777bcf442287fa3bbb1a0;p=xonotic%2Fxonotic-data.pk3dir.git Hakk arround lack of vehicle panelhud. now all relevant info is dispalyed in vehicles too --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 31fee2c95..777a192fa 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -368,7 +368,6 @@ void CSQC_UpdateView(float w, float h) vector v, vo; vector vf_size, vf_min; float a; - float hud; hud = getstati(STAT_HUD); button_attack2 = (input_buttons & BUTTON_3); @@ -859,18 +858,8 @@ void CSQC_UpdateView(float w, float h) sound(world, CHAN_AUTO, "misc/typehit.wav", VOL_BASE, ATTN_NONE); nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time; } - if(hud && !intermission) - { - if(hud == HUD_SPIDERBOT) - CSQC_SPIDER_HUD(); - else if(hud == HUD_WAKIZASHI) - CSQC_WAKIZASHI_HUD(); - else if(hud == HUD_RAPTOR) - CSQC_RAPTOR_HUD(); - else if(hud == HUD_BUMBLEBEE) - CSQC_BUMBLE_HUD(); - } - else + + //else { if(gametype == GAME_FREEZETAG) { @@ -888,7 +877,7 @@ void CSQC_UpdateView(float w, float h) CSQC_common_hud(); // crosshair goes VERY LAST - if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1) { + if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1 && hud == HUD_NORMAL) { string wcross_style; float wcross_alpha, wcross_resolution; wcross_style = autocvar_crosshair; @@ -1289,7 +1278,18 @@ void CSQC_UpdateView(float w, float h) if(autocvar__hud_configure) HUD_Panel_Mouse(); - + + if(hud && !intermission) + { + if(hud == HUD_SPIDERBOT) + CSQC_SPIDER_HUD(); + else if(hud == HUD_WAKIZASHI) + CSQC_WAKIZASHI_HUD(); + else if(hud == HUD_RAPTOR) + CSQC_RAPTOR_HUD(); + else if(hud == HUD_BUMBLEBEE) + CSQC_BUMBLE_HUD(); + } // let's reset the view back to normal for the end R_SetView(VF_MIN, '0 0 0'); R_SetView(VF_SIZE, '1 0 0' * w + '0 1 0' * h); @@ -1298,62 +1298,51 @@ void CSQC_UpdateView(float w, float h) void CSQC_common_hud(void) { - // HUD_SortFrags(); done in HUD_Draw - float hud; - hud = getstati(STAT_HUD); - - if(intermission) - hud = HUD_NORMAL; - - //hud = 10; - switch(hud) - { - case HUD_NORMAL: - // do some accuracy var caching - float i; - if(!(gametype == GAME_RACE || gametype == GAME_CTS)) - { - if(autocvar_accuracy_color_levels != acc_color_levels) - { - if(acc_color_levels) - strunzone(acc_color_levels); - acc_color_levels = strzone(autocvar_accuracy_color_levels); - acc_levels = tokenize(acc_color_levels); - if (acc_levels > MAX_ACCURACY_LEVELS) - acc_levels = MAX_ACCURACY_LEVELS; - - for (i = 0; i < acc_levels; ++i) - acc_lev[i] = stof(argv(i)) / 100.0; - } - // let know that acc_col[] needs to be loaded - acc_col_x[0] = -1; - } - - HUD_Main(); // always run these functions for alpha checks - HUD_DrawScoreboard(); + // do some accuracy var caching + float i; + if(!(gametype == GAME_RACE || gametype == GAME_CTS)) + { + if(autocvar_accuracy_color_levels != acc_color_levels) + { + if(acc_color_levels) + strunzone(acc_color_levels); + acc_color_levels = strzone(autocvar_accuracy_color_levels); + acc_levels = tokenize(acc_color_levels); + if (acc_levels > MAX_ACCURACY_LEVELS) + acc_levels = MAX_ACCURACY_LEVELS; + + for (i = 0; i < acc_levels; ++i) + acc_lev[i] = stof(argv(i)) / 100.0; + } + // let know that acc_col[] needs to be loaded + acc_col_x[0] = -1; + } - if (scoreboard_active) // scoreboard/accuracy - { - HUD_Reset(); - // HUD_DrawScoreboard takes care of centerprint_start - } - else if (intermission == 2) // map voting screen - { - HUD_FinaleOverlay(); - HUD_Reset(); + HUD_Main(); // always run these functions for alpha checks + HUD_DrawScoreboard(); - centerprint_start_x = 0; - centerprint_start_y = autocvar_scr_centerpos * vid_conheight; - } - else // hud - { - centerprint_start_x = 0; - centerprint_start_y = autocvar_scr_centerpos * vid_conheight; - } + if (scoreboard_active) // scoreboard/accuracy + { + HUD_Reset(); + // HUD_DrawScoreboard takes care of centerprint_start + } + else if (intermission == 2) // map voting screen + { + HUD_FinaleOverlay(); + HUD_Reset(); - HUD_DrawCenterPrint(); - break; + centerprint_start_x = 0; + centerprint_start_y = autocvar_scr_centerpos * vid_conheight; + } + else // hud + { + centerprint_start_x = 0; + centerprint_start_y = autocvar_scr_centerpos * vid_conheight; + } + /* + switch(hud) + { case HUD_SPIDERBOT: CSQC_SPIDER_HUD(); break; @@ -1365,8 +1354,11 @@ void CSQC_common_hud(void) case HUD_BUMBLEBEE: CSQC_BUMBLE_HUD(); break; - } + */ + + HUD_DrawCenterPrint(); + } diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 7189cbd79..6b1171956 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -614,7 +614,7 @@ void HUD_Weapons(void) { float f, screen_ar; float center_x, center_y; - + if(hud != HUD_NORMAL) return; if(!autocvar__hud_configure) { if(!autocvar_hud_panel_weapons) return; @@ -1019,6 +1019,7 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s void HUD_Ammo(void) { + if(hud != HUD_NORMAL) return; if(!autocvar__hud_configure) { if(!autocvar_hud_panel_ammo) return; @@ -1319,6 +1320,7 @@ void HUD_HealthArmor(void) if(!autocvar__hud_configure) { if(!autocvar_hud_panel_healtharmor) return; + if(hud != HUD_NORMAL) return; if(spectatee_status == -1) return; health = getstati(STAT_HEALTH); diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index af849e18c..6788daad1 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -164,3 +164,5 @@ float g_balance_electro_secondary_bouncestop; float g_trueaim_minrange; entity entcs_receiver[255]; // 255 is the engine limit on maxclients + +float hud;