Skip to content

Commit a147b4d

Browse files
committed
Add BPM change displays on timeline
1 parent a820105 commit a147b4d

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

scripts/control_draw/control_draw.gml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ function control_draw() {
366366
}
367367
note_offset = floor(((marker_pos - floor(marker_pos + 0.5 * !isplayer)) * 32) + 0.5) * ((playing && marker_follow && marker_pagebypage = 2 && (marker_pos - floor(totalcols / 2 + 0.5) < enda + 1 && marker_pos - floor(totalcols / 2 + 0.5) > 0)) || isplayer)
368368
if (!isplayer) {
369+
var tempo_changer_display_queue = []
369370
for (a = 0; a < totalcols; a += 1) {
370371
if (!blackout) {
371372
if ((starta + a) mod (timesignature * 4) == 0) {
@@ -396,7 +397,8 @@ function control_draw() {
396397
if (fade=0) c += ((selbx = starta + a && selby = startb + b && select = 0 && window = 0 && cursmarker = 0) || s) * 0.5
397398
}
398399
draw_block(x1 + 2 + 32 * a - note_offset, y1 + 34 + 32 * b, song_ins[starta + a, startb + b], song_key[starta + a, startb + b], song_pan[starta + a, startb + b], song_vel[starta + a, startb + b], song_pit[starta + a, startb + b], c, s * 0.8)
399-
}
400+
if (instrument_list[| ds_list_find_index(instrument_list, song_ins[starta + a, startb + b])].name = "Tempo Changer") array_push(tempo_changer_display_queue, [x1 + 2 + 32 * a - note_offset, y1 + 34 + 32 * b, string(abs(song_pit[starta + a, startb + b]))])
401+
}
400402
}
401403
} else {
402404
break
@@ -1179,6 +1181,31 @@ function control_draw() {
11791181

11801182
marker_pos = median(0, marker_pos, enda + totalcols)
11811183
if (!isplayer) {
1184+
draw_theme_font(font_main)
1185+
var tempo_str;
1186+
var tempo_prefix = "BPM = ";
1187+
var last_tc_x = 0;
1188+
var last_tc_y = 0;
1189+
for (var tempo_index = array_length(tempo_changer_display_queue) - 1; tempo_index >= 0; tempo_index -= 1) {
1190+
xx = tempo_changer_display_queue[tempo_index][0]
1191+
yy = tempo_changer_display_queue[tempo_index][1]
1192+
tempo_str = tempo_changer_display_queue[tempo_index][2]
1193+
if (xx != last_tc_x) last_tc_y = 0
1194+
if (yy > last_tc_y) {
1195+
draw_sprite(spr_marker, 0 + 8 * (theme = 2 || blackout || (theme = 3 && fdark)), xx, y1 + 2)
1196+
draw_sprite(spr_marker, 1 + 8 * (theme = 2 || blackout || (theme = 3 && fdark)), xx, y1 + 2 + 15)
1197+
draw_set_color(c_white)
1198+
if(theme = 2) draw_set_color(3552822)
1199+
if (theme = 3) draw_set_color(16579836)
1200+
if (theme = 3 && fdark) draw_set_color(2960685)
1201+
draw_rectangle(xx + 10, y1 + 4, xx + 10 + string_width_dynamic(tempo_prefix + tempo_str), y1 + 16, 0)
1202+
draw_area(xx + 9, y1 + 3, xx + 11 + string_width_dynamic(tempo_prefix + tempo_str), y1 + 17)
1203+
draw_theme_color()
1204+
draw_text_dynamic(xx + 10, y1 + 2 + (theme != 3), tempo_prefix + tempo_str)
1205+
last_tc_y = yy
1206+
}
1207+
last_tc_x = xx
1208+
}
11821209
a = floor(marker_pos * 32 - starta * 32)
11831210
draw_sprite_ext(spr_marker, 0 + 6 * (theme = 2 || (blackout && theme != 3)) + 8 * (theme = 3), x1 + 2 + a, y1 + 2, 1, 1, 0, accent[3] * (theme = 3) - !(theme = 3), 1)
11841211
draw_sprite_ext(spr_marker, 1 + 6 * (theme = 2 || (blackout && theme != 3)) + 8 * (theme = 3), x1 + 2 + a, y1 + 2, 1 + (window_scale <= 0.5), (totalrows + 1) * 32 / 15, 0, accent[3] * (theme = 3) - !(theme = 3), 1)

0 commit comments

Comments
 (0)