]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
initial work on messaging system through notify panel, THIS is not ready even for...
authorFruitieX <rasse@rasse-lappy.localdomain>
Mon, 14 Jun 2010 21:27:57 +0000 (00:27 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Mon, 14 Jun 2010 21:27:57 +0000 (00:27 +0300)
defaultXonotic.cfg
qcsrc/client/hud.qc

index 57838fbae73290ebef9d428f850b5e3416d03e36..83574f60dc3633194a5d685bcb7b52d984fa5e8e 100644 (file)
@@ -1410,6 +1410,7 @@ seta hud_notify_flip 0 "order the list top to bottom instead of bottom to top"
 seta hud_notify_print 0 "also con_notify print the messages that are shown on the notify panel"
 seta hud_notify_time 10 "time that a new entry stays until it fades out"
 seta hud_notify_fadetime 3 "fade out time"
+seta hud_notify_info_top 1 "show info messages at top of panel"
 
 seta hud_timer 1 "enable/disable this panel"
 seta hud_timer_pos "-0.125000 0.016667" "position of this base of the panel"
index 28e4e0b68252836a3e87f86b98cb9351f0272f4b..16f9baea985e484e73539cdf92c7aa64e494bcc4 100644 (file)
@@ -2594,6 +2594,7 @@ void HUD_Notify (void)
        float entries, height;
        entries = bound(1, floor(12 * mySize_y/mySize_x), 10);
        height = mySize_y/entries;
+       entries -= 2; // top/bottom two lines reserved for info messaged, such as spec instructions
        
        vector fontsize;
        fontsize = '0.5 0.5 0' * height;
@@ -2618,6 +2619,8 @@ void HUD_Notify (void)
                        i = j;
                else // rather nasty hack for ordering items from the bottom up
                        i = entries - j - 1;
+               if(cvar("hud_notify_info_top"))
+                       i += 2; // top/bottom two lines reserved for info messaged, such as spec instructions
 
                if(fadetime)
                {
@@ -2721,22 +2724,21 @@ void HUD_Notify (void)
                        }
                }
        }
-       /* This will come later.
-       string s;
+
+       // Info messages
+       //
        entity tm;
        if(spectatee_status && !intermission)
        {
-               drawfont = hud_bigfont;
+               //drawfont = hud_bigfont;
                if(spectatee_status == -1)
                        s = "^1Observing";
                else
                        s = GetPlayerName(spectatee_status - 1);
-               // spectated player name between HUD and chat area, aligned to the left
-               pos_x = 0;
-               pos_y = - 50 - hud_fontsize_spec_y;
-               s = textShortenToWidth(s, vid_conwidth/2.5, hud_fontsize_spec, stringwidth_colors);
-               drawcolorcodedstring(pos, s, hud_fontsize_spec, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
-               drawfont = hud_font;
+
+               //s = textShortenToWidth(s, mySize_y, 0.5 * height, stringwidth_colors);
+               //drawcolorcodedstring(pos + eY * 0.25 * height, s, 0.5 * height, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+               //drawfont = hud_font;
 
                // spectator text in the upper right corner
                if(spectatee_status == -1)
@@ -2837,7 +2839,13 @@ void HUD_Notify (void)
                        }
                }
        }
-       */
+       if(hud_configure)
+               s = strcat(s, "^7Press ^3ESC ^7to show HUD options.\n^3Doubleclick a panel for panel-specific options.");
+       //s = textShortenToWidth(s, mySize_y, 0.5 * height, stringwidth_colors);
+       if(cvar("hud_notify_info_top"))
+               drawcolorcodedstring(pos + eY * 0.25 * height, s, '1 1 0' * 0.5 * height, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+       else
+               drawcolorcodedstring(pos + eY * mySize_y - eY * 1.75 * height, s, '1 1 0' * 0.5 * height, HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
 }
 
 // Timer (#5)