-
Notifications
You must be signed in to change notification settings - Fork 6
timer
Timer displays a countdown and fires a callback when it reaches zero. It uses skin animations for the number resize and highlight effects, and plays voice clips at 10 and 5 seconds. The countdown can be frozen via config.
Timer(int time, double current_time_ms, std::function<void()> confirm_func);Initialises the countdown to time seconds. Retrieves animations from global_tex: number resize (ID 9), highlight resize (ID 10), and highlight fade (ID 11). Reads timer_frozen from the config at construction time.
confirm_func is called once, after the voice clip for 0 seconds has finished playing.
void update(double current_ms);Decrements the counter once per second. Plays timer_blip and starts the resize/highlight animations when the count falls below 10. Plays voice_timer_10, voice_timer_5, and voice_timer_0 at the corresponding values. Calls confirm_func after voice_timer_0 finishes. Does nothing while is_frozen is true.
void draw(float x = 0, float y = 0);Draws the timer background (BG or BG_RED when below 10), the highlight overlay with its fade and resize animations, and each digit of the counter using the appropriate counter sprite (counter_black or counter_white). Digits are spaced by SC::TIMER_TEXT_MARGIN and centered horizontally.
Building
libs
- animation
- audio
- config
- filesystem
- global_data
- input
- logging
- ray
- scores
- screen
- script
- song_parser
- text
- texture
- video
- webcam
libs/parsers
objects
objects/game
- player
- background
- gauge
- judgment
- combo
- branch_indicator
- ending_animations
- gogo_time
- fireworks
- song_info
- transition
- result_transition
- judge_counter
- score_counter
- score_counter_animation
- balloon_counter
- drumroll_counter
- kusudama_counter
- drum_hit_effect
- lane_hit_effect
- gauge_hit_effect
- combo_announce
- note_arc
objects/global
objects/title
objects/entry
objects/settings
objects/result
objects/song_select
- player
- navigator
- box_base
- box_song
- box_folder
- neiro
- modifier
- ura_switch
- diff_sort
- search_box
- dan_transition
- genre_bg
- score_history
- song_select_script
scenes