]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
similar thing for chat panel (time slider)
authorFruitieX <rasse@rasse-lappy.localdomain>
Sun, 13 Jun 2010 22:06:03 +0000 (01:06 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sun, 13 Jun 2010 22:06:03 +0000 (01:06 +0300)
qcsrc/client/hud.qc
qcsrc/menu/xonotic/dialog_hudpanel_chat.c
qcsrc/menu/xonotic/dialog_hudpanel_notification.c

index 5ea29f4469f8ae2777a3a361322b0decac7bac4f..5480ca4ee6819b8a3ec9b0a8133ddd3ac7fa3651 100644 (file)
@@ -3865,11 +3865,17 @@ void HUD_Chat(void)
 
        if(hud_configure)
        {
+               float chatsize;
+               chatsize = cvar("con_chatsize");
                cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
-               float i;
+               float i, a;
                for(i = 0; i < cvar("con_chat"); ++i)
                {
-                       drawcolorcodedstring(pos + eY * i * cvar("con_chatsize"), "^3Player^7: This is the chat area.", '1 1 0' * cvar("con_chatsize"), HUD_Panel_GetFgAlpha(id), DRAWFLAG_NORMAL);
+                       if(i == cvar("con_chat") - 1)
+                               a = HUD_Panel_GetFgAlpha(id);
+                       else
+                               a = HUD_Panel_GetFgAlpha(id) * floor(((i + 1) * 7 + cvar("con_chattime"))/45);
+                       drawcolorcodedstring(pos + eY * i * chatsize, textShortenToWidth("^3Player^7: This is the chat area.", mySize_x, '1 1 0' * chatsize, stringwidth_colors), '1 1 0' * chatsize, a, DRAWFLAG_NORMAL);
                }
        }
 }
index 6a48fb645641c4c2db1b63b4f7fca17c6df654f7..693c7ad7003d00271623f3eeb85d143de95a69be 100644 (file)
@@ -24,6 +24,14 @@ void fillXonoticHUDChatDialog(entity me)
                        me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background Alpha:"));
                                me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "hud_chat_bg_alpha"));
        me.TR(me);
+               me.TR(me);
+                       me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Font size:"));
+                               me.TD(me, 1, 2, e = makeXonoticSlider(6, 16, 1, "con_chatsize"));
+               me.TR(me);
+                       me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Message lifetime:"));
+                               me.TD(me, 1, 2, e = makeXonoticSlider(16, 40, 2, "con_chattime"));
+               me.TR(me);
+                       me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_chatsound", "Message sound beep"));
        //me.gotoRC(me, me.rows - 1, 0);
                //me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit Setup", '0 0 0', "_hud_configure 0", 1));
 }
index 201dd72072461369e4c9cc7617ec9998daf589ec..45accec2d25b4664978403a74d0f4812f9272621 100644 (file)
@@ -26,10 +26,10 @@ void fillXonoticHUDNotificationDialog(entity me)
                me.TR(me);
                        me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_notify_flip", "Flip"));
                me.TR(me);
-                       me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Msg lifetime:"));
+                       me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Message lifetime:"));
                                me.TD(me, 1, 2, e = makeXonoticSlider(3, 15, 1, "hud_notify_time"));
                me.TR(me);
-                       me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Msg fadetime:"));
+                       me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Message fadetime:"));
                                me.TD(me, 1, 2, e = makeXonoticSlider(1, 5, 1, "hud_notify_fadetime"));
                me.TR(me);
                        me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_notify_print", "Also print messages to console"));