Skip to content

Commit 74fa1ec

Browse files
committed
Add blackout mode toggle with F10 key
1 parent 8cb53cd commit 74fa1ec

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

scripts/control_create/control_create.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ check_update = 1
3232
show_welcome = 1
3333
scroll_wheel = 0
3434
theme = 0
35+
blackout = 0
3536
editmode = 0
3637
clickinarea = 0
3738
dontplace = 0

scripts/control_draw/control_draw.gml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,20 @@ for (b = 0; b <= totalrows; b += 1) {
241241
}
242242
}
243243
}
244+
if (blackout) {
245+
draw_set_color(c_black)
246+
draw_rectangle(x1 + 2, y1 + 34, x1 + 2 + 32 * totalcols, y1 + 34 + 32 * totalrows, false)
247+
}
244248
for (a = 0; a < totalcols; a += 1) {
245-
if ((starta + a) mod (timesignature * 4) == 0) {
246-
draw_set_alpha(0.3)
247-
draw_rectangle(x1 + 2 + 32 * a, y1 + 34, (x1 + 2 + 32 * a) + 1, y1 + 34 + totalrows * 32, false)
248-
} else {
249-
draw_set_alpha(0.1)
250-
if ((starta + a) mod 4 == 0) draw_set_alpha(0.25)
251-
draw_line(x1 + 2 + 32 * a, y1 + 34, x1 + 2 + 32 * a, y1 + 34 + totalrows * 32)
249+
if (!blackout) {
250+
if ((starta + a) mod (timesignature * 4) == 0) {
251+
draw_set_alpha(0.3)
252+
draw_rectangle(x1 + 2 + 32 * a, y1 + 34, (x1 + 2 + 32 * a) + 1, y1 + 34 + totalrows * 32, false)
253+
} else {
254+
draw_set_alpha(0.1)
255+
if ((starta + a) mod 4 == 0) draw_set_alpha(0.25)
256+
draw_line(x1 + 2 + 32 * a, y1 + 34, x1 + 2 + 32 * a, y1 + 34 + totalrows * 32)
257+
}
252258
}
253259
for (b = 0; b < totalrows; b += 1) {
254260
if (starta + a <= enda) {
@@ -597,6 +603,10 @@ if (window = 0 && text_focus = -1) {
597603
}
598604
}
599605
}
606+
// Toggle blackout mode
607+
if (keyboard_check_pressed(vk_f10)) {
608+
blackout = !blackout
609+
}
600610
// Toggle fullscreen
601611
if (keyboard_check_pressed(vk_f11)) {
602612
fullscreen = !fullscreen

0 commit comments

Comments
 (0)