Skip to content

Commit

Permalink
Merge pull request #118 from HielkeMinecraft/development
Browse files Browse the repository at this point in the history
3.7.1
  • Loading branch information
Bentroen authored Jan 20, 2020
2 parents b57c225 + 5199c42 commit d0fa783
Show file tree
Hide file tree
Showing 62 changed files with 462 additions and 195 deletions.
45 changes: 45 additions & 0 deletions Minecraft Note Block Studio.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/action_redo/action_redo.gml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ arg14 = history[historypos, 15]
changed = 1

if (t = h_addblock) {
add_block(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
add_block(arg0, arg1, arg2, arg3, arg4, arg5, arg6)
} else if (t = h_removeblock) {
remove_block(arg0, arg1)
} else if (t = h_changeblock) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/action_undo/action_undo.gml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ changed = 1
if (t = h_addblock) {
remove_block(arg0, arg1)
} else if (t = h_removeblock) {
add_block(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
add_block(arg0, arg1, arg2, arg3, arg4, arg5, arg6)
} else if (t = h_changeblock) {
change_block(arg0, arg1, arg7, arg8, arg9, arg10, arg11)
} else if (t = h_selectadd) {
Expand Down
3 changes: 2 additions & 1 deletion scripts/add_block/add_block.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// add_block(x, y, ins, key, vel, pan, [insnum])
// add_block(x, y, ins, key, vel, pan, pit, [insnum])
var a, b, c, xx, yy, ins, key, vel, pan, pit, insnum;
xx = argument[0]
yy = argument[1]
Expand Down Expand Up @@ -51,6 +51,7 @@ if (!insnum) {
if (ins.user) block_custom += 1
}
if (key < 33 || key > 57) block_outside += 1
if (pit != 0) block_pitched += 1
totalblocks += 1

if (colfirst[xx] = -1 || yy < colfirst[xx]) colfirst[xx] = yy
Expand Down
1 change: 1 addition & 0 deletions scripts/add_block_manual/add_block_manual.gml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ rowamount[yy] += 1
ins.num_blocks++
if (key < 33 || key > 57) block_outside += 1
if (ins.user) block_custom += 1
if (pit != 0) block_pitched += 1
totalblocks += 1
changed = 1
work_add += 1
Expand Down
3 changes: 2 additions & 1 deletion scripts/add_block_select/add_block_select.gml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// add_block_select(x, y, ins, key, vel, pan)
// add_block_select(x, y, ins, key, vel, pan, pit)
var a, b, c, xx, yy, ins, key, vel, pan, pit;
xx = argument0
yy = argument1
Expand Down Expand Up @@ -44,6 +44,7 @@ rowamount[yy] += 1
ins.num_blocks++
if (key < 33 || key > 57) block_outside += 1
if (ins.user) block_custom += 1
if (pit != 0) block_pitched += 1
totalblocks += 1

if (colfirst[xx] = -1 || yy < colfirst[xx]) colfirst[xx] = yy
Expand Down
3 changes: 3 additions & 0 deletions scripts/calculate_size/calculate_size.gml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ if (block_outside > 0) {
if (block_custom > 0) {
if (!question("Some note blocks have a custom instrument assigned to them. Export anyway?", "Minecraft Compatibility")) return 0
}
if (block_pitched > 0) {
if (!question("Some note blocks have fine pitch tuning, which isn't supported in note blocks. Export anyway?", "Minecraft Compatibility")) return 0
}
if (tempo != 10 && tempo != 5 && tempo != 2.5) {
message("The tempo of the song is not compatible with Minecraft. As a result, the playback speed of the song in-game will differ from the one in the program.", "Tempo")
}
Expand Down
2 changes: 2 additions & 0 deletions scripts/change_block_manual/change_block_manual.gml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ history_set(h_changeblock, xx, yy, ins, key, vel, pan, pit, pins, pkey, pvel, pp
changed = 1
if (pkey >= 33 && pkey <= 57 && (key < 33 || key > 57)) block_outside += 1
if (key >= 33 && key <= 57 && (pkey < 33 || pkey > 57)) block_outside -= 1
if (ppit = 0 && pit != 0) block_pitched += 1
if (ppit != 0 && pit = 0) block_pitched -= 1
34 changes: 34 additions & 0 deletions scripts/check_updates/check_updates.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// check_updates()
// Handles the update checking
// update values:
// -1: unable to check for update
// 1: update found
// 2: up to date

if (async_load[? "id"] = update_http) {
update_http = -1
if (async_load[? "http_status"] = 200) {
var res = async_load[? "result"];
if (is_string(res)) {
res = json_decode(res)
if(res[?"tag_name"] != undefined){
var newVersion = string_replace(res[?"tag_name"],"v","")
if (string_count(".", newVersion) = 2) {
if (newVersion = version) {
update = 2
} else {
if (question("Version " + newVersion + " is available! Do you want to download it?", "Update available!")) {
update_download = http_get_file("https://github.com/HielkeMinecraft/OpenNoteBlockStudio/releases/latest/download/Minecraft.Note.Block.Studio.exe", update_file)
update = 4
} else {
update = 1
}
}
}
}else
update = -1
}else
update = -1
} else
update = -1
}
8 changes: 8 additions & 0 deletions scripts/check_updates/check_updates.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions scripts/control_create/control_create.gml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ window_set_min_height(100)
cam_window = camera_create()
view_set_camera(0, cam_window)
window_background = c_white
window2 = 0

// Application
update = 0
Expand Down Expand Up @@ -48,6 +47,7 @@ tonextbackup = 0
filename = ""
changed = 0
midifile = ""
song_midi = ""
for (a = 0; a < 11; a += 1) {
mididevice_instrument[a] = -1
recent_song[a] = ""
Expand Down Expand Up @@ -99,6 +99,7 @@ song_played[0, 0] = 0
song_added[0, 0] = 0
block_outside = 0
block_custom = 0
block_pitched = 0
midi_devices = 0

colamount[0] = 0
Expand Down Expand Up @@ -334,15 +335,24 @@ save_version = nbs_version
load_settings()
change_theme()
if (show_welcome) window = w_greeting

// Updates
if (check_update)
update_http = http_get("https://api.github.com/repos/HielkeMinecraft/OpenNoteBlockStudio/releases/latest")
else
update_http = -1
update_download = -1
downloaded_size = 0
total_size = -1
if (file_exists_lib(settings_file) && vers != version) {
window = w_update
update = 3
}
log("Startup OK")

// Delete old installer
if (file_exists_lib(update_file)) {
files_delete_lib(update_file)
}

// Auto-recovery
if (file_exists_lib(backup_file)) {
Expand All @@ -355,4 +365,6 @@ if (file_exists_lib(backup_file)) {
if (parameter_count() > 0) {
filename = parameter_string(1)
if (filename != "") load_song(filename)
}
}

log("Startup OK")
Loading

0 comments on commit d0fa783

Please sign in to comment.