Skip to content

Commit 7507549

Browse files
committedMay 28, 2021
Reset window when only window = 0
1 parent 439525c commit 7507549

File tree

11 files changed

+43
-8
lines changed

11 files changed

+43
-8
lines changed
 

‎scripts/draw_window_greeting/draw_window_greeting.gml

+12-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ function draw_window_greeting() {
8888
}
8989
draw_text(b + 48 + (a > 1), c + 9 + (a > 1), "Load a song")
9090
if (a = 2 && mouse_check_button_released(mb_left)) {
91+
windowalpha = 0
92+
windowclose = 0
93+
windowopen = 0
9194
load_song("")
9295
return 1
9396
}
@@ -117,6 +120,9 @@ function draw_window_greeting() {
117120
recent_song[10] = ""
118121
recent_song_time[10] = 0
119122
} else {
123+
windowalpha = 0
124+
windowclose = 0
125+
windowopen = 0
120126
load_song(recent_song[a])
121127
}
122128
}
@@ -140,7 +146,12 @@ function draw_window_greeting() {
140146
draw_sprite(spr_bigicons_f, 2, b + (a > 1), c + (a > 1))
141147
}
142148
draw_text(b + 48 + (a > 1), c + 9 + (a > 1), "Generate song out of MIDI file")
143-
if (a = 2 && mouse_check_button_released(mb_left)) open_midi("")
149+
if (a = 2 && mouse_check_button_released(mb_left)) {
150+
windowalpha = 0
151+
windowclose = 0
152+
windowopen = 0
153+
open_midi("")
154+
}
144155

145156
b = x1 + 300
146157
c += 44

‎scripts/draw_window_macro_arpeggio/draw_window_macro_arpeggio.gml

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ function draw_window_macro_arpeggio() {
3030
message("Please add pipes ( | ) to separate values!", "Error")
3131
return 1
3232
}
33+
windowalpha = 0
34+
windowclose = 0
35+
windowopen = 0
3336
window = 0
3437
str = selection_code
3538
arr_data = selection_to_array(str)

