From: FruitieX Date: Sun, 13 Jun 2010 22:06:03 +0000 (+0300) Subject: similar thing for chat panel (time slider) X-Git-Tag: xonotic-v0.1.0preview~541^2~42 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=7e470e38b6f2f409586d1db3af06989360199813 similar thing for chat panel (time slider) --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 5ea29f4469..5480ca4ee6 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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); } } } diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_chat.c b/qcsrc/menu/xonotic/dialog_hudpanel_chat.c index 6a48fb6456..693c7ad700 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_chat.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_chat.c @@ -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)); } diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_notification.c b/qcsrc/menu/xonotic/dialog_hudpanel_notification.c index 201dd72072..45accec2d2 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_notification.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_notification.c @@ -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"));