Skip to content

Commit

Permalink
more track move stuff things
Browse files Browse the repository at this point in the history
  • Loading branch information
jnackmclain committed Nov 3, 2024
1 parent 0046e2c commit 2e55513
Show file tree
Hide file tree
Showing 10 changed files with 331 additions and 329 deletions.
9 changes: 0 additions & 9 deletions _ark/dx/track/beatmatch/dx_beatmatch_funcs.dta
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#define DX_GEMTRACKDIR
;must be used in beatmatch foreach $player, used for find_obj
({{get_track_panel} loaded_dir} {sprint "track_" {{$player get_user} get_slot_num}})
{func
dx_current_section_fetcher
{if {&& $dx_mtvup $dx_section_mtv_line}
{set $dx_current_section
{localize {beatmatch get_section_at_ms {{beatmatch main_performer} progress_ms}}}
}
{{{gamemode get track_panel} find mtv_overlay} mtv_formatter}
}
}
{func
dx_set_song_speed
;{dx_log_writer info {sprint "func: dx_set_song_speed"}}
Expand Down
76 changes: 76 additions & 0 deletions _ark/dx/track/callbacks/dx_track_callback_funcs.dta
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,80 @@
{set $num_gems_miss_real_keys $num_gems_miss}
)
}
}
{func
dx_check_first_miss
($instrument)
{set $this_missed_once
{switch $instrument
(guitar $guitar_missed_once)
(bass $bass_missed_once)
(drum $drum_missed_once)
(keys $keys_missed_once)
(real_guitar $real_guitar_missed_once)
(real_bass $real_bass_missed_once)
(real_drum $real_drum_missed_once)
(real_keys $real_keys_missed_once)
}
}
$this_missed_once
}
{func
dx_set_first_miss
($instrument)
{switch $instrument
(guitar {set $guitar_missed_once TRUE})
(bass {set $bass_missed_once TRUE})
(drum {set $drum_missed_once TRUE})
(keys {set $keys_missed_once TRUE})
(real_guitar {set $real_guitar_missed_once TRUE})
(real_bass {set $real_bass_missed_once TRUE})
(real_drum {set $real_drum_missed_once TRUE})
(real_keys {set $real_keys_missed_once TRUE})
}
}
{func
dx_track_this_missed
($instrument)
{switch $instrument
(bass {if {! $bass_caughtmissed} {set $bass_caughtmissed TRUE}})
(real_guitar {if {! $real_guitar_caughtmissed} {set $real_guitar_caughtmissed TRUE}})
(real_bass {if {! $real_bass_caughtmissed} {set $real_bass_caughtmissed TRUE}})
(keys {if {! $keys_caughtmissed} {set $keys_caughtmissed TRUE}})
(real_keys {if {! $real_keys_caughtmissed} {set $real_keys_caughtmissed TRUE}})
(guitar {if {! $guitar_caughtmissed} {set $guitar_caughtmissed TRUE}})
(drum {if {! $drum_caughtmissed} {set $drum_caughtmissed TRUE}})
(real_drum {if {! $real_drum_caughtmissed} {set $real_drum_caughtmissed TRUE}})
}
}
{func
dx_check_first_note
($instrument)
{set $this_first_note
{switch $instrument
(guitar $guitar_firstnote)
(bass $bass_firstnote)
(drum $drum_firstnote)
(keys $keys_firstnote)
(real_guitar $real_guitar_firstnote)
(real_bass $real_bass_firstnote)
(real_drum $real_drum_firstnote)
(real_keys $real_keys_firstnote)
}
}
$this_first_note
}
{func
dx_set_first_note
($instrument)
{switch $instrument
(guitar {set $guitar_firstnote TRUE})
(bass {set $bass_firstnote TRUE})
(drum {set $drum_firstnote TRUE})
(keys {set $keys_firstnote TRUE})
(real_guitar {set $real_guitar_firstnote TRUE})
(real_bass {set $real_bass_firstnote TRUE})
(real_drum {set $real_drum_firstnote TRUE})
(real_keys {set $real_keys_firstnote TRUE})
}
}
4 changes: 3 additions & 1 deletion _ark/dx/track/dx_track_includes.dta
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include textures/dx_track_texture_handles.dta
#include track/dx_track_panel_handles.dta
#include track/dx_track_funcs.dta
#include track_ui/dx_track_fc_ui_funcs.dta
#include track_ui/dx_track_ui_funcs.dta
#include track_ui/dx_track_inst_label_funcs.dta
#include track_ui/dx_track_streak_funcs.dta
#include track_ui/dx_track_streak_funcs.dta
#include track_ui/dx_track_overdrive_ui_funcs.dta
1 change: 1 addition & 0 deletions _ark/dx/track/hud_ui/dx_hud_streak_funcs.dta
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
;HUD streak is the band total streak, not individual player streak
{func
dx_track_streak_reset
{if
Expand Down
84 changes: 84 additions & 0 deletions _ark/dx/track/hud_ui/dx_hud_ui_funcs.dta
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,88 @@
{{{{coop_track_panel find scoreboard} find star_display} find stars.grp} set_local_pos $star_displaypos_0 $star_displaypos_1 $star_displaypos_2}
}
}
}
{func dx_game_hud_label
($name $size $font $alignment $kerning $x $z $y $r $g $b $reset)
{set_this {coop_track_panel find scoreboard}}
{set $thislabel {sprint $name ".lbl"}}
{set $thiscolor {sprint $name ".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_showing TRUE}
{$thislabel set_local_scale 1 1 1}
{$thislabel set_local_rot 0 0 0}
{$thislabel set text_size $size}
{$thislabel set alignment $alignment}
{$thislabel set width 500}
{$thislabel set height 500}
{$thislabel set alpha 1}
{$thislabel set kerning $kerning}
{numbers.grp add_object $thislabel}
{numbers.grp set_showing TRUE}
{$thislabel set_token_fmt os_blnk}
}
{if {! {exists $thiscolor}}
{new UIColor $thiscolor}
{$thislabel set color_override $thiscolor}
}
{$thiscolor set color {pack_color $r $g $b}}
{$thislabel set_local_pos $x $z $y}
}
;old time remaining stuff
{func
dx_reset_time_remaining_position
{unless $dx_fetched_time_remaining_pos ;gate this block to run once
{set $dx_fetched_time_remaining_pos TRUE}
{set $dx_stored_time_remaining_pos {{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} get_local_pos_index 2}} ;store the base position
{set $dx_song_label_scale_x {{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} get_local_scale_index 0}}
{set $dx_song_label_scale_y {{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} get_local_scale_index 2}}
}
{if {|| {== $dx_time_remaining down} {== $dx_time_remaining up}}
{{{coop_track_panel find scoreboard} find tracker_band_display} iterate Mesh $m {$m set_showing TRUE}} ;ensure that it is visible at a base level
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_middle.lbl} set_showing TRUE} ;ensure that it is visible at a base level
#ifdef HX_WII ;the label is too big on wii so we shrink it
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_scale_index 0 {- $dx_song_label_scale_x 0.50}}
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_scale_index 2 {- $dx_song_label_scale_y 0.50}}
#endif
{cond
({&& {|| $dx_active_vocals {! $dx_time_remaining_on_top}} {== $dx_streak_counter single} {> $dx_num_active_instruments 1}} ;handle this stupid case specifically
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 {+ $dx_stored_time_remaining_pos 1.4}}
)
({&& {! $dx_time_remaining_on_top} {|| {== $dx_streak_counter single} {== $dx_streak_counter multi}}} ;if vocals are active, move the label to the bottom again because it looks bad on top
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 $dx_stored_time_remaining_pos}
)
({&& {|| {== $dx_streak_counter single} {== $dx_streak_counter multi}} $dx_active_vocals} ;if vocals are active, move the label to the bottom again because it looks bad on top
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 $dx_stored_time_remaining_pos}
)
({&& {! $dx_time_remaining_on_top} {== $dx_streak_counter off}} ;if vocals are active, move the label to the bottom but slightly up to account for missing streak
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 {+ $dx_stored_time_remaining_pos 1.4}}
)
({&& {== $dx_streak_counter off} $dx_active_vocals} ;if vocals are active, move the label to the bottom but slightly up to account for missing streak
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 {+ $dx_stored_time_remaining_pos 1.4}}
)
({&& $dx_time_remaining_on_top {! $dx_active_vocals}} ;if we need to move the label to the top
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 {+ $dx_stored_time_remaining_pos 4.66}} ;move it up
)
}
}
{if {|| {== $dx_streak_counter off} {&& {== $dx_streak_counter single} {> $dx_num_active_instruments 1}}}
{do
{{{coop_track_panel find scoreboard} find tracker_band_display} iterate Mesh $m {$m set_showing FALSE}} ;ensure that it is visible at a base level
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_middle.lbl} set_showing FALSE} ;ensure that it is visible at a base level
}
}
{if {|| {gamemode in_mode tour} {gamemode in_mode campaign}}
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 $dx_stored_time_remaining_pos}
{set $dx_current_time_remaining_pos {{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} get_local_pos_index 2}}
}
}
10 changes: 9 additions & 1 deletion _ark/dx/track/mtv/dx_mtv_funcs.dta
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,13 @@
dx_mtv_array_reader
($songdtareader)
;{set $songdtareader {array $songdtareader}}

}
{func
dx_current_section_fetcher
{if {&& $dx_mtvup $dx_section_mtv_line}
{set $dx_current_section
{localize {beatmatch get_section_at_ms {{beatmatch main_performer} progress_ms}}}
}
{{{gamemode get track_panel} find mtv_overlay} mtv_formatter}
}
}
49 changes: 0 additions & 49 deletions _ark/dx/track/track/dx_track_funcs.dta
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,6 @@
; }
;}
}

