zDevelopers / UHPlugin

Plugin UltraHardcore (“Kill the Patrick”), augmenté. | UHC (“KTP”) plugin, improved.
Other
32 stars 24 forks source link

Add a way to register other timers #30

Closed AmauryCarrade closed 10 years ago

AmauryCarrade commented 10 years ago

Commands:

/uh timers set hh:mm:ss <name ...>
/uh timers set mm:ss <name ...>
/uh timers set mm <name ...>
/uh timers add hh:mm:ss <name ...>
/uh timers add mm:ss <name ...>
/uh timers add mm <name ...>
/uh timers display <name ...>     ← Automatic display if the timer wasn't displayed
/uh timers hide <name ...>
/uh timers start <name ...>
/uh timers pause <name ...>  
/uh timers restart <name ...>
/uh timers stop <name ...>  
/uh timers remove <name ...>  
/uh timers list

How this would be displayed in the scoreboard:

Episode 1
12 players
8 teams

mm:ss (episode timer)

Timer title
mm:ss

Timer title 2
mm:ss

An UHTimerManager would be used to manage that.

UHTimerManager tm = new UHTimerManager(UHPlugin plugin);

UHTimer timer = new UHTimer(String name);
timer.setDuration(int seconds);

timer.isRegistered()
timer.isEnabled();
timer.getTimeLeft();
timer.update(); // updates the time left, and the calculated hours, minutes, seconds left.
timer.getHours();
timer.getMinutes();
timer.getSeconds();

tm.register(UHTimer timer);
tm.start(UHTimer timer);
tm.pause(UHTimer timer, boolean pauseEnabled);
tm.unregister(UHTimer timer);

tm.getTimer(String name);
tm.getTimers();

tm.pauseAll(boolean pauseEnabled);

An idea by @jonyroda97.

jonyroda97 commented 10 years ago

More Commands:

/uh countdown start 
/uh countdown list

And change /uh countdown to /uh timer

AmauryCarrade commented 10 years ago

Good idea, thanks :) .

And change /uh countdown to /uh timer

I prefer timers instead of timer :) . But this is a very small detail.

AmauryCarrade commented 10 years ago

/uh timers pause <name ...> ?

jonyroda97 commented 10 years ago

Dont forget, when the /uh freeze all is used, it pauses the timers too

AmauryCarrade commented 10 years ago

Thanks for the reminder in this issue. This said, I didn't forget this point; this is why I added this method:

tm.pauseAll(boolean pauseEnabled);
jonyroda97 commented 10 years ago

Oh... Ok :smiley:

jonyroda97 commented 10 years ago

About the /uh timers pause yes it too. The numbers of the timer continue appearing but paused and maybe with something saying Paused above?

AmauryCarrade commented 10 years ago

Migration of the border timer to these timers (also, remove the time left from the periodic message) needed, I think.

The numbers of the timer continue appearing but paused and maybe with something saying Paused above?

There is a 16-characters limit on the titles. And I don't think such a notice (« Paused ») is needed. The timer don't change anymore, so...


By the way, you can use text instead of <code>text</code>. And long code instead of <pre>long code</pre>. And this to add syntax highlighting.

```java
↑ or any other language
[...]
```
jonyroda97 commented 10 years ago

There is a 16-characters limit on the titles. And I don't know such a notice (« Paused ») is needed. The timer don't change anymore, so..

I ve think on that and yes dont add it...

jonyroda97 commented 10 years ago

use /uh timers add hh:mm:ss <name ...> or /uh timers add mm:ss <name ...>

AmauryCarrade commented 10 years ago