Add proper ring functions to work with
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 3 May 2011 15:04:05 +0000 (18:04 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 3 May 2011 15:04:05 +0000 (18:04 +0300)
data/qcsrc/client/sbar.qc

index 1b9c6f3..f877545 100644 (file)
@@ -1980,24 +1980,35 @@ void Sbar_Timer()
 \r
 void Sbar_Ring()\r
 {\r
 \r
 void Sbar_Ring()\r
 {\r
-       vector pos, text_pos, text_size;\r
-       float sz1, sz2;\r
-       pos_x = vid_conwidth / 2;\r
-       pos_y = vid_conheight / 1.375;\r
-       pos_z = 0;\r
-       sz1 = 60;\r
-       sz2 = 40;\r
+       vector ring_pos, ring1_color, ring2_color;\r
+       vector text_pos, text_size;\r
+       float ring_alpha, ring1_size, ring1_clip, ring2_size, ring2_clip;\r
+       string text1_msg, text2_msg;\r
+\r
+       ring_pos_x = vid_conwidth / 2;\r
+       ring_pos_y = vid_conheight / 1.375;\r
+       ring_pos_z = 0;\r
+       ring1_size = 60;\r
+       ring2_size = 40;\r
+       ring_alpha = sbar_alpha_fg * 1;\r
        text_size = '10 10 0';\r
 \r
        text_size = '10 10 0';\r
 \r
-       DrawCircleClippedPic(pos, sz1, "gfx/hud/sb_ring.tga", 0.85, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_ADDITIVE);\r
-       text_pos_x = pos_x - stringwidth("Text 1 ssdfsdfdsfsdf", FALSE, text_size) / 2;\r
-       text_pos_y = pos_y - sz1 / 2 - vlen(text_size);\r
-       drawstring(text_pos, "Text 1 ssdfsdfdsfsdf", text_size, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
-\r
-       DrawCircleClippedPic(pos, sz2, "gfx/hud/sb_ring.tga", 0.75, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_ADDITIVE);\r
-       text_pos_x = pos_x - stringwidth("Text 2 3453rf234f", FALSE, text_size) / 2;\r
-       text_pos_y = pos_y + sz1 / 2 + vlen(text_size);\r
-       drawstring(text_pos, "Text 2 3453rf234f", text_size, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+       ring1_clip = 0.85;\r
+       ring2_clip = 0.95;\r
+       ring1_color = '1 0 0';\r
+       ring2_color = '0 1 0';\r
+       text1_msg = "Text 1 ssdfsdfdsfsdf";\r
+       text2_msg = "Text 2 3453rf234f";\r
+\r
+       DrawCircleClippedPic(ring_pos, ring1_size, "gfx/hud/sb_ring.tga", ring1_clip, ring1_color, ring_alpha, DRAWFLAG_ADDITIVE);\r
+       text_pos_x = ring_pos_x - stringwidth(text1_msg, FALSE, text_size) / 2;\r
+       text_pos_y = ring_pos_y - ring1_size / 2 - vlen(text_size);\r
+       drawstring(text_pos, text1_msg, text_size, ring1_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+\r
+       DrawCircleClippedPic(ring_pos, ring2_size, "gfx/hud/sb_ring.tga", ring2_clip, ring2_color, ring_alpha, DRAWFLAG_ADDITIVE);\r
+       text_pos_x = ring_pos_x - stringwidth(text2_msg, FALSE, text_size) / 2;\r
+       text_pos_y = ring_pos_y + ring1_size / 2 + vlen(text_size);\r
+       drawstring(text_pos, text2_msg, text_size, ring2_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
 }\r
 \r
 void CSQC_Strength_Timer() {\r
 }\r
 \r
 void CSQC_Strength_Timer() {\r