{func
dx_reset_time_remaining_position
{unless $dx_fetched_time_remaining_pos ;gate this block to run once
{set $dx_fetched_time_remaining_pos TRUE}
{set $dx_stored_time_remaining_pos {{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} get_local_pos_index 2}} ;store the base position
{set $dx_song_label_scale_x {{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} get_local_scale_index 0}}
{set $dx_song_label_scale_y {{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} get_local_scale_index 2}}
}
{if {|| {== $dx_time_remaining down} {== $dx_time_remaining up}}
{{{coop_track_panel find scoreboard} find tracker_band_display} iterate Mesh $m {$m set_showing TRUE}} ;ensure that it is visible at a base level
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_middle.lbl} set_showing TRUE} ;ensure that it is visible at a base level
#ifdef HX_WII ;the label is too big on wii so we shrink it
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_scale_index 0 {- $dx_song_label_scale_x 0.50}}
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_scale_index 2 {- $dx_song_label_scale_y 0.50}}
#endif
{cond
({&& {|| $dx_active_vocals {! $dx_time_remaining_on_top}} {== $dx_streak_counter single} {> $dx_num_active_instruments 1}} ;handle this stupid case specifically
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 {+ $dx_stored_time_remaining_pos 1.4}}
)
({&& {! $dx_time_remaining_on_top} {|| {== $dx_streak_counter single} {== $dx_streak_counter multi}}} ;if vocals are active, move the label to the bottom again because it looks bad on top
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 $dx_stored_time_remaining_pos}
)
({&& {|| {== $dx_streak_counter single} {== $dx_streak_counter multi}} $dx_active_vocals} ;if vocals are active, move the label to the bottom again because it looks bad on top
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 $dx_stored_time_remaining_pos}
)
({&& {! $dx_time_remaining_on_top} {== $dx_streak_counter off}} ;if vocals are active, move the label to the bottom but slightly up to account for missing streak
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 {+ $dx_stored_time_remaining_pos 1.4}}
)
({&& {== $dx_streak_counter off} $dx_active_vocals} ;if vocals are active, move the label to the bottom but slightly up to account for missing streak
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 {+ $dx_stored_time_remaining_pos 1.4}}
)
({&& $dx_time_remaining_on_top {! $dx_active_vocals}} ;if we need to move the label to the top
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 {+ $dx_stored_time_remaining_pos 4.66}} ;move it up
)
}
}
{if {|| {== $dx_streak_counter off} {&& {== $dx_streak_counter single} {> $dx_num_active_instruments 1}}}
{do
{{{coop_track_panel find scoreboard} find tracker_band_display} iterate Mesh $m {$m set_showing FALSE}} ;ensure that it is visible at a base level
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_middle.lbl} set_showing FALSE} ;ensure that it is visible at a base level
}
}
{if {|| {gamemode in_mode tour} {gamemode in_mode campaign}}
{{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} set_local_pos_index 2 $dx_stored_time_remaining_pos}
{set $dx_current_time_remaining_pos {{{{coop_track_panel find scoreboard} find tracker_band_display} find tg_main_text_top.lbl} get_local_pos_index 2}}
}
}

