Skip to content

Commit c3626c5

Browse files
committed
Merge branch 'development' of https://github.com/OpenNBS/OpenNoteBlockStudio into development
2 parents de289a9 + a147b4d commit c3626c5

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
@@ -371,6 +371,7 @@ function control_draw() {
371371
}
372372
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)
373373
if (!isplayer) {
374+
var tempo_changer_display_queue = []
374375
for (a = 0; a < totalcols; a += 1) {
375376
if (!blackout) {
376377
if ((starta + a) mod (timesignature * 4) == 0) {
@@ -401,7 +402,8 @@ function control_draw() {
401402
if (fade=0) c += ((selbx = starta + a && selby = startb + b && select = 0 && window = 0 && cursmarker = 0) || s) * 0.5
402403
}
403404
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)
404-
}
405+
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]))])
406+
}
405407
}
406408
} else {
407409
break
@@ -1184,6 +1186,31 @@ function control_draw() {
11841186

11851187
marker_pos = median(0, marker_pos, enda + totalcols)
11861188
if (!isplayer) {
1189+
draw_theme_font(font_main)
1190+
var tempo_str;
1191+
var tempo_prefix = "BPM = ";
1192+
var last_tc_x = 0;
1193+
var last_tc_y = 0;
1194+
for (var tempo_index = array_length(tempo_changer_display_queue) - 1; tempo_index >= 0; tempo_index -= 1) {
1195+
xx = tempo_changer_display_queue[tempo_index][0]
1196+
yy = tempo_changer_display_queue[tempo_index][1]
1197+
tempo_str = tempo_changer_display_queue[tempo_index][2]
1198+
if (xx != last_tc_x) last_tc_y = 0
1199+
if (yy > last_tc_y) {
1200+
draw_sprite(spr_marker, 0 + 8 * (theme = 2 || blackout || (theme = 3 && fdark)), xx, y1 + 2)
1201+
draw_sprite(spr_marker, 1 + 8 * (theme = 2 || blackout || (theme = 3 && fdark)), xx, y1 + 2 + 15)
1202+
draw_set_color(c_white)
1203+
if(theme = 2) draw_set_color(3552822)
1204+
if (theme = 3) draw_set_color(16579836)
1205+
if (theme = 3 && fdark) draw_set_color(2960685)
1206+
draw_rectangle(xx + 10, y1 + 4, xx + 10 + string_width_dynamic(tempo_prefix + tempo_str), y1 + 16, 0)
1207+
draw_area(xx + 9, y1 + 3, xx + 11 + string_width_dynamic(tempo_prefix + tempo_str), y1 + 17)
1208+
draw_theme_color()
1209+
draw_text_dynamic(xx + 10, y1 + 2 + (theme != 3), tempo_prefix + tempo_str)
1210+
last_tc_y = yy
1211+
}
1212+
last_tc_x = xx
1213+
}
11871214
a = floor(marker_pos * 32 - starta * 32)
11881215
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)
11891216
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)