]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into z411/bai-server
authorz411 <z411@omaera.org>
Tue, 22 Feb 2022 03:32:48 +0000 (00:32 -0300)
committerz411 <z411@omaera.org>
Tue, 22 Feb 2022 03:32:48 +0000 (00:32 -0300)
18 files changed:
1  2 
gamemodes-server.cfg
qcsrc/client/hud/panel/chat.qc
qcsrc/client/hud/panel/timer.qc
qcsrc/client/main.qc
qcsrc/client/view.qc
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
qcsrc/common/items/inventory.qh
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/notifications/all.qh
qcsrc/common/state.qc
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/items/items.qc
qcsrc/server/mutators/events.qh
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/accuracy.qh

Simple merge
Simple merge
index 095e44307ec149b9d9f2b58099e31d3c95022993,f70e5a2805962a43cbebc48607f65b80d27cda8b..7613347b62e134e00b8a75e87872465af1eb57b1
@@@ -38,32 -36,18 +38,36 @@@ void HUD_Timer(
                mySize -= '2 2 0' * panel_bg_padding;
        }
  
 -      string timer;
 -      float timelimit, timeleft, minutesLeft;
 +      string timer_sub = "";
 +      float timelimit, timeleft, minutesLeft, overtimes, timeout_last;
  
        timelimit = STAT(TIMELIMIT);
 +      overtimes = STAT(OVERTIMESADDED);
 +      timeout_last = STAT(TIMEOUT_LAST);
  
-       timeleft = bound(0, timelimit * 60 + STAT(GAMESTARTTIME) - time, timelimit * 60);
+       if (autocvar_hud_panel_timer_unbound){
+               timeleft = max(0, timelimit * 60 + STAT(GAMESTARTTIME) - time);
+       } else {
+               timeleft = bound(0, timelimit * 60 + STAT(GAMESTARTTIME) - time, timelimit * 60);
+       }
        timeleft = ceil(timeleft);
  
 +      // countdown sound
 +      // if 3 use server dictated option, otherwise the client's
 +      int countdown_type;
 +      if(autocvar_cl_timer_countdown == 3)
 +              countdown_type = sv_timer_countdown;
 +      else
 +              countdown_type = autocvar_cl_timer_countdown;
 +      
 +      if(countdown_type && !warmup_stage && timeleft > 0 && timeleft != last_timeleft && timeleft <= 10)
 +      {
 +              if(countdown_type == 1 || (countdown_type == 2 && spectatee_status))
 +                      sound(NULL, CH_INFO, SND_ENDCOUNT, VOL_BASE, ATTN_NONE);
 +              
 +              last_timeleft = timeleft;
 +      }
 +
        minutesLeft = floor(timeleft / 60);
  
        float warmup_timeleft = 0;
                timer_color = '1 0 0'; //red
  
        if (intermission_time) {
 -              timer = seconds_tostring(max(0, floor(intermission_time - STAT(GAMESTARTTIME))));
 -      } else if (warmup_stage && warmup_timeleft >= 60) {
 -              timer = _("WARMUP");
 -      } else if (autocvar_hud_panel_timer_increment || (!warmup_stage && timelimit == 0) || (warmup_stage && warmup_timeleft <= 0)) {
 -              if (time < STAT(GAMESTARTTIME))
 -                      if (autocvar_hud_panel_timer_unbound){
 -                              timer = seconds_tostring(-(STAT(GAMESTARTTIME) - time));
 -                      } else {
 -                              timer = seconds_tostring(0); //while restart is still active, show 00:00
 -                      }
 +              timer = max(0, floor(intermission_time - STAT(GAMESTARTTIME)));
 +              timer_sub = "Intermission";
-       //} else if (autocvar_hud_panel_timer_increment || (!warmup_stage && timelimit == 0) || (warmup_stage && warmup_timeleft <= 0)) {
 +      } else if (timeout_last) {
 +              if(autocvar_hud_panel_timer_increment)
 +                      timer = max(0, floor(timeout_last - STAT(GAMESTARTTIME)));
                else
 -                      timer = seconds_tostring(floor(time - STAT(GAMESTARTTIME)));
 -      } else {
 -              if(warmup_stage)
 -                      timer = seconds_tostring(warmup_timeleft);
 +                      timer = ceil(max(0, timelimit * 60 + STAT(GAMESTARTTIME) - timeout_last));
 +              timer_sub = "Timeout";
 +      } else if (autocvar_hud_panel_timer_increment || timelimit == 0) {
 +              // Time elapsed timer
 +              if((warmup_stage && warmup_timeleft <= 0) || time < STAT(GAMESTARTTIME))
 +                      timer = 0;
                else
 -                      timer = seconds_tostring(timeleft);
 +                      timer = floor(time - STAT(GAMESTARTTIME));
 +      } else {
 +              // Time left timer
 +              if(warmup_stage) {
 +                      if(warmup_timeleft <= 0)
 +                              timer = floor(timelimit * 60);
 +                      else
 +                              timer = warmup_timeleft;
 +              } else {
 +                      timer = timeleft;
 +              }
 +      }
 +      
 +      if(warmup_stage)
 +              timer_sub = "Warmup";
 +      else if(overtimes == 1)
 +              timer_sub = "Overtime";
 +      else if (overtimes > 1)
 +              timer_sub = sprintf("Overtime #%d", overtimes);
 +      
 +      drawstring_aspect(pos, seconds_tostring(timer), mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);
 +      
 +      if(timer_sub != "") {
 +              pos.y += mySize.y;
 +              mySize.y = mySize.y / 2;
 +              drawstring_aspect(pos, timer_sub, mySize, '1 0 0', panel_fg_alpha, DRAWFLAG_NORMAL);
        }
 -
 -      drawstring_aspect(pos, timer, mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);
  
        draw_endBoldFont();
  }
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index cf48ca1a765f9fe592de06d629ee3e6a34c1a429,40b621aa9ba77e157f3d20f056e7f79e42290a86..8019d4a42db1b7a50d95254b74458a562a46a407
@@@ -486,8 -475,9 +488,10 @@@ void ReadyRestart_force(bool is_fake_ro
                FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; });
        }
  
-       if (!sv_ready_restart_after_countdown || warmup_stage) reset_map(true, is_fake_round_start);
 +      round_handler_Activate(!warmup_stage);
+       if (!sv_ready_restart_after_countdown || warmup_stage)
+               reset_map(true, is_fake_round_start);
        if (autocvar_sv_eventlog) GameLogEcho(":restart");
  }
  
Simple merge
Simple merge
Simple merge
index 285da07276d2ce540c0354f1016c00421e1538c0,d5d9f97d9fc469783ae5ff49bb799e02ff2f2941..cf698d98c8a4657dd19e7f32737c847fbb89c31c
  
  float autocvar_sv_accuracy_data_share = 1;
  
- .bool cvar_cl_accuracy_data_share;
- REPLICATE(cvar_cl_accuracy_data_share, bool, "cl_accuracy_data_share");
- .bool cvar_cl_accuracy_data_receive;
- REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive");
+ REPLICATE_INIT(bool, cvar_cl_accuracy_data_share);
+ REPLICATE_INIT(bool, cvar_cl_accuracy_data_receive);
  
  .entity accuracy;
 +.entity roundaccuracy;
  .float accuracy_frags[REGISTRY_MAX(Weapons)];
  
  .float accuracy_hit[REGISTRY_MAX(Weapons)];