From: MirceaKitsune Date: Tue, 3 May 2011 15:04:05 +0000 (+0300) Subject: Add proper ring functions to work with X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=61403f7f2f849988f1463c3851e4fd5e265dbe25;p=voretournament%2Fvoretournament.git Add proper ring functions to work with --- diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 1b9c6f33..f8775459 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -1980,24 +1980,35 @@ void Sbar_Timer() void Sbar_Ring() { - vector pos, text_pos, text_size; - float sz1, sz2; - pos_x = vid_conwidth / 2; - pos_y = vid_conheight / 1.375; - pos_z = 0; - sz1 = 60; - sz2 = 40; + vector ring_pos, ring1_color, ring2_color; + vector text_pos, text_size; + float ring_alpha, ring1_size, ring1_clip, ring2_size, ring2_clip; + string text1_msg, text2_msg; + + ring_pos_x = vid_conwidth / 2; + ring_pos_y = vid_conheight / 1.375; + ring_pos_z = 0; + ring1_size = 60; + ring2_size = 40; + ring_alpha = sbar_alpha_fg * 1; text_size = '10 10 0'; - DrawCircleClippedPic(pos, sz1, "gfx/hud/sb_ring.tga", 0.85, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_ADDITIVE); - text_pos_x = pos_x - stringwidth("Text 1 ssdfsdfdsfsdf", FALSE, text_size) / 2; - text_pos_y = pos_y - sz1 / 2 - vlen(text_size); - drawstring(text_pos, "Text 1 ssdfsdfdsfsdf", text_size, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_NORMAL); - - DrawCircleClippedPic(pos, sz2, "gfx/hud/sb_ring.tga", 0.75, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_ADDITIVE); - text_pos_x = pos_x - stringwidth("Text 2 3453rf234f", FALSE, text_size) / 2; - text_pos_y = pos_y + sz1 / 2 + vlen(text_size); - drawstring(text_pos, "Text 2 3453rf234f", text_size, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_NORMAL); + ring1_clip = 0.85; + ring2_clip = 0.95; + ring1_color = '1 0 0'; + ring2_color = '0 1 0'; + text1_msg = "Text 1 ssdfsdfdsfsdf"; + text2_msg = "Text 2 3453rf234f"; + + DrawCircleClippedPic(ring_pos, ring1_size, "gfx/hud/sb_ring.tga", ring1_clip, ring1_color, ring_alpha, DRAWFLAG_ADDITIVE); + text_pos_x = ring_pos_x - stringwidth(text1_msg, FALSE, text_size) / 2; + text_pos_y = ring_pos_y - ring1_size / 2 - vlen(text_size); + drawstring(text_pos, text1_msg, text_size, ring1_color, sbar_alpha_fg, DRAWFLAG_NORMAL); + + DrawCircleClippedPic(ring_pos, ring2_size, "gfx/hud/sb_ring.tga", ring2_clip, ring2_color, ring_alpha, DRAWFLAG_ADDITIVE); + text_pos_x = ring_pos_x - stringwidth(text2_msg, FALSE, text_size) / 2; + text_pos_y = ring_pos_y + ring1_size / 2 + vlen(text_size); + drawstring(text_pos, text2_msg, text_size, ring2_color, sbar_alpha_fg, DRAWFLAG_NORMAL); } void CSQC_Strength_Timer() {