‎scripts/draw_window_macro_portamento/draw_window_macro_portamento.gml

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function draw_window_macro_portamento() {
2525

2626
draw_theme_color()
2727
if (draw_button2(x1 + 10, y1 + 98, 60, "OK")) {
28+
windowalpha = 0
29+
windowclose = 0
30+
windowopen = 0
2831
str = selection_code
2932
val = 0
3033
decr = port_cent / string_count("-1", str)

‎scripts/draw_window_macro_setpanning/draw_window_macro_setpanning.gml

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function draw_window_macro_setpanning() {
2525

2626
draw_theme_color()
2727
if (draw_button2(x1 + 10, y1 + 98, 60, "OK")) {
28+
windowalpha = 0
29+
windowclose = 0
30+
windowopen = 0
2831
str = selection_code
2932
val = 0
3033
arr_data = selection_to_array(str)

‎scripts/draw_window_macro_setpitch/draw_window_macro_setpitch.gml

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ function draw_window_macro_setpitch() {
2424

2525
draw_theme_color()
2626
if (draw_button2(x1 + 10, y1 + 98, 60, "OK")) {
27+
windowalpha = 0
28+
windowclose = 0
29+
windowopen = 0
2730
str = selection_code
2831
val = 0
2932
arr_data = selection_to_array(str)

‎scripts/draw_window_macro_setvelocity/draw_window_macro_setvelocity.gml

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ function draw_window_macro_setvelocity() {
2424

2525
draw_theme_color()
2626
if (draw_button2(x1 + 10, y1 + 98, 60, "OK")) {
27+
windowalpha = 0
28+
windowclose = 0
29+
windowopen = 0
2730
str = selection_code
2831
val = 0
2932
arr_data = selection_to_array(str)

‎scripts/draw_window_macro_stagger/draw_window_macro_stagger.gml

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ function draw_window_macro_stagger() {
3939
message("Stagger can only extend downwards!", "Error")
4040
return -1
4141
}
42+
windowalpha = 0
43+
windowclose = 0
44+
windowopen = 0
4245
window = 0
4346
str = selection_code
4447
arr_data = selection_to_array(str)

‎scripts/draw_window_macro_stereo/draw_window_macro_stereo.gml

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function draw_window_macro_stereo() {
2525

2626
draw_theme_color()
2727
if (draw_button2(x1 + 10, y1 + 98, 60, "OK")) {
28+
windowalpha = 0
29+
windowclose = 0
30+
windowopen = 0
2831
str = selection_code
2932
arr_data = selection_to_array(str)
3033
window = 0

‎scripts/draw_window_macro_tremolo/draw_window_macro_tremolo.gml

+3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ function draw_window_macro_tremolo() {
5656
if tremolotype = 0 macro_tremolo()
5757
if tremolotype = 1 macro_tremolo_fadein()
5858
if tremolotype = 2 macro_tremolo_fadeout()
59+
windowalpha = 0
60+
windowclose = 0
61+
windowopen = 0
5962
window = 0
6063
}
6164
if (draw_button2(x1 + 80, y1 + 215, 60, "Cancel") && windowopen = 1) {windowclose = 1}

‎scripts/draw_window_midi_import/draw_window_midi_import.gml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function draw_window_midi_import() {
3434
} else {
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
}
37-
if (draw_button2(x1 + 520, y1 + 368, 72, "Import") && wmenu = 0) {w_midi_tab = 0 window = -1 import_midi()}
37+
if (draw_button2(x1 + 520, y1 + 368, 72, "Import") && wmenu = 0) {w_midi_tab = 0 window = -1 import_midi() windowalpha = 0 windowclose = 0 windowopen = 0}
3838
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")) {

‎scripts/draw_window_minecraft/draw_window_minecraft.gml

+6-6
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ function draw_window_minecraft() {
145145
}
146146
if (draw_button2(x1 + 45, yy + 34, 120, "Select lower blocks", 0, 1)) {
147147
select_outside(true, false)
148-
window = 0
148+
windowclose = 1
149149
}
150150
if (draw_button2(x1 + 175, yy + 34, 120, "Select higher blocks", 0, 1)) {
151151
select_outside(false, true)
152-
window = 0
152+
windowclose = 1
153153
}
154154
if (draw_button2(x1 + 305, yy + 34, 100, "Transpose notes", 0, 1)) {
155155
if (question("Transpose notes so that they fall within Minecraft's 2 octaves?", "Transpose notes")) {
@@ -182,7 +182,7 @@ function draw_window_minecraft() {
182182
else draw_text(x1 + 45, yy + 16, "There are " + string(block_custom) + " blocks with custom instruments.")
183183
if (draw_button2(x1 + 45, yy + 34, 160, "Select affected blocks", 0, 1)) {
184184
select_custom()
185-
window = 0
185+
windowclose = 1
186186
}
187187
} else {
188188
draw_set_color(c_green)
@@ -254,11 +254,11 @@ function draw_window_minecraft() {
254254
}
255255
if (draw_button2(x1 + 45, yy + 50, 120, "Select lower blocks", 0, 1)) {
256256
select_outside(true, false)
257-
window = 0
257+
windowclose = 1
258258
}
259259
if (draw_button2(x1 + 175, yy + 50, 120, "Select higher blocks", 0, 1)) {
260260
select_outside(false, true)
261-
window = 0
261+
windowclose = 1
262262
}
263263
if (draw_button2(x1 + 305, yy + 50, 100, "Transpose notes", 0, 1)) {
264264
if (question("Transpose notes so that they fall within Minecraft's 2 octaves?", "Transpose notes")) {
@@ -297,7 +297,7 @@ function draw_window_minecraft() {
297297
else draw_text(x1 + 45, yy + 32, "There are " + string(block_custom) + " blocks with custom instruments.")
298298
if (draw_button2(x1 + 45, yy + 50, 160, "Select affected blocks", 0, 1)) {
299299
select_custom()
300-
window = 0
300+
windowclose = 1
301301
}
302302
} else {
303303
if (theme != 3) {

0 commit comments

Comments
 (0)
Please sign in to comment.