Skip to content

Commit

Permalink
perfects counter
Browse files Browse the repository at this point in the history
This commit adds support for a perfects counter. It defaults to off, and has a toggle in the settings.
  • Loading branch information
LocalH committed Nov 26, 2024
1 parent d7e5070 commit 61e30cd
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 1 deletion.
5 changes: 4 additions & 1 deletion _ark/dx/game/dx_game_reset_funcs.dta
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
dx_game_var_reset
{set $guitar_groove_active FALSE} {set $bass_groove_active FALSE} {set $drum_groove_active FALSE}
{set $dx_someone_fcd FALSE} {set $dx_someone_niced FALSE} {set $dx_someone_jurgend FALSE}
{set $brutal_number_0 -26} {set $brutal_number_1 -26} {set $brutal_number_2 -26} {set $brutal_number_3 -26}
{set $dx_reported_highscore FALSE}
{foreach_int $i 0 3
{set_var {sprint "brutal_number_" $i} -26}
{set_var {sprint "dx_perfects_count_" $i} 0}
}
{foreach $entry (guitar bass drum keys real_guitar real_bass real_drum real_keys)
{set_var {sprint "dx_stop_od_" $entry} FALSE}
{set_var {sprint $entry "_milosong"} FALSE}
Expand Down
5 changes: 5 additions & 0 deletions _ark/dx/locale/dx_locale_updates.dta
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,11 @@
(os_perfects_indicator_off "Perfects: OFF")
(os_perfects_indicator_off_desc "Perfect text on Note Hit is disabled")

(os_perfects_ctr_on "Perfect Counter: ON")
(os_perfects_ctr_on_desc "Shows how many perfect notes you have hit")
(os_perfects_ctr_off "Perfect Counter: OFF")
(os_perfects_ctr_off_desc "Doesn't show how many perfect notes you have hit")

(os_detailed_hit_on "Detailed Hits: ON")
(os_detailed_hit_on_desc "Perfect, Great, Good, Bad Text is enabled")
(os_detailed_hit_off "Detailed Hits: OFF")
Expand Down
12 changes: 12 additions & 0 deletions _ark/dx/overshell/dx_hud_states.dta
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,8 @@

{push_back $options {if_else $dx_perfects_indicator os_perfects_indicator_on os_perfects_indicator_off}}

{push_back $options {if_else $dx_perfects_ctr os_perfects_ctr_on os_perfects_ctr_off}}

{push_back $options {if_else $dx_detailed_hit_stats os_detailed_hit_on os_detailed_hit_off}}

{push_back $options {if_else $dx_detailed_hit_timing os_hit_timing_on os_hit_timing_off}}
Expand Down Expand Up @@ -1463,6 +1465,16 @@
DX_TRACK_PERFECT_DATA
{set $previous_state dxState_TrackPerfects}
)
((os_perfects_ctr_on os_perfects_ctr_off)
{set $dx_perfects_ctr {! $dx_perfects_ctr}}
{if_else $dx_perfects_ctr
{set $dx_tracked_changed os_perfects_ctr_on}
{set $dx_tracked_changed os_perfects_ctr_off}
}
{dx_state_pos_tracker}
DX_TRACK_PERFECT_DATA
{set $previous_state dxState_TrackPerfects}
)
((os_detailed_hit_on os_detailed_hit_off)
{set $dx_detailed_hit_stats {! $dx_detailed_hit_stats}}
{if_else $dx_detailed_hit_stats
Expand Down
5 changes: 5 additions & 0 deletions _ark/dx/read_write/dx_reader_macros.dta
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,11 @@
{elem {find $entry dx_perfects_indicator} 1}
}
}
{if {== {elem $entry 0} {basename dx_perfects_ctr}}
{set $dx_perfects_ctr
{elem {find $entry dx_perfects_ctr} 1}
}
}
{if {== {elem $entry 0} {basename dx_detailed_hit_stats}}
{set $dx_detailed_hit_stats
{elem {find $entry dx_detailed_hit_stats} 1}
Expand Down
1 change: 1 addition & 0 deletions _ark/dx/read_write/dx_writer_macros.dta
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
{dx_setting_saver dx_settings dx_track_username_g $dx_track_username_g}
{dx_setting_saver dx_settings dx_track_username_b $dx_track_username_b}
{dx_setting_saver dx_settings dx_perfects_indicator $dx_perfects_indicator}
{dx_setting_saver dx_settings dx_perfects_ctr $dx_perfects_ctr}
{dx_setting_saver dx_settings dx_detailed_hit_stats $dx_detailed_hit_stats}
{dx_setting_saver dx_settings dx_detailed_hit_timing $dx_detailed_hit_timing}
{dx_setting_saver dx_settings dx_track_streak $dx_track_streak}
Expand Down
2 changes: 2 additions & 0 deletions _ark/dx/track/callbacks/dx_track_callbacks.dta
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
}
{func dx_create_instrument_callback
($instrument $player $slot)
{set_var {sprint "dx_perfects_count_" $player} 0} ;shove this here so it resets for a player when callback is added
{if {exists {sprint "fc_" $instrument "_callback"}} ;delete the object and recreate it if already exists
{delete {sprint "fc_" $instrument "_callback"}}
}
Expand Down Expand Up @@ -120,6 +121,7 @@
{cond
({&& {< [offset] 25} {> [offset] -25}}
{dx_perfect_hit $dx_perfects_indicator [track_instrument] [player] [slot] $dx_detailed_hit_stats [timing] perfect}
{dx_perfect_hit_ctr $dx_perfects_ctr [track_instrument] [player] [slot]}
)
({&& {< [offset] 40} {> [offset] -40}}
{dx_perfect_hit $dx_perfects_indicator [track_instrument] [player] [slot] $dx_detailed_hit_stats [timing] great}
Expand Down
1 change: 1 addition & 0 deletions _ark/dx/track/track/dx_track_panel_handles.dta
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
{if {!= {$player instrument} vocals}
{dx_track_label dx_track_label_username $dx_track_username_size $dx_track_username_font $dx_track_username_alignment $dx_track_username_kerning {{$player get_user} get_slot_num} $dx_track_username_x $dx_track_username_y $dx_track_username_r $dx_track_username_g $dx_track_username_b TRUE}
{dx_track_label_perfect dx_track_label_perfect $dx_track_perfect_size $dx_track_perfect_font $dx_track_perfect_alignment $dx_track_perfect_kerning {{$player get_user} get_slot_num} $dx_track_perfect_x $dx_track_perfect_y $dx_track_perfect_r $dx_track_perfect_g $dx_track_perfect_b TRUE}
{dx_track_label_perfect_ctr dx_track_label_perfect_ctr $dx_track_perfect_ctr_size $dx_track_perfect_ctr_font $dx_track_perfect_ctr_alignment $dx_track_perfect_ctr_kerning {{$player get_user} get_slot_num} $dx_track_perfect_ctr_x $dx_track_perfect_ctr_y $dx_track_perfect_ctr_r $dx_track_perfect_ctr_g $dx_track_perfect_ctr_b TRUE}
{dx_track_label_streak dx_track_label_streak $dx_track_streak_size $dx_track_streak_font $dx_track_streak_alignment $dx_track_streak_kerning {{$player get_user} get_slot_num} $dx_track_streak_x $dx_track_streak_y $dx_track_streak_r $dx_track_streak_g $dx_track_streak_b TRUE}
{dx_track_label_overdrive dx_track_label_overdrive $dx_track_overdrive_size $dx_track_overdrive_font $dx_track_overdrive_alignment $dx_track_overdrive_kerning {{$player get_user} get_slot_num} $dx_track_overdrive_x $dx_track_overdrive_y $dx_track_overdrive_r $dx_track_overdrive_g $dx_track_overdrive_b TRUE}
}
Expand Down
55 changes: 55 additions & 0 deletions _ark/dx/track/track_ui/dx_track_streak_funcs.dta
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,61 @@
{$thiscolor set color {pack_color $r $g $b}}
{$thislabel set_local_pos $x -5 $y}
}
{func dx_track_label_perfect_ctr
($name $size $font $alignment $kerning $slot $x $y $r $g $b $reset)
{set_this {find_obj {{get_track_panel} loaded_dir} {sprint "track_" $slot} band_power_meter}}
{set $thislabel {sprint $name $slot ".lbl"}}
{set $thiscolor {sprint $name $slot ".color"}}
{if $reset
{if {exists $thislabel}
{delete $thislabel}
}
{if {exists $thiscolor}
{delete $thiscolor}
}
}
{if {! {exists $thislabel}}
{new BandLabel $thislabel}
{$thislabel set resource_name $font}
{$thislabel set alt_font_resource_name instruments_icons}
{$thislabel set markup TRUE}
{$thislabel set alt_text_size 3.3}
{$thislabel set alt_z_offset 0}
{$thislabel set_showing TRUE}
{$thislabel set_local_scale 1 1 1}
{$thislabel set_local_rot 0 0 0}
{$thislabel set width 500}
{$thislabel set height 500}
{$thislabel set alpha 1}
{meters.grp add_object $thislabel}
{$thislabel set_token_fmt os_blnk}
}
{if {! {exists $thiscolor}}
{new UIColor $thiscolor}
{$thislabel set color_override $thiscolor}
}
{$thislabel set kerning $kerning}
{$thislabel set italics 0.03}
{$thislabel set alignment $alignment}
{$thislabel set text_size $size}
{$thiscolor set color {pack_color $r $g $b}}
{$thislabel set_local_pos $x -5 $y}
}
{func
dx_perfect_hit_ctr
($enabled $instrument $player $slot)
{set_this {find_obj DX_GEMTRACKDIR band_power_meter}}
{set $perfect_ctr_label_inst {sprint "dx_track_label_perfect_ctr" {{$player get_user} get_slot_num} ".lbl"}}
{set $perfect_ctr_label_inst_color {sprint "dx_track_label_perfect_ctr" {{$player get_user} get_slot_num} ".color"}}
{set_var {sprint "dx_perfects_count_" $player} {+ 1 {eval {var {sprint "dx_perfects_count_" $player}}}}}
{if $enabled
{$perfect_ctr_label_inst set_token_fmt dx_indv_combo {eval {var {sprint "dx_perfects_count_" $player}}}} ;reusing locale since it's just %i and I need just %i
{$perfect_ctr_label_inst_color set color {pack_color $dx_gold_ui_r $dx_gold_ui_g $dx_gold_ui_b}}
}
{if {! $enabled}
{$perfect_ctr_label_inst set_token_fmt os_blnk}
}
}
{func
dx_perfect_hit
($enabled $instrument $player $slot $diag $timing $level)
Expand Down
16 changes: 16 additions & 0 deletions _ark/dx/ui/dx_ui_init.dta
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ DX_CURRENT_SONG_CLEAR
{set $dx_track_streak_b 1}

{set $dx_perfects_indicator TRUE}
{set $dx_perfects_ctr FALSE}
{set $dx_detailed_hit_stats FALSE}
{set $dx_detailed_hit_timing FALSE}
{set $dx_track_perfect TRUE}
Expand All @@ -129,6 +130,21 @@ DX_CURRENT_SONG_CLEAR
{set $dx_track_perfect_g 1}
{set $dx_track_perfect_b 1}

{set $dx_track_perfect_ctr TRUE}
{set $dx_track_perfect_ctr_size 0.85}
{set $dx_track_perfect_ctr_font pentatonic_outline}
{set $dx_track_perfect_ctr_alignment kMiddleRight}
{set $dx_track_perfect_ctr_kerning 0}
{set $dx_track_perfect_ctr_x -6}
{set $dx_track_perfect_ctr_z -5}
{set $dx_track_perfect_ctr_y -2} ;-2.75 for below
{set $dx_track_perfect_ctr_r 1}
{set $dx_track_perfect_ctr_g 1}
{set $dx_track_perfect_ctr_b 1}
{foreach_int $i 0 3
{set_var {sprint "dx_perfects_count_" $i} 0}
}

{set $dx_track_username TRUE}
{set $dx_track_username_size 2}
{set $dx_track_username_font pentatonic_outline}
Expand Down

0 comments on commit 61e30cd

Please sign in to comment.