Skip to content

Commit 6c6de95

Browse files
committed
Fixed shortcuts for new instruments
1 parent 0fe0f5c commit 6c6de95

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

scripts/control_draw/control_draw.gml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,27 @@ if (window = 0 && text_focus = -1) {
402402
if (keyboard_check_pressed(vk_f1)) {
403403
open_url("http://www.youtube.com/playlist?list=PL7EA4F0D271DA6E86")
404404
}
405+
// Instrument shortcuts
405406
if (keyboard_check(vk_control)) {
406-
for (a = 1; a <= 10; a++) {
407-
if (keyboard_check_pressed(ord(string(a % 10)))) {
407+
408+
//First 10 (only ctrl)
409+
if(!keyboard_check(vk_shift)){
410+
for (a = 1; a <= 10; a++) {
411+
if (keyboard_check_pressed(ord(string(a % 10)))) {
408412
instrument = instrument_list[| a - 1]
409413
play_sound(instrument, selected_key, 1)
410-
}
411-
}
412-
}
414+
}
415+
}
416+
}else{
417+
//Last 6 (ctrl+shift)
418+
for (a = 1; a <= 6; a++) {
419+
if (keyboard_check_pressed(ord(string(a % 10)))) {
420+
instrument = instrument_list[| a + 9]
421+
play_sound(instrument, selected_key, 1)
422+
}
423+
}
424+
}
425+
}
413426
}
414427
// Selecting note blocks
415428
if (select > 0) {
@@ -731,8 +744,13 @@ if (draw_tab("Settings")) {
731744
var ins = instrument_list[| a];
732745
if (ins.user)
733746
customstr += check(instrument = ins) + clean(ins.name) + "|"
734-
else
735-
str += check(instrument = ins) + "Ctrl+" + string((a + 1) % 10) + "$" + clean(ins.name) + "|"
747+
else{
748+
if(a < 9){
749+
str += check(instrument = ins) + "Ctrl+" + string((a + 1) % 10) + "$" + clean(ins.name) + "|"
750+
}else{
751+
str += check(instrument = ins) + "Ctrl+Shift+" + string((a + 1) % 10) + "$" + clean(ins.name) + "|"
752+
}
753+
}
736754
}
737755
show_menu_ext("settings", 59, 19, "Instrument|\\|" + str + "-|" + customstr + condstr(customstr != "", "-|") +
738756
icon(icons.INSTRUMENTS)+"Instrument settings...|/|-|" + icon(icons.INFORMATION) + "Song info...|" + icon(icons.PROPERTIES) + "Song properties...|Song stats...|-|" + icon(icons.MIDI_INPUT) + "MIDI device manager|Preferences...")

0 commit comments

Comments
 (0)