Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to register other timers #30

Closed
6 tasks done
AmauryCarrade opened this issue Aug 25, 2014 · 11 comments
Closed
6 tasks done

Add a way to register other timers #30

AmauryCarrade opened this issue Aug 25, 2014 · 11 comments

Comments

@AmauryCarrade
Copy link
Member

  • UHTimer class
  • UHTimersManager
  • Scoreboard integration
  • Migration of the episode timer to the TimerManager (this timer is the only timer with an empty name).
  • Migration of the border timer to these timers (also, remove the time left from the periodic message).
  • Commands.

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.

@AmauryCarrade AmauryCarrade added this to the 1.2 – Stable milestone Aug 25, 2014
@AmauryCarrade AmauryCarrade self-assigned this Aug 25, 2014
@jonyroda97
Copy link
Contributor

More Commands:

/uh countdown start 
/uh countdown list

And change /uh countdown to /uh timer

@AmauryCarrade
Copy link
Member Author

Good idea, thanks :) .

And change /uh countdown to /uh timer

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

@AmauryCarrade
Copy link
Member Author

/uh timers pause <name ...> ?

@jonyroda97
Copy link
Contributor

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

@AmauryCarrade
Copy link
Member Author

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
Copy link
Contributor

Oh... Ok 😃

@jonyroda97
Copy link
Contributor

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

@AmauryCarrade
Copy link
Member Author

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
Copy link
Contributor

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
Copy link
Contributor

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

@AmauryCarrade
Copy link
Member Author

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

AmauryCarrade added a commit that referenced this issue Sep 2, 2014
AmauryCarrade added a commit that referenced this issue Sep 2, 2014
Adde two events fired when a timer starts and ends.

Related to #30.
AmauryCarrade added a commit that referenced this issue Sep 2, 2014
AmauryCarrade added a commit that referenced this issue Sep 2, 2014
Warning, the code is currently broken (until the new way to display timers in the scoreboard is implemented).

Related to #30.
AmauryCarrade added a commit that referenced this issue Sep 2, 2014
Warning, the code is currently broken (until the new way to display timers in the scoreboard is implemented).

Related to #30.
AmauryCarrade added a commit that referenced this issue Sep 3, 2014
AmauryCarrade added a commit that referenced this issue Sep 3, 2014
The updater task is started when the plugin is enabled, so a timer can be added before the start of the game.

Related to #30.
AmauryCarrade added a commit that referenced this issue Sep 5, 2014
AmauryCarrade added a commit that referenced this issue Sep 6, 2014
Fixes all bugs related to the calculation of the hours, minutes, seconds.
Like:
 - the first minute of a timer with some extra seconds (like 55:10) was skipped.

Related to #30.
@AmauryCarrade AmauryCarrade removed their assignment Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants