]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/client/sbar.qc
Sbar ring for regurgitation delay
[voretournament/voretournament.git] / data / qcsrc / client / sbar.qc
index f87754595e96fbe15e2283626b08a1bd43259b7b..575ff08798eac7b426a157c7675a9b859356987f 100644 (file)
@@ -1987,28 +1987,56 @@ void Sbar_Ring()
 \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
+       ring1_size = 100;\r
+       ring2_size = 60;\r
        ring_alpha = sbar_alpha_fg * 1;\r
        text_size = '10 10 0';\r
 \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
+       switch(getstati(STAT_SBRING1_TYPE))\r
+       {\r
+               case 0:\r
+                       // ring disabled\r
+                       break;\r
+               case 1:\r
+                       // ring shows vore system delay, empties with progress\r
+                       ring1_color = '0.5 0.5 1';\r
+                       text1_msg = "Vore delay";\r
+                       break;\r
+               default:\r
+                       print(strcat("^1Error:^7 Unknown ring type: ", ftos(getstati(STAT_SBRING1_TYPE)), "\n"));\r
+                       break;\r
+       }\r
+       switch(getstati(STAT_SBRING2_TYPE))\r
+       {\r
+               case 0:\r
+                       // ring disabled\r
+                       break;\r
+               case 1:\r
+                       // ring shows regurgitation delay, fills with progress\r
+                       ring2_color = '1 0.5 1';\r
+                       text2_msg = "Regurgitating...";\r
+                       break;\r
+               default:\r
+                       print(strcat("^1Error:^7 Unknown ring type: ", ftos(getstati(STAT_SBRING1_TYPE)), "\n"));\r
+                       break;\r
+       }\r
+       ring1_clip = getstatf(STAT_SBRING1_CLIP);\r
+       ring2_clip = getstatf(STAT_SBRING2_CLIP);\r
+\r
+       if(text1_msg != "")\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;\r
+               drawstring(text_pos, text1_msg, text_size, ring1_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+       }\r
+       if(text2_msg != "")\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;\r
+               drawstring(text_pos, text2_msg, text_size, ring2_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+       }\r
 }\r
 \r
 void CSQC_Strength_Timer() {\r