Pages: [1]
Author Topic: What about adding cg_drawtimer 2 as countdown?  (Read 101 times)
In the year 3000

Cakes 48
Posts: 4281

« on: July 31, 2018, 01:45:29 am »

On Discord, ccCam user asked if there is a way to show a countdown for the remaining time of a match. AFAIK, there is only a countup timer, cg_drawtimer 1.
However, a countdown may actually be useful. So, what about adding "cg_drawtimer 2" to work as a countdown?
I can guess that the change shouldn't be too much: get timelimit value (convert it to mm:ss if necessary), then subtract the time you would usually print, then print this new value.

Additional thoughts:
- In case no timelimit is set (timelimit <= 0... or, well, timelimit < 1), it should fall back to showing a countup.
- In a few cases, the match time may exceed the timelimit (e.g. in LMS mode, you have to wait for the end of the current round, before the match can actually end. And in Elimination mode, a team has to win of at least two rounds of difference before the match can end, IIRC). I don't think this should be a big problem: I suppose just having a minus symbol (or an "extra" or "ot" word or similar) in front of a upgoing time should work. However that should be tested, to be sure it would not show weird things.
- I just did a quick test, it looks like timelimit is always rounded down (I entered timelimit 1.7 and the match ended at 1 minute).
- Elimination roundtime is already a countdown, it is independent from cg_drawtimer and doesn't need to be modified. Might give some hint about the code, but elimination_roundtime is expressed in seconds instead of minutes like timelimit variable.

What do you think?
« Last Edit: August 01, 2018, 04:39:43 pm by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Pages: [1]
Jump to: