Skip to content

Commit 439525c

Browse files
committed
Fixed animation bug
1 parent bce14ad commit 439525c

File tree

27 files changed

+28
-28
lines changed

27 files changed

+28
-28
lines changed

scripts/draw_switch/draw_switch.gml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function draw_switch() {
1111
lock = argument[5]
1212
if (tip != "") popup_set_window(xx, yy, 13 + string_width(str) + 8, 13, tip)
1313
if (lock = 1) {
14-
draw_sprite(spr_switch, 6, xx, yy)
14+
if (!expression) draw_sprite(spr_switch, 6, xx, yy)
1515
if (expression) draw_sprite(spr_switch, 7, xx, yy)
1616
draw_set_color(make_color_rgb(204, 204, 204))
1717
if (theme) {
@@ -25,7 +25,7 @@ function draw_switch() {
2525
m = mouse_rectangle(xx, yy, 26 + string_width(str) + 8, 13)
2626
if (w_isdragging > 0) m = 0
2727
if (m) m += mouse_check_button(mb_left)
28-
draw_sprite(spr_switch, m, xx, yy)
28+
if (!expression) draw_sprite(spr_switch, m, xx, yy)
2929
if (expression) draw_sprite(spr_switch, m + 3, xx, yy)
3030
draw_text(xx + 31, yy - 1, str)
3131
return (m && mouse_check_button_released(mb_left))

scripts/draw_window_about/draw_window_about.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function draw_window_about() {
2121
draw_text(x1 + 150, y1 + 217, "Version " + version + " - Released " + version_date + "\n\nThis program is a continuation of\n Minecraft Note Block Studio, \ncreated by David Norgren. \n\nThis product is not affiliated with\nMojang Studios, Microsoft Studios\nor the game Minecraft.")
2222
}
2323
draw_set_halign(fa_left)
24-
if (draw_button2(x1 + 120, y1 + 370, 72, "OK", false)) windowclose = 1
24+
if (draw_button2(x1 + 120, y1 + 370, 72, "OK", false) && windowopen = 1) windowclose = 1
2525
window_set_cursor(cr_default)
2626
if (windowopen = 0 && theme = 3) {
2727
if (windowalpha < 1) {

scripts/draw_window_branch_export/draw_window_branch_export.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function draw_window_branch_export() {
211211
branch_export()
212212
}
213213
}
214-
if (draw_button2(x1 + 470 - 80 * 1, y1 + 368, 72, "Cancel") && wmenu = 0) {
214+
if (draw_button2(x1 + 470 - 80 * 1, y1 + 368, 72, "Cancel") && wmenu = 0 && windowopen = 1) {
215215
windowclose = 1
216216
selected_tab_sch = 0
217217
}

scripts/draw_window_clip_editor/draw_window_clip_editor.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function draw_window_clip_editor() {
2323
text_exists[59] = 0
2424
selection_copied = draw_text_edit(59, selection_copied, x1 + 32, y1 + 23 * 3, 370, 300, 0, 0)
2525

26-
if (draw_button2(x1 + 320, y1 + 398, 72, "OK")) {
26+
if (draw_button2(x1 + 320, y1 + 398, 72, "OK") && windowopen = 1) {
2727
windowclose = 1
2828
}
2929
window_set_cursor(curs)

scripts/draw_window_datapack_export/draw_window_datapack_export.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function draw_window_datapack_export() {
228228
}
229229

230230
//Cancel button
231-
if (draw_button2(x1 + 390, y1 + 398, 72, "Cancel", false)) {
231+
if (draw_button2(x1 + 390, y1 + 398, 72, "Cancel", false) && windowopen = 1) {
232232
windowclose = 1
233233
}
234234
window_set_cursor(cr_default)

scripts/draw_window_greeting/draw_window_greeting.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function draw_window_greeting() {
7474
draw_sprite(spr_bigicons_f, 0, b + (a > 1), c + (a > 1))
7575
}
7676
draw_text(b + 48 + (a > 1), c + 9 + (a > 1), "Create a new song")
77-
if (a = 2 && mouse_check_button_released(mb_left)) windowclose = 1
77+
if (a = 2 && mouse_check_button_released(mb_left) && windowopen = 1) windowclose = 1
7878

7979
c += 44
8080
b = x1 + 300

scripts/draw_window_instruments/draw_window_instruments.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function draw_window_instruments() {
7676
instrument_swap(userselect, instrument_list[| insselect])
7777
c = 1
7878
}
79-
if (draw_button2(x1 + 456, y1 + 318, 80, "OK") && wmenu = 0) {
79+
if (draw_button2(x1 + 456, y1 + 318, 80, "OK") && wmenu = 0 && windowopen = 1) {
8080
windowclose = 1
8181
if (save_version < 5 && user_instruments > 18) {
8282
show_message("This song contains more than 18 instruments and cannot be saved in version " + string(save_version) + ". The save version will be changed to " + string(nbs_version) + ".")

scripts/draw_window_macro_arpeggio/draw_window_macro_arpeggio.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function draw_window_macro_arpeggio() {
6262
selection_load(selection_x,selection_y,str,true)
6363
selection_code_update()
6464
}
65-
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel")) {windowclose = 1}
65+
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel") && windowopen = 1) {windowclose = 1}
6666
window_set_cursor(curs)
6767
window_set_cursor(cr_default)
6868
if (windowopen = 0 && theme = 3) {

scripts/draw_window_macro_portamento/draw_window_macro_portamento.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function draw_window_macro_portamento() {
5555
selection_load(selection_x,selection_y,str,true)
5656
if(!keyboard_check(vk_alt)) selection_place(false)
5757
}
58-
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel")) {windowclose = 1}
58+
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel") && windowopen = 1) {windowclose = 1}
5959
window_set_cursor(curs)
6060
window_set_cursor(cr_default)
6161
if (windowopen = 0 && theme = 3) {

scripts/draw_window_macro_setpanning/draw_window_macro_setpanning.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function draw_window_macro_setpanning() {
4646
selection_load(selection_x,selection_y,str,true)
4747
if(!keyboard_check(vk_alt)) selection_place(false)
4848
}
49-
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel")) {windowclose = 1}
49+
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel") && windowopen = 1) {windowclose = 1}
5050
window_set_cursor(curs)
5151
window_set_cursor(cr_default)
5252
if (windowopen = 0 && theme = 3) {

scripts/draw_window_macro_setpitch/draw_window_macro_setpitch.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function draw_window_macro_setpitch() {
4545
selection_load(selection_x,selection_y,str,true)
4646
if(!keyboard_check(vk_alt)) selection_place(false)
4747
}
48-
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel")) {windowclose = 1}
48+
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel") && windowopen = 1) {windowclose = 1}
4949
window_set_cursor(curs)
5050
window_set_cursor(cr_default)
5151
if (windowopen = 0 && theme = 3) {

scripts/draw_window_macro_setvelocity/draw_window_macro_setvelocity.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function draw_window_macro_setvelocity() {
4545
selection_load(selection_x,selection_y,str,true)
4646
if(!keyboard_check(vk_alt)) selection_place(false)
4747
}
48-
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel")) {windowclose = 1}
48+
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel") && windowopen = 1) {windowclose = 1}
4949
window_set_cursor(curs)
5050
window_set_cursor(cr_default)
5151
if (windowopen = 0 && theme = 3) {

scripts/draw_window_macro_stagger/draw_window_macro_stagger.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function draw_window_macro_stagger() {
8585
selection_code_update()
8686
history_set(h_selectchange, selection_x, selection_y, selection_code, selection_x, selection_y, str)
8787
}
88-
if (draw_button2(x1 + 75, y1 + 128, 60, "Cancel")) {windowclose = 1}
88+
if (draw_button2(x1 + 75, y1 + 128, 60, "Cancel") && windowopen = 1) {windowclose = 1}
8989
window_set_cursor(curs)
9090
window_set_cursor(cr_default)
9191
if (windowopen = 0 && theme = 3) {

scripts/draw_window_macro_stereo/draw_window_macro_stereo.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function draw_window_macro_stereo() {
6464
selection_load(selection_x,selection_y,str,true)
6565
if(!keyboard_check(vk_alt)) selection_place(false)
6666
}
67-
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel")) {windowclose = 1}
67+
if (draw_button2(x1 + 70, y1 + 98, 60, "Cancel") && windowopen = 1) {windowclose = 1}
6868
window_set_cursor(curs)
6969
window_set_cursor(cr_default)
7070
if (windowopen = 0 && theme = 3) {

scripts/draw_window_macro_tremolo/draw_window_macro_tremolo.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function draw_window_macro_tremolo() {
5858
if tremolotype = 2 macro_tremolo_fadeout()
5959
window = 0
6060
}
61-
if (draw_button2(x1 + 80, y1 + 215, 60, "Cancel")) {windowclose = 1}
61+
if (draw_button2(x1 + 80, y1 + 215, 60, "Cancel") && windowopen = 1) {windowclose = 1}
6262
window_set_cursor(curs)
6363
window_set_cursor(cr_default)
6464
if (windowopen = 0 && theme = 3) {

scripts/draw_window_midi_import/draw_window_midi_import.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function draw_window_midi_import() {
3535
if (draw_switch(x1 + 12, y1 + 374, w_midi_remember, "Remember changes", "Whether to use these settings the\nnext time you import a MIDI file.") && wmenu = 0) w_midi_remember=!w_midi_remember
3636
}
3737
if (draw_button2(x1 + 520, y1 + 368, 72, "Import") && wmenu = 0) {w_midi_tab = 0 window = -1 import_midi()}
38-
if (draw_button2(x1 + 520 - 80, y1 + 368, 72, "Cancel") && wmenu = 0) {midifile = "" w_midi_tab = 0 windowclose = 1}
38+
if (draw_button2(x1 + 520 - 80, y1 + 368, 72, "Cancel") && wmenu = 0 && windowopen = 1) {midifile = "" w_midi_tab = 0 windowclose = 1}
3939
if (draw_button2(x1 + 520 - 160, y1 + 368, 72, "Use default") && wmenu = 0) {
4040
if (question("Are you sure?", "Confirm")) {
4141
midi_instruments()

scripts/draw_window_mididevices/draw_window_mididevices.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function draw_window_mididevices() {
3232
popup_set_window(x1 + 13 - 2, y1 + 67, 250 + 75, 20, "The name of the device.")
3333
draw_text(x1 + 18, y1 + 70, "Name")
3434

35-
if (draw_button2(x1 + 408, y1 + 318, 80, "OK") && wmenu = 0) windowclose = 1
35+
if (draw_button2(x1 + 408, y1 + 318, 80, "OK") && wmenu = 0 && windowopen = 1) windowclose = 1
3636

3737
// Instruments
3838
for (a = 0; a < 11; a += 1) {

scripts/draw_window_minecraft/draw_window_minecraft.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ function draw_window_minecraft() {
312312
draw_theme_color()
313313
}
314314

315-
if (draw_button2(x1 + 240 - 36, y1 + 413, 72, "OK")) windowclose = 1
315+
if (draw_button2(x1 + 240 - 36, y1 + 413, 72, "OK") && windowopen = 1) windowclose = 1
316316
window_set_cursor(cr_default)
317317
if (windowopen = 0 && theme = 3) {
318318
if (windowalpha < 1) {

scripts/draw_window_mp3_export/draw_window_mp3_export.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function draw_window_mp3_export() {
2828
//Submit button
2929
if (draw_button2(x1 + 165, y1 + 238, 72, "Export", false)) mp3_export()
3030

31-
if (draw_button2(x1 + 10, y1 + 238, 72, "Cancel", false)) {
31+
if (draw_button2(x1 + 10, y1 + 238, 72, "Cancel", false) && windowopen = 1) {
3232
windowclose = 1
3333
}
3434
window_set_cursor(cr_default)

scripts/draw_window_preferences_f/draw_window_preferences_f.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function draw_window_preferences_f() {
2121
draw_set_color(13487565)
2222
if (mouse_check_button(mb_left)) draw_set_color(12105912)
2323
draw_rectangle(x1 + 1, y1 + 30, x1 + 39, y1 + 69, 0)
24-
if (mouse_check_button_released(mb_left)) {
24+
if (mouse_check_button_released(mb_left && windowopen = 1)) {
2525
windowclose = 1
2626
}
2727
}

scripts/draw_window_properties/draw_window_properties.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function draw_window_properties() {
8080
timestoloop = loopmax
8181
draw_theme_color()
8282

83-
if (draw_button2(x1 + 430 - 72, y1 + 366, 72, "OK")) {windowclose = 1}
83+
if (draw_button2(x1 + 430 - 72, y1 + 366, 72, "OK") && windowopen = 1) {windowclose = 1}
8484
window_set_cursor(curs)
8585
window_set_cursor(cr_default)
8686
if (windowopen = 0 && theme = 3) {

scripts/draw_window_save_options/draw_window_save_options.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function draw_window_save_options() {
3333
if (draw_radiobox(x1 + 15, y1 + 95, save_version = 1, "v1", "Includes custom instrument index", min_version > 1)) save_version = 1
3434
if (draw_radiobox(x1 + 15, y1 + 110, save_version = 0, "Classic", "Doesn't have any of the above, but works on all versions.", min_version > 0)) save_version = 0
3535

36-
if (draw_button2(x1 + 40, y1 + 135, 60, "OK")) {
36+
if (draw_button2(x1 + 40, y1 + 135, 60, "OK") && windowopen = 1) {
3737
if save_version != nbs_version question("Some of the song's data will be lost if you save in a previous version! Are you sure?", "Confirm")
3838
changed = 1
3939
windowclose = 1

scripts/draw_window_schematic_export/draw_window_schematic_export.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ function draw_window_schematic_export() {
229229
schematic_export()
230230
}
231231
}
232-
if (draw_button2(x1 + 470 - 80 * 1, y1 + 368, 72, "Cancel") && wmenu = 0) {
232+
if (draw_button2(x1 + 470 - 80 * 1, y1 + 368, 72, "Cancel") && wmenu = 0 && windowopen = 1) {
233233
windowclose = 1
234234
}
235235
if (draw_button2(x1 + 470 - 80 * 2, y1 + 368, 72, "Use default") && wmenu = 0) {

scripts/draw_window_set_tempo/draw_window_set_tempo.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function draw_window_set_tempo() {
2525
tempoo = draw_textarea(57, x1 + 15, y1 + 50, 113, 25, string(tempoo), "Will always floor to integer if using BPM.")
2626

2727
draw_theme_color()
28-
if (draw_button2(x1 + 10, y1 + 98, 60, "OK")) {
28+
if (draw_button2(x1 + 10, y1 + 98, 60, "OK") && windowopen = 1) {
2929
try {
3030
if (use_bpm) tempo = floor(tempoo) / 15
3131
else tempo = floor(real(tempoo) * 100) / 100

scripts/draw_window_songinfo/draw_window_songinfo.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function draw_window_songinfo() {
125125

126126
if (window = w_songinfoedit) {
127127
if (draw_button2(x1 + floor(w / 2) - 70, y1 + h - 30, 70, "Edit")) window = w_properties
128-
if (draw_button2(x1 + floor(w / 2) + 5, y1 + h - 30, 70, "OK")) windowclose = 1
128+
if (draw_button2(x1 + floor(w / 2) + 5, y1 + h - 30, 70, "OK") && windowopen = 1) windowclose = 1
129129
} else {
130130
if (mouse_check_button_pressed(mb_left)) window = w_releasemouse
131131
}

scripts/draw_window_stats/draw_window_stats.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function draw_window_stats() {
4747
changed = 1
4848
}
4949
}
50-
if (draw_button2(x1 + 220, y1 + 368, 72, "OK")) windowclose = 1
50+
if (draw_button2(x1 + 220, y1 + 368, 72, "OK") && windowopen = 1) windowclose = 1
5151
window_set_cursor(cr_default)
5252
if (windowopen = 0 && theme = 3) {
5353
if (windowalpha < 1) {

scripts/draw_window_update/draw_window_update.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function draw_window_update() {
4747
draw_set_font(fnt_main)
4848
if (theme = 3) draw_set_font(fnt_wslui)
4949
draw_scrollbar(update_scrollbar, x1 + 470, y1 + 60, 12, 18, n, 0, 1)
50-
if (draw_button2(x1 + 220, y1 + 340, 72, "OK")) {
50+
if (draw_button2(x1 + 220, y1 + 340, 72, "OK") && windowopen = 1) {
5151
if (window = w_update) {
5252
window = w_greeting
5353
save_settings() // Save new version number

0 commit comments

Comments
 (0)