Skip to content

Commit 94b0f74

Browse files
author
ShinkoNet
committed
Add Show/Hide Piano Toggle
Good for stuff like recording a video
1 parent 343adb7 commit 94b0f74

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

scripts/control_create/control_create.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ songfolder = songs_directory
3636
icons_init()
3737
refreshrate = 0 //0 = 30fps, 1 = 60fps
3838
fade = 0
39+
rhval = 270
3940

4041
// File
4142
filename = ""
@@ -153,6 +154,7 @@ dragstereob = 0
153154
dragstereo = 0
154155

155156
// Piano
157+
show_piano = 1
156158
show_keynames = 1
157159
show_keyboard = 1
158160
show_notechart = 0

scripts/control_draw/control_draw.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ draw_clear(window_background)
5858

5959
// Calculate area
6060
totalcols = floor((rw - 198) / 32)
61-
totalrows = floor((rh - 270) / 32)
61+
if show_piano = 1 {
62+
rhval = 270
63+
}
64+
totalrows = floor((rh - rhval) / 32)
6265
if (min(keysmax, floor((rw - 32) / 39)) != keysshow) {
6366
startkey = 27 - floor(min(keysmax, floor((rw - 32) / 39)) / 2)
6467
sharpkeys = 0

scripts/draw_window_preferences/draw_window_preferences.gml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,20 @@ if (selected_tab = 0) {
104104

105105

106106
draw_areaheader(x1 + 22, y1 + 240, 456, 110, "Piano")
107-
if (draw_checkbox(x1 + 40, y1 + 256, show_keynames, "Show key names", "If the names of the keys should be shown.")) show_keynames=!show_keynames
108-
if (draw_checkbox(x1 + 40, y1 + 276, show_keyboard, "Show keyboard shortcuts", "Show the keyboard shortcuts of the keys.")) show_keyboard=!show_keyboard
109-
if (draw_checkbox(x1 + 40, y1 + 296, show_notechart, "Show note chart when hovering over keys", "Whether to show a note chart\nwhen hovering over the keys.")) show_notechart=!show_notechart
110-
draw_text(x1 + 40, y1 + 326, "Keys to show:")
111-
keysmax = median(20, draw_dragvalue(3, x1 + 120, y1 + 326, keysmax, 2), 50)
107+
if (draw_checkbox(x1 + 40, y1 + 256, show_piano, "Show Piano", "Whether the piano should be visible.")) {
108+
show_piano=!show_piano
109+
keysmax=0
110+
rhval=120
111+
if show_piano = 1 {
112+
keysmax=20
113+
rhval=270
114+
}
115+
}
116+
if (draw_checkbox(x1 + 40, y1 + 276, show_keynames, "Show key names", "If the names of the keys should be shown.")) show_keynames=!show_keynames
117+
if (draw_checkbox(x1 + 40, y1 + 296, show_keyboard, "Show keyboard shortcuts", "Show the keyboard shortcuts of the keys.")) show_keyboard=!show_keyboard
118+
if (draw_checkbox(x1 + 40, y1 + 316, show_notechart, "Show note chart when hovering over keys", "Whether to show a note chart\nwhen hovering over the keys.")) show_notechart=!show_notechart
119+
draw_text(x1 + 40, y1 + 336, "Keys to show:")
120+
keysmax = median(0, draw_dragvalue(3, x1 + 120, y1 + 336, keysmax, 2), 50)
112121
popup_set_window(x1 + 40, y1 + 322, 150, 21, "The amount of keys to show. A high number may\nslow down the program on old computers.")
113122
} else if (selected_tab = 2) {
114123
draw_areaheader(x1 + 22, y1 + 74, 456, 120, "Mouse wheel")

scripts/load_settings/load_settings.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ soundsystem = max(0, buffer_read_byte())
9999
refreshrate = buffer_read_byte()
100100
fade = buffer_read_byte()
101101
realstereo = buffer_read_byte()
102+
show_piano = buffer_read_byte()
103+
rhval = buffer_read_byte()
102104

103105
buffer_delete(buffer)
104106
return 1

scripts/save_settings/save_settings.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ buffer_write_byte(soundsystem)
9393
buffer_write_byte(refreshrate)
9494
buffer_write_byte(fade)
9595
buffer_write_byte(realstereo)
96+
buffer_write_byte(show_piano)
97+
buffer_write_byte(rhval)
9698

9799
buffer_export(buffer, data_directory + "settings.onbs")
98100
buffer_delete(buffer)

views/f6b05121-5ba0-4a03-80e7-4378e4fc6999.yy

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)