Skip to content

Commit 1b76528

Browse files
committed
Added MP3 export option to include or exclude locked layers
1 parent fffb186 commit 1b76528

File tree

14 files changed

+134
-4
lines changed

14 files changed

+134
-4
lines changed

Minecraft Note Block Studio.yyp

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/control_create/control_create.gml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ dat_enableradius = 0
293293
dat_radius = 16
294294
dat_radiusvalue = 0
295295

296+
//MP3
297+
mp3_includelocked = 0
298+
296299
// Settings
297300
load_settings()
298301
change_theme()
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// draw_window_mp3_export()
2+
3+
var x1, y1
4+
curs = cr_default
5+
x1 = floor(window_width / 2 - 125)
6+
y1 = floor(window_height / 2 - 135)
7+
draw_window(x1, y1, x1 + 250, y1 + 270)
8+
draw_set_font(fnt_mainbold)
9+
draw_text(x1 + 8, y1 + 8, "MP3 Export")
10+
draw_set_font(fnt_main)
11+
12+
draw_sprite(spr_mp3_exp, sch_exp_layout, x1 + 20, y1)
13+
14+
//Locked layers
15+
if (draw_checkbox(x1 + 16, y1 + 190, mp3_includelocked, "Include locked layers", "Whether to export locked layers in the MP3.")) mp3_includelocked= !mp3_includelocked
16+
17+
//Submit button
18+
if (draw_button2(x1 + 165, y1 + 238, 72, "Export", false)) mp3_export()
19+
20+
if (draw_button2(x1 + 10, y1 + 238, 72, "Cancel", false)) {
21+
window = 0
22+
}

scripts/draw_window_mp3_export/draw_window_mp3_export.yy

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/draw_windows/draw_windows.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ switch (window mod w_menu) {
1010
case w_midi: draw_window_midi_import() break
1111
case w_schematic_export: draw_window_schematic_export() break
1212
case w_datapack_export: draw_window_datapack_export() break
13+
case w_mp3_export: draw_window_mp3_export() break
1314
case w_instruments: draw_window_instruments() break
1415
case w_stats: draw_window_stats() break
1516
case w_properties: draw_window_properties() break

scripts/macros/macros.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#macro w_minecraft 15
3939
#macro w_schematic_export 14
4040
#macro w_datapack_export 30
41+
#macro w_mp3_export 31
4142
#macro w_checkupdates 13
4243
#macro w_about 12
4344
#macro w_songinfoedit 11

scripts/menu_click/menu_click.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ switch (m) {
4141
if (sel = b + 5) save_song("")
4242
if (sel = b + 6) open_midi("")
4343
if (sel = b + 7) open_schematic("")
44-
if (sel = b + 8) mp3_export()
44+
if (sel = b + 8) window = w_mp3_export
4545
if (sel = b + 9) {
4646
if (calculate_size()) window = w_schematic_export
4747
}

scripts/mp3_export/mp3_export.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ with (obj_instrument) {
2727
for (a = 0; a <= enda; a += 1) {
2828
if (colamount[a] > 0) {
2929
for (b = 0; b <= collast[a]; b += 1) {
30-
if (song_exists[a, b]) {
30+
if (song_exists[a, b] && (lockedlayer[b] = 0 || mp3_includelocked)) {
3131
var ins = song_ins[a, b];
3232
var key = song_key[a, b];
3333
if (ins.loaded) {
3.43 KB
Loading
3.43 KB
Loading

0 commit comments

Comments
 (0)