Skip to content

Commit c6dca47

Browse files
committed
Add a command block option to schematic export
1 parent bb17eb0 commit c6dca47

6 files changed

Lines changed: 78 additions & 54 deletions

File tree

scripts/control_create/control_create.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ function control_create() {
469469
reset_schematic_export(0)
470470
block_color = 0
471471
structure = 0
472+
command_block = 0
472473

473474
//Datapack
474475
dat_reset(0)

scripts/draw_window_schematic_export/draw_window_schematic_export.gml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,24 @@ function draw_window_schematic_export() {
9797
draw_text_dynamic(x1 + 16, y1 + 220, "Layout:")
9898
if (draw_radiobox(x1 + 32, y1 + 240, sch_exp_layout = 1, "Simple walkway", "Generate a simple walkway that stretches\nas far as the length of the song.")) sch_exp_layout = 1
9999
if (draw_radiobox(x1 + 32, y1 + 260, sch_exp_layout = 0, "Circular walkway", "Generate a walkway where the\nplayer travels back and forth.")) sch_exp_layout = 0
100-
draw_text_dynamic(x1 + 16, y1 + 220 + 54, "For Minecraft version:")
101-
if (draw_radiobox(x1 + 32, y1 + 290, structure, "1.13+", "Create a Structure block file that is compatible with 1.13+.\nOnly the default block choice is supported.")) structure = true
102-
if (draw_radiobox(x1 + 32, y1 + 310, (!sch_exp_minecraft_old && !structure), "1.11-1.12", "Create a Schematic that is compatible with 1.11 or 1.12.")) {sch_exp_minecraft_old = false structure = false}
103-
if (draw_radiobox(x1 + 32, y1 + 330, (sch_exp_minecraft_old && !structure), "pre 1.11", "Create a Schematic that is compatible with\nold Minecraft versions only, before 1.11.")) {sch_exp_minecraft_old = true structure = false}
100+
draw_text_dynamic(x1 + 16, y1 + 280, "For Minecraft version:")
101+
if (draw_radiobox(x1 + 32, y1 + 300, structure, "1.13+", "Create a Structure block file that is compatible with 1.13+.\nOnly the default block choice is supported.")) structure = true
102+
if (draw_radiobox(x1 + 32, y1 + 320, (!sch_exp_minecraft_old && !structure), "1.11-1.12", "Create a Schematic that is compatible with 1.11 or 1.12.")) {sch_exp_minecraft_old = false structure = false}
103+
if (draw_radiobox(x1 + 32, y1 + 340, (sch_exp_minecraft_old && !structure), "pre 1.11", "Create a Schematic that is compatible with\nold Minecraft versions only, before 1.11.")) {sch_exp_minecraft_old = true structure = false}
104104
draw_text_dynamic(x1 + 170, y1 + 220, "Repeaters per row:")
105105
sch_exp_notesperrow = median(5, draw_dragvalue(5, x1 + 300, y1 + 220, sch_exp_notesperrow, 1), 100)
106106
sch_exp_notesperrow = max(5, sch_exp_notesperrow)
107107
popup_set_window(x1 + 170, y1 + 220, 150, 16, "The amount of repeaters per row in\nthe Schematic. Click and drag to change.")
108108
if (draw_checkbox(x1 + 170, y1 + 240, sch_exp_includelocked, "Include locked layers", "Whether to include locked layers in the Schematic.", false, true)) sch_exp_includelocked=!sch_exp_includelocked
109109
if (draw_checkbox(x1 + 170, y1 + 260, sch_exp_compress, "Compress layers", "Compress layers to save vertical space.", false, true)) sch_exp_compress=!sch_exp_compress
110110
if (sch_exp_layout = 0 || sch_exp_layout = 1) {
111-
if (draw_checkbox(x1 + 170, y1 + 290, sch_exp_minecart, "Include minecart track", "Include a minecart track that\nautomatically goes along with the song.", false, true)) sch_exp_minecart=!sch_exp_minecart
112-
if (draw_checkbox(x1 + 170 + 16, y1 + 310, sch_exp_chest, "Add chest with minecarts", "Whether to add a chest full of minecarts\nat the beginning of the song.", !sch_exp_minecart)) sch_exp_chest=!sch_exp_chest
111+
if (draw_checkbox(x1 + 170, y1 + 280, sch_exp_minecart, "Include minecart track", "Include a minecart track that\nautomatically goes along with the song.", false, true)) sch_exp_minecart=!sch_exp_minecart
112+
if (draw_checkbox(x1 + 170 + 16, y1 + 300, sch_exp_chest, "Add chest with minecarts", "Whether to add a chest full of minecarts\nat the beginning of the song.", !sch_exp_minecart)) sch_exp_chest=!sch_exp_chest
113113
if (sch_exp_layout = 0) {
114-
if (draw_checkbox(x1 + 170, y1 + 330, sch_exp_loop, "Include looping option", "Whether to add a lever that toggles looping.", false, true)) sch_exp_loop=!sch_exp_loop
114+
if (draw_checkbox(x1 + 170, y1 + 320, sch_exp_loop, "Include looping option", "Whether to add a lever that toggles looping.", false, true)) sch_exp_loop=!sch_exp_loop
115+
}
116+
if (structure = true) {
117+
if (draw_checkbox(x1 + 170, y1 + 320 + (sch_exp_layout = 0) * 20, command_block, "Use Command Blocks", "Whether to use command blocks instesd of note blocks for a wider octave range.\n(Extra notes pack required)", false, true)) command_block=!command_block
115118
}
116119
} else {
117120
if (draw_checkbox(x1 + 170, y1 + 290, sch_exp_glass, "Create glass floor", "Whether a glass floor should\nmake all the note blocks visible.")) sch_exp_glass=!sch_exp_glass
@@ -133,21 +136,24 @@ function draw_window_schematic_export() {
133136
draw_text_dynamic(x1 + 16, y1 + 220, "分布:")
134137
if (draw_radiobox(x1 + 32, y1 + 240, sch_exp_layout = 1, "普通过道", "生成过道延伸到歌曲末尾。")) sch_exp_layout = 1
135138
if (draw_radiobox(x1 + 32, y1 + 260, sch_exp_layout = 0, "环形过道", "生成让玩家来回走的过道。")) sch_exp_layout = 0
136-
draw_text_dynamic(x1 + 16, y1 + 220 + 54, "导出为 Minecraft 版本:")
137-
if (draw_radiobox(x1 + 32, y1 + 290, structure, "1.13+", "创建一个兼容 1.13+ 的结构方块文件。只兼容默认方块。")) structure = true
138-
if (draw_radiobox(x1 + 32, y1 + 310, (!sch_exp_minecraft_old && !structure), "1.11-1.12", "创建一个兼容 1.11 和 1.12 的 Schematic 文件。")) {sch_exp_minecraft_old = false structure = false}
139-
if (draw_radiobox(x1 + 32, y1 + 330, (sch_exp_minecraft_old && !structure), "pre 1.11", "创建一个只兼容 1.11 之前旧版本的 Schematic 文件。")) {sch_exp_minecraft_old = true structure = false}
139+
draw_text_dynamic(x1 + 16, y1 + 280, "导出为 Minecraft 版本:")
140+
if (draw_radiobox(x1 + 32, y1 + 300, structure, "1.13+", "创建一个兼容 1.13+ 的结构方块文件。只兼容默认方块。")) structure = true
141+
if (draw_radiobox(x1 + 32, y1 + 320, (!sch_exp_minecraft_old && !structure), "1.11-1.12", "创建一个兼容 1.11 和 1.12 的 Schematic 文件。")) {sch_exp_minecraft_old = false structure = false}
142+
if (draw_radiobox(x1 + 32, y1 + 340, (sch_exp_minecraft_old && !structure), "pre 1.11", "创建一个只兼容 1.11 之前旧版本的 Schematic 文件。")) {sch_exp_minecraft_old = true structure = false}
140143
draw_text_dynamic(x1 + 170, y1 + 220, "每行中继器个数:")
141144
sch_exp_notesperrow = median(5, draw_dragvalue(5, x1 + 300, y1 + 220, sch_exp_notesperrow, 1), 100)
142145
sch_exp_notesperrow = max(5, sch_exp_notesperrow)
143146
popup_set_window(x1 + 170, y1 + 220, 150, 16, "Schematic 里每行中继器的个数。拖拽来更改。")
144147
if (draw_checkbox(x1 + 170, y1 + 240, sch_exp_includelocked, "包括已静音的层", "是否在 Schematic 内包括已静音的层。", false, true)) sch_exp_includelocked=!sch_exp_includelocked
145148
if (draw_checkbox(x1 + 170, y1 + 260, sch_exp_compress, "压缩每层", "压缩每层以节省竖向空间。", false, true)) sch_exp_compress=!sch_exp_compress
146149
if (sch_exp_layout = 0 || sch_exp_layout = 1) {
147-
if (draw_checkbox(x1 + 170, y1 + 290, sch_exp_minecart, "包括矿车轨道", "包括一个跟随歌曲进度的矿车轨道。", false, true)) sch_exp_minecart=!sch_exp_minecart
148-
if (draw_checkbox(x1 + 170 + 16, y1 + 310, sch_exp_chest, "添加矿车箱", "是否在歌曲开始处添加一个装满矿车的箱子。", !sch_exp_minecart)) sch_exp_chest=!sch_exp_chest
150+
if (draw_checkbox(x1 + 170, y1 + 280, sch_exp_minecart, "包括矿车轨道", "包括一个跟随歌曲进度的矿车轨道。", false, true)) sch_exp_minecart=!sch_exp_minecart
151+
if (draw_checkbox(x1 + 170 + 16, y1 + 300, sch_exp_chest, "添加矿车箱", "是否在歌曲开始处添加一个装满矿车的箱子。", !sch_exp_minecart)) sch_exp_chest=!sch_exp_chest
149152
if (sch_exp_layout = 0) {
150-
if (draw_checkbox(x1 + 170, y1 + 330, sch_exp_loop, "包括循环选项", "是否添加开关循环功能的拉杆。", false, true)) sch_exp_loop=!sch_exp_loop
153+
if (draw_checkbox(x1 + 170, y1 + 320, sch_exp_loop, "包括循环选项", "是否添加开关循环功能的拉杆。", false, true)) sch_exp_loop=!sch_exp_loop
154+
}
155+
if (structure = true) {
156+
if (draw_checkbox(x1 + 170, y1 + 320 + (sch_exp_layout = 0) * 20, command_block, "使用命令方块", "是否使用命令方块代替音符盒以获得更广音域。\n(需要更多音符资源包)", false, true)) command_block=!command_block
151157
}
152158
} else {
153159
if (draw_checkbox(x1 + 170, y1 + 290, sch_exp_glass, "Create glass floor", "Whether a glass floor should\nmake all the note blocks visible.")) sch_exp_glass=!sch_exp_glass

scripts/load_settings/load_settings.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ function load_settings() {
123123
sch_exp_ins_block[a] = ini_read_real("schematic_export", "ins_block_" + string(a), sch_exp_ins_block[a])
124124
sch_exp_ins_data[a] = ini_read_real("schematic_export", "ins_data_" + string(a), sch_exp_ins_data[a])
125125
}
126+
command_block = ini_read_real("schematic_export", "command_block", command_block)
126127

127128
// Branch export settings
128129
sch_exp_stereo = ini_read_real("branch_export", "stereo", sch_exp_stereo)

scripts/macros/macros.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function macros() {
22
#macro gm_runtime_version "2022.2.0.487"
3-
#macro version_date "2022.04.06"
3+
#macro version_date "2022.05.23"
44
#macro version "3.10.0-beta.3"
55
#macro is_prerelease 1 // remember to change to 0 in the release!
66
#macro nbs_version 5

scripts/save_settings/save_settings.gml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ function save_settings() {
118118
ini_write_real_clean("schematic_export", "ins_data_" + string(a), sch_exp_ins_data[a])
119119
}
120120
}
121+
ini_write_real_clean("schematic_export", "command_block", command_block)
121122

122123
// Branch export settings
123124
ini_write_real_clean("branch_export", "stereo", sch_exp_stereo)

0 commit comments

Comments
 (0)