X-Git-Url: http://de.git.xonotic.org/?p=voretournament%2Fvoretournament.git;a=blobdiff_plain;f=data%2Fqcsrc%2Fclient%2Fsbar.qc;h=f8d7eefc002920842e0e5a6e91d46bc9e10bc9e6;hp=7fa1280d852f22f49b3039cfbf4af37feeb99a97;hb=65ebedb3627734e33d349eacf3d949cb96cf2707;hpb=7f1609a8c1ba223e1fcf95eb3f24177876b78a83 diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 7fa1280d..f8d7eefc 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -1980,14 +1980,90 @@ void Sbar_Timer() void Sbar_Ring() { - vector pos; - pos_x = vid_conwidth / 2; - pos_y = vid_conheight / 1.375; - pos_z = 0; - - DrawCircleClippedPic(pos, 100, "gfx/hud/sb_ring.tga", 0.85, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_ADDITIVE); + vector ring_pos, ring1_color, ring2_color; + vector text_pos, text1_size, text2_size; + float ring1_alpha, ring2_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; + ring1_size = cvar("sbar_ring1_scale"); + ring2_size = cvar("sbar_ring2_scale"); + ring1_alpha = sbar_alpha_fg * cvar("sbar_ring1_alpha"); + ring2_alpha = sbar_alpha_fg * cvar("sbar_ring2_alpha"); + text1_size = '1 1 0' * cvar("sbar_ring1_text_scale"); + text2_size = '1 1 0' * cvar("sbar_ring2_text_scale"); + + switch(getstati(STAT_SBRING1_TYPE)) + { + case 0: + // ring disabled + break; + case 1: + // ring shows predator swallow progress, fills with progress + if not(cvar("sbar_ring1_info_swallowprogress_pred")) + break; + ring1_color = '0.5 1 0.5'; + text1_msg = "Swallowing..."; + break; + case 2: + // ring shows vore system delay, empties with progress + if not(cvar("sbar_ring1_info_voredelay")) + break; + ring1_color = '0.5 0.5 1'; + text1_msg = "Vore delay"; + break; + case 3: + // ring shows stomach kick delay, empties with progress + if not(cvar("sbar_ring1_info_kickdelay")) + break; + ring1_color = '1 1 0.5'; + text1_msg = "Kick delay"; + break; + default: + print(strcat("^1Error:^7 Unknown ring type: ", ftos(getstati(STAT_SBRING1_TYPE)), "\n")); + break; + } + switch(getstati(STAT_SBRING2_TYPE)) + { + case 0: + // ring disabled + break; + case 1: + // ring shows prey swallow progress, fills with progress + if not(cvar("sbar_ring2_info_swallowprogress_prey")) + break; + ring2_color = '1 0.5 0.5'; + text2_msg = "Swallowed..."; + break; + case 2: + // ring shows regurgitation preparing, fills with progress + if not(cvar("sbar_ring2_info_regurgitateprepare")) + break; + ring2_color = '1 0.5 1'; + text2_msg = "Regurgitating..."; + break; + default: + print(strcat("^1Error:^7 Unknown ring type: ", ftos(getstati(STAT_SBRING1_TYPE)), "\n")); + break; + } + ring1_clip = getstatf(STAT_SBRING1_CLIP); + ring2_clip = getstatf(STAT_SBRING2_CLIP); - DrawCircleClippedPic(pos, 80, "gfx/hud/sb_ring.tga", 0.75, '1 1 1', 1 * sbar_alpha_fg, DRAWFLAG_ADDITIVE); + if(text1_msg != "" && cvar("sbar_ring1")) + { + DrawCircleClippedPic(ring_pos, ring1_size, "gfx/hud/sb_ring.tga", ring1_clip, ring1_color, ring1_alpha, DRAWFLAG_ADDITIVE); + text_pos_x = ring_pos_x - stringwidth(text1_msg, FALSE, text1_size) / 2; + text_pos_y = ring_pos_y - ring1_size / 2; + drawstring(text_pos, text1_msg, text1_size, ring1_color, sbar_alpha_fg, DRAWFLAG_NORMAL); + } + if(text2_msg != "" && cvar("sbar_ring2")) + { + DrawCircleClippedPic(ring_pos, ring2_size, "gfx/hud/sb_ring.tga", ring2_clip, ring2_color, ring2_alpha, DRAWFLAG_ADDITIVE); + text_pos_x = ring_pos_x - stringwidth(text2_msg, FALSE, text2_size) / 2; + text_pos_y = ring_pos_y + ring1_size / 2; + drawstring(text_pos, text2_msg, text2_size, ring2_color, sbar_alpha_fg, DRAWFLAG_NORMAL); + } } void CSQC_Strength_Timer() { @@ -2596,8 +2672,13 @@ string GetAmmoPicture(float i) { switch(i) { - case 0: return "gfx/hud/sb_fuel"; - default: return ""; + case 0: + if(getstati(STAT_ITEMS) & IT_FUEL_REGEN) + return "gfx/hud/sb_fuel_regen"; + else + return "gfx/hud/sb_fuel"; + default: + return ""; } }