Skip to content

Commit 968370e

Browse files
Merge pull request #84 from Bentroen/better-datapack
Datapack export improvements
2 parents eb0877e + 1562e70 commit 968370e

32 files changed

+817
-304
lines changed

Minecraft Note Block Studio.yyp

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

datafiles/7za.exe

723 KB
Binary file not shown.

datafiles/Data/extranotes.zip

388 KB
Binary file not shown.

datafiles_yy/7za.exe.yy

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

datafiles_yy/Data/extranotes.zip.yy

Lines changed: 19 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: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,25 @@ if (str != "") message("The following file(s) could not be found:\n\n" + str + "
280280

281281
log("Instruments loaded")
282282

283+
// Minecraft
284+
selected_tab_mc = 0
285+
283286
// Schematic
284287
reset_schematic_export(0)
285288

286289
//Datapack
287290
dat_name = ""
288-
dat_obj = ""
289-
dat_tempo = 0
290-
dat_source = "block"
291+
dat_namespace = ""
292+
dat_path = ""
293+
dat_source = "record"
294+
dat_usezip = 1
291295
dat_includelocked = 0
296+
dat_includeoutofrange = 0
292297
dat_enableradius = 0
293298
dat_radius = 16
294299
dat_radiusvalue = 0
300+
dat_enablelooping = 0
301+
dat_loopstart = 0
295302

296303
//MP3
297304
mp3_includelocked = 0

scripts/control_draw/control_draw.gml

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ rh = window_height
55
curs = cr_default
66
showmenu = 0
77
cursmarker = 0
8-
compx = 120
8+
compx = 180
99
window_set_caption(condstr(filename = "", "Unsaved song") + filename_name(filename) + condstr(changed && filename != "", "*") + " - Minecraft Note Block Studio")
1010
draw_set_alpha(1)
1111
draw_theme_color()
@@ -20,9 +20,10 @@ work_mins += 1 / (room_speed * 60)
2020
remove_emitters()
2121

2222
if (selected = 0) {
23-
if((tempo = 10 || tempo = 5 ||tempo = 2.5) && (block_outside = 0 && block_custom = 0))compatible = 1
24-
else if ((tempo = 20 || tempo = 6.66 || tempo = 4|| tempo = 3.33 || tempo = 2.86) && (block_outside = 0 && block_custom = 0))compatible = 2
25-
else compatible = 0
23+
if (block_outside = 0 && block_custom = 0) {
24+
if (tempo = 10 || tempo = 5 || tempo = 2.5) compatible = 1
25+
else compatible = 2
26+
} else compatible = 0
2627
}
2728

2829
sela = -1
@@ -759,7 +760,7 @@ if (draw_tab("File")) {
759760
"Import from MIDI...|Import from Schematic...|-|"+
760761
inactive(totalblocks = 0) + "Export as MP3...|"+
761762
inactive(totalblocks = 0) + "Export as Schematic...|"+
762-
inactive(totalblocks = 0) + "Export as Datapack...|-|" +
763+
inactive(totalblocks = 0) + "Export as Data Pack...|-|" +
763764
"Alt + F4$Exit")
764765

765766
}
@@ -841,54 +842,54 @@ for (a = 0; a < ds_list_size(instrument_list); a += 1) {
841842
}
842843
xx += 4 draw_separator(xx, 26) xx += 4
843844
while (1) {
844-
if (draw_icon(icons.UNDO, xx, "Undo the last change", historypos = historylen, 0)) {playing = 0 action_undo()} xx += 25 if (xx > rw - 140) break
845-
if (draw_icon(icons.REDO, xx, "Redo the last undo", historypos = 0, 0)) {playing = 0 action_redo()} xx += 25 if (xx > rw - 140) break
846-
if (draw_icon(icons.COPY, xx, "Copy the selected note blocks", selected = 0, 0)) {playing = 0 action_copy()} xx += 25 if (xx > rw - 140) break
847-
if (draw_icon(icons.CUT, xx, "Cut the selected note blocks", selected = 0, 0)) {playing = 0 action_cut()} xx += 25 if (xx > rw - 140) break
848-
if (draw_icon(icons.PASTE, xx, "Paste the copied note blocks", selection_copied = "", 0)) {playing = 0 action_paste(starta, startb)} xx += 25 if (xx > rw - 140) break
849-
if (draw_icon(icons.DELETE, xx, "Delete the selected note blocks", selected = 0, 0)) {playing = 0 action_delete()} xx += 25 if (xx > rw - 140) break
850-
xx += 4 draw_separator(xx, 26) xx += 4 if (xx > rw - 140) break
851-
if (draw_icon(icons.INFORMATION, xx, "View song info")) {playing = 0 window = w_songinfoedit} xx += 25 if (xx > rw - 140) break
852-
if (draw_icon(icons.PROPERTIES, xx, "Edit song properties")) {playing = 0 window = w_properties} xx += 25 if (xx > rw - 140) break
853-
if (draw_icon(icons.INSTRUMENTS, xx, "Edit instruments")) {playing = 0 window = w_instruments} xx += 25 if (xx > rw - 140) break
854-
if (draw_icon(icons.MIDI_INPUT, xx, "MIDI device manager")) {playing = 0 window = w_mididevices} xx += 25 if (xx > rw - 140) break
855-
xx += 4 draw_separator(xx, 26) xx += 4 if (xx > rw - 140) break
845+
if (draw_icon(icons.UNDO, xx, "Undo the last change", historypos = historylen, 0)) {playing = 0 action_undo()} xx += 25 if (xx > rw - 190) break
846+
if (draw_icon(icons.REDO, xx, "Redo the last undo", historypos = 0, 0)) {playing = 0 action_redo()} xx += 25 if (xx > rw - 190) break
847+
if (draw_icon(icons.COPY, xx, "Copy the selected note blocks", selected = 0, 0)) {playing = 0 action_copy()} xx += 25 if (xx > rw - 190) break
848+
if (draw_icon(icons.CUT, xx, "Cut the selected note blocks", selected = 0, 0)) {playing = 0 action_cut()} xx += 25 if (xx > rw - 190) break
849+
if (draw_icon(icons.PASTE, xx, "Paste the copied note blocks", selection_copied = "", 0)) {playing = 0 action_paste(starta, startb)} xx += 25 if (xx > rw - 190) break
850+
if (draw_icon(icons.DELETE, xx, "Delete the selected note blocks", selected = 0, 0)) {playing = 0 action_delete()} xx += 25 if (xx > rw - 190) break
851+
xx += 4 draw_separator(xx, 26) xx += 4 if (xx > rw - 190) break
852+
if (draw_icon(icons.INFORMATION, xx, "View song info")) {playing = 0 window = w_songinfoedit} xx += 25 if (xx > rw - 190) break
853+
if (draw_icon(icons.PROPERTIES, xx, "Edit song properties")) {playing = 0 window = w_properties} xx += 25 if (xx > rw - 190) break
854+
if (draw_icon(icons.INSTRUMENTS, xx, "Edit instruments")) {playing = 0 window = w_instruments} xx += 25 if (xx > rw - 190) break
855+
if (draw_icon(icons.MIDI_INPUT, xx, "MIDI device manager")) {playing = 0 window = w_mididevices} xx += 25 if (xx > rw - 190) break
856+
xx += 4 draw_separator(xx, 26) xx += 4 if (xx > rw - 190) break
856857
if (draw_icon(icons.HELP, xx, "Watch tutorial videos")) {
857858
open_url("http://www.youtube.com/playlist?list=PL7EA4F0D271DA6E86")
858-
} xx += 25 if (xx > rw - 140) break
859-
if (draw_icon(icons.INTERNET, xx, "Visit the Minecraft Forums topic")) {open_url(link_topic)} xx += 25 if (xx > rw - 140) break
859+
} xx += 25 if (xx > rw - 190) break
860+
if (draw_icon(icons.INTERNET, xx, "Visit the Minecraft Forums topic")) {open_url(link_topic)} xx += 25 if (xx > rw - 190) break
860861
break
861862
}
862863

