-
Notifications
You must be signed in to change notification settings - Fork 296
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
[Feature] Timer System WIP #1045
Open
CG-Tespy
wants to merge
46
commits into
snozbot:develop
Choose a base branch
from
CG-Tespy:TimerSystem
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit d4e4808.
Updating develop branch on my end
This reverts commit e03289b.
…Say dialog entries" This reverts commit 5cad400.
…ability to track seconds
…it in nested namespace It's a whole system, so I figured it'd be good to put it in a namespace specifically for said system
Since they'll all need to fetch the tracker and have the same button color, I felt it best to create a superclass that handles all that for each Playtime Command that we expect users to mess with.
…e user... well, use it
It's pretty much a POCO version of the old PlaytimeTracker but repurposed to be more... well, general-purpose.
…orry as much about WaitForSeconds issues
…ists function public Also had the fungus manager make sure there is a TimerManager with it at all times
Also added missing Continue calls to the non-abstract Timer Commands
So that the user can show them in the UI and such
When their time recorded gets into the negatives
This way, Start can also resume timers
…ahead Also did a small update to the CountupTimers scene so that seeing milliseconds pass doesn't cause any text-shaking
StartDate isn't needed to keep either timer type ticking, and given how the tick process works, there's no need to have the dates stay intact after deserialization
…t tests A few bugfixes to other glitches made these tests fail despite the FungusExample scenes showing things working just fine. Turns out I just had to correct a rounding error and make sure the timer doesn't get restarted at the wrong time
No longer need to use it as reference for the Timer System
… the playtime timer
- New Commands - ForceTimerCountdownEnd - TimerStatToString - New EventHandlers - TimerCountdownEnd - Enum values being capitalized - All inputs for timer IDs requiring IntegerVariables - TimerStopped event not executing when a countdown timer stops itself anymore - Renamed TimerState enum to TimeMeasurement to avoid confusion with TimerStat - For better encapsulation, TimerManager's public Timers property returns a copy of the timers it keeps track of - Had to refactor several unit tests that assumed that everything in said Timers property DIDN'T return copies - Changes to demo scenes to show off new features
I think things are looking pretty good now ^^ Thoughts, @chrisgregan and @stevehalliwell ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This adds an easy-to-use Timer system to Fungus
Why would Fungus need this?
It's pretty common to set time limits in games or check how long things took. It's even more common to track the player's playtime, yet as all official releases of Fungus (at the time of this writing) lack that, that forces devs to look to other things to implement those features.
With this, we save devs the trouble. Plus, the new save system really needs this one; it has to be able to show playtime in the UI, after all. Heck, that's the reason I even went through all this effort xD
Important Notes
Other information
While I think the system is production-ready as-is, I would very much like to get feedback on it before it gets approved for an official release.