Skip to content

Commit defd669

Browse files
committed
fix: refine layout of import sounds window
1 parent 86b8efe commit defd669

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

scripts/draw_window_sound_import/draw_window_sound_import.gml

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ function draw_window_sound_import() {
66
var x1, y1, a, n;
77

88
// Window frame
9-
var width = 480;
10-
var height = 320;
9+
var width = 415;
10+
var height = 310;
1111
var startx = floor((rw - width) / 2);
1212
var starty = floor((rh - height) / 2) + windowoffset;
1313
var x1 = startx;
@@ -27,30 +27,30 @@ function draw_window_sound_import() {
2727
y1 += 20;
2828
draw_text_dynamic(
2929
x1, y1,
30-
"This assistant will help you extract sound files from your Minecraft: Java Edition" + "\n" +
31-
"installation." + "\n" +
32-
"Before continuing, ensure you have launched the version you want from the" + "\n" +
33-
"Minecraft Launcher." + "\n" +
30+
"This assistant will help you extract sound files from your Minecraft:" + "\n" +
31+
"Java Edition installation." + "\n" +
32+
"Before continuing, ensure you have launched the version you want from" + "\n" +
33+
"the Minecraft Launcher." + "\n" +
3434
"Select a version from the list, and then click 'Import' to look for sounds!"
3535
)
3636

3737
// Minecraft installation path
3838
x1 = startx;
39-
y1 += 100;
39+
y1 += 110;
4040
draw_text_dynamic(x1, y1, "1. Set your Minecraft installation path:");
4141
x1 += 16;
4242
y1 += 20;
4343
draw_text_dynamic(x1, y1, string_truncate(mc_install_path, 280, true));
44-
x1 += 300;
44+
y1 -= 20;
4545

4646
// Change button
47-
y1 -= 4
47+
x1 = startx + width - 72 - 20;
4848
if (draw_button2(x1, y1, 72, "Change", false, true)) {
4949
var fn = string(get_save_filename_ext("", "Select Minecraft installation directory", mc_install_path, "Minecraft installation directory"));
5050
if (fn != "") mc_install_path = filename_dir(fn);
5151
update_asset_index_menu();
5252
}
53-
x1 += 76;
53+
y1 += 28;
5454

5555
// Use default button
5656
if (draw_button2(x1, y1, 72, "Use default", false, true)) {
@@ -61,51 +61,49 @@ function draw_window_sound_import() {
6161

6262
// Asset index select menu
6363
x1 = startx;
64-
y1 += 40;
64+
y1 += 30;
6565
draw_text_dynamic(x1, y1, "2. Select the asset list to copy sounds from:");
6666
x1 += 16;
6767
y1 += 20;
6868
y1 += 1;
69-
draw_area(x1, y1, x1 + 100, y1 + 20);
69+
draw_area(x1, y1, x1 + 86, y1 + 20);
7070
draw_text_dynamic(x1 + 4, y1 + 4, sound_import_selected_asset_index);
71-
if (draw_abutton(x1 + 100 - 16, y1 + 1, sound_import_menu_str == "")) {
72-
show_debug_message(sound_import_menu_str);
71+
if (draw_abutton(x1 + 86 - 16, y1 + 1, sound_import_menu_str == "")) {
7372
menu = show_menu_ext("sound_import_asset_index", x1, y1, sound_import_menu_str);
7473
}
75-
y1 -= 1;
76-
x1 += 110;
77-
78-
// Copy sounds button
79-
var is_locked = sound_import_selected_asset_index == "";
80-
if (draw_button2(x1, y1, 112, "Get sounds", is_locked, false)) {
81-
load_asset_index(true);
82-
}
83-
84-
x1 = startx;
85-
y1 += 30;
8674

8775
// Status text
88-
x1 += 16;
76+
x1 += 86 + 8;
77+
y1 += 3;
8978
draw_theme_font(font_main_bold);
9079
draw_theme_color();
9180

9281
// 0 = idle; 1 = copying; 2 = copying done
9382
if (sound_import_status == 2) {
9483
if (theme == 3 && fdark || theme == 2) draw_set_color(c_lime);
9584
else draw_set_color(c_green);
96-
draw_text_dynamic(x1, y1, string(sound_import_asset_index_count) + " sounds have been copied!");
85+
draw_text_dynamic(x1, y1, string_format_thousands(sound_import_asset_index_count) + " sounds have been copied!");
9786
} else if (sound_import_status == 1) {
9887
draw_text_dynamic(x1, y1, "Copying sounds... please wait!");
9988
} else {
10089
if (sound_import_asset_index_count > 0) {
101-
draw_text_dynamic(x1, y1, string(sound_import_asset_index_count) + " sounds located!");
90+
draw_text_dynamic(x1, y1, string_format_thousands(sound_import_asset_index_count) + " sounds located!");
10291
} else {
10392
draw_set_color(c_red);
104-
draw_text_dynamic(x1, y1, "No sounds located! Check your Minecraft installation path.");
93+
draw_text_dynamic(x1, y1 - 7, "No sounds located! Check your");
94+
draw_text_dynamic(x1, y1 + 7, "Minecraft installation path.");
10595
}
10696
}
10797
draw_theme_color();
10898
draw_theme_font(font_main);
99+
y1 -= 3;
100+
101+
// Copy sounds button
102+
x1 = startx + width - 86 - 20;
103+
var is_locked = sound_import_selected_asset_index == "";
104+
if (draw_button2(x1, y1, 86, "Get sounds", is_locked, false)) {
105+
load_asset_index(true);
106+
}
109107

110108
// Instrument settings button
111109
x1 = startx + 12;
@@ -115,7 +113,7 @@ function draw_window_sound_import() {
115113
}
116114
// Sounds folder button
117115
x1 += 120 + 12;
118-
if (draw_button2(x1, y1, 120, "Open sounds folder", false, true)) {
116+
if (draw_button2(x1, y1, 120, "Open Sounds folder", false, true)) {
119117
open_url(sounds_directory);
120118
}
121119

0 commit comments

Comments
 (0)