863864
// Compatible
865+
draw_separator(rw - 34, 26)
864866
draw_set_font(fnt_mainbold)
865-
if(compatible = 0){
866-
draw_sprite(spr_minecraft, 1, rw - 130, 24)
867-
draw_set_color(c_red)
868-
draw_text(rw - 105, 28, "Not compatible")
867+
if (compatible = 1) {
868+
draw_sprite(spr_minecraft, 0, rw - 30, 25)
869+
draw_sprite(spr_minecraft, 0, rw - 59, 25)
870+
draw_set_color(c_green)
871+
draw_text(rw - 166, 28, "Fully compatible")
869872
draw_theme_color()
870873
draw_set_font(fnt_main)
871-
popup_set(rw - compx, 24, compx, 25, "This song is not compatible with Minecraft.\n(Click for more info.)")
872-
873-
}else if (compatible = 2){
874-
compx = 155
875-
draw_sprite(spr_minecraft, 2, rw - 165, 24)
874+
popup_set(rw - compx, 24, compx, 25, "This song is compatible with both schematics and data packs.\n(Click for more info.)")
875+
} else if (compatible = 2) {
876+
draw_sprite(spr_minecraft, 0, rw - 30, 25)
877+
draw_sprite(spr_minecraft, 1, rw - 59, 25)
876878
draw_set_color(c_orange)
877-
draw_text(rw - 140, 28, "Datapack compatible")
879+
draw_text(rw - 154, 28, "Data pack only")
878880
draw_theme_color()
879881
draw_set_font(fnt_main)
880-
popup_set(rw - compx, 24, compx, 25, "This song is compatible with Minecraft Datapacks.\n(Click for more info.)")
881-
882-
}else if(compatible = 1){
883-
draw_sprite(spr_minecraft, 0, rw - 120, 24)
884-
draw_set_color(c_green)
885-
draw_text(rw - 95, 28, "Compatible")
882+
popup_set(rw - compx, 24, compx, 25, "This song is only compatible with data packs.\n(Click for more info.)")
883+
} else {
884+
draw_sprite(spr_minecraft, 2, rw - 30, 25)
885+
draw_sprite(spr_minecraft, 1, rw - 59, 25)
886+
draw_set_color(c_red)
887+
draw_text(rw - 180, 28, "Resource pack only")
886888
draw_theme_color()
887889
draw_set_font(fnt_main)
888-
popup_set(rw - compx, 24, compx, 25, "This song is compatible with Minecraft.\n(Click for more info.)")
890+
popup_set(rw - compx, 24, compx, 25, "This song is compatible with data packs using a resource pack.\n(Click for more info.)")
889891
}
890892

891-
892893
a = mouse_rectangle(rw - compx, 24, compx, 25)
893894
if (a && window = 0) {
894895
curs = cr_handpoint

0 commit comments

Comments
 (0)