]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
Merge branch 'master' into divVerent/csqcmodel
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 2ba6b48c2a61f22ae7ae62a580a0a1925bb80ac3..7acfacb8c428b99d8246db0b10b8f9a3c2db8335 100644 (file)
@@ -4358,7 +4358,7 @@ void HUD_Physics(void)
                speed_baralign = (autocvar_hud_panel_physics_baralign == 2);
                acceleration_baralign = (autocvar_hud_panel_physics_baralign == 3);
        }
-       if (autocvar_hud_panel_physics_acceleration_progressbar_mode == 0)
+       if (autocvar_hud_panel_physics_acceleration_mode == 0)
                acceleration_baralign = 3; //override hud_panel_physics_baralign value for acceleration
 
        //draw speed
@@ -4615,9 +4615,14 @@ void HUD_CenterPrint (void)
                if (scoreboard_bottom >= 0.96 * vid_conheight)
                        return;
                vector target_pos;
+               
                target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size_x);
-               panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
-               panel_size_y = min(panel_size_y, vid_conheight - scoreboard_bottom);
+               
+               if(target_pos_y > panel_pos_y)
+               {
+                       panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
+                       panel_size_y = min(panel_size_y, vid_conheight - scoreboard_bottom);
+               }
        }
 
        HUD_Panel_DrawBg(1);
@@ -4669,14 +4674,13 @@ void HUD_CenterPrint (void)
                }
                
                // fade the centerprint in/out 
-               if (centerprint_time[j] < 0 || centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_in > time)
-               {
+               if (centerprint_time[j] < 0 || centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time)
                        a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in), 1);
-               }
-               else if ((centerprint_expire_time[j] > time) && autocvar_hud_panel_centerprint_fade_out)
-               {
+               else if (centerprint_expire_time[j] > time)
                        a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
-               }
+               
+               // set the size from fading in/out before subsequent fading
+               sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize); 
                
                // also fade it based on positioning
                if(autocvar_hud_panel_centerprint_fade_subsequent)
@@ -4685,14 +4689,15 @@ void HUD_CenterPrint (void)
                        a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (i / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1); // pass two: after that, gradually lower alpha even more for each message
                }
                
-               // finally set the size based on the new alpha
-               sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize); 
+               // finally set the size based on the new alpha from subsequent fading
+               sz = sz * (autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize)); 
                drawfontscale = sz * '1 1 0';
                
                if (centerprint_countdown_num[j])
                        n = tokenizebyseparator(sprintf(centerprint_messages[j], centerprint_countdown_num[j]), "\n");
                else
                        n = tokenizebyseparator(centerprint_messages[j], "\n");
+
                if (autocvar_hud_panel_centerprint_flip)
                {
                        // check if the message can be entirely shown
@@ -4706,12 +4711,6 @@ void HUD_CenterPrint (void)
                                                pos_y -= fontsize_y;
                                        else
                                                pos_y -= fontsize_y * CENTERPRINT_SPACING/2;
-                                       // NOTE: uncommented so as to not reject messages whenever they are "too large" -- This just continues drawing it anyway.
-                                       //if (pos_y < panel_pos_y) // check if the next line can be shown
-                                       //{
-                                       //      drawfontscale = '1 1 0';
-                                       //      return;
-                                       //}
                                }
                        }
                        current_msg_pos_y = pos_y; // save starting pos (first line) of the current message
@@ -4733,12 +4732,6 @@ void HUD_CenterPrint (void)
                                }
                                else
                                        pos_y += fontsize_y * CENTERPRINT_SPACING/2;
-                               // NOTE: uncommented so as to not reject messages whenever they are "too large" -- This just continues drawing it anyway.
-                               //if (!autocvar_hud_panel_centerprint_flip && pos_y > panel_pos_y + panel_size_y - fontsize_y) // check if the next line can be shown
-                               //{
-                               //      drawfontscale = '1 1 0';
-                               //      return;
-                               //}
                        }
                }
                msg_size = pos_y - msg_size;
@@ -4747,12 +4740,24 @@ void HUD_CenterPrint (void)
                        pos_y = current_msg_pos_y - CENTERPRINT_SPACING * fontsize_y;
                        if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
                                pos_y += (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
+                               
+                       if (pos_y < panel_pos_y) // check if the next message can be shown
+                       {
+                               drawfontscale = '1 1 0';
+                               return;
+                       }
                }
                else
                {
                        pos_y += CENTERPRINT_SPACING * fontsize_y;
                        if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
                                pos_y -= (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
+                               
+                       if(pos_y > panel_pos_y + panel_size_y - fontsize_y) // check if the next message can be shown
+                       {
+                               drawfontscale = '1 1 0';
+                               return;
+                       }
                }
        }
        drawfontscale = '1 1 0';