Skip to content

Commit bce14ad

Browse files
committed
Make all windows fade
1 parent f79240c commit bce14ad

File tree

27 files changed

+1014
-80
lines changed

27 files changed

+1014
-80
lines changed

scripts/control_create/control_create.gml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ function control_create() {
2525
prev_scale = -1
2626
rw = 0
2727
rh = 0
28-
preferencesalpha = 0
29-
preferencesopen = 0
30-
preferencesclose = 0
28+
windowalpha = 0
29+
windowopen = 0
30+
windowclose = 0
3131

3232
// Audio
3333
channels = 256

scripts/draw_window_about/draw_window_about.gml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
function draw_window_about() {
22
// draw_window_stats()
33
var x1, y1, a, n;
4+
if (theme = 3) draw_set_alpha(windowalpha)
45
x1 = floor(rw / 2 - 150)
56
y1 = floor(rh / 2 - 200)
67
draw_window(x1, y1, x1 + 300, y1 + 400)
@@ -20,8 +21,44 @@ function draw_window_about() {
2021
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.")
2122
}
2223
draw_set_halign(fa_left)
23-
if (draw_button2(x1 + 120, y1 + 370, 72, "OK", false)) window = 0
24-
24+
if (draw_button2(x1 + 120, y1 + 370, 72, "OK", false)) windowclose = 1
25+
window_set_cursor(cr_default)
26+
if (windowopen = 0 && theme = 3) {
27+
if (windowalpha < 1) {
28+
if (refreshrate = 0) windowalpha += 1/3.75
29+
else if (refreshrate = 1) windowalpha += 1/7.5
30+
else if (refreshrate = 2) windowalpha += 1/15
31+
else if (refreshrate = 3) windowalpha += 1/18
32+
else windowalpha += 1/20
33+
} else {
34+
windowalpha = 1
35+
windowopen = 1
36+
}
37+
}
38+
if(theme = 3) {
39+
if (windowclose = 1) {
40+
if (windowalpha > 0) {
41+
if (refreshrate = 0) windowalpha -= 1/3.75
42+
else if (refreshrate = 1) windowalpha -= 1/7.5
43+
else if (refreshrate = 2) windowalpha -= 1/15
44+
else if (refreshrate = 3) windowalpha -= 1/18
45+
else windowalpha -= 1/20
46+
} else {
47+
windowalpha = 0
48+
windowclose = 0
49+
windowopen = 0
50+
window = 0
51+
window_set_cursor(curs)
52+
save_settings()
53+
}
54+
}
55+
} else {
56+
if (windowclose = 1) {
57+
windowclose = 0
58+
window = 0
59+
}
60+
}
61+
draw_set_alpha(1)
2562

2663

2764
}

scripts/draw_window_branch_export/draw_window_branch_export.gml

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
function draw_window_branch_export() {
22
// draw_window_branch_export()
33
var x1, y1, a, b, c, d, str, nsel, tabs, tabstr, tabw, tabtip, menun, menua, menub, block, c1, c2;
4+
if (theme = 3) draw_set_alpha(windowalpha)
45
curs = cr_default
56
x1 = floor(rw / 2 - 275)
67
y1 = floor(rh / 2 - 200)
@@ -211,7 +212,7 @@ function draw_window_branch_export() {
211212
}
212213
}
213214
if (draw_button2(x1 + 470 - 80 * 1, y1 + 368, 72, "Cancel") && wmenu = 0) {
214-
window = 0
215+
windowclose = 1
215216
selected_tab_sch = 0
216217
}
217218
if (draw_button2(x1 + 470 - 80 * 2, y1 + 368, 72, "Use default") && wmenu = 0) {
@@ -367,7 +368,45 @@ function draw_window_branch_export() {
367368
}
368369
}
369370
window_set_cursor(curs)
370-
371+
window_set_cursor(cr_default)
372+
if (windowopen = 0 && theme = 3) {
373+
if (windowalpha < 1) {
374+
if (refreshrate = 0) windowalpha += 1/3.75
375+
else if (refreshrate = 1) windowalpha += 1/7.5
376+
else if (refreshrate = 2) windowalpha += 1/15
377+
else if (refreshrate = 3) windowalpha += 1/18
378+
else windowalpha += 1/20
379+
} else {
380+
windowalpha = 1
381+
windowopen = 1
382+
}
383+
}
384+
if(theme = 3) {
385+
if (windowclose = 1) {
386+
if (windowalpha > 0) {
387+
if (refreshrate = 0) windowalpha -= 1/3.75
388+
else if (refreshrate = 1) windowalpha -= 1/7.5
389+
else if (refreshrate = 2) windowalpha -= 1/15
390+
else if (refreshrate = 3) windowalpha -= 1/18
391+
else windowalpha -= 1/20
392+
} else {
393+
windowalpha = 0
394+
windowclose = 0
395+
windowopen = 0
396+
window = 0
397+
window_set_cursor(curs)
398+
save_settings()
399+
selected_tab_sch = 0
400+
}
401+
}
402+
} else {
403+
if (windowclose = 1) {
404+
windowclose = 0
405+
window = 0
406+
selected_tab_sch = 0
407+
}
408+
}
409+
draw_set_alpha(1)
371410

372411

373412
}