; whether not to darken the highway of remote players
{func
dx_dim_remote_players
Expand Down
57 changes: 57 additions & 0 deletions _ark/dx/track/track_ui/dx_track_fc_ui_funcs.dta
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{func
dx_fc_glow_enabler
($enabled $instrument $num_gems_pass $num_gems_miss)
{if $enabled
{if {== {'+' $num_gems_pass $num_gems_miss} 0}
{beatmatch foreach_active_player $player ;dx - add our custom fc checking callbacks to the currently loaded player
{if {== {$player instrument} $instrument}
{set_this {find_obj DX_GEMTRACKDIR streak_meter}}
{star_deploy.trig trigger}
}
}
}
}
}
{func
dx_fc_glow_disabler
($enabled $instrument $num_gems_pass $num_gems_miss)
{if $enabled
{if {> {'+' $num_gems_pass $num_gems_miss} 0}
{beatmatch foreach_active_player $player
{if {== {$player instrument} $instrument}
{set_this {find_obj DX_GEMTRACKDIR streak_meter}}
{if {! {dx_check_first_miss $instrument}}
{dx_set_first_miss $instrument}
{end_streak.trig trigger}
}
{star_deploy_stop.trig trigger}
}
}
}
}
}
{func
dx_miss_fc_remover
($instrument)
{unless {coop_track_panel get dx_is_nohud} ; this could break if someone were to disable performance mode mid song
{set_this coop_track_panel}
{beatmatch foreach_active_player $player ;handle adding the appropriate callbacks to each player
{if {== {$player instrument} $instrument}
{dx_track_this_missed $instrument}
{fcframe.tex iterate_refs $ref {$ref set diffuse_tex multframe.tex}} ;remove the FC ring and replace it with the normal ring (the player just missed)
}
}
}
}
{func
dx_track_fc_reset
{if $dx_fc_glow
{beatmatch foreach_active_player $player ;dx - add our custom fc checking callbacks to the currently loaded player
{unless {== {$player instrument} vocals}
{set_this {find_obj DX_GEMTRACKDIR streak_meter}}
{peak_state.trig trigger}
{star_deploy.trig trigger}
}
}
}
}
Loading

0 comments on commit 2e55513

Please sign in to comment.