scripts/draw_window_clip_editor/draw_window_clip_editor.gml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
function draw_window_clip_editor() {
22
// draw_window_clip_editor()
33
var x1, y1;
4+
if (theme = 3) draw_set_alpha(windowalpha)
45
curs = cr_default
56
x1 = floor(rw / 2 - 220)
67
y1 = floor(rh / 2 - 215)
@@ -23,9 +24,45 @@ function draw_window_clip_editor() {
2324
selection_copied = draw_text_edit(59, selection_copied, x1 + 32, y1 + 23 * 3, 370, 300, 0, 0)
2425

2526
if (draw_button2(x1 + 320, y1 + 398, 72, "OK")) {
26-
window = 0
27+
windowclose = 1
2728
}
2829
window_set_cursor(curs)
29-
30+
window_set_cursor(cr_default)
31+
if (windowopen = 0 && theme = 3) {
32+
if (windowalpha < 1) {
33+
if (refreshrate = 0) windowalpha += 1/3.75
34+
else if (refreshrate = 1) windowalpha += 1/7.5
35+
else if (refreshrate = 2) windowalpha += 1/15
36+
else if (refreshrate = 3) windowalpha += 1/18
37+
else windowalpha += 1/20
38+
} else {
39+
windowalpha = 1
40+
windowopen = 1
41+
}
42+
}
43+
if(theme = 3) {
44+
if (windowclose = 1) {
45+
if (windowalpha > 0) {
46+
if (refreshrate = 0) windowalpha -= 1/3.75
47+
else if (refreshrate = 1) windowalpha -= 1/7.5
48+
else if (refreshrate = 2) windowalpha -= 1/15
49+
else if (refreshrate = 3) windowalpha -= 1/18
50+
else windowalpha -= 1/20
51+
} else {
52+
windowalpha = 0
53+
windowclose = 0
54+
windowopen = 0
55+
window = 0
56+
window_set_cursor(curs)
57+
save_settings()
58+
}
59+
}
60+
} else {
61+
if (windowclose = 1) {
62+
windowclose = 0
63+
window = 0
64+
}
65+
}
66+
draw_set_alpha(1)
3067

3168
}

scripts/draw_window_datapack_export/draw_window_datapack_export.gml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
function draw_window_datapack_export() {
22
// draw_window_datapack_export()
3-
var x1, y1, a, b, c, d, str, nsel, tabs, tabstr, tabw, tabtip, menun, menua, menub, block, blocks, c1, c2;
3+
var x1, y1, a, b, c, d, str, nsel, tabs, tabstr, tabw, tabtip, menun, menua, menub, block, blocks, c1, c2
4+
if (theme = 3) draw_set_alpha(windowalpha)
45
curs = cr_default
56
x1 = floor(rw / 2 - 275)
67
y1 = floor(rh / 2 - 215)
@@ -228,10 +229,47 @@ function draw_window_datapack_export() {
228229

229230
//Cancel button
230231
if (draw_button2(x1 + 390, y1 + 398, 72, "Cancel", false)) {
231-
window = 0
232-
selected_tab_dat = 0
232+
windowclose = 1
233233
}
234-
234+
window_set_cursor(cr_default)
235+
if (windowopen = 0 && theme = 3) {
236+
if (windowalpha < 1) {
237+
if (refreshrate = 0) windowalpha += 1/3.75
238+
else if (refreshrate = 1) windowalpha += 1/7.5
239+
else if (refreshrate = 2) windowalpha += 1/15
240+
else if (refreshrate = 3) windowalpha += 1/18
241+
else windowalpha += 1/20
242+
} else {
243+
windowalpha = 1
244+
windowopen = 1
245+
}
246+
}
247+
if(theme = 3) {
248+
if (windowclose = 1) {
249+
if (windowalpha > 0) {
250+
if (refreshrate = 0) windowalpha -= 1/3.75
251+
else if (refreshrate = 1) windowalpha -= 1/7.5
252+
else if (refreshrate = 2) windowalpha -= 1/15
253+
else if (refreshrate = 3) windowalpha -= 1/18
254+
else windowalpha -= 1/20
255+
} else {
256+
windowalpha = 0
257+
windowclose = 0
258+
windowopen = 0
259+
window = 0
260+
window_set_cursor(curs)
261+
save_settings()
262+
selected_tab_dat = 0
263+
}
264+
}
265+
} else {
266+
if (windowclose = 1) {
267+
windowclose = 0
268+
window = 0
269+
selected_tab_dat = 0
270+
}
271+
}
272+
draw_set_alpha(1)
235273

236274

237275
}

scripts/draw_window_greeting/draw_window_greeting.gml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
function draw_window_greeting() {
22
// draw_window_greeting()
33
var x1, y1, a, b, c, d, e, m;
4+
if (theme = 3) draw_set_alpha(windowalpha)
45
curs = cr_default
56
x1 = floor(rw / 2 - 350)
67
y1 = floor(rh / 2 - 210)
@@ -73,7 +74,7 @@ function draw_window_greeting() {
7374
draw_sprite(spr_bigicons_f, 0, b + (a > 1), c + (a > 1))
7475
}
7576
draw_text(b + 48 + (a > 1), c + 9 + (a > 1), "Create a new song")
76-
if (a = 2 && mouse_check_button_released(mb_left)) window = 0
77+
if (a = 2 && mouse_check_button_released(mb_left)) windowclose = 1
7778

7879
c += 44
7980
b = x1 + 300
@@ -155,7 +156,43 @@ function draw_window_greeting() {
155156
if (a = 2 && mouse_check_button_released(mb_left)) open_url("http://www.youtube.com/playlist?list=PL7EA4F0D271DA6E86")
156157

157158
window_set_cursor(curs)
158-
159+
window_set_cursor(cr_default)
160+
if (windowopen = 0 && theme = 3) {
161+
if (windowalpha < 1) {
162+
if (refreshrate = 0) windowalpha += 1/3.75
163+
else if (refreshrate = 1) windowalpha += 1/7.5
164+
else if (refreshrate = 2) windowalpha += 1/15
165+
else if (refreshrate = 3) windowalpha += 1/18
166+
else windowalpha += 1/20
167+
} else {
168+
windowalpha = 1
169+
windowopen = 1
170+
}
171+
}
172+
if(theme = 3) {
173+
if (windowclose = 1) {
174+
if (windowalpha > 0) {
175+
if (refreshrate = 0) windowalpha -= 1/3.75
176+
else if (refreshrate = 1) windowalpha -= 1/7.5
177+
else if (refreshrate = 2) windowalpha -= 1/15
178+
else if (refreshrate = 3) windowalpha -= 1/18
179+
else windowalpha -= 1/20
180+
} else {
181+
windowalpha = 0
182+
windowclose = 0
183+
windowopen = 0
184+
window = 0
185+
window_set_cursor(curs)
186+
save_settings()
187+
}
188+
}
189+
} else {
190+
if (windowclose = 1) {
191+
windowclose = 0
192+
window = 0
193+
}
194+
}
195+
draw_set_alpha(1)
159196

160197

161198
}

scripts/draw_window_instruments/draw_window_instruments.gml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
function draw_window_instruments() {
22
// draw_window_instruments()
33
var x1, y1, a, b, c, str, menun, menua, menub, prev;
4+
if (theme = 3) draw_set_alpha(windowalpha)
45
curs = cr_default
56
menun = -1
67
x1 = floor(rw / 2 - 275)
@@ -76,7 +77,7 @@ function draw_window_instruments() {
7677
c = 1
7778
}
7879
if (draw_button2(x1 + 456, y1 + 318, 80, "OK") && wmenu = 0) {
79-
window = 0
80+
windowclose = 1
8081
if (save_version < 5 && user_instruments > 18) {
8182
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) + ".")
8283
save_version = nbs_version
@@ -174,6 +175,42 @@ function draw_window_instruments() {
174175
draw_line(x1 + 13 + 194 + 160 + 80, y1 + 87, x1 + 13 + 194 + 160 + 80, y1 + 86 + 20 * a)
175176
draw_scrollbar(insscrollbar, x1 + 14 + 194 + 160 + 80 + 70, y1 + 88, 21, 9, ds_list_size(instrument_list) - 2, 0, 1)
176177
window_set_cursor(curs)
177-
178-
178+
window_set_cursor(cr_default)
179+
if (windowopen = 0 && theme = 3) {
180+
if (windowalpha < 1) {
181+
if (refreshrate = 0) windowalpha += 1/3.75
182+
else if (refreshrate = 1) windowalpha += 1/7.5
183+
else if (refreshrate = 2) windowalpha += 1/15
184+
else if (refreshrate = 3) windowalpha += 1/18
185+
else windowalpha += 1/20
186+
} else {
187+
windowalpha = 1
188+
windowopen = 1
189+
}
190+
}
191+
if(theme = 3) {
192+
if (windowclose = 1) {
193+
if (windowalpha > 0) {
194+
if (refreshrate = 0) windowalpha -= 1/3.75
195+
else if (refreshrate = 1) windowalpha -= 1/7.5
196+
else if (refreshrate = 2) windowalpha -= 1/15
197+
else if (refreshrate = 3) windowalpha -= 1/18
198+
else windowalpha -= 1/20
199+
} else {
200+
windowalpha = 0
201+
windowclose = 0
202+
windowopen = 0
203+
window = 0
204+
window_set_cursor(curs)
205+
save_settings()
206+
}
207+
}
208+
} else {
209+
if (windowclose = 1) {
210+
windowclose = 0
211+
window = 0
212+
}
213+
}
214+
draw_set_alpha(1)
215+
179216
}

0 commit comments

Comments
